From f0d2fec29dd00bf62ba946385dea603e20a5b7f4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 4 Nov 2010 15:40:25 +0000 Subject: [PATCH] Fix roll after locate from the audio clock context menu. Restore Go buttons in the location window. Fixes #3521. git-svn-id: svn://localhost/ardour2/branches/3.0@7962 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui.cc | 4 ++-- gtk2_ardour/ardour_ui.h | 2 +- gtk2_ardour/audio_clock.cc | 4 ++-- gtk2_ardour/location_ui.cc | 12 +++++++----- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index df03e955fa..3c0e5b91fa 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1403,7 +1403,7 @@ restart JACK with more ports."), PROGRAM_NAME)); } void -ARDOUR_UI::do_transport_locate (nframes_t new_position) +ARDOUR_UI::do_transport_locate (nframes_t new_position, bool with_roll) { nframes_t _preroll = 0; @@ -1417,7 +1417,7 @@ ARDOUR_UI::do_transport_locate (nframes_t new_position) new_position = 0; } - _session->request_locate (new_position); + _session->request_locate (new_position, with_roll); } } diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 4efbc91e96..3f947b2af8 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -187,7 +187,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void save_ardour_state (); gboolean configure_handler (GdkEventConfigure* conf); - void do_transport_locate (nframes_t position); + void do_transport_locate (nframes_t, bool); void halt_on_xrun_message (); void xrun_handler (nframes_t); void create_xrun_marker (nframes_t); diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index a7f57c6820..3f60c6d3b1 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -1963,7 +1963,7 @@ AudioClock::build_ops_menu () if (editable && !is_duration && !_follows_playhead) { ops_items.push_back (SeparatorElem()); ops_items.push_back (MenuElem (_("Set From Playhead"), sigc::mem_fun(*this, &AudioClock::set_from_playhead))); - ops_items.push_back (MenuElem (_("Locate to this time"), sigc::mem_fun(*this, &AudioClock::locate))); + ops_items.push_back (MenuElem (_("Locate to This Time"), sigc::mem_fun(*this, &AudioClock::locate))); } } @@ -1984,7 +1984,7 @@ AudioClock::locate () return; } - _session->request_locate (current_time(), false); + _session->request_locate (current_time(), _session->transport_rolling ()); } void diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc index 70a00f0a26..e1fe31a858 100644 --- a/gtk2_ardour/location_ui.cc +++ b/gtk2_ardour/location_ui.cc @@ -118,7 +118,7 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num) set_session (sess); - // start_hbox.pack_start (start_go_button, false, false); + start_hbox.pack_start (start_go_button, false, false); start_hbox.pack_start (start_clock, false, false); /* this is always in this location, no matter what the location is */ @@ -129,7 +129,7 @@ LocationEditRow::LocationEditRow(Session * sess, Location * loc, int32_t num) start_clock.ValueChanged.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::clock_changed), LocStart)); start_clock.ChangeAborted.connect (sigc::bind (sigc::mem_fun (*this, &LocationEditRow::change_aborted), LocStart)); - // end_hbox.pack_start (end_go_button, false, false); + end_hbox.pack_start (end_go_button, false, false); end_hbox.pack_start (end_clock, false, false); end_go_button.signal_clicked().connect(sigc::bind (sigc::mem_fun (*this, &LocationEditRow::go_button_pressed), LocEnd)); @@ -364,14 +364,16 @@ LocationEditRow::composer_entry_changed () void LocationEditRow::go_button_pressed (LocationPart part) { - if (!location) return; + if (!location) { + return; + } switch (part) { case LocStart: - ARDOUR_UI::instance()->do_transport_locate (location->start()); + ARDOUR_UI::instance()->do_transport_locate (location->start(), _session->transport_rolling ()); break; case LocEnd: - ARDOUR_UI::instance()->do_transport_locate (location->end()); + ARDOUR_UI::instance()->do_transport_locate (location->end(), _session->transport_rolling ()); break; default: break;