summaryrefslogtreecommitdiffstats
path: root/src/server/internals
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/internals')
-rw-r--r--src/server/internals/BlockDelay.cpp2
-rw-r--r--src/server/internals/Controller.cpp2
-rw-r--r--src/server/internals/Note.cpp17
-rw-r--r--src/server/internals/Note.hpp13
-rw-r--r--src/server/internals/Time.cpp2
-rw-r--r--src/server/internals/Trigger.cpp2
6 files changed, 19 insertions, 19 deletions
diff --git a/src/server/internals/BlockDelay.cpp b/src/server/internals/BlockDelay.cpp
index d52ae721..c0e8dded 100644
--- a/src/server/internals/BlockDelay.cpp
+++ b/src/server/internals/BlockDelay.cpp
@@ -47,7 +47,7 @@ BlockDelayNode::BlockDelayNode(InternalPlugin* plugin,
: InternalBlock(plugin, symbol, polyphonic, parent, srate)
{
const Ingen::URIs& uris = bufs.uris();
- _ports = new Raul::Array<PortImpl*>(2);
+ _ports = bufs.maid().make_managed<Ports>(2);
_in_port = new InputPort(bufs, this, Raul::Symbol("in"), 0, 1,
PortType::AUDIO, 0, bufs.forge().make(0.0f));
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp
index 4b6f9c02..0366cbf0 100644
--- a/src/server/internals/Controller.cpp
+++ b/src/server/internals/Controller.cpp
@@ -51,7 +51,7 @@ ControllerNode::ControllerNode(InternalPlugin* plugin,
, _learning(false)
{
const Ingen::URIs& uris = bufs.uris();
- _ports = new Raul::Array<PortImpl*>(7);
+ _ports = bufs.maid().make_managed<Ports>(7);
const Atom zero = bufs.forge().make(0.0f);
const Atom one = bufs.forge().make(1.0f);
diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp
index 564ae34c..cc592794 100644
--- a/src/server/internals/Note.cpp
+++ b/src/server/internals/Note.cpp
@@ -53,12 +53,11 @@ NoteNode::NoteNode(InternalPlugin* plugin,
GraphImpl* parent,
SampleRate srate)
: InternalBlock(plugin, symbol, polyphonic, parent, srate)
- , _voices(new Raul::Array<Voice>(_polyphony))
- , _prepared_voices(NULL)
+ , _voices(bufs.maid().make_managed<Voices>(_polyphony))
, _sustain(false)
{
const Ingen::URIs& uris = bufs.uris();
- _ports = new Raul::Array<PortImpl*>(8);
+ _ports = bufs.maid().make_managed<Ports>(8);
const Atom zero = bufs.forge().make(0.0f);
const Atom one = bufs.forge().make(1.0f);
@@ -131,7 +130,6 @@ NoteNode::NoteNode(InternalPlugin* plugin,
NoteNode::~NoteNode()
{
- delete _voices;
}
bool
@@ -145,22 +143,21 @@ NoteNode::prepare_poly(BufferFactory& bufs, uint32_t poly)
if (_prepared_voices && poly <= _prepared_voices->size())
return true;
- _prepared_voices = new Raul::Array<Voice>(poly, *_voices, Voice());
+ _prepared_voices = bufs.maid().make_managed<Voices>(
+ poly, *_voices, Voice());
return true;
}
bool
-NoteNode::apply_poly(RunContext& context, Raul::Maid& maid, uint32_t poly)
+NoteNode::apply_poly(RunContext& context, uint32_t poly)
{
- if (!BlockImpl::apply_poly(context, maid, poly))
+ if (!BlockImpl::apply_poly(context, poly))
return false;
if (_prepared_voices) {
assert(_polyphony <= _prepared_voices->size());
- maid.dispose(_voices);
- _voices = _prepared_voices;
- _prepared_voices = NULL;
+ _voices = std::move(_prepared_voices);
}
assert(_polyphony <= _voices->size());
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;
diff --git a/src/server/internals/Time.cpp b/src/server/internals/Time.cpp
index 0f4bdd56..2da2a2ae 100644
--- a/src/server/internals/Time.cpp
+++ b/src/server/internals/Time.cpp
@@ -45,7 +45,7 @@ TimeNode::TimeNode(InternalPlugin* plugin,
: InternalBlock(plugin, symbol, false, parent, srate)
{
const Ingen::URIs& uris = bufs.uris();
- _ports = new Raul::Array<PortImpl*>(1);
+ _ports = bufs.maid().make_managed<Ports>(1);
_notify_port = new OutputPort(
bufs, this, Raul::Symbol("notify"), 0, 1,
diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp
index 68089283..88bfd3f1 100644
--- a/src/server/internals/Trigger.cpp
+++ b/src/server/internals/Trigger.cpp
@@ -51,7 +51,7 @@ TriggerNode::TriggerNode(InternalPlugin* plugin,
, _learning(false)
{
const Ingen::URIs& uris = bufs.uris();
- _ports = new Raul::Array<PortImpl*>(6);
+ _ports = bufs.maid().make_managed<Ports>(6);
const Atom zero = bufs.forge().make(0.0f);