13
0

remove Editor::redraw_measures to improve efficiency of tempo measure line redraws

This commit is contained in:
Paul Davis 2013-04-20 16:11:30 -04:00
parent 05905d3ec8
commit f88cfdb478
4 changed files with 17 additions and 29 deletions

View File

@ -3725,8 +3725,14 @@ Editor::set_show_measures (bool yn)
if (tempo_lines) {
tempo_lines->show();
}
(void) redraw_measures ();
ARDOUR::TempoMap::BBTPointList::const_iterator begin;
ARDOUR::TempoMap::BBTPointList::const_iterator end;
compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(), begin, end);
draw_measures (begin, end);
}
instant_save ();
}
}

View File

@ -1489,7 +1489,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void hide_measures ();
void draw_measures (ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
ARDOUR::TempoMap::BBTPointList::const_iterator& end);
bool redraw_measures ();
void new_tempo_section ();

View File

@ -119,7 +119,7 @@ Editor::tempo_map_changed (const PropertyChange& /*ignored*/)
compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(), begin, end);
_session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
redraw_measures ();
draw_measures (begin, end);
update_tempo_based_rulers (begin, end);
}
@ -130,22 +130,18 @@ Editor::redisplay_tempo (bool immediate_redraw)
return;
}
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin;
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end;
compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
if (immediate_redraw) {
redraw_measures ();
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_begin;
ARDOUR::TempoMap::BBTPointList::const_iterator current_bbt_points_end;
compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(),
current_bbt_points_begin, current_bbt_points_end);
draw_measures (current_bbt_points_begin, current_bbt_points_end);
update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end); // redraw rulers and measures
} else {
#ifdef GTKOSX
redraw_measures ();
#else
Glib::signal_idle().connect (sigc::mem_fun (*this, &Editor::redraw_measures));
#endif
Glib::signal_idle().connect (sigc::bind_return (sigc::bind (sigc::mem_fun (*this, &Editor::redisplay_tempo), true), false));
}
update_tempo_based_rulers (current_bbt_points_begin, current_bbt_points_end); // redraw rulers and measures
}
void
@ -170,18 +166,6 @@ Editor::hide_measures ()
tempo_lines->hide();
}
bool
Editor::redraw_measures ()
{
ARDOUR::TempoMap::BBTPointList::const_iterator begin;
ARDOUR::TempoMap::BBTPointList::const_iterator end;
compute_current_bbt_points (leftmost_frame, leftmost_frame + current_page_samples(), begin, end);
draw_measures (begin, end);
return false;
}
void
Editor::draw_measures (ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
ARDOUR::TempoMap::BBTPointList::const_iterator& end)

View File

@ -212,7 +212,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible {
virtual void maybe_locate_with_edit_preroll (framepos_t location) = 0;
virtual void set_show_measures (bool yn) = 0;
virtual bool show_measures () const = 0;
virtual bool redraw_measures () = 0;
virtual Editing::MouseMode effective_mouse_mode () const = 0;