1 #include "mackie_control_protocol.h"
3 #include "midi_byte_array.h"
4 #include "surface_port.h"
6 #include "pbd/pthread_utils.h"
9 #include "midi++/types.h"
10 #include "midi++/port.h"
11 #include "midi++/manager.h"
25 using namespace Mackie;
28 const char * MackieControlProtocol::default_port_name = "mcu";
30 bool MackieControlProtocol::probe()
32 if ( MIDI::Manager::instance()->port(default_port_name) == 0 ) {
33 info << "Mackie: No MIDI port called " << default_port_name << endmsg;
40 void MackieControlProtocol::handle_port_inactive( SurfacePort * port )
42 // port gone away. So stop polling it ASAP
44 // delete the port instance
45 Glib::Mutex::Lock lock( update_mutex );
46 MackiePorts::iterator it = find( _ports.begin(), _ports.end(), port );
47 if ( it != _ports.end() )
54 // TODO all the rebuilding of surfaces and so on
57 void MackieControlProtocol::handle_port_active (SurfacePort *)
59 // no need to re-add port because it was already added
60 // during the init phase. So just update the local surface
61 // representation and send the representation to
64 // TODO update bank size
66 // TODO rebuild surface, to have new units
68 // finally update session state to the surface
69 // TODO but this is also done in set_active, and
70 // in fact update_surface won't execute unless
72 cout << "update_surface in handle_port_active" << endl;
78 void MackieControlProtocol::handle_port_init (Mackie::SurfacePort *)
81 cout << "MackieControlProtocol::handle_port_init" << endl;
84 cout << "MackieControlProtocol::handle_port_init finish" << endl;