13
0

(Source List) Handle Session::RemoveSource

This commit is contained in:
Ben Loftis 2019-07-30 13:43:14 -05:00
parent 595959abf7
commit d400dd813a
2 changed files with 10 additions and 7 deletions

View File

@ -266,10 +266,12 @@ EditorSources::set_session (ARDOUR::Session* s)
if (s) { if (s) {
/* Currently, none of the displayed properties are mutable, so there is no reason to register for changes /* Currently, none of the displayed properties are mutable, so there is no reason to register for changes
* ARDOUR::Region::RegionPropertyChanged.connect (region_property_connection, MISSING_INVALIDATOR, boost::bind (&EditorSources::source_changed, this, _1, _2), gui_context()); * ARDOUR::Region::RegionPropertyChanged.connect (source_property_connection, MISSING_INVALIDATOR, boost::bind (&EditorSources::source_changed, this, _1, _2), gui_context());
*/ */
ARDOUR::RegionFactory::CheckNewRegion.connect (check_new_region_connection, MISSING_INVALIDATOR, boost::bind (&EditorSources::add_source, this, _1), gui_context()); ARDOUR::RegionFactory::CheckNewRegion.connect (add_source_connection, MISSING_INVALIDATOR, boost::bind (&EditorSources::add_source, this, _1), gui_context());
s->SourceRemoved.connect (remove_source_connection, MISSING_INVALIDATOR, boost::bind (&EditorSources::remove_source, this, _1), gui_context());
redisplay(); redisplay();
@ -279,13 +281,13 @@ EditorSources::set_session (ARDOUR::Session* s)
} }
void void
EditorSources::remove_source (boost::shared_ptr<ARDOUR::Region> region) EditorSources::remove_source (boost::shared_ptr<ARDOUR::Source> source)
{ {
TreeModel::iterator i; TreeModel::iterator i;
TreeModel::Children rows = _model->children(); TreeModel::Children rows = _model->children();
for (i = rows.begin(); i != rows.end(); ++i) { for (i = rows.begin(); i != rows.end(); ++i) {
boost::shared_ptr<ARDOUR::Region> rr = (*i)[_columns.region]; boost::shared_ptr<ARDOUR::Region> rr = (*i)[_columns.region];
if (region == rr) { if (rr->source() == source) {
_model->erase(i); _model->erase(i);
break; break;
} }

View File

@ -116,7 +116,7 @@ private:
void format_position (ARDOUR::samplepos_t pos, char* buf, size_t bufsize, bool onoff = true); void format_position (ARDOUR::samplepos_t pos, char* buf, size_t bufsize, bool onoff = true);
void add_source (boost::shared_ptr<ARDOUR::Region>); void add_source (boost::shared_ptr<ARDOUR::Region>);
void remove_source (boost::shared_ptr<ARDOUR::Region>); void remove_source (boost::shared_ptr<ARDOUR::Source>);
void clock_format_changed (); void clock_format_changed ();
@ -143,8 +143,9 @@ private:
Glib::RefPtr<Gtk::TreeStore> _model; Glib::RefPtr<Gtk::TreeStore> _model;
PBD::ScopedConnection region_property_connection; PBD::ScopedConnection source_property_connection;
PBD::ScopedConnection check_new_region_connection; PBD::ScopedConnection add_source_connection;
PBD::ScopedConnection remove_source_connection;
PBD::ScopedConnection editor_freeze_connection; PBD::ScopedConnection editor_freeze_connection;
PBD::ScopedConnection editor_thaw_connection; PBD::ScopedConnection editor_thaw_connection;