X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession.cc;h=decb2603fe98a73fd7268a7eea62c16a646d269f;hb=7720d0d109ca47c2a0a23883d5831de1ff32005d;hp=b3c0ed29fbc9f46ebb6649e147005569e4c119d5;hpb=8e65788ef0cb56747f4e1e08c9c64a137f922026;p=ardour.git diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index b3c0ed29fb..decb2603fe 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -32,15 +32,16 @@ #include #include #include +#include #include "pbd/error.h" -#include #include "pbd/boost_debug.h" #include "pbd/pathscanner.h" #include "pbd/stl_delete.h" #include "pbd/basename.h" #include "pbd/stacktrace.h" #include "pbd/file_utils.h" +#include "pbd/convert.h" #include "ardour/amp.h" #include "ardour/analyser.h" @@ -93,6 +94,8 @@ #include "ardour/tempo.h" #include "ardour/utils.h" +#include "midi++/jack.h" + #include "i18n.h" using namespace std; @@ -350,6 +353,10 @@ Session::destroy () _engine.remove_session (); + /* clear region map. it doesn't hold references, but lets just be sensible here */ + + RegionFactory::clear_map (); + /* clear history so that no references to objects are held any more */ _history.clear (); @@ -790,6 +797,7 @@ Session::hookup_io () /* Tell all IO objects to connect themselves together */ IO::enable_connecting (); + MIDI::JACK_MidiPort::MakeConnections (); /* Now reset all panners */ @@ -1860,20 +1868,27 @@ void Session::set_remote_control_ids () { RemoteModel m = Config->get_remote_model(); + bool emit_signal = false; shared_ptr r = routes.reader (); for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { - if ( MixerOrdered == m) { + if (MixerOrdered == m) { long order = (*i)->order_key(N_("signal")); - (*i)->set_remote_control_id( order+1 ); - } else if ( EditorOrdered == m) { + (*i)->set_remote_control_id (order+1, false); + emit_signal = true; + } else if (EditorOrdered == m) { long order = (*i)->order_key(N_("editor")); - (*i)->set_remote_control_id( order+1 ); - } else if ( UserOrdered == m) { + (*i)->set_remote_control_id (order+1, false); + emit_signal = true; + } else if (UserOrdered == m) { //do nothing ... only changes to remote id's are initiated by user } } + + if (emit_signal) { + Route::RemoteControlIDChange(); + } } @@ -2167,6 +2182,7 @@ Session::add_routes (RouteList& new_routes, bool save) } RouteAdded (new_routes); /* EMIT SIGNAL */ + Route::RemoteControlIDChange (); /* EMIT SIGNAL */ } void @@ -2369,6 +2385,8 @@ Session::remove_route (shared_ptr route) sync_order_keys (N_("session")); + Route::RemoteControlIDChange(); /* EMIT SIGNAL */ + /* save the new state of the world */ if (save_state (_current_snapshot_name)) { @@ -2432,8 +2450,7 @@ Session::route_solo_changed (void* /*src*/, boost::weak_ptr wpr) for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { bool via_sends_only; - - if ((*i) == route || !(*i)->solo_isolated() || !(*i)->is_master() || !(*i)->is_control() || (*i)->is_hidden()) { + if ((*i) == route || (*i)->solo_isolated() || (*i)->is_master() || (*i)->is_control() || (*i)->is_hidden()) { continue; } else if ((*i)->feeds (route, &via_sends_only)) { if (!via_sends_only) { @@ -2793,7 +2810,7 @@ Session::add_regions (vector >& new_regions) } } - region->StateChanged.connect_same_thread (*this, boost::bind (&Session::region_changed, this, _1, boost::weak_ptr(region))); + region->PropertyChanged.connect_same_thread (*this, boost::bind (&Session::region_changed, this, _1, boost::weak_ptr(region))); update_region_name_map (region); } @@ -2823,7 +2840,7 @@ Session::update_region_name_map (boost::shared_ptr region) } void -Session::region_changed (Change what_changed, boost::weak_ptr weak_region) +Session::region_changed (const PropertyChange& what_changed, boost::weak_ptr weak_region) { boost::shared_ptr region (weak_region.lock ()); @@ -2831,12 +2848,12 @@ Session::region_changed (Change what_changed, boost::weak_ptr weak_regio return; } - if (what_changed & Region::HiddenChanged) { + if (what_changed.contains (Properties::hidden)) { /* relay hidden changes */ RegionHiddenChange (region); } - if (what_changed & NameChanged) { + if (what_changed.contains (Properties::name)) { update_region_name_map (region); } } @@ -3658,7 +3675,7 @@ Session::bundle_by_name (string name) const } void -Session::tempo_map_changed (Change) +Session::tempo_map_changed (const PropertyChange&) { clear_clicks (); @@ -4052,9 +4069,14 @@ Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end, /* construct a region to represent the bounced material */ - result = RegionFactory::create (srcs, 0, - srcs.front()->length(srcs.front()->timeline_position()), - region_name_from_path (srcs.front()->name(), true)); + PropertyList plist; + + plist.add (Properties::start, 0); + plist.add (Properties::length, srcs.front()->length(srcs.front()->timeline_position())); + plist.add (Properties::name, region_name_from_path (srcs.front()->name(), true)); + + result = RegionFactory::create (srcs, plist); + } out: @@ -4180,8 +4202,11 @@ Session::sync_order_keys (std::string const & base) } Route::SyncOrderKeys (base); // EMIT SIGNAL -} + /* this might not do anything */ + + set_remote_control_ids (); +} /** @return true if there is at least one record-enabled diskstream, otherwise false */ bool