diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-10-24 12:18:40 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-10-24 12:18:46 -0400 |
commit | f90071113654c5d788e90196db5ee1dedd11172f (patch) | |
tree | 54e708b10f4df0687db03bda9feb3d16dc83ff38 /gtk2_ardour | |
parent | 2f4a8cf69394d4c6442381297136662af923f577 (diff) |
port changes to ARDOUR::Location and ARDOUR::Locations APIs from Tracks to Ardour.
Fixes deadlocks caused by mutex on Locations list, and clarifies the purposes and uses of the class-level and
object-level change-related signals.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_markers.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/location_ui.cc | 20 | ||||
-rw-r--r-- | gtk2_ardour/location_ui.h | 3 |
5 files changed, 8 insertions, 22 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index eaf55bcc1c..4c747638eb 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -1356,7 +1356,6 @@ Editor::set_session (Session *t) _session->locations()->added.connect (_session_connections, invalidator (*this), boost::bind (&Editor::add_new_location, this, _1), gui_context()); _session->locations()->removed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::location_gone, this, _1), gui_context()); _session->locations()->changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::refresh_location_display, this), gui_context()); - _session->locations()->StateChanged.connect (_session_connections, invalidator (*this), boost::bind (&Editor::refresh_location_display, this), gui_context()); _session->history().Changed.connect (_session_connections, invalidator (*this), boost::bind (&Editor::history_changed, this), gui_context()); playhead_cursor->show (); diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index bb33fbf51c..4dc5f80d6f 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -572,7 +572,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD void location_changed (ARDOUR::Location *); void location_flags_changed (ARDOUR::Location *); void refresh_location_display (); - void refresh_location_display_internal (ARDOUR::Locations::LocationList&); + void refresh_location_display_internal (const ARDOUR::Locations::LocationList&); void add_new_location (ARDOUR::Location *); ArdourCanvas::Container* add_new_location_internal (ARDOUR::Location *); void location_gone (ARDOUR::Location *); diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 5a37fe70cb..0900c7fc18 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -486,7 +486,7 @@ Editor::find_location_from_marker (Marker *marker, bool& is_start) const } void -Editor::refresh_location_display_internal (Locations::LocationList& locations) +Editor::refresh_location_display_internal (const Locations::LocationList& locations) { /* invalidate all */ @@ -496,7 +496,7 @@ Editor::refresh_location_display_internal (Locations::LocationList& locations) /* add new ones */ - for (Locations::LocationList::iterator i = locations.begin(); i != locations.end(); ++i) { + for (Locations::LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) { LocationMarkerMap::iterator x; diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc index 538d7315bd..689706ba01 100644 --- a/gtk2_ardour/location_ui.cc +++ b/gtk2_ardour/location_ui.cc @@ -959,7 +959,7 @@ LocationUI::location_removed (Location* location) } void -LocationUI::map_locations (Locations::LocationList& locations) +LocationUI::map_locations (const Locations::LocationList& locations) { Locations::LocationList::iterator i; gint n; @@ -968,9 +968,8 @@ LocationUI::map_locations (Locations::LocationList& locations) LocationSortByStart cmp; temp.sort (cmp); - locations = temp; - for (n = 0, i = locations.begin(); i != locations.end(); ++n, ++i) { + for (n = 0, i = temp.begin(); i != temp.end(); ++n, ++i) { Location* location = *i; @@ -1074,10 +1073,10 @@ LocationUI::set_session(ARDOUR::Session* s) SessionHandlePtr::set_session (s); if (_session) { - _session->locations()->changed.connect (_session_connections, invalidator (*this), boost::bind (&LocationUI::locations_changed, this, _1), gui_context()); - _session->locations()->StateChanged.connect (_session_connections, invalidator (*this), boost::bind (&LocationUI::refresh_location_list, this), gui_context()); _session->locations()->added.connect (_session_connections, invalidator (*this), boost::bind (&LocationUI::location_added, this, _1), gui_context()); _session->locations()->removed.connect (_session_connections, invalidator (*this), boost::bind (&LocationUI::location_removed, this, _1), gui_context()); + _session->locations()->changed.connect (_session_connections, invalidator (*this), boost::bind (&LocationUI::refresh_location_list, this), gui_context()); + _clock_group->set_clock_mode (clock_mode_from_session_instant_xml ()); } @@ -1088,17 +1087,6 @@ LocationUI::set_session(ARDOUR::Session* s) } void -LocationUI::locations_changed (Locations::Change c) -{ - /* removal is signalled by both a removed and a changed signal emission from Locations, - so we don't need to refresh the list on a removal - */ - if (c != Locations::REMOVAL) { - refresh_location_list (); - } -} - -void LocationUI::session_going_away() { ENSURE_GUI_THREAD (*this, &LocationUI::session_going_away); diff --git a/gtk2_ardour/location_ui.h b/gtk2_ardour/location_ui.h index b363040e57..76dca563fc 100644 --- a/gtk2_ardour/location_ui.h +++ b/gtk2_ardour/location_ui.h @@ -202,8 +202,7 @@ class LocationUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr void location_removed (ARDOUR::Location *); void location_added (ARDOUR::Location *); - void locations_changed (ARDOUR::Locations::Change); - void map_locations (ARDOUR::Locations::LocationList&); + void map_locations (const ARDOUR::Locations::LocationList&); ClockGroup* _clock_group; AudioClock::Mode clock_mode_from_session_instant_xml () const; |