1 #include "ardour/debug.h"
10 using namespace Mackie;
12 Surface::Surface( uint32_t max_strips, uint32_t unit_strips )
13 : _max_strips( max_strips ), _unit_strips( unit_strips )
19 DEBUG_TRACE (DEBUG::MackieControl, "Surface::init\n");
21 init_strips( _max_strips, _unit_strips );
22 DEBUG_TRACE (DEBUG::MackieControl, "Surface::init finish\n");
28 for( Groups::iterator it = groups.begin(); it != groups.end(); ++it )
34 for( Controls::iterator it = controls.begin(); it != controls.end(); ++it )
40 // Mackie-specific, because of multiple devices on separate ports
41 // add the strips from 9..max_strips
42 // unit_strips is the number of strips for additional units.
43 void Surface::init_strips (uint32_t max_strips, uint32_t unit_strips)
45 if ( strips.size() < max_strips ) {
47 uint32_t const old_size = strips.size();
48 strips.resize (max_strips);
50 for (uint32_t i = old_size; i < max_strips; ++i) {
51 // because I can't find itoa
53 os << "strip_" << i + 1;
54 string name = os.str();
56 // shallow copy existing strip
57 // which works because the controls
58 // have the same ids across units
59 // TODO this needs to be a deep copy because
60 // controls hold state now - in_use
61 Strip * strip = new Strip( *strips[i % unit_strips] );
63 // update the relevant values
67 // add to data structures