summaryrefslogtreecommitdiff
path: root/libs/midi++2/mmc.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-07-06 00:27:03 +0000
committerCarl Hetherington <carl@carlh.net>2010-07-06 00:27:03 +0000
commitff8ea4d2f2443a2b6cfe58025eded7524b5f4bbb (patch)
treea1e71c139996f78742a4942ea54d302cc892593e /libs/midi++2/mmc.cc
parent91850f0eb4ab9f63bc6582d042d5495ea1968031 (diff)
Remove MMC thread protection which is pointless now that only JACK MIDI ports are used for output, which themselves can cope with multi-threaded access.
git-svn-id: svn://localhost/ardour2/branches/3.0@7378 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2/mmc.cc')
-rw-r--r--libs/midi++2/mmc.cc39
1 files changed, 2 insertions, 37 deletions
diff --git a/libs/midi++2/mmc.cc b/libs/midi++2/mmc.cc
index 79132f0e1a..597904d293 100644
--- a/libs/midi++2/mmc.cc
+++ b/libs/midi++2/mmc.cc
@@ -30,8 +30,6 @@ using namespace std;
using namespace MIDI;
using namespace PBD;
-pthread_t MachineControl::_sending_thread;
-
static std::map<int,string> mmc_cmd_map;
static void build_mmc_cmd_map ()
{
@@ -197,7 +195,6 @@ static void build_mmc_cmd_map ()
MachineControl::MachineControl ()
: _port (0)
- , _pending (16)
{
build_mmc_cmd_map ();
@@ -640,37 +637,12 @@ MachineControl::enable_send (bool yn)
_enable_send = yn;
}
-/** Send a MMC command. It will be sent immediately if the call is made in _sending_thread,
- * otherwise it will be queued and sent next time flush_pending()
- * is called.
- * @param c command, which this method takes ownership of.
+/** Send a MMC command to a the MMC port.
+ * @param c command.
*/
void
MachineControl::send (MachineControlCommand const & c)
{
- if (pthread_self() == _sending_thread) {
- send_immediately (c);
- } else {
- _pending.write (&c, 1);
- }
-}
-
-/** Send any pending MMC commands immediately. Must be called from _sending_thread */
-void
-MachineControl::flush_pending ()
-{
- MachineControlCommand c;
- while (_pending.read (&c, 1) == 1) {
- send_immediately (c);
- }
-}
-
-/** Send a MMC immediately. Must be called from _sending_thread.
- * @param c command, which this method takes ownership of.
- */
-void
-MachineControl::send_immediately (MachineControlCommand const & c)
-{
if (_port == 0 || !_enable_send) {
// cerr << "Not delivering MMC " << _mmc->port() << " - " << session_send_mmc << endl;
return;
@@ -684,13 +656,6 @@ MachineControl::send_immediately (MachineControlCommand const & c)
}
}
-/** Set the thread that we should send MMC in */
-void
-MachineControl::set_sending_thread (pthread_t t)
-{
- _sending_thread = t;
-}
-
void
MachineControl::spp_start (Parser& parser, nframes_t timestamp)
{