diff options
author | David Robillard <d@drobilla.net> | 2017-02-12 15:04:20 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-02-12 15:31:47 +0100 |
commit | b1198f0842e6e4d6b1c01f07d91b42ef4a212788 (patch) | |
tree | 93fdf4da89a6f5f634707fb8c989e0d9ee1a3c65 /src/server/internals/Note.hpp | |
parent | 81d45973412c675e3c0b4a10b64d811a219feeae (diff) | |
download | ingen-b1198f0842e6e4d6b1c01f07d91b42ef4a212788.tar.gz ingen-b1198f0842e6e4d6b1c01f07d91b42ef4a212788.tar.bz2 ingen-b1198f0842e6e4d6b1c01f07d91b42ef4a212788.zip |
Use smart pointers to handle real-time memory disposal
Diffstat (limited to 'src/server/internals/Note.hpp')
-rw-r--r-- | src/server/internals/Note.hpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/server/internals/Note.hpp b/src/server/internals/Note.hpp index 08d1b358..e8593768 100644 --- a/src/server/internals/Note.hpp +++ b/src/server/internals/Note.hpp @@ -48,7 +48,7 @@ public: ~NoteNode(); bool prepare_poly(BufferFactory& bufs, uint32_t poly); - bool apply_poly(RunContext& context, Raul::Maid& maid, uint32_t poly); + bool apply_poly(RunContext& context, uint32_t poly); void run(RunContext& context); @@ -84,12 +84,15 @@ private: SampleCount time; }; + typedef Raul::Array<Voice> Voices; + void free_voice(RunContext& context, uint32_t voice, FrameTime time); - Raul::Array<Voice>* _voices; - Raul::Array<Voice>* _prepared_voices; - Key _keys[128]; - bool _sustain; ///< Whether or not hold pedal is depressed + MPtr<Voices> _voices; + MPtr<Voices> _prepared_voices; + + Key _keys[128]; + bool _sustain; ///< Whether or not hold pedal is depressed InputPort* _midi_in_port; OutputPort* _freq_port; |