8 using namespace Mackie;
10 Surface::Surface( uint32_t max_strips, uint32_t unit_strips )
11 : _max_strips( max_strips ), _unit_strips( unit_strips )
18 cout << "Surface::init" << endl;
21 init_strips( _max_strips, _unit_strips );
23 cout << "Surface::init finish" << endl;
30 for( Groups::iterator it = groups.begin(); it != groups.end(); ++it )
36 for( Controls::iterator it = controls.begin(); it != controls.end(); ++it )
42 // Mackie-specific, because of multiple devices on separate ports
43 // add the strips from 9..max_strips
44 // unit_strips is the number of strips for additional units.
45 void Surface::init_strips( uint32_t max_strips, uint32_t unit_strips )
47 if ( strips.size() < max_strips )
49 strips.resize( max_strips );
50 for ( uint32_t i = strips.size(); i < max_strips; ++i )
52 // because I can't find itoa
54 os << "strip_" << i + 1;
55 string name = os.str();
57 // shallow copy existing strip
58 // which works because the controls
59 // have the same ids across units
60 // TODO this needs to be a deep copy because
61 // controls hold state now - in_use
62 Strip * strip = new Strip( *strips[i % unit_strips] );
64 // update the relevant values
68 // add to data structures