mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Fix Midi Tracer handling of different port types
Transport Masters and Async MIDI port already have a parser available, so just connect to it. Normal Midi ports are the only one that need to use the Midi Tracers parser.
This commit is contained in:
parent
89eab2714f
commit
6f251f8b2f
1 changed files with 17 additions and 4 deletions
|
|
@ -172,16 +172,29 @@ MidiTracer::port_changed ()
|
|||
* this mess will all go away ...
|
||||
*/
|
||||
|
||||
/* Some ports have a parser avaiable (Transport Masters and ASYNC ports)
|
||||
* and some do not. If the port has a parser already, just attach to it.
|
||||
* If not use our local parser and tell the port that we need it to be called.
|
||||
*/
|
||||
|
||||
boost::shared_ptr<AsyncMIDIPort> async = boost::dynamic_pointer_cast<AsyncMIDIPort> (p);
|
||||
|
||||
if (!async) {
|
||||
|
||||
boost::shared_ptr<ARDOUR::MidiPort> mp = boost::dynamic_pointer_cast<ARDOUR::MidiPort> (p);
|
||||
|
||||
if (mp) {
|
||||
my_parser.any.connect_same_thread (_parser_connection, boost::bind (&MidiTracer::tracer, this, _1, _2, _3, _4));
|
||||
mp->set_trace (&my_parser);
|
||||
traced_port = mp;
|
||||
if (mp->flags() & TransportMasterPort) {
|
||||
boost::shared_ptr<TransportMaster> tm = TransportMasterManager::instance().master_by_port(boost::dynamic_pointer_cast<ARDOUR::Port> (p));
|
||||
boost::shared_ptr<TransportMasterViaMIDI> tm_midi = boost::dynamic_pointer_cast<TransportMasterViaMIDI> (tm);
|
||||
if (tm_midi) {
|
||||
tm_midi->transport_parser().any.connect_same_thread(_parser_connection, boost::bind (&MidiTracer::tracer, this, _1, _2, _3, _4));
|
||||
}
|
||||
}
|
||||
else {
|
||||
my_parser.any.connect_same_thread (_parser_connection, boost::bind (&MidiTracer::tracer, this, _1, _2, _3, _4));
|
||||
mp->set_trace (&my_parser);
|
||||
traced_port = mp;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue