support for MMC track mute register, in addition to existing track record status register

git-svn-id: svn://localhost/ardour2/branches/3.0@6156 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2009-11-23 17:34:11 +00:00
parent 5cfeaf4102
commit 47c88ff7d1
2 changed files with 28 additions and 14 deletions

View file

@ -154,6 +154,13 @@ class MachineControl : public sigc::trackable
sigc::signal<void,MachineControl &,size_t,bool> sigc::signal<void,MachineControl &,size_t,bool>
TrackRecordStatusChange; TrackRecordStatusChange;
/* The second argument specifies the desired track record enabled
status.
*/
sigc::signal<void,MachineControl &,size_t,bool>
TrackMuteChange;
/* The second argument points to a byte array containing /* The second argument points to a byte array containing
the locate target value in MMC Standard Time Code the locate target value in MMC Standard Time Code
format (5 bytes, roughly: hrs/mins/secs/frames/subframes) format (5 bytes, roughly: hrs/mins/secs/frames/subframes)
@ -196,7 +203,7 @@ class MachineControl : public sigc::trackable
byte fixedSpeed; byte fixedSpeed;
byte lifterDefeat; byte lifterDefeat;
byte controlDisable; byte controlDisable;
byte trackMute; byte trackMute[MMC_NTRACKS];
byte failure; byte failure;
byte selectedTimeCode; byte selectedTimeCode;
byte shortSelectedTimeCode; byte shortSelectedTimeCode;
@ -257,7 +264,7 @@ class MachineControl : public sigc::trackable
int do_step (byte *, size_t len); int do_step (byte *, size_t len);
int do_shuttle (byte *, size_t len); int do_shuttle (byte *, size_t len);
void write_track_record_ready (byte *, size_t len); void write_track_status (byte *, size_t len, byte reg);
}; };
} // namespace MIDI } // namespace MIDI

View file

@ -464,7 +464,11 @@ MachineControl::do_masked_write (byte *msg, size_t len)
switch (msg[2]) { switch (msg[2]) {
case 0x4f: /* Track Record Ready Status */ case 0x4f: /* Track Record Ready Status */
write_track_record_ready (&msg[3], len - 3); write_track_status (&msg[3], len - 3, msg[2]);
break;
case 0x62: /* track mute */
write_track_status (&msg[3], len - 3, msg[2]);
break; break;
default: default:
@ -478,8 +482,7 @@ MachineControl::do_masked_write (byte *msg, size_t len)
} }
void void
MachineControl::write_track_record_ready (byte *msg, size_t /*len*/) MachineControl::write_track_status (byte *msg, size_t /*len*/, byte reg)
{ {
size_t n; size_t n;
ssize_t base_track; ssize_t base_track;
@ -549,14 +552,18 @@ MachineControl::write_track_record_ready (byte *msg, size_t /*len*/)
bit set. bit set.
*/ */
if (msg[2] & (1<<n)) { bool val = (msg[2] & (1<<n));
trackRecordStatus[base_track+n] = true;
TrackRecordStatusChange (*this, base_track+n, switch (reg) {
true); case 0x4f:
} else { trackRecordStatus[base_track+n] = val;
trackRecordStatus[base_track+n] = false; TrackRecordStatusChange (*this, base_track+n, val);
TrackRecordStatusChange (*this, base_track+n, break;
false);
case 0x62:
trackMute[base_track+n] = val;
TrackMuteChange (*this, base_track+n, val);
break;
} }
} }