diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-03-13 12:19:03 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-03-13 12:19:03 +0000 |
commit | af4dc6747c962be544be6024db99c60132b698c1 (patch) | |
tree | ca85022a7c091f78aab15cb06ec5e05f0882bddd /libs | |
parent | 82da4fa3ac435712831580da183b4abd1062e0ff (diff) |
use Session::master_out() to find the master out route, and avoid crash during startup of mackie support if there is no master
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4827 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index de6623c4d2..fb7d30b107 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -543,11 +543,13 @@ void MackieControlProtocol::update_surface() switch_banks( _current_initial_bank ); // create a RouteSignal for the master route - // but only the first time around - master_route_signal = shared_ptr<RouteSignal>( new RouteSignal( *master_route(), *this, master_strip(), mcu_port() ) ); - // update strip from route - master_route_signal->notify_all(); - + boost::shared_ptr<Route> mr = master_route (); + if (mr) { + master_route_signal = shared_ptr<RouteSignal> (new RouteSignal (mr, *this, master_strip(), mcu_port()) ); + // update strip from route + master_route_signal->notify_all(); + } + // sometimes the jog wheel is a pot surface().blank_jog_ring( mcu_port(), builder ); @@ -656,13 +658,7 @@ void MackieControlProtocol::create_ports() shared_ptr<Route> MackieControlProtocol::master_route() { - shared_ptr<Route> retval; - retval = session->route_by_name( "master" ); - if ( retval == 0 ) - { - // TODO search through all routes for one with the master attribute set - } - return retval; + return session->master_out (); } Strip & MackieControlProtocol::master_strip() |