diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/engine/LADSPANode.cpp | 18 | ||||
-rw-r--r-- | src/libs/engine/LV2Node.cpp | 18 | ||||
-rw-r--r-- | src/libs/engine/MidiNoteNode.cpp | 7 |
3 files changed, 24 insertions, 19 deletions
diff --git a/src/libs/engine/LADSPANode.cpp b/src/libs/engine/LADSPANode.cpp index f8ecb1f5..24661a3d 100644 --- a/src/libs/engine/LADSPANode.cpp +++ b/src/libs/engine/LADSPANode.cpp @@ -47,6 +47,15 @@ LADSPANode::LADSPANode(PluginImpl* plugin, const string& path, bool polyphonic, } +LADSPANode::~LADSPANode() +{ + for (uint32_t i=0; i < _polyphony; ++i) + _descriptor->cleanup((*_instances)[i]); + + delete _instances; +} + + bool LADSPANode::prepare_poly(uint32_t poly) { @@ -204,15 +213,6 @@ LADSPANode::instantiate() } -LADSPANode::~LADSPANode() -{ - for (uint32_t i=0; i < _polyphony; ++i) - _descriptor->cleanup((*_instances)[i]); - - delete[] _instances; -} - - void LADSPANode::activate() { diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index eb8f86b7..d901176f 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -55,6 +55,15 @@ LV2Node::LV2Node(PluginImpl* plugin, } +LV2Node::~LV2Node() +{ + for (uint32_t i=0; i < _polyphony; ++i) + slv2_instance_free((*_instances)[i]); + + delete _instances; +} + + bool LV2Node::prepare_poly(uint32_t poly) { @@ -193,15 +202,6 @@ LV2Node::instantiate() } -LV2Node::~LV2Node() -{ - for (uint32_t i=0; i < _polyphony; ++i) - slv2_instance_free((*_instances)[i]); - - delete _instances; -} - - void LV2Node::activate() { diff --git a/src/libs/engine/MidiNoteNode.cpp b/src/libs/engine/MidiNoteNode.cpp index c90f44ae..128b7a13 100644 --- a/src/libs/engine/MidiNoteNode.cpp +++ b/src/libs/engine/MidiNoteNode.cpp @@ -195,6 +195,11 @@ MidiNoteNode::note_on(uchar note_num, uchar velocity, FrameTime time, ProcessCon Voice* voice = NULL; uint32_t voice_num = 0; + if (key->state != Key::OFF) { + cerr << "[MidiNoteNode] Double note. Who be sendin dem crazy midis?" << endl; + return; + } + // Look for free voices for (uint32_t i=0; i < _polyphony; ++i) { if ((*_voices)[i].state == Voice::Voice::FREE) { @@ -225,8 +230,8 @@ MidiNoteNode::note_on(uchar note_num, uchar velocity, FrameTime time, ProcessCon // Update stolen key, if applicable if (voice->state == Voice::Voice::ACTIVE) { - assert(_keys[voice->note].voice == voice_num); assert(_keys[voice->note].state == Key::ON_ASSIGNED); + assert(_keys[voice->note].voice == voice_num); _keys[voice->note].state = Key::Key::ON_UNASSIGNED; //cerr << "[MidiNoteNode] Stole voice " << voice_num << endl; } |