, _initialized (false)
, _surfaces_state (0)
, _surfaces_version (0)
+ , _session_load (true)
{
DEBUG_TRACE (DEBUG::MackieControl, "MackieControlProtocol::MackieControlProtocol\n");
if (route_is_locked_to_strip(route)) {
continue;
}
-
+ /* This next section which is not used yet, looks wrong to me
+ The first four belong here but the bottom five are not a selection
+ of routes and belong elsewhere as they are v-pot modes.
+ */
switch (_view_mode) {
case Mixer:
break;
if (!_device_info.has_global_controls()) {
return;
}
-
- boost::shared_ptr<Surface> surface = surfaces.front();
+ // surface needs to be master surface
+ boost::shared_ptr<Surface> surface = _master_surface;
map<int,Control*>::iterator x = surface->controls_by_device_independent_id.find (id);
if (x != surface->controls_by_device_independent_id.end()) {
if (!_device_info.has_global_controls()) {
return;
}
-
- boost::shared_ptr<Surface> surface = surfaces.front();
+ boost::shared_ptr<Surface> surface = _master_surface;
map<int,Control*>::iterator x = surface->controls_by_device_independent_id.find (id);
return;
}
- if (!surfaces.front()->active ()) {
+ if (!_master_surface->active ()) {
return;
}
// sometimes the jog wheel is a pot
if (_device_info.has_jog_wheel()) {
- surfaces.front()->blank_jog_ring ();
+ _master_surface->blank_jog_ring ();
}
}
MackieControlProtocol::create_surfaces ()
{
string device_name;
- surface_type_t stype = mcu;
+ surface_type_t stype = mcu; // type not yet determined
char buf[128];
if (_device_info.extenders() == 0) {
boost::shared_ptr<Surface> surface;
+ if (n == _device_info.master_position()) {
+ stype = mcu;
+ } else {
+ stype = ext;
+ }
try {
surface.reset (new Surface (*this, device_name, n, stype));
} catch (...) {
return -1;
}
+ if (n == _device_info.master_position()) {
+ _master_surface = surface;
+ }
+
if (_surfaces_state) {
surface->set_state (*_surfaces_state, _surfaces_version);
}
Glib::Threads::Mutex::Lock lm (surfaces_lock);
surfaces.push_back (surface);
}
-
- /* next device will be an extender */
if (_device_info.extenders() < 2) {
device_name = X_("mackie control #2");
snprintf (buf, sizeof (buf), X_("mackie control #%d"), n+2);
device_name = buf;
}
- stype = ext;
if (!_device_info.uses_ipmidi()) {
return;
}
- boost::shared_ptr<Surface> surface = surfaces.front();
+ boost::shared_ptr<Surface> surface = _master_surface;
if (surface->type() != mcu || !_device_info.has_timecode_display() || !surface->active ()) {
return;
{
Glib::Threads::Mutex::Lock lm (surfaces_lock);
- surface = surfaces.front ();
+ surface = _master_surface;
}
map<int,Control*>::iterator x = surface->controls_by_device_independent_id.find (Led::RudeSolo);
{
Glib::Threads::Mutex::Lock lm (surfaces_lock);
- surface = surfaces.front();
+ surface = _master_surface;
}
/* rec is a tristate */