summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_info_box.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/time_info_box.cc')
-rw-r--r--gtk2_ardour/time_info_box.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/gtk2_ardour/time_info_box.cc b/gtk2_ardour/time_info_box.cc
index ebebade6c1..ae3d3b65d4 100644
--- a/gtk2_ardour/time_info_box.cc
+++ b/gtk2_ardour/time_info_box.cc
@@ -125,6 +125,12 @@ TimeInfoBox::TimeInfoBox ()
punch_start->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_punch_mode), punch_start));
punch_end->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_punch_mode), punch_end));
+ selection_start->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), selection_start), true);
+ selection_end->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), selection_end), true);
+
+ punch_start->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), punch_start), true);
+ punch_end->signal_button_release_event().connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::clock_button_release_event), punch_end), true);
+
Editor::instance().get_selection().TimeChanged.connect (sigc::mem_fun (*this, &TimeInfoBox::selection_changed));
}
@@ -138,6 +144,21 @@ TimeInfoBox::~TimeInfoBox ()
delete punch_end;
}
+bool
+TimeInfoBox::clock_button_release_event (GdkEventButton* ev, AudioClock* src)
+{
+ if (!_session) {
+ return false;
+ }
+
+ if (ev->button == 1) {
+ _session->request_locate (src->current_time ());
+ return true;
+ }
+
+ return false;
+}
+
void
TimeInfoBox::sync_selection_mode (AudioClock* src)
{