summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_info_box.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-06-07 18:20:22 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-06-07 18:20:22 +0000
commit7e2b86dc835bd061786bffd0d503dfb3e8c74912 (patch)
tree5e3b49709ce34a9fc5b448f96b679109af1cf2ce /gtk2_ardour/time_info_box.cc
parentf6e67fa3dd7ddbb2315887af37a7cb20c3e8157f (diff)
locate when clicking on start/end fields in time info box
git-svn-id: svn://localhost/ardour2/branches/3.0@9683 d708f5d6-7413-0410-9779-e7cbd77b26cf
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)
{