mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
Preserve and restore x and y origin of editor viewport in Editor state.
Clean up Editor's update of various things by: 1. merging Editor's handlers of SuperRapidScreenUpdate. 2. separating out work to be done on this update and work to be done on a locate. Hopefully easier to understand this way. git-svn-id: svn://localhost/ardour2/branches/3.0@6648 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
2c16f7aa7f
commit
c3b5e572df
5 changed files with 150 additions and 158 deletions
|
|
@ -1416,7 +1416,6 @@ ARDOUR_UI::transport_goto_zero ()
|
||||||
if (_session) {
|
if (_session) {
|
||||||
_session->request_locate (0);
|
_session->request_locate (0);
|
||||||
|
|
||||||
|
|
||||||
/* force displayed area in editor to start no matter
|
/* force displayed area in editor to start no matter
|
||||||
what "follow playhead" setting is.
|
what "follow playhead" setting is.
|
||||||
*/
|
*/
|
||||||
|
|
@ -3147,7 +3146,6 @@ ARDOUR_UI::push_buffer_stats (uint32_t capture, uint32_t playback)
|
||||||
void
|
void
|
||||||
ARDOUR_UI::write_buffer_stats ()
|
ARDOUR_UI::write_buffer_stats ()
|
||||||
{
|
{
|
||||||
|
|
||||||
std::ofstream fout;
|
std::ofstream fout;
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
|
|
||||||
|
|
@ -263,6 +263,7 @@ Editor::Editor ()
|
||||||
, nudge_clock (X_("nudge"), false, X_("NudgeClock"), true, false, true)
|
, nudge_clock (X_("nudge"), false, X_("NudgeClock"), true, false, true)
|
||||||
, meters_running(false)
|
, meters_running(false)
|
||||||
, _pending_locate_request (false)
|
, _pending_locate_request (false)
|
||||||
|
, _pending_initial_locate (false)
|
||||||
|
|
||||||
{
|
{
|
||||||
constructed = false;
|
constructed = false;
|
||||||
|
|
@ -923,8 +924,6 @@ Editor::access_action (std::string action_group, std::string action_item)
|
||||||
if (act) {
|
if (act) {
|
||||||
act->activate();
|
act->activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -934,20 +933,6 @@ Editor::on_realize ()
|
||||||
Realized ();
|
Realized ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Editor::start_scrolling ()
|
|
||||||
{
|
|
||||||
scroll_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect
|
|
||||||
(sigc::mem_fun(*this, &Editor::update_current_screen));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::stop_scrolling ()
|
|
||||||
{
|
|
||||||
scroll_connection.disconnect ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::map_position_change (nframes64_t frame)
|
Editor::map_position_change (nframes64_t frame)
|
||||||
{
|
{
|
||||||
|
|
@ -1068,7 +1053,6 @@ Editor::set_session (Session *t)
|
||||||
compute_fixed_ruler_scale ();
|
compute_fixed_ruler_scale ();
|
||||||
|
|
||||||
/* there are never any selected regions at startup */
|
/* there are never any selected regions at startup */
|
||||||
|
|
||||||
sensitize_the_right_region_actions (false);
|
sensitize_the_right_region_actions (false);
|
||||||
|
|
||||||
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
|
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
|
||||||
|
|
@ -1077,6 +1061,7 @@ Editor::set_session (Session *t)
|
||||||
/* catch up with the playhead */
|
/* catch up with the playhead */
|
||||||
|
|
||||||
_session->request_locate (playhead_cursor->current_frame);
|
_session->request_locate (playhead_cursor->current_frame);
|
||||||
|
_pending_initial_locate = true;
|
||||||
|
|
||||||
update_title ();
|
update_title ();
|
||||||
|
|
||||||
|
|
@ -1158,8 +1143,10 @@ Editor::set_session (Session *t)
|
||||||
(static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
|
(static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
start_scrolling ();
|
super_rapid_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (
|
||||||
|
sigc::mem_fun (*this, &Editor::super_rapid_screen_update)
|
||||||
|
);
|
||||||
|
|
||||||
switch (_snap_type) {
|
switch (_snap_type) {
|
||||||
case SnapToRegionStart:
|
case SnapToRegionStart:
|
||||||
case SnapToRegionEnd:
|
case SnapToRegionEnd:
|
||||||
|
|
@ -1175,7 +1162,7 @@ Editor::set_session (Session *t)
|
||||||
/* register for undo history */
|
/* register for undo history */
|
||||||
_session->register_with_memento_command_factory(_id, this);
|
_session->register_with_memento_command_factory(_id, this);
|
||||||
|
|
||||||
start_updating ();
|
start_updating_meters ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2296,11 +2283,13 @@ Editor::set_state (const XMLNode& node, int /*version*/)
|
||||||
nframes64_t pos;
|
nframes64_t pos;
|
||||||
if (sscanf (prop->value().c_str(), "%" PRId64, &pos) == 1) {
|
if (sscanf (prop->value().c_str(), "%" PRId64, &pos) == 1) {
|
||||||
reset_x_origin (pos);
|
reset_x_origin (pos);
|
||||||
/* this hack prevents the initial call to update_current_screen() from doing re-centering on the playhead */
|
|
||||||
last_update_frame = pos;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((prop = node.property ("y-origin")) != 0) {
|
||||||
|
reset_y_origin (atof (prop->value ()));
|
||||||
|
}
|
||||||
|
|
||||||
if ((prop = node.property ("internal-edit"))) {
|
if ((prop = node.property ("internal-edit"))) {
|
||||||
bool yn = string_is_affirmative (prop->value());
|
bool yn = string_is_affirmative (prop->value());
|
||||||
RefPtr<Action> act = ActionManager::get_action (X_("MouseMode"), X_("toggle-internal-edit"));
|
RefPtr<Action> act = ActionManager::get_action (X_("MouseMode"), X_("toggle-internal-edit"));
|
||||||
|
|
@ -2455,6 +2444,8 @@ Editor::get_state ()
|
||||||
node->add_property ("playhead", buf);
|
node->add_property ("playhead", buf);
|
||||||
snprintf (buf, sizeof (buf), "%" PRIi64, leftmost_frame);
|
snprintf (buf, sizeof (buf), "%" PRIi64, leftmost_frame);
|
||||||
node->add_property ("left-frame", buf);
|
node->add_property ("left-frame", buf);
|
||||||
|
snprintf (buf, sizeof (buf), "%f", vertical_adjustment.get_value ());
|
||||||
|
node->add_property ("y-origin", buf);
|
||||||
|
|
||||||
node->add_property ("show-waveforms-recording", _show_waveforms_recording ? "yes" : "no");
|
node->add_property ("show-waveforms-recording", _show_waveforms_recording ? "yes" : "no");
|
||||||
node->add_property ("show-measures", _show_measures ? "yes" : "no");
|
node->add_property ("show-measures", _show_measures ? "yes" : "no");
|
||||||
|
|
@ -3699,7 +3690,7 @@ Editor::set_follow_playhead (bool yn)
|
||||||
if (_follow_playhead != yn) {
|
if (_follow_playhead != yn) {
|
||||||
if ((_follow_playhead = yn) == true) {
|
if ((_follow_playhead = yn) == true) {
|
||||||
/* catch up */
|
/* catch up */
|
||||||
update_current_screen ();
|
reset_x_origin_to_follow_playhead ();
|
||||||
}
|
}
|
||||||
instant_save ();
|
instant_save ();
|
||||||
}
|
}
|
||||||
|
|
@ -4066,10 +4057,12 @@ Editor::on_key_release_event (GdkEventKey* ev)
|
||||||
// return key_press_focus_accelerator_handler (*this, ev);
|
// return key_press_focus_accelerator_handler (*this, ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Queue up a change to the viewport x origin.
|
||||||
|
* @param frame New x origin.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
Editor::reset_x_origin (nframes64_t frame)
|
Editor::reset_x_origin (nframes64_t frame)
|
||||||
{
|
{
|
||||||
//cerr << "resetting x origin" << endl;
|
|
||||||
queue_visual_change (frame);
|
queue_visual_change (frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4731,7 +4724,13 @@ Editor::located ()
|
||||||
{
|
{
|
||||||
ENSURE_GUI_THREAD (*this, &Editor::located);
|
ENSURE_GUI_THREAD (*this, &Editor::located);
|
||||||
|
|
||||||
|
playhead_cursor->set_position (_session->audible_frame ());
|
||||||
|
if (_follow_playhead && !_pending_initial_locate) {
|
||||||
|
reset_x_origin_to_follow_playhead ();
|
||||||
|
}
|
||||||
|
|
||||||
_pending_locate_request = false;
|
_pending_locate_request = false;
|
||||||
|
_pending_initial_locate = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -5025,115 +5024,127 @@ Editor::horizontal_scroll_right ()
|
||||||
reset_x_origin (leftmost_position() + current_page_frames() / 5);
|
reset_x_origin (leftmost_position() + current_page_frames() / 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Queue a change for the Editor viewport x origin to follow the playhead */
|
||||||
void
|
void
|
||||||
Editor::update_current_screen ()
|
Editor::reset_x_origin_to_follow_playhead ()
|
||||||
{
|
{
|
||||||
if (_pending_locate_request) {
|
nframes64_t const frame = playhead_cursor->current_frame;
|
||||||
/* we don't update things when there's a pending locate request, otherwise
|
|
||||||
when the editor requests a locate there is a chance that this method
|
if (frame < leftmost_frame || frame > leftmost_frame + current_page_frames()) {
|
||||||
will move the playhead before the locate request is processed, causing
|
|
||||||
a visual glitch. */
|
if (_session->transport_speed() < 0) {
|
||||||
|
|
||||||
|
if (frame > (current_page_frames() / 2)) {
|
||||||
|
center_screen (frame-(current_page_frames()/2));
|
||||||
|
} else {
|
||||||
|
center_screen (current_page_frames()/2);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (frame < leftmost_frame) {
|
||||||
|
/* moving left */
|
||||||
|
nframes64_t l = 0;
|
||||||
|
if (_session->transport_rolling()) {
|
||||||
|
/* rolling; end up with the playhead at the right of the page */
|
||||||
|
l = frame - current_page_frames ();
|
||||||
|
} else {
|
||||||
|
/* not rolling: end up with the playhead 3/4 of the way along the page */
|
||||||
|
l = frame - (3 * current_page_frames() / 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (l < 0) {
|
||||||
|
l = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
center_screen_internal (l + (current_page_frames() / 2), current_page_frames ());
|
||||||
|
} else {
|
||||||
|
/* moving right */
|
||||||
|
if (_session->transport_rolling()) {
|
||||||
|
/* rolling: end up with the playhead on the left of the page */
|
||||||
|
center_screen_internal (frame + (current_page_frames() / 2), current_page_frames ());
|
||||||
|
} else {
|
||||||
|
/* not rolling: end up with the playhead 1/4 of the way along the page */
|
||||||
|
center_screen_internal (frame + (current_page_frames() / 4), current_page_frames ());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::super_rapid_screen_update ()
|
||||||
|
{
|
||||||
|
if (!_session || !_session->engine().running()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_session && _session->engine().running()) {
|
/* METERING / MIXER STRIPS */
|
||||||
|
|
||||||
nframes64_t const frame = _session->audible_frame();
|
/* update track meters, if required */
|
||||||
|
if (is_mapped() && meters_running) {
|
||||||
if (_dragging_playhead) {
|
RouteTimeAxisView* rtv;
|
||||||
goto almost_done;
|
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||||
|
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
||||||
|
rtv->fast_update ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* only update if the playhead is on screen or we are following it */
|
/* and any current mixer strip */
|
||||||
|
if (current_mixer_strip) {
|
||||||
|
current_mixer_strip->fast_update ();
|
||||||
|
}
|
||||||
|
|
||||||
if (_follow_playhead && _session->requested_return_frame() < 0) {
|
/* PLAYHEAD AND VIEWPORT */
|
||||||
|
|
||||||
//playhead_cursor->canvas_item.show();
|
nframes64_t const frame = _session->audible_frame();
|
||||||
|
|
||||||
if (frame != last_update_frame) {
|
/* There are a few reasons why we might not update the playhead / viewport stuff:
|
||||||
|
*
|
||||||
|
* 1. we don't update things when there's a pending locate request, otherwise
|
||||||
|
* when the editor requests a locate there is a chance that this method
|
||||||
|
* will move the playhead before the locate request is processed, causing
|
||||||
|
* 2. if we're not rolling, there's nothing to do here (locates are handled elsewhere).
|
||||||
|
* 3. if we're still at the same frame that we were last time, there's nothing to do.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!_pending_locate_request && _session->transport_speed() != 0 && frame != last_update_frame) {
|
||||||
|
|
||||||
|
last_update_frame = frame;
|
||||||
|
|
||||||
|
if (!_dragging_playhead) {
|
||||||
|
playhead_cursor->set_position (frame);
|
||||||
|
}
|
||||||
|
|
||||||
#undef CONTINUOUS_SCROLL
|
#undef CONTINUOUS_SCROLL
|
||||||
#ifndef CONTINUOUS_SCROLL
|
#ifndef CONTINUOUS_SCROLL
|
||||||
if (frame < leftmost_frame || frame > leftmost_frame + current_page_frames()) {
|
|
||||||
|
|
||||||
if (_session->transport_speed() < 0) {
|
if (!_dragging_playhead && _follow_playhead && _session->requested_return_frame() < 0) {
|
||||||
if (frame > (current_page_frames()/2)) {
|
reset_x_origin_to_follow_playhead ();
|
||||||
center_screen (frame-(current_page_frames()/2));
|
}
|
||||||
} else {
|
|
||||||
center_screen (current_page_frames()/2);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (frame < leftmost_frame) {
|
|
||||||
/* moving left */
|
|
||||||
nframes64_t l = 0;
|
|
||||||
if (_session->transport_rolling()) {
|
|
||||||
/* rolling; end up with the playhead at the right of the page */
|
|
||||||
l = frame - current_page_frames ();
|
|
||||||
} else {
|
|
||||||
/* not rolling: end up with the playhead 3/4 of the way along the page */
|
|
||||||
l = frame - (3 * current_page_frames() / 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (l < 0) {
|
|
||||||
l = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
center_screen_internal (l + (current_page_frames() / 2), current_page_frames ());
|
|
||||||
} else {
|
|
||||||
/* moving right */
|
|
||||||
if (_session->transport_rolling()) {
|
|
||||||
/* rolling: end up with the playhead on the left of the page */
|
|
||||||
center_screen_internal (frame + (current_page_frames() / 2), current_page_frames ());
|
|
||||||
} else {
|
|
||||||
/* not rolling: end up with the playhead 1/4 of the way along the page */
|
|
||||||
center_screen_internal (frame + (current_page_frames() / 4), current_page_frames ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
playhead_cursor->set_position (frame);
|
|
||||||
|
|
||||||
#else // CONTINUOUS_SCROLL
|
#else // CONTINUOUS_SCROLL
|
||||||
|
|
||||||
/* don't do continuous scroll till the new position is in the rightmost quarter of the
|
/* don't do continuous scroll till the new position is in the rightmost quarter of the
|
||||||
editor canvas
|
editor canvas
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (_session->transport_speed()) {
|
double target = ((double)frame - (double)current_page_frames()/2.0) / frames_per_unit;
|
||||||
double target = ((double)frame - (double)current_page_frames()/2.0) / frames_per_unit;
|
if (target <= 0.0) {
|
||||||
if (target <= 0.0) target = 0.0;
|
target = 0.0;
|
||||||
if ( fabs(target - current) < current_page_frames()/frames_per_unit ) {
|
}
|
||||||
target = (target * 0.15) + (current * 0.85);
|
if (fabs(target - current) < current_page_frames() / frames_per_unit) {
|
||||||
} else {
|
target = (target * 0.15) + (current * 0.85);
|
||||||
/* relax */
|
} else {
|
||||||
}
|
/* relax */
|
||||||
//printf("frame: %d, cpf: %d, fpu: %6.6f, current: %6.6f, target : %6.6f\n", frame, current_page_frames(), frames_per_unit, current, target );
|
}
|
||||||
current = target;
|
|
||||||
horizontal_adjustment.set_value ( current );
|
current = target;
|
||||||
}
|
horizontal_adjustment.set_value (current);
|
||||||
|
|
||||||
playhead_cursor->set_position (frame);
|
|
||||||
|
|
||||||
#endif // CONTINUOUS_SCROLL
|
#endif // CONTINUOUS_SCROLL
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (frame != last_update_frame) {
|
|
||||||
playhead_cursor->set_position (frame);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
almost_done:
|
|
||||||
last_update_frame = frame;
|
|
||||||
if (current_mixer_strip) {
|
|
||||||
current_mixer_strip->fast_update ();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5145,7 +5156,8 @@ Editor::session_going_away ()
|
||||||
|
|
||||||
_session_connections.drop_connections ();
|
_session_connections.drop_connections ();
|
||||||
|
|
||||||
stop_scrolling ();
|
super_rapid_screen_update_connection.disconnect ();
|
||||||
|
|
||||||
selection->clear ();
|
selection->clear ();
|
||||||
cut_buffer->clear ();
|
cut_buffer->clear ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -401,6 +401,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
void restore_editing_space();
|
void restore_editing_space();
|
||||||
|
|
||||||
void reset_x_origin (nframes64_t);
|
void reset_x_origin (nframes64_t);
|
||||||
|
void reset_x_origin_to_follow_playhead ();
|
||||||
void reset_y_origin (double);
|
void reset_y_origin (double);
|
||||||
void reset_zoom (double);
|
void reset_zoom (double);
|
||||||
void reposition_and_zoom (nframes64_t, double);
|
void reposition_and_zoom (nframes64_t, double);
|
||||||
|
|
@ -987,11 +988,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
|
|
||||||
static void build_cursors ();
|
static void build_cursors ();
|
||||||
|
|
||||||
sigc::connection scroll_connection;
|
sigc::connection super_rapid_screen_update_connection;
|
||||||
nframes64_t last_update_frame;
|
nframes64_t last_update_frame;
|
||||||
void center_screen_internal (nframes64_t, float);
|
void center_screen_internal (nframes64_t, float);
|
||||||
|
|
||||||
void update_current_screen ();
|
void super_rapid_screen_update ();
|
||||||
|
|
||||||
void session_going_away ();
|
void session_going_away ();
|
||||||
|
|
||||||
|
|
@ -1253,9 +1254,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
void reverse_selection ();
|
void reverse_selection ();
|
||||||
void edit_envelope ();
|
void edit_envelope ();
|
||||||
|
|
||||||
void start_scrolling ();
|
|
||||||
void stop_scrolling ();
|
|
||||||
|
|
||||||
double last_scrub_x;
|
double last_scrub_x;
|
||||||
int scrubbing_direction;
|
int scrubbing_direction;
|
||||||
int scrub_reversals;
|
int scrub_reversals;
|
||||||
|
|
@ -1966,10 +1964,8 @@ public:
|
||||||
|
|
||||||
void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
|
void get_regions_for_action (RegionSelection&, bool allow_entered = false, bool allow_edit_position = true);
|
||||||
|
|
||||||
sigc::connection fast_screen_update_connection;
|
void start_updating_meters ();
|
||||||
gint start_updating ();
|
void stop_updating_meters ();
|
||||||
gint stop_updating ();
|
|
||||||
void fast_update_strips ();
|
|
||||||
bool meters_running;
|
bool meters_running;
|
||||||
|
|
||||||
void select_next_route ();
|
void select_next_route ();
|
||||||
|
|
@ -1999,7 +1995,15 @@ public:
|
||||||
void visible_order_range (int*, int*) const;
|
void visible_order_range (int*, int*) const;
|
||||||
|
|
||||||
void located ();
|
void located ();
|
||||||
|
|
||||||
|
/** true if we've made a locate request that hasn't yet been processed */
|
||||||
bool _pending_locate_request;
|
bool _pending_locate_request;
|
||||||
|
|
||||||
|
/** if true, there is a pending Session locate which is the initial one when loading a session;
|
||||||
|
we need to know this so that we don't (necessarily) set the viewport to show the playhead
|
||||||
|
initially.
|
||||||
|
*/
|
||||||
|
bool _pending_initial_locate;
|
||||||
|
|
||||||
Gtk::HBox _summary_hbox;
|
Gtk::HBox _summary_hbox;
|
||||||
EditorSummary* _summary;
|
EditorSummary* _summary;
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,11 @@ Editor::set_show_waveforms_recording (bool yn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
void
|
||||||
Editor::start_updating ()
|
Editor::start_updating_meters ()
|
||||||
{
|
{
|
||||||
RouteTimeAxisView* rtv;
|
RouteTimeAxisView* rtv;
|
||||||
|
|
||||||
//cerr << "Editor::start_updating () called" << endl;//DEBUG
|
|
||||||
if (is_mapped() && _session) {
|
if (is_mapped() && _session) {
|
||||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||||
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
||||||
|
|
@ -63,21 +62,16 @@ Editor::start_updating ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!meters_running) {
|
meters_running = true;
|
||||||
fast_screen_update_connection = ARDOUR_UI::SuperRapidScreenUpdate.connect (sigc::mem_fun(*this, &Editor::fast_update_strips));
|
|
||||||
meters_running = true;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
void
|
||||||
Editor::stop_updating ()
|
Editor::stop_updating_meters ()
|
||||||
{
|
{
|
||||||
RouteTimeAxisView* rtv;
|
RouteTimeAxisView* rtv;
|
||||||
|
|
||||||
meters_running = false;
|
meters_running = false;
|
||||||
fast_screen_update_connection.disconnect();
|
|
||||||
//cerr << "Editor::stop_updating () called" << endl;//DEBUG
|
|
||||||
if (is_mapped() && _session) {
|
if (is_mapped() && _session) {
|
||||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||||
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
||||||
|
|
@ -85,32 +79,17 @@ Editor::stop_updating ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::toggle_meter_updating()
|
Editor::toggle_meter_updating()
|
||||||
{
|
{
|
||||||
if (Config->get_show_track_meters()) {
|
if (Config->get_show_track_meters()) {
|
||||||
start_updating();
|
start_updating_meters ();
|
||||||
} else {
|
} else {
|
||||||
stop_updating ();
|
stop_updating_meters ();
|
||||||
}
|
|
||||||
track_canvas_allocate(track_canvas->get_allocation());
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
Editor::fast_update_strips ()
|
|
||||||
{
|
|
||||||
RouteTimeAxisView* rtv;
|
|
||||||
|
|
||||||
if (is_mapped() && _session) {
|
|
||||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
|
||||||
if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
|
|
||||||
rtv->fast_update ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
track_canvas_allocate (track_canvas->get_allocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -820,7 +820,6 @@ Editor::cursor_to_region_boundary (bool with_selection, int32_t dir)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_session->request_locate (target);
|
_session->request_locate (target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue