Don't add duplicate remote_control_id to active banks. Notes and tweaks.
authorJohn Anderson <ardour@semiosix.com>
Sat, 17 Feb 2007 10:54:57 +0000 (10:54 +0000)
committerJohn Anderson <ardour@semiosix.com>
Sat, 17 Feb 2007 10:54:57 +0000 (10:54 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1471 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/surfaces/mackie/TODO
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mackie_control_protocol_poll.cc
libs/surfaces/mackie/route_signal.cc
libs/surfaces/mackie/route_signal.h
libs/surfaces/mackie/surface.cc
libs/surfaces/mackie/surface.h

index 8e7e795acd2d393dfab15b37b2d08b62fa3a7575..a4e7316b18127b6a1d91070a9619f129014f5adf 100644 (file)
@@ -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.
index 2d443ad711ac72c25cf636b28465cd82373594d8..2c487103f17dc8b6f9ddf729febcf66eb9bca3ec 100644 (file)
@@ -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 ) );
index f6b2deeb6b9f2c5ec7e81fddec22256126a010f0..047620ca41bf4bc68305a0c0362d2c3305c39cbd 100644 (file)
@@ -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;
        }
 }
 
index 824251fe7317effc0a45e6c91e2d2d6afb243dd8..a5b98dc7091acbb675911b99914d8add50c784fb 100644 (file)
@@ -61,7 +61,7 @@ void RouteSignal::connect()
        // TODO
        // active_changed
        // SelectedChanged
-       // RemoteControlIDChanged
+       // RemoteControlIDChanged. Better handled at Session level.
 }
 
 void RouteSignal::disconnect()
index aefee7c41bee0fac15be2a2d49d502220b212aca..f8742a5875e3f86266aa32200c71181990621847 100644 (file)
@@ -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
 {
index 25c0abec68f48e984963ed4acfc822dd2fd0deae..01be2c60c2c1f00867ad429cebb6c11147086832 100644 (file)
@@ -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 )
index 28bbaf8c2b069887d2449a5e005f3c29b1f68c8c..8bff3c45388714a2b829cdfb8701147b17413dc6 100644 (file)
@@ -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;
 };
 
 }