From fbc946d60dbe68016abcc386932b35c4ef4ba1af Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 27 Jul 2010 03:09:58 +0000 Subject: [PATCH] Fix up Mackie control surface to cope with changes to midi++ midi ports from a while back. git-svn-id: svn://localhost/ardour2/branches/3.0@7513 d708f5d6-7413-0410-9779-e7cbd77b26cf --- .../mackie/mackie_control_protocol.cc | 20 +++++++++++-------- .../mackie/mackie_control_protocol_poll.cc | 7 +------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 5802e80b1a..439572ac3e 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -579,8 +579,12 @@ void MackieControlProtocol::create_ports() { MIDI::Manager * mm = MIDI::Manager::instance(); - MIDI::Port * midi_input_port = mm->add_port (new MIDI::Port (default_port_name, MIDI::Port::IsInput, session->engine().jack())); - MIDI::Port * midi_output_port = mm->add_port (new MIDI::Port (default_port_name, MIDI::Port::IsOutput, session->engine().jack())); + MIDI::Port * midi_input_port = mm->add_port ( + new MIDI::Port (string_compose (_("%1 in"), default_port_name), MIDI::Port::IsInput, session->engine().jack()) + ); + MIDI::Port * midi_output_port = mm->add_port ( + new MIDI::Port (string_compose (_("%1 out"), default_port_name), MIDI::Port::IsOutput, session->engine().jack()) + ); // open main port @@ -596,13 +600,13 @@ MackieControlProtocol::create_ports() // open extender ports. Up to 9. Should be enough. // could also use mm->get_midi_ports() - string ext_port_base = "mcu_xt_"; - for (int index = 1; index <= 9; ++index) { - ostringstream os; - os << ext_port_base << index; - MIDI::Port * midi_input_port = mm->add_port (new MIDI::Port (os.str(), MIDI::Port::IsInput, session->engine().jack())); - MIDI::Port * midi_output_port = mm->add_port (new MIDI::Port (os.str(), MIDI::Port::IsOutput, session->engine().jack())); + MIDI::Port * midi_input_port = mm->add_port ( + new MIDI::Port (string_compose (_("mcu_xt_%1 in"), index), MIDI::Port::IsInput, session->engine().jack()) + ); + MIDI::Port * midi_output_port = mm->add_port ( + new MIDI::Port (string_compose (_("mcu_xt_%1 out"), index), MIDI::Port::IsOutput, session->engine().jack()) + ); if (midi_input_port->ok() && midi_output_port->ok()) { add_port (*midi_input_port, *midi_output_port, index); } diff --git a/libs/surfaces/mackie/mackie_control_protocol_poll.cc b/libs/surfaces/mackie/mackie_control_protocol_poll.cc index 6392a91c4f..06aafc5965 100644 --- a/libs/surfaces/mackie/mackie_control_protocol_poll.cc +++ b/libs/surfaces/mackie/mackie_control_protocol_poll.cc @@ -29,12 +29,7 @@ const char * MackieControlProtocol::default_port_name = "mcu"; bool MackieControlProtocol::probe() { - if ( MIDI::Manager::instance()->port(default_port_name) == 0 ) { - info << "Mackie: No MIDI port called " << default_port_name << endmsg; - return false; - } else { - return true; - } + return true; } void MackieControlProtocol::handle_port_inactive( SurfacePort * port )