diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-08-04 14:37:22 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-08-04 14:37:22 +0000 |
commit | 047bf14592018cff6f2fbe57ac1cabac02cea781 (patch) | |
tree | 0e0af472dc442419e82efd6e5300044f332b62dc /libs/midi++2 | |
parent | deba9b3ccd866ec603b86e6c484641ded05f58a3 (diff) |
separate MMC ID's for send + receive
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2239 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2')
-rw-r--r-- | libs/midi++2/midi++/mmc.h | 9 | ||||
-rw-r--r-- | libs/midi++2/mmc.cc | 16 |
2 files changed, 17 insertions, 8 deletions
diff --git a/libs/midi++2/midi++/mmc.h b/libs/midi++2/midi++/mmc.h index bc23beb0a1..6abbed8207 100644 --- a/libs/midi++2/midi++/mmc.h +++ b/libs/midi++2/midi++/mmc.h @@ -91,8 +91,10 @@ class MachineControl : public sigc::trackable Port &port() { return _port; } - void set_device_id (byte id); - byte device_id () const { return _device_id; } + void set_receive_device_id (byte id); + void set_send_device_id (byte id); + byte receive_device_id () const { return _receive_device_id; } + byte send_device_id () const { return _send_device_id; } static bool is_mmc (byte *sysex_buf, size_t len); @@ -244,7 +246,8 @@ class MachineControl : public sigc::trackable byte resume; private: - byte _device_id; + byte _receive_device_id; + byte _send_device_id; MIDI::Port &_port; void process_mmc_message (Parser &p, byte *, size_t len); diff --git a/libs/midi++2/mmc.cc b/libs/midi++2/mmc.cc index 28d6393fb4..1ede281c28 100644 --- a/libs/midi++2/mmc.cc +++ b/libs/midi++2/mmc.cc @@ -202,7 +202,8 @@ MachineControl::MachineControl (Port &p, float version, build_mmc_cmd_map (); - _device_id = 0; + _receive_device_id = 0; + _send_device_id = 0x7f; if ((parser = _port.input()) != 0) { parser->mmc.connect @@ -214,10 +215,15 @@ MachineControl::MachineControl (Port &p, float version, } void -MachineControl::set_device_id (byte id) +MachineControl::set_receive_device_id (byte id) +{ + _receive_device_id = id & 0x7f; +} +void +MachineControl::set_send_device_id (byte id) { - _device_id = id & 0x7f; + _send_device_id = id & 0x7f; } bool @@ -258,14 +264,14 @@ MachineControl::process_mmc_message (Parser &p, byte *msg, size_t len) */ #if 0 - cerr << "*** me = " << (int) _device_id << " MMC message: len = " << len << "\n\t"; + cerr << "*** me = " << (int) _receive_device_id << " MMC message: len = " << len << "\n\t"; for (size_t i = 0; i < len; i++) { cerr << hex << (int) msg[i] << dec << ' '; } cerr << endl; #endif - if (msg[1] != 0x7f && msg[1] != _device_id) { + if (msg[1] != 0x7f && msg[1] != _receive_device_id) { return; } |