diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-03 00:11:33 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-03 00:11:33 +0000 |
commit | bde4d3f3412e16543faff7bd489beb040311b781 (patch) | |
tree | 2e743f306fec80520cd1bdec474f27c90aa57739 /libs/midi++2 | |
parent | 2062ce8186592801d84162f6fa14173769b37521 (diff) |
Fix up my previous buggy MMC cleanup.
git-svn-id: svn://localhost/ardour2/branches/3.0@7363 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2')
-rw-r--r-- | libs/midi++2/midi++/mmc.h | 12 | ||||
-rw-r--r-- | libs/midi++2/mmc.cc | 26 |
2 files changed, 34 insertions, 4 deletions
diff --git a/libs/midi++2/midi++/mmc.h b/libs/midi++2/midi++/mmc.h index 2dc38e81c0..61415d39f2 100644 --- a/libs/midi++2/midi++/mmc.h +++ b/libs/midi++2/midi++/mmc.h @@ -24,12 +24,13 @@ #include "pbd/signals.h" #include "pbd/ringbuffer.h" #include "midi++/types.h" +#include "midi++/parser.h" namespace MIDI { class Port; class Parser; -class MachineControlCommand; +class MachineControlCommand; /** Class to handle incoming and outgoing MIDI machine control messages */ class MachineControl @@ -143,6 +144,10 @@ class MachineControl MMCSignal Wait; MMCSignal Resume; + TimestampedSignal SPPStart; + TimestampedSignal SPPContinue; + TimestampedSignal SPPStop; + /* The second argument is the shuttle speed, the third is true if the direction is "forwards", false for "reverse" */ @@ -264,7 +269,7 @@ class MachineControl static pthread_t _sending_thread; void process_mmc_message (Parser &p, byte *, size_t len); - PBD::ScopedConnection mmc_connection; ///< connection to our parser for incoming data + PBD::ScopedConnectionList port_connections; ///< connections to our parser for incoming data int do_masked_write (byte *, size_t len); int do_locate (byte *, size_t len); @@ -273,6 +278,9 @@ class MachineControl void send_immediately (MachineControlCommand const &); void write_track_status (byte *, size_t len, byte reg); + void spp_start (Parser&, nframes_t); + void spp_continue (Parser&, nframes_t); + void spp_stop (Parser&, nframes_t); }; /** Class to describe a MIDI machine control command to be sent. diff --git a/libs/midi++2/mmc.cc b/libs/midi++2/mmc.cc index 8adfcafb85..79132f0e1a 100644 --- a/libs/midi++2/mmc.cc +++ b/libs/midi++2/mmc.cc @@ -210,10 +210,13 @@ MachineControl::set_port (Port* p) { _port = p; - mmc_connection.disconnect (); + port_connections.drop_connections (); if (_port->input()) { - _port->input()->mmc.connect_same_thread (mmc_connection, boost::bind (&MachineControl::process_mmc_message, this, _1, _2, _3)); + _port->input()->mmc.connect_same_thread (port_connections, boost::bind (&MachineControl::process_mmc_message, this, _1, _2, _3)); + _port->input()->start.connect_same_thread (port_connections, boost::bind (&MachineControl::spp_start, this, _1, _2)); + _port->input()->contineu.connect_same_thread (port_connections, boost::bind (&MachineControl::spp_continue, this, _1, _2)); + _port->input()->stop.connect_same_thread (port_connections, boost::bind (&MachineControl::spp_stop, this, _1, _2)); } else { warning << "MMC connected to a non-input port: useless!" << endmsg; } @@ -688,6 +691,24 @@ MachineControl::set_sending_thread (pthread_t t) _sending_thread = t; } +void +MachineControl::spp_start (Parser& parser, nframes_t timestamp) +{ + SPPStart (parser, timestamp); /* EMIT SIGNAL */ +} + +void +MachineControl::spp_continue (Parser& parser, nframes_t timestamp) +{ + SPPContinue (parser, timestamp); /* EMIT SIGNAL */ +} + +void +MachineControl::spp_stop (Parser& parser, nframes_t timestamp) +{ + SPPStop (parser, timestamp); /* EMIT SIGNAL */ +} + MachineControlCommand::MachineControlCommand (MachineControl::Command c) : _command (c) { @@ -725,3 +746,4 @@ MachineControlCommand::fill_buffer (MachineControl* mmc, MIDI::byte* b) const return b; } + |