13
0

change API for libmidi++ RPN-related signals to be more useful

This commit is contained in:
Paul Davis 2015-11-23 11:49:08 -05:00
parent 14fe7a0ae8
commit 5f7784e4f2
2 changed files with 12 additions and 11 deletions

View File

@ -174,12 +174,12 @@ Channel::maybe_process_rpns (Parser& parser, EventTwoBytes *tb)
case 0x60:
/* data increment */
_nrpn_state = RPNState (_nrpn_state|HaveValue);
parser.channel_nrpn_increment[_channel_number] (parser, rpn_id); /* EMIT SIGNAL */
parser.channel_nrpn_increment[_channel_number] (parser, rpn_id, 1); /* EMIT SIGNAL */
return true;
case 0x61:
/* data decrement */
_nrpn_state = RPNState (_nrpn_state|HaveValue);
parser.channel_nrpn_decrement[_channel_number] (parser, rpn_id); /* EMIT SIGNAL */
parser.channel_nrpn_decrement[_channel_number] (parser, rpn_id, -1); /* EMIT SIGNAL */
return true;
case 0x06:
/* data entry MSB */
@ -202,7 +202,7 @@ Channel::maybe_process_rpns (Parser& parser, EventTwoBytes *tb)
result.first->second = rpn_val;
}
parser.channel_nrpn[_channel_number] (parser, rpn_id); /* EMIT SIGNAL */
parser.channel_nrpn[_channel_number] (parser, rpn_id, rpn_val); /* EMIT SIGNAL */
return true;
}
@ -214,12 +214,12 @@ Channel::maybe_process_rpns (Parser& parser, EventTwoBytes *tb)
case 0x60:
/* data increment */
_rpn_state = RPNState (_rpn_state|HaveValue);
parser.channel_rpn_increment[_channel_number] (parser, rpn_id); /* EMIT SIGNAL */
parser.channel_rpn_increment[_channel_number] (parser, rpn_id, 1); /* EMIT SIGNAL */
return true;
case 0x61:
/* data decrement */
_rpn_state = RPNState (_rpn_state|HaveValue);
parser.channel_rpn_decrement[_channel_number] (parser, rpn_id); /* EMIT SIGNAL */
parser.channel_rpn_decrement[_channel_number] (parser, rpn_id, -1); /* EMIT SIGNAL */
return true;
case 0x06:
/* data entry MSB */
@ -242,7 +242,7 @@ Channel::maybe_process_rpns (Parser& parser, EventTwoBytes *tb)
result.first->second = rpn_val;
}
parser.channel_rpn[_channel_number] (parser, rpn_id); /* EMIT SIGNAL */
parser.channel_rpn[_channel_number] (parser, rpn_id, rpn_val); /* EMIT SIGNAL */
return true;
}
}

View File

@ -39,7 +39,8 @@ typedef PBD::Signal2<void,Parser&,framecnt_t> TimestampedSignal;
typedef PBD::Signal2<void,Parser&, byte> OneByteSignal;
typedef PBD::Signal2<void,Parser &, EventTwoBytes *> TwoByteSignal;
typedef PBD::Signal2<void,Parser &, pitchbend_t> PitchBendSignal;
typedef PBD::Signal2<void,Parser &, uint16_t> RPNSignal;
typedef PBD::Signal3<void,Parser &, uint16_t, int> RPNSignal;
typedef PBD::Signal3<void,Parser &, uint16_t, float> RPNValueSignal;
typedef PBD::Signal3<void,Parser &, byte *, size_t> Signal;
class LIBMIDIPP_API Parser {
@ -78,10 +79,10 @@ class LIBMIDIPP_API Parser {
ZeroByteSignal channel_active_postparse[16];
RPNSignal channel_rpn[16];
RPNSignal channel_nrpn[16];
RPNSignal channel_rpn_increment[16];
RPNSignal channel_rpn_decrement[16];
RPNSignal channel_nrpn_increment[16];
RPNSignal channel_nrpn_decrement[16];
RPNValueSignal channel_rpn_increment[16];
RPNValueSignal channel_rpn_decrement[16];
RPNValueSignal channel_nrpn_increment[16];
RPNValueSignal channel_nrpn_decrement[16];
OneByteSignal mtc_quarter_frame; /* see below for more useful signals */
Signal mtc;