diff options
Diffstat (limited to 'libs/surfaces/mackie')
-rw-r--r-- | libs/surfaces/mackie/controls.h | 4 | ||||
-rw-r--r-- | libs/surfaces/mackie/mackie_control_protocol.cc | 26 | ||||
-rw-r--r-- | libs/surfaces/mackie/mackie_port.cc | 28 | ||||
-rw-r--r-- | libs/surfaces/mackie/mackie_port.h | 11 | ||||
-rw-r--r-- | libs/surfaces/mackie/route_signal.cc | 18 | ||||
-rw-r--r-- | libs/surfaces/mackie/route_signal.h | 2 | ||||
-rw-r--r-- | libs/surfaces/mackie/surface_port.h | 10 |
7 files changed, 40 insertions, 59 deletions
diff --git a/libs/surfaces/mackie/controls.h b/libs/surfaces/mackie/controls.h index acd91e6047..8a7740598f 100644 --- a/libs/surfaces/mackie/controls.h +++ b/libs/surfaces/mackie/controls.h @@ -22,7 +22,7 @@ #include <vector> #include <string> -#include <boost/signals2.hpp> +#include "pbd/signals.h" #include "mackie_control_exception.h" @@ -228,7 +228,7 @@ public: virtual unsigned int in_use_timeout() { return _in_use_timeout; } /// Keep track of the timeout so it can be updated with more incoming events - boost::signals2::scoped_connection in_use_connection; + PBD::ScopedConnection in_use_connection; private: int _id; diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 7460b041ad..9698b299b9 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -562,23 +562,23 @@ void MackieControlProtocol::update_surface() void MackieControlProtocol::connect_session_signals() { // receive routes added - session_connections.add_connection (session->RouteAdded.connect(boost::bind (&MackieControlProtocol::notify_route_added, this, _1))); + session->RouteAdded.connect(session_connections, boost::bind (&MackieControlProtocol::notify_route_added, this, _1)); // receive record state toggled - session_connections.add_connection (session->RecordStateChanged.connect(boost::bind (&MackieControlProtocol::notify_record_state_changed, this))); + session->RecordStateChanged.connect(session_connections, boost::bind (&MackieControlProtocol::notify_record_state_changed, this)); // receive transport state changed - session_connections.add_connection (session->TransportStateChange.connect(boost::bind (&MackieControlProtocol::notify_transport_state_changed, this))); + session->TransportStateChange.connect(session_connections, boost::bind (&MackieControlProtocol::notify_transport_state_changed, this)); // receive punch-in and punch-out - session_connections.add_connection (Config->ParameterChanged.connect(boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1))); - session_connections.add_connection (session->config.ParameterChanged.connect (boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1))); + Config->ParameterChanged.connect(session_connections, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1)); + session->config.ParameterChanged.connect (session_connections, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1)); // receive rude solo changed - session_connections.add_connection (session->SoloActive.connect(boost::bind (&MackieControlProtocol::notify_solo_active_changed, this, _1))); + session->SoloActive.connect(session_connections, boost::bind (&MackieControlProtocol::notify_solo_active_changed, this, _1)); // make sure remote id changed signals reach here // see also notify_route_added Sorted sorted = get_sorted_routes(); for ( Sorted::iterator it = sorted.begin(); it != sorted.end(); ++it ) { - session_connections.add_connection ((*it)->RemoteControlIDChanged.connect (boost::bind(&MackieControlProtocol::notify_remote_id_changed, this))); + ((*it)->RemoteControlIDChanged.connect (route_connections, boost::bind(&MackieControlProtocol::notify_remote_id_changed, this))); } } @@ -602,10 +602,10 @@ void MackieControlProtocol::add_port( MIDI::Port & midi_port, int number ) MackiePort * sport = new MackiePort( *this, midi_port, number ); _ports.push_back( sport ); - port_connections.add_connection (sport->init_event.connect (boost::bind (&MackieControlProtocol::handle_port_init, this, sport))); - port_connections.add_connection (sport->active_event.connect (boost::bind (&MackieControlProtocol::handle_port_active, this, sport))); - port_connections.add_connection (sport->inactive_event.connect (boost::bind (&MackieControlProtocol::handle_port_inactive, this, sport))); - + sport->init_event.connect (port_connections, boost::bind (&MackieControlProtocol::handle_port_init, this, sport)); + sport->active_event.connect (port_connections, boost::bind (&MackieControlProtocol::handle_port_active, this, sport)); + sport->inactive_event.connect (port_connections, boost::bind (&MackieControlProtocol::handle_port_inactive, this, sport)); + _ports_changed = true; } } @@ -682,7 +682,7 @@ void MackieControlProtocol::initialize_surface() // Connect events. Must be after route table otherwise there will be trouble for( MackiePorts::iterator it = _ports.begin(); it != _ports.end(); ++it ) { - port_connections.add_connection ((*it)->control_event.connect(boost::bind (&MackieControlProtocol::handle_control_event, this, _1, _2, _3))); + (*it)->control_event.connect (port_connections, boost::bind (&MackieControlProtocol::handle_control_event, this, _1, _2, _3)); } } @@ -1445,7 +1445,7 @@ void MackieControlProtocol::notify_route_added( ARDOUR::RouteList & rl ) typedef ARDOUR::RouteList ARS; for (ARS::iterator it = rl.begin(); it != rl.end(); ++it) { - route_connections.add_connection ((*it)->RemoteControlIDChanged.connect (boost::bind (&MackieControlProtocol::notify_remote_id_changed, this))); + (*it)->RemoteControlIDChanged.connect (route_connections, boost::bind (&MackieControlProtocol::notify_remote_id_changed, this)); } } diff --git a/libs/surfaces/mackie/mackie_port.cc b/libs/surfaces/mackie/mackie_port.cc index 3316483914..8cf69585e3 100644 --- a/libs/surfaces/mackie/mackie_port.cc +++ b/libs/surfaces/mackie/mackie_port.cc @@ -94,7 +94,7 @@ void MackiePort::open() #ifdef PORT_DEBUG cout << "MackiePort::open " << *this << endl; #endif - _sysex = port().input()->sysex.connect (boost::bind (&MackiePort::handle_midi_sysex, this, _1, _2, _3)); + port().input()->sysex.connect (sysex_connection, boost::bind (&MackiePort::handle_midi_sysex, this, _1, _2, _3)); // make sure the device is connected init(); @@ -107,8 +107,8 @@ void MackiePort::close() #endif // disconnect signals - _any.disconnect(); - _sysex.disconnect(); + any_connection.disconnect(); + sysex_connection.disconnect(); // TODO emit a "closing" signal? #ifdef PORT_DEBUG @@ -288,26 +288,8 @@ void MackiePort::finalise_init( bool yn ) void MackiePort::connect_any() { -/* - Doesn't work because there isn't an == operator for slots - MIDI::Signal::slot_list_type slots = port().input()->any.slots(); - - if ( find( slots.begin(), slots.end(), mem_fun( *this, &MackiePort::handle_midi_any ) ) == slots.end() ) -*/ - // TODO but this will break if midi tracing is turned on - if ( port().input()->any.empty() ) - { -#ifdef DEBUG - cout << "connect input parser " << port().input() << " to handle_midi_any" << endl; -#endif - _any = port().input()->any.connect (boost::bind (&MackiePort::handle_midi_any, this, _1, _2, _3)); -#ifdef DEBUG - cout << "input parser any connections: " << port().input()->any.size() << endl; -#endif - } - else - { - cout << "MackiePort::connect_any already connected" << endl; + if (!any_connection.connected()) { + port().input()->any.connect (any_connection, boost::bind (&MackiePort::handle_midi_any, this, _1, _2, _3)); } } diff --git a/libs/surfaces/mackie/mackie_port.h b/libs/surfaces/mackie/mackie_port.h index 639183d066..292fc2ac13 100644 --- a/libs/surfaces/mackie/mackie_port.h +++ b/libs/surfaces/mackie/mackie_port.h @@ -18,13 +18,12 @@ #ifndef mackie_port_h #define mackie_port_h -#include "surface_port.h" - #include <midi++/types.h> -#include <boost/signals2.hpp> - #include <glibmm/thread.h> +#include "pbd/signals.h" + +#include "surface_port.h" #include "midi_byte_array.h" #include "types.h" @@ -115,8 +114,8 @@ protected: private: MackieControlProtocol & _mcp; port_type_t _port_type; - boost::signals2::scoped_connection _any; - boost::signals2::scoped_connection _sysex; + PBD::ScopedConnection any_connection; + PBD::ScopedConnection sysex_connection; emulation_t _emulation; bool _initialising; diff --git a/libs/surfaces/mackie/route_signal.cc b/libs/surfaces/mackie/route_signal.cc index fb6cf5b092..9a3dd41bf4 100644 --- a/libs/surfaces/mackie/route_signal.cc +++ b/libs/surfaces/mackie/route_signal.cc @@ -32,36 +32,36 @@ using namespace std; void RouteSignal::connect() { if (_strip.has_solo()) { - connections.add_connection (_route->solo_control()->Changed.connect(boost::bind (&MackieControlProtocol::notify_solo_changed, &_mcp, this))); + _route->solo_control()->Changed.connect(connections, boost::bind (&MackieControlProtocol::notify_solo_changed, &_mcp, this)); } if (_strip.has_mute()) { - connections.add_connection (_route->mute_control()->Changed.connect(boost::bind (&MackieControlProtocol::notify_mute_changed, &_mcp, this))); + _route->mute_control()->Changed.connect(connections, boost::bind (&MackieControlProtocol::notify_mute_changed, &_mcp, this)); } if (_strip.has_gain()) { - connections.add_connection (_route->gain_control()->Changed.connect(boost::bind (&MackieControlProtocol::notify_gain_changed, &_mcp, this, false))); + _route->gain_control()->Changed.connect(connections, boost::bind (&MackieControlProtocol::notify_gain_changed, &_mcp, this, false)); } - connections.add_connection (_route->NameChanged.connect (boost::bind (&MackieControlProtocol::notify_name_changed, &_mcp, this))); + _route->NameChanged.connect (connections, boost::bind (&MackieControlProtocol::notify_name_changed, &_mcp, this)); if (_route->panner()) { - connections.add_connection (_route->panner()->Changed.connect(boost::bind (&MackieControlProtocol::notify_panner_changed, &_mcp, this, false))); + _route->panner()->Changed.connect(connections, boost::bind (&MackieControlProtocol::notify_panner_changed, &_mcp, this, false)); for ( unsigned int i = 0; i < _route->panner()->npanners(); ++i ) { - connections.add_connection (_route->panner()->streampanner(i).Changed.connect (boost::bind (&MackieControlProtocol::notify_panner_changed, &_mcp, this, false))); + _route->panner()->streampanner(i).Changed.connect (connections, boost::bind (&MackieControlProtocol::notify_panner_changed, &_mcp, this, false)); } } boost::shared_ptr<Track> trk = boost::dynamic_pointer_cast<ARDOUR::Track>(_route); if (trk) { - connections.add_connection (trk->rec_enable_control()->Changed .connect(boost::bind (&MackieControlProtocol::notify_record_enable_changed, &_mcp, this))); + trk->rec_enable_control()->Changed .connect(connections, boost::bind (&MackieControlProtocol::notify_record_enable_changed, &_mcp, this)); } // TODO this works when a currently-banked route is made inactive, but not // when a route is activated which should be currently banked. - connections.add_connection (_route->active_changed.connect (boost::bind (&MackieControlProtocol::notify_active_changed, &_mcp, this))); - + _route->active_changed.connect (connections, boost::bind (&MackieControlProtocol::notify_active_changed, &_mcp, this)); + // TODO // SelectedChanged // RemoteControlIDChanged. Better handled at Session level. diff --git a/libs/surfaces/mackie/route_signal.h b/libs/surfaces/mackie/route_signal.h index 5b388a7da5..59bfc66e7b 100644 --- a/libs/surfaces/mackie/route_signal.h +++ b/libs/surfaces/mackie/route_signal.h @@ -21,7 +21,7 @@ #include <vector> #include <boost/shared_ptr.hpp> -#include "pbd/scoped_connections.h" +#include "pbd/signals.h" #include "midi_byte_array.h" diff --git a/libs/surfaces/mackie/surface_port.h b/libs/surfaces/mackie/surface_port.h index f41f2865bb..86ec8ffd9e 100644 --- a/libs/surfaces/mackie/surface_port.h +++ b/libs/surfaces/mackie/surface_port.h @@ -18,9 +18,9 @@ #ifndef surface_port_h #define surface_port_h -#include <boost/signals2.hpp> #include <glibmm/thread.h> +#include "pbd/signals.h" #include "midi_byte_array.h" #include "types.h" @@ -64,17 +64,17 @@ public: const MIDI::Port & port() const { return *_port; } // all control notofications are sent from here - boost::signals2::signal<void(SurfacePort &, Control &, const ControlState &)> control_event; + PBD::Signal3<void,SurfacePort &, Control &, const ControlState &> control_event; // emitted just before the port goes into initialisation // where it tries to establish that its device is connected - boost::signals2::signal<void()> init_event; + PBD::Signal0<void> init_event; // emitted when the port completes initialisation successfully - boost::signals2::signal<void()> active_event; + PBD::Signal0<void> active_event; // emitted when the port goes inactive (ie a read or write failed) - boost::signals2::signal<void()> inactive_event; + PBD::Signal0<void> inactive_event; // the port number - master is 0(extenders are 1((,4 virtual int number() const { return _number; } |