diff options
author | John Anderson <ardour@semiosix.com> | 2007-02-17 10:54:57 +0000 |
---|---|---|
committer | John Anderson <ardour@semiosix.com> | 2007-02-17 10:54:57 +0000 |
commit | 207eaa4298c2424cd70a9c97e83c16fbf60ffaee (patch) | |
tree | 79c73721b53fd1685976f42934f710287366b0dc | |
parent | 78f6e01f2dcc810d8479ec43728139c69c5c7c0b (diff) |
Don't add duplicate remote_control_id to active banks. Notes and tweaks.
git-svn-id: svn://localhost/ardour2/trunk@1471 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/surfaces/mackie/TODO | 17 | ||||
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.cc | 19 | ||||
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol_poll.cc | 2 | ||||
-rw-r--r-- | libs/surfaces/mackie/route_signal.cc | 2 | ||||
-rw-r--r-- | libs/surfaces/mackie/route_signal.h | 2 | ||||
-rw-r--r-- | libs/surfaces/mackie/surface.cc | 11 | ||||
-rw-r--r-- | libs/surfaces/mackie/surface.h | 12 |
7 files changed, 46 insertions, 19 deletions
diff --git a/libs/surfaces/mackie/TODO b/libs/surfaces/mackie/TODO index 8e7e795acd..a4e7316b18 100644 --- a/libs/surfaces/mackie/TODO +++ b/libs/surfaces/mackie/TODO @@ -6,24 +6,29 @@ * discuss button mapping for Ardour * concurrency for bank switching? And make sure "old" events aren't sent to "new" faders * concurrency in write( bytes ). Queueing? -* Are remote_ids supposed to be 1-based or 0-based? * TODOs in code * handle remote_control_id changed signal from Route. * handle removal of route. Need another session signal? -* Some indication on the UI of remote_ids? - Useful for surfaces that don't have a scribble strip. * use i18n. see string_compose * MackieControlProtocol in namespace Mackie? * Generic surface code to common location * power-cycling of surface. fd_midiport doesn't close. * remove couts -* jog with transport rolling doesn't work properly +* jog with transport rolling doesn't work properly. My use of ScrollTimeline also doesn't work. * docs in manual Later ----- * which bank switching - overlap or dead faders? Option? * signals for buttons? +* mix busses and/or a "bus-only" bank/mode +* what about surfaces like Mackie C4 and BCR2000? + +Need UI integration +------------------- +* Some indication on the UI of currently bank-switched-in routes? + Useful for surfaces that don't have a scribble strip. +* use current zoom setting and snap state for shuttle wheel Actual Mackie ------------- @@ -35,8 +40,8 @@ Actual Mackie Bugs ---- -* get_state isn't called on deactivate +* get_state isn't called on deactivate. Huh? What did I mean here? * routes "forget" their remote_id between session save and the next session load * definitely something wrong with remote_id assignment on session create (master strip assigned 0). -* gui enables record for tracks with no inputs +* editor window doesn't update route remote_control_id when it's updated in mixer window. diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 2d443ad711..2c487103f1 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -202,14 +202,27 @@ MackieControlProtocol::Sorted MackieControlProtocol::get_sorted_routes() // fetch all routes boost::shared_ptr<Session::RouteList> routes = session->get_routes(); + set<uint32_t> remote_ids; + + // routes with remote_id 0 should never be added + // TODO verify this with ardour devs + // remote_ids.insert( 0 ); // sort in remote_id order, and exclude master, control and hidden routes + // and any routes that are already set. for ( Session::RouteList::iterator it = routes->begin(); it != routes->end(); ++it ) { Route & route = **it; - if ( route.active() && !route.master() && !route.hidden() && !route.control() ) + if ( + route.active() + && !route.master() + && !route.hidden() + && !route.control() + && remote_ids.find( route.remote_control_id() ) == remote_ids.end() + ) { sorted.push_back( *it ); + remote_ids.insert( route.remote_control_id() ); } } sort( sorted.begin(), sorted.end(), RouteByRemoteId() ); @@ -846,7 +859,11 @@ void MackieControlProtocol::handle_control_event( SurfacePort & port, Control & next = session->current_end_frame(); } + // moves jerkily and doesn't really work. eventually core-dumps session->request_locate( next, session->transport_rolling() ); + // ditto + // ScrollTimeline( state.ticks ); + // mtaht says maybe snap-to code has some ideas // turn off the led ring, for bcf emulation mode port.write( builder.build_led_ring( dynamic_cast<Pot &>( control ), off ) ); diff --git a/libs/surfaces/mackie/mackie_control_protocol_poll.cc b/libs/surfaces/mackie/mackie_control_protocol_poll.cc index f6b2deeb6b..047620ca41 100644 --- a/libs/surfaces/mackie/mackie_control_protocol_poll.cc +++ b/libs/surfaces/mackie/mackie_control_protocol_poll.cc @@ -104,7 +104,9 @@ void MackieControlProtocol::update_ports() } _ports_changed = false; } + cout << "MackieControlProtocol::update_ports signalling" << endl; update_cond.signal(); + cout << "MackieControlProtocol::update_ports finished" << endl; } } diff --git a/libs/surfaces/mackie/route_signal.cc b/libs/surfaces/mackie/route_signal.cc index 824251fe73..a5b98dc709 100644 --- a/libs/surfaces/mackie/route_signal.cc +++ b/libs/surfaces/mackie/route_signal.cc @@ -61,7 +61,7 @@ void RouteSignal::connect() // TODO // active_changed // SelectedChanged - // RemoteControlIDChanged + // RemoteControlIDChanged. Better handled at Session level. } void RouteSignal::disconnect() diff --git a/libs/surfaces/mackie/route_signal.h b/libs/surfaces/mackie/route_signal.h index aefee7c41b..f8742a5875 100644 --- a/libs/surfaces/mackie/route_signal.h +++ b/libs/surfaces/mackie/route_signal.h @@ -37,8 +37,6 @@ class MackiePort; connections from a route to a control surface strip. Instantiating it will connect the signals, and destructing it will disconnect the signals. - - TODO deal with routes with >1 panner. */ class RouteSignal { diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc index 25c0abec68..01be2c60c2 100644 --- a/libs/surfaces/mackie/surface.cc +++ b/libs/surfaces/mackie/surface.cc @@ -7,16 +7,15 @@ using namespace std; using namespace Mackie; -Surface::Surface( uint32_t max_strips ) -: _max_strips( max_strips ) +Surface::Surface( uint32_t max_strips, uint32_t unit_strips ) +: _max_strips( max_strips ), _unit_strips( unit_strips ) { } void Surface::init() { init_controls(); - // TODO fix this hard coding - init_strips( _max_strips, 8 ); + init_strips( _max_strips, _unit_strips ); } Surface::~Surface() @@ -34,11 +33,9 @@ Surface::~Surface() } } -// Possibly Mackie-specific, because of multiple devices on separate ports +// Mackie-specific, because of multiple devices on separate ports // add the strips from 9..max_strips // unit_strips is the number of strips for additional units. -// TODO would be better to pass the MackiePorts in here, cos -// each might have a different number of strips void Surface::init_strips( uint32_t max_strips, uint32_t unit_strips ) { if ( strips.size() < max_strips ) diff --git a/libs/surfaces/mackie/surface.h b/libs/surfaces/mackie/surface.h index 28bbaf8c2b..8bff3c4538 100644 --- a/libs/surfaces/mackie/surface.h +++ b/libs/surfaces/mackie/surface.h @@ -28,7 +28,14 @@ class MackieButtonHandler; class Surface { public: - Surface( uint32_t max_strips ); + /** + A Surface can be made up of multiple units. eg one Mackie MCU plus + one or more Mackie MCU extenders. + + \param max_strips is the number of strips for the entire surface. + \param unit_strips is the number of strips per unit. + */ + Surface( uint32_t max_strips, uint32_t unit_strips = 8 ); virtual ~Surface(); /// Calls the virtual initialisation methods. This *must* be called after @@ -56,7 +63,7 @@ public: std::map<std::string,Control*> controls_by_name; /// The collection of all numbered strips. No master - /// strip in here. + /// strip in here. typedef std::vector<Strip*> Strips; Strips strips; @@ -78,6 +85,7 @@ protected: private: uint32_t _max_strips; + uint32_t _unit_strips; }; } |