summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie/surface.cc
diff options
context:
space:
mode:
authorRodrigo Severo <rodrigo@fabricadeideias.com>2012-06-13 03:07:50 +0000
committerRodrigo Severo <rodrigo@fabricadeideias.com>2012-06-13 03:07:50 +0000
commit335bf3d21e05a4ba9afc3be803d1cc71b39cc11c (patch)
tree9560952107d57a4ad89e7eaf73d2ddd1ee1c6043 /libs/surfaces/mackie/surface.cc
parent5573b6a049646fd0fe10d4d79f98cf272ee1f107 (diff)
Prevents a master fader being created without a control at Surface::setup_master_fader;
Several DEBUG_TRACE changes to help identify race conditions; git-svn-id: svn://localhost/ardour2/branches/3.0@12693 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/mackie/surface.cc')
-rw-r--r--libs/surfaces/mackie/surface.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/libs/surfaces/mackie/surface.cc b/libs/surfaces/mackie/surface.cc
index e55dad18e3..0344d7e135 100644
--- a/libs/surfaces/mackie/surface.cc
+++ b/libs/surfaces/mackie/surface.cc
@@ -65,7 +65,7 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
, _jog_wheel (0)
, _last_master_gain_written (-0.0f)
{
- DEBUG_TRACE (DEBUG::MackieControl, "Surface::init\n");
+ DEBUG_TRACE (DEBUG::MackieControl, "Surface::Surface init\n");
_port = new SurfacePort (*this);
@@ -93,12 +93,12 @@ Surface::Surface (MackieControlProtocol& mcp, const std::string& device_name, ui
connect_to_signals ();
- DEBUG_TRACE (DEBUG::MackieControl, "Surface::init finish\n");
+ DEBUG_TRACE (DEBUG::MackieControl, "Surface::Surface done\n");
}
Surface::~Surface ()
{
- DEBUG_TRACE (DEBUG::MackieControl, "Surface: destructor\n");
+ DEBUG_TRACE (DEBUG::MackieControl, "Surface::~Surface init\n");
zero_all ();
@@ -114,6 +114,8 @@ Surface::~Surface ()
delete _jog_wheel;
delete _port;
+
+ DEBUG_TRACE (DEBUG::MackieControl, "Surface::~Surface done\n");
}
const MidiByteArray&
@@ -200,8 +202,6 @@ Surface::init_strips (uint32_t n)
void
Surface::setup_master ()
{
- _master_fader = dynamic_cast<Fader*> (Fader::factory (*this, _mcp.device_info().strip_cnt(), "master", *groups["master"]));
-
boost::shared_ptr<Route> m;
if ((m = _mcp.get_session().monitor_out()) == 0) {
@@ -211,6 +211,8 @@ Surface::setup_master ()
if (!m) {
return;
}
+
+ _master_fader = dynamic_cast<Fader*> (Fader::factory (*this, _mcp.device_info().strip_cnt(), "master", *groups["master"]));
_master_fader->set_control (m->gain_control());
m->gain_control()->Changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&Surface::master_gain_changed, this), ui_context());
@@ -626,7 +628,7 @@ Surface::zero_all ()
show_two_char_display (string (2, '0'), string (2, ' '));
}
- if (_mcp.device_info().has_master_fader ()) {
+ if (_mcp.device_info().has_master_fader () && _master_fader) {
_port->write (_master_fader->zero ());
}