diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-12 11:28:50 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-12 11:28:50 -0400 |
commit | bb826f4beebfcedc50570b818c305560d2233e47 (patch) | |
tree | 1484460f914e64fdbdce58230ffe7934bc0761f4 /libs/surfaces/mackie/mackie_control_protocol.cc | |
parent | 8c5cff60912c7e0a7256f635641399500d8d00d9 (diff) | |
parent | f85b362351a5f9167f93b6988f2c8a4c7e03a33c (diff) |
incomplete merge of master into windows (requires upcoming changes to master to be complete)
Diffstat (limited to 'libs/surfaces/mackie/mackie_control_protocol.cc')
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.cc | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 95ac0c3025..194e35a26f 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -392,7 +392,9 @@ MackieControlProtocol::set_active (bool yn) BaseUI::run (); - create_surfaces (); + if (create_surfaces ()) { + return -1; + } connect_session_signals (); _active = true; update_surfaces (); @@ -605,7 +607,7 @@ MackieControlProtocol::set_profile (const string& profile_name) _device_profile = d->second; } -void +int MackieControlProtocol::set_device (const string& device_name, bool allow_activation) { map<string,DeviceInfo>::iterator d = DeviceInfo::device_info.find (device_name); @@ -614,7 +616,7 @@ MackieControlProtocol::set_device (const string& device_name, bool allow_activat device_name, allow_activation)); if (d == DeviceInfo::device_info.end()) { - return; + return -1; } if (_active) { @@ -628,13 +630,16 @@ MackieControlProtocol::set_device (const string& device_name, bool allow_activat set_active (true); } else { if (_active) { - create_surfaces (); + if (create_surfaces ()) { + return -1; + } switch_banks (0, true); } } + return 0; } -void +int MackieControlProtocol::create_surfaces () { string device_name; @@ -651,7 +656,13 @@ MackieControlProtocol::create_surfaces () for (uint32_t n = 0; n < 1 + _device_info.extenders(); ++n) { - boost::shared_ptr<Surface> surface (new Surface (*this, device_name, n, stype)); + boost::shared_ptr<Surface> surface; + + try { + surface.reset (new Surface (*this, device_name, n, stype)); + } catch (...) { + return -1; + } { Glib::Threads::Mutex::Lock lm (surfaces_lock); @@ -697,6 +708,8 @@ MackieControlProtocol::create_surfaces () g_source_ref (psrc->gobj()); } } + + return 0; } void @@ -1237,7 +1250,7 @@ MackieControlProtocol::midi_input_handler (IOCondition ioc, MIDI::Port* port) } DEBUG_TRACE (DEBUG::MackieControl, string_compose ("data available on %1\n", port->name())); - framepos_t now = session->engine().frame_time(); + framepos_t now = session->engine().sample_time(); port->parse (now); } @@ -1574,14 +1587,17 @@ MackieControlProtocol::set_ipmidi_base (int16_t portnum) } } -void +int MackieControlProtocol::ipmidi_restart () { clear_ports (); clear_surfaces (); - create_surfaces (); + if (create_surfaces ()) { + return -1; + } switch_banks (_current_initial_bank, true); needs_ipmidi_restart = false; + return 0; } void |