summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-01-21 22:26:14 +0100
committerRobin Gareus <robin@gareus.org>2015-01-21 22:26:14 +0100
commit01d99870ffdefa1a76093c95250f355db11609d1 (patch)
tree346b64be59e8a05a3b12f84461ee9c628bda7349
parentc7c8cc7dc7555c9e852ff4b667fbcd046517d21c (diff)
update selection clock
-rw-r--r--gtk2_ardour/time_info_box.cc28
-rw-r--r--gtk2_ardour/time_info_box.h2
2 files changed, 30 insertions, 0 deletions
diff --git a/gtk2_ardour/time_info_box.cc b/gtk2_ardour/time_info_box.cc
index afd48715b3..a384ae5ed8 100644
--- a/gtk2_ardour/time_info_box.cc
+++ b/gtk2_ardour/time_info_box.cc
@@ -149,6 +149,7 @@ TimeInfoBox::TimeInfoBox ()
Editor::instance().get_selection().TimeChanged.connect (sigc::mem_fun (*this, &TimeInfoBox::selection_changed));
Editor::instance().get_selection().RegionsChanged.connect (sigc::mem_fun (*this, &TimeInfoBox::selection_changed));
+ Region::RegionPropertyChanged.connect (region_property_connections, invalidator (*this), boost::bind (&TimeInfoBox::region_property_change, this, _1, _2), gui_context());
Editor::instance().MouseModeChanged.connect (editor_connections, invalidator(*this), boost::bind (&TimeInfoBox::track_mouse_mode, this), gui_context());
}
@@ -168,6 +169,33 @@ TimeInfoBox::track_mouse_mode ()
selection_changed ();
}
+void
+TimeInfoBox::region_property_change (boost::shared_ptr<ARDOUR::Region> /* r */, const PBD::PropertyChange& what_changed)
+{
+ Selection& selection (Editor::instance().get_selection());
+
+ if (selection.regions.empty()) {
+ return;
+ }
+
+ PBD::PropertyChange our_interests;
+
+ our_interests.add (ARDOUR::Properties::position);
+ our_interests.add (ARDOUR::Properties::length);
+ our_interests.add (ARDOUR::Properties::start);
+
+ if (!what_changed.contains (our_interests)) {
+ return;
+ }
+
+ /* TODO: check if RegionSelection includes the given region.
+ * This is not straight foward because RegionSelection is done by
+ * RegionView (not Region itself).
+ */
+
+ selection_changed ();
+}
+
bool
TimeInfoBox::clock_button_release_event (GdkEventButton* ev, AudioClock* src)
{
diff --git a/gtk2_ardour/time_info_box.h b/gtk2_ardour/time_info_box.h
index ac4cc98ea5..d0fabae872 100644
--- a/gtk2_ardour/time_info_box.h
+++ b/gtk2_ardour/time_info_box.h
@@ -69,6 +69,7 @@ class TimeInfoBox : public CairoHPacker, public ARDOUR::SessionHandlePtr
void watch_punch (ARDOUR::Location*);
PBD::ScopedConnectionList punch_connections;
PBD::ScopedConnectionList editor_connections;
+ PBD::ScopedConnectionList region_property_connections;
ArdourButton punch_in_button;
ArdourButton punch_out_button;
@@ -80,6 +81,7 @@ class TimeInfoBox : public CairoHPacker, public ARDOUR::SessionHandlePtr
bool clock_button_release_event (GdkEventButton* ev, AudioClock* src);
void track_mouse_mode ();
+ void region_property_change (boost::shared_ptr<ARDOUR::Region> r, const PBD::PropertyChange& what_changed);
};