listen for midi binding control range.

This commit is contained in:
Robin E. R. Davies
2025-06-26 10:24:48 -04:00
parent 2974033128
commit 07af383211
20 changed files with 591 additions and 522 deletions
+20 -8
View File
@@ -31,6 +31,20 @@ namespace pipedal
{
class IndexedSnapshot;
class MidiNotifyBody
{
public:
MidiNotifyBody() = default;
MidiNotifyBody(uint8_t cc0, uint8_t cc1, uint8_t cc2)
: cc0_(cc0), cc1_(cc1), cc2_(cc2)
{
}
uint8_t cc0_;
uint8_t cc1_;
uint8_t cc2_;
};
enum class RingBufferCommand : int64_t
{
Invalid = 0,
@@ -38,7 +52,7 @@ namespace pipedal
EffectReplaced,
SetValue,
SetBypass,
//AudioStopped,
// AudioStopped,
AudioTerminatedAbnormally, // specifically for an ALSA loss of connection.
SetVuSubscriptions,
FreeVuSubscriptions,
@@ -327,7 +341,7 @@ namespace pipedal
return;
}
}
template <typename T>
void write(RingBufferCommand command, const T &value, size_t dataLength, uint8_t *variableData)
{
@@ -374,12 +388,9 @@ namespace pipedal
write(RingBufferCommand::MidiValueChanged, body);
}
void OnMidiListen(bool isNote, uint8_t noteOrControl)
void OnMidiListen(const MidiNotifyBody &body)
{
uint16_t msg = noteOrControl;
if (isNote)
msg |= 0x100;
write(RingBufferCommand::OnMidiListen, msg);
write(RingBufferCommand::OnMidiListen, body);
}
/**
@@ -485,7 +496,8 @@ namespace pipedal
{
write(RingBufferCommand::AckMidiProgramChange, requestId);
}
void AckMidiSnapshotRequest(uint64_t snapshotRequestId) {
void AckMidiSnapshotRequest(uint64_t snapshotRequestId)
{
write(RingBufferCommand::AckMidiSnapshotRequest, snapshotRequestId);
}