Handle message /cc/changed
This commit is contained in:
parent
c39cae79f9
commit
d03495d568
3 changed files with 15 additions and 0 deletions
|
|
@ -258,6 +258,7 @@ void Synth::Impl::clear()
|
||||||
clearCCLabels();
|
clearCCLabels();
|
||||||
currentUsedCCs_.clear();
|
currentUsedCCs_.clear();
|
||||||
changedCCsThisCycle_.clear();
|
changedCCsThisCycle_.clear();
|
||||||
|
changedCCsLastCycle_.clear();
|
||||||
clearKeyLabels();
|
clearKeyLabels();
|
||||||
keySlots_.clear();
|
keySlots_.clear();
|
||||||
swLastSlots_.clear();
|
swLastSlots_.clear();
|
||||||
|
|
@ -1025,6 +1026,7 @@ void Synth::renderBlock(AudioSpan<float> buffer) noexcept
|
||||||
sfizz_blob_t blob { changedCCs.data(), static_cast<uint32_t>(changedCCs.byte_size()) };
|
sfizz_blob_t blob { changedCCs.data(), static_cast<uint32_t>(changedCCs.byte_size()) };
|
||||||
broadcaster.receive<'b'>(finalFrameNumber, "/cc/changed", &blob);
|
broadcaster.receive<'b'>(finalFrameNumber, "/cc/changed", &blob);
|
||||||
}
|
}
|
||||||
|
impl.changedCCsLastCycle_ = impl.changedCCsThisCycle_;
|
||||||
impl.changedCCsThisCycle_.clear();
|
impl.changedCCsThisCycle_.clear();
|
||||||
// Send the changed keyswitch
|
// Send the changed keyswitch
|
||||||
if (impl.currentSwitchChanged_) {
|
if (impl.currentSwitchChanged_) {
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,18 @@ void sfz::Synth::dispatchMessage(Client& client, int delay, const char* path, co
|
||||||
client.receive<'s'>(delay, path, label ? label->c_str() : "");
|
client.receive<'s'>(delay, path, label ? label->c_str() : "");
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
MATCH("/cc/changed", "") {
|
||||||
|
const BitArray<config::numCCs>& changedCCs = impl.changedCCsThisCycle_;
|
||||||
|
sfizz_blob_t blob { changedCCs.data(), static_cast<uint32_t>(changedCCs.byte_size()) };
|
||||||
|
client.receive<'b'>(delay, path, &blob);
|
||||||
|
} break;
|
||||||
|
|
||||||
|
MATCH("/cc/changed~", "") {
|
||||||
|
const BitArray<config::numCCs>& changedCCs = impl.changedCCsLastCycle_;
|
||||||
|
sfizz_blob_t blob { changedCCs.data(), static_cast<uint32_t>(changedCCs.byte_size()) };
|
||||||
|
client.receive<'b'>(delay, path, &blob);
|
||||||
|
} break;
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
MATCH("/mem/buffers", "") {
|
MATCH("/mem/buffers", "") {
|
||||||
|
|
|
||||||
|
|
@ -315,6 +315,7 @@ struct Synth::Impl final: public Parser::Listener {
|
||||||
std::array<float, config::numCCs> defaultCCValues_;
|
std::array<float, config::numCCs> defaultCCValues_;
|
||||||
BitArray<config::numCCs> currentUsedCCs_;
|
BitArray<config::numCCs> currentUsedCCs_;
|
||||||
BitArray<config::numCCs> changedCCsThisCycle_;
|
BitArray<config::numCCs> changedCCsThisCycle_;
|
||||||
|
BitArray<config::numCCs> changedCCsLastCycle_;
|
||||||
|
|
||||||
// Messaging
|
// Messaging
|
||||||
sfizz_receive_t* broadcastReceiver = nullptr;
|
sfizz_receive_t* broadcastReceiver = nullptr;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue