diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-08 18:16:12 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-12-08 18:16:12 +0000 |
commit | 42db44c1939410aab15eb3c0d08f6026fb58b003 (patch) | |
tree | f609009ae5823ae34100c272cb873a35ac8086ba /libs | |
parent | 752d8d4b6f2f28fdd3fc810cfd956e4bec5b9ef8 (diff) |
merge 3870-3890 from 2.0-ongoing into 3.X (compiles, runs, no other promises
git-svn-id: svn://localhost/ardour2/branches/3.0@4303 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/route.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 4 | ||||
-rw-r--r-- | libs/ardour/audioengine.cc | 1 | ||||
-rw-r--r-- | libs/ardour/jack_slave.cc | 1 | ||||
-rw-r--r-- | libs/ardour/route.cc | 32 | ||||
-rw-r--r-- | libs/ardour/session.cc | 8 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 5 |
7 files changed, 33 insertions, 22 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index fb98cb57a7..f963d3b2cf 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -256,8 +256,8 @@ class Route : public IO uint32_t remote_control_id () const; sigc::signal<void> RemoteControlIDChanged; - void sync_order_keys (); - static sigc::signal<void> SyncOrderKeys; + void sync_order_keys (const char* base); + static sigc::signal<void,const char*> SyncOrderKeys; protected: friend class Session; diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index a5245b73f8..017a78a015 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -319,6 +319,8 @@ class Session : public PBD::StatefulDestructible struct RoutePublicOrderSorter { bool operator() (boost::shared_ptr<Route>, boost::shared_ptr<Route> b); }; + + void sync_order_keys (const char* base); template<class T> void foreach_route (T *obj, void (T::*func)(Route&)); template<class T> void foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>)); @@ -1395,8 +1397,6 @@ class Session : public PBD::StatefulDestructible void change_midi_ports (); int use_config_midi_ports (); - mutable gint butler_active; - void set_play_loop (bool yn); void overwrite_some_buffers (Diskstream*); void flush_all_inserts (); diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 0ae71f739c..788017555a 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -1103,7 +1103,6 @@ AudioEngine::transport_stop () void AudioEngine::transport_start () { - // cerr << "tell JACK to start\n"; if (_jack) { jack_transport_start (_jack); } diff --git a/libs/ardour/jack_slave.cc b/libs/ardour/jack_slave.cc index 7865f5253b..40729d3370 100644 --- a/libs/ardour/jack_slave.cc +++ b/libs/ardour/jack_slave.cc @@ -67,7 +67,6 @@ JACK_Slave::speed_and_position (float& sp, nframes_t& position) { jack_position_t pos; jack_transport_state_t state; - state = jack_transport_query (jack, &pos); switch (state) { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 78d4a85e61..5d1a26d3d0 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -57,7 +57,7 @@ using namespace ARDOUR; using namespace PBD; uint32_t Route::order_key_cnt = 0; -sigc::signal<void> Route::SyncOrderKeys; +sigc::signal<void,const char*> Route::SyncOrderKeys; Route::Route (Session& sess, string name, int input_min, int input_max, int output_min, int output_max, Flag flg, DataType default_type) : IO (sess, name, input_min, input_max, output_min, output_max, default_type), @@ -177,20 +177,32 @@ Route::set_order_key (const char* name, long n) } void -Route::sync_order_keys () +Route::sync_order_keys (const char* base) { - uint32_t key; - if (order_keys.empty()) { return; } - - OrderKeys::iterator x = order_keys.begin(); - key = x->second; - ++x; - for (; x != order_keys.end(); ++x) { - x->second = key; + OrderKeys::iterator i; + uint32_t key; + + if ((i = order_keys.find (base)) == order_keys.end()) { + /* key doesn't exist, use the first existing + key (this is done during session initialization) + */ + i = order_keys.begin(); + key = i->second; + ++i; + } else { + /* key exists - use it and reset all others + (actually, itself included) + */ + i = order_keys.begin(); + key = i->second; + } + + for (; i != order_keys.end(); ++i) { + i->second = key; } } diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 3b9b48a2de..14ef0e1ac5 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2114,6 +2114,8 @@ Session::remove_route (shared_ptr<Route> route) route->drop_references (); + sync_order_keys (N_("session")); + /* save the new state of the world */ if (save_state (_current_snapshot_name)) { @@ -4274,7 +4276,7 @@ Session::compute_initial_length () } void -Session::sync_order_keys () +Session::sync_order_keys (const char* base) { if (!Config->get_sync_all_route_ordering()) { /* leave order keys as they are */ @@ -4284,10 +4286,10 @@ Session::sync_order_keys () boost::shared_ptr<RouteList> r = routes.reader (); for (RouteList::iterator i = r->begin(); i != r->end(); ++i) { - (*i)->sync_order_keys (); + (*i)->sync_order_keys (base); } - Route::SyncOrderKeys (); // EMIT SIGNAL + Route::SyncOrderKeys (base); // EMIT SIGNAL } void diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 0ac6e08827..a1b4f34a25 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -193,7 +193,6 @@ Session::first_stage_init (string fullpath, string snapshot_name) session_send_mtc = false; post_transport_work = PostTransportWork (0); g_atomic_int_set (&butler_should_do_transport_work, 0); - g_atomic_int_set (&butler_active, 0); g_atomic_int_set (&_playback_load, 100); g_atomic_int_set (&_capture_load, 100); g_atomic_int_set (&_playback_load_min, 100); @@ -255,7 +254,7 @@ Session::first_stage_init (string fullpath, string snapshot_name) /* slave stuff */ - average_slave_delta = 1800; + average_slave_delta = 1800; // !!! why 1800 ???? have_first_delta_accumulator = false; delta_accumulator_cnt = 0; slave_state = Stopped; @@ -3260,7 +3259,7 @@ Session::config_changed (const char* parameter_name) } else if (PARAM_IS ("history-depth")) { set_history_depth (Config->get_history_depth()); } else if (PARAM_IS ("sync-all-route-ordering")) { - sync_order_keys (); + sync_order_keys ("session"); } else if (PARAM_IS ("initial-program-change")) { if (_mmc_port && Config->get_initial_program_change() >= 0) { |