summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_info_box.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-06-07 17:40:05 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-06-07 17:40:05 +0000
commitf6e67fa3dd7ddbb2315887af37a7cb20c3e8157f (patch)
treecb2d583c7a21369a73e9d717e91714c6a683ddc6 /gtk2_ardour/time_info_box.cc
parentbe1abb12ffcd8ded8638742e96ac60d754dac8f5 (diff)
allow mode changes in the time info box, all synced
git-svn-id: svn://localhost/ardour2/branches/3.0@9681 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_info_box.cc')
-rw-r--r--gtk2_ardour/time_info_box.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/gtk2_ardour/time_info_box.cc b/gtk2_ardour/time_info_box.cc
index 8319db94ef..ebebade6c1 100644
--- a/gtk2_ardour/time_info_box.cc
+++ b/gtk2_ardour/time_info_box.cc
@@ -37,6 +37,8 @@ using namespace ARDOUR;
TimeInfoBox::TimeInfoBox ()
: Table (4, 4)
+ , syncing_selection (false)
+ , syncing_punch (false)
{
selection_start = new AudioClock ("selection-start", false, "SelectionClockDisplay", false, false, false, false);
selection_end = new AudioClock ("selection-end", false, "SelectionClockDisplay", false, false, false, false);
@@ -83,6 +85,7 @@ TimeInfoBox::TimeInfoBox ()
set_homogeneous (false);
set_spacings (0);
set_border_width (2);
+ set_col_spacings (2);
/* a bit more spacing between the two "sides" */
set_col_spacing (1, 10);
@@ -115,6 +118,13 @@ TimeInfoBox::TimeInfoBox ()
show_all ();
+ selection_start->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_selection_mode), selection_start));
+ selection_end->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_selection_mode), selection_start));
+ selection_length->mode_changed.connect (sigc::bind (sigc::mem_fun (*this, &TimeInfoBox::sync_selection_mode), selection_start));
+
+ 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));
+
Editor::instance().get_selection().TimeChanged.connect (sigc::mem_fun (*this, &TimeInfoBox::selection_changed));
}
@@ -129,6 +139,30 @@ TimeInfoBox::~TimeInfoBox ()
}
void
+TimeInfoBox::sync_selection_mode (AudioClock* src)
+{
+ if (!syncing_selection) {
+ syncing_selection = true;
+ selection_start->set_mode (src->mode());
+ selection_end->set_mode (src->mode());
+ selection_length->set_mode (src->mode());
+ syncing_selection = false;
+ }
+}
+
+void
+TimeInfoBox::sync_punch_mode (AudioClock* src)
+{
+ if (!syncing_punch) {
+ syncing_punch = true;
+ punch_start->set_mode (src->mode());
+ punch_end->set_mode (src->mode());
+ syncing_punch = false;
+ }
+}
+
+
+void
TimeInfoBox::set_session (Session* s)
{
SessionHandlePtr::set_session (s);