summaryrefslogtreecommitdiffstats
path: root/src/server/internals
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/internals')
-rw-r--r--src/server/internals/BlockDelay.cpp25
-rw-r--r--src/server/internals/BlockDelay.hpp1
-rw-r--r--src/server/internals/Controller.cpp35
-rw-r--r--src/server/internals/Controller.hpp2
-rw-r--r--src/server/internals/Note.cpp34
-rw-r--r--src/server/internals/Note.hpp6
-rw-r--r--src/server/internals/Time.cpp29
-rw-r--r--src/server/internals/Time.hpp1
-rw-r--r--src/server/internals/Trigger.cpp32
-rw-r--r--src/server/internals/Trigger.hpp2
10 files changed, 72 insertions, 95 deletions
diff --git a/src/server/internals/BlockDelay.cpp b/src/server/internals/BlockDelay.cpp
index 68252fe4..acc68851 100644
--- a/src/server/internals/BlockDelay.cpp
+++ b/src/server/internals/BlockDelay.cpp
@@ -14,7 +14,7 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "internals/BlockDelay.hpp"
+#include "BlockDelay.hpp"
#include "BlockImpl.hpp"
#include "Buffer.hpp"
@@ -24,21 +24,16 @@
#include "OutputPort.hpp"
#include "PortType.hpp"
-#include "ingen/Forge.hpp"
-#include "ingen/URI.hpp"
-#include "ingen/URIs.hpp"
-#include "raul/Array.hpp"
-#include "raul/Maid.hpp"
-#include "raul/Symbol.hpp"
+#include <ingen/Forge.hpp>
+#include <ingen/URI.hpp>
+#include <ingen/URIs.hpp>
+#include <raul/Array.hpp>
+#include <raul/Maid.hpp>
+#include <raul/Symbol.hpp>
#include <memory>
-namespace ingen {
-namespace server {
-
-class RunContext;
-
-namespace internals {
+namespace ingen::server::internals {
InternalPlugin* BlockDelayNode::internal_plugin(URIs& uris) {
return new InternalPlugin(
@@ -91,6 +86,4 @@ BlockDelayNode::run(RunContext& ctx)
_buffer->copy(ctx, _in_port->buffer(0).get());
}
-} // namespace internals
-} // namespace server
-} // namespace ingen
+} // namespace ingen::server::internals
diff --git a/src/server/internals/BlockDelay.hpp b/src/server/internals/BlockDelay.hpp
index 78a03c28..a9667fa0 100644
--- a/src/server/internals/BlockDelay.hpp
+++ b/src/server/internals/BlockDelay.hpp
@@ -36,7 +36,6 @@ class GraphImpl;
class InputPort;
class InternalPlugin;
class OutputPort;
-class RunContext;
namespace internals {
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp
index d0d8cd39..9103649e 100644
--- a/src/server/internals/Controller.cpp
+++ b/src/server/internals/Controller.cpp
@@ -14,7 +14,8 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "BlockImpl.hpp"
+#include "Controller.hpp"
+
#include "Buffer.hpp"
#include "BufferFactory.hpp"
#include "BufferRef.hpp"
@@ -24,25 +25,23 @@
#include "PortType.hpp"
#include "RunContext.hpp"
-#include "ingen/Atom.hpp"
-#include "ingen/Forge.hpp"
-#include "ingen/URI.hpp"
-#include "ingen/URIs.hpp"
-#include "internals/Controller.hpp"
-#include "lv2/atom/atom.h"
-#include "lv2/atom/util.h"
-#include "lv2/midi/midi.h"
-#include "raul/Array.hpp"
-#include "raul/Maid.hpp"
-#include "raul/Symbol.hpp"
+#include <ingen/Atom.hpp>
+#include <ingen/Forge.hpp>
+#include <ingen/URI.hpp>
+#include <ingen/URIs.hpp>
+#include <lv2/atom/atom.h>
+#include <lv2/atom/util.h>
+#include <lv2/midi/midi.h>
+#include <raul/Array.hpp>
+#include <raul/Maid.hpp>
+#include <raul/Symbol.hpp>
#include <cassert>
#include <cmath>
#include <initializer_list>
#include <memory>
-namespace ingen {
-namespace server {
+namespace ingen::server {
class GraphImpl;
@@ -60,7 +59,6 @@ ControllerNode::ControllerNode(InternalPlugin* plugin,
GraphImpl* parent,
SampleRate srate)
: InternalBlock(plugin, symbol, false, parent, srate)
- , _learning(false)
{
const ingen::URIs& uris = bufs.uris();
_ports = bufs.maid().make_managed<Ports>(7);
@@ -125,7 +123,7 @@ ControllerNode::run(RunContext& ctx)
auto* seq = midi_in->get<LV2_Atom_Sequence>();
const BufferRef midi_out = _midi_out_port->buffer(0);
- LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
+ LV2_ATOM_SEQUENCE_FOREACH (seq, ev) {
const auto* buf = static_cast<const uint8_t*>(LV2_ATOM_BODY_CONST(&ev->body));
if (ev->body.type == _midi_in_port->bufs().uris().midi_MidiEvent &&
ev->body.size >= 3 &&
@@ -174,7 +172,7 @@ ControllerNode::control(RunContext& ctx, uint8_t control_num, uint8_t val, Frame
}
const Sample min = logf(min_port_val + 1 + log_offset);
const Sample max = logf(max_port_val + 1 + log_offset);
- scaled_value = expf(nval * (max - min) + min) - 1 - log_offset;
+ scaled_value = expf((nval * (max - min)) + min) - 1 - log_offset;
} else {
scaled_value = ((nval) * (max_port_val - min_port_val)) + min_port_val;
}
@@ -185,5 +183,4 @@ ControllerNode::control(RunContext& ctx, uint8_t control_num, uint8_t val, Frame
}
} // namespace internals
-} // namespace server
-} // namespace ingen
+} // namespace ingen::server
diff --git a/src/server/internals/Controller.hpp b/src/server/internals/Controller.hpp
index b5cea110..2a0bc834 100644
--- a/src/server/internals/Controller.hpp
+++ b/src/server/internals/Controller.hpp
@@ -74,7 +74,7 @@ private:
InputPort* _min_port;
InputPort* _max_port;
OutputPort* _audio_port;
- bool _learning;
+ bool _learning{false};
};
} // namespace internals
diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp
index 4952310b..960bca85 100644
--- a/src/server/internals/Note.cpp
+++ b/src/server/internals/Note.cpp
@@ -14,28 +14,27 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "internals/Note.hpp"
+#include "Note.hpp"
#include "BlockImpl.hpp"
#include "Buffer.hpp"
#include "BufferFactory.hpp"
-#include "BufferRef.hpp"
#include "InputPort.hpp"
#include "InternalPlugin.hpp"
#include "OutputPort.hpp"
#include "PortType.hpp"
#include "RunContext.hpp"
-#include "ingen/Atom.hpp"
-#include "ingen/Forge.hpp"
-#include "ingen/URI.hpp"
-#include "ingen/URIs.hpp"
-#include "lv2/atom/atom.h"
-#include "lv2/atom/util.h"
-#include "lv2/midi/midi.h"
-#include "raul/Array.hpp"
-#include "raul/Maid.hpp"
-#include "raul/Symbol.hpp"
+#include <ingen/Atom.hpp>
+#include <ingen/Forge.hpp>
+#include <ingen/URI.hpp>
+#include <ingen/URIs.hpp>
+#include <lv2/atom/atom.h>
+#include <lv2/atom/util.h>
+#include <lv2/midi/midi.h>
+#include <raul/Array.hpp>
+#include <raul/Maid.hpp>
+#include <raul/Symbol.hpp>
#include <cassert>
#include <cmath>
@@ -44,8 +43,7 @@
// #define NOTE_DEBUG 1
-namespace ingen {
-namespace server {
+namespace ingen::server {
class GraphImpl;
@@ -64,7 +62,6 @@ NoteNode::NoteNode(InternalPlugin* plugin,
SampleRate srate)
: InternalBlock(plugin, symbol, polyphonic, parent, srate)
, _voices(bufs.maid().make_managed<Voices>(_polyphony))
- , _sustain(false)
{
const ingen::URIs& uris = bufs.uris();
_ports = bufs.maid().make_managed<Ports>(8);
@@ -179,7 +176,7 @@ NoteNode::run(RunContext& ctx)
Buffer* const midi_in = _midi_in_port->buffer(0).get();
auto* seq = midi_in->get<LV2_Atom_Sequence>();
- LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
+ LV2_ATOM_SEQUENCE_FOREACH (seq, ev) {
const auto* buf =
static_cast<const uint8_t*>(LV2_ATOM_BODY_CONST(&ev->body));
@@ -360,7 +357,7 @@ NoteNode::free_voice(RunContext& ctx, uint32_t voice, FrameTime time)
}
}
- if (replace_key != nullptr) { // Found a key to assign to freed voice
+ if (replace_key != nullptr) { // Found a key to assign to freed voice
assert(&_keys[replace_key_num] == replace_key);
assert(replace_key->state == Key::State::ON_UNASSIGNED);
@@ -437,5 +434,4 @@ NoteNode::channel_pressure(RunContext& ctx, FrameTime time, float amount)
}
} // namespace internals
-} // namespace server
-} // namespace ingen
+} // namespace ingen::server
diff --git a/src/server/internals/Note.hpp b/src/server/internals/Note.hpp
index 80816131..2cf6c1e2 100644
--- a/src/server/internals/Note.hpp
+++ b/src/server/internals/Note.hpp
@@ -20,8 +20,8 @@
#include "InternalBlock.hpp"
#include "types.hpp"
-#include "raul/Array.hpp"
-#include "raul/Maid.hpp"
+#include <raul/Array.hpp>
+#include <raul/Maid.hpp>
#include <cstdint>
@@ -105,7 +105,7 @@ private:
raul::managed_ptr<Voices> _prepared_voices;
Key _keys[128];
- bool _sustain; ///< Whether or not hold pedal is depressed
+ bool _sustain{false}; ///< 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 651a2f36..2ea09b0b 100644
--- a/src/server/internals/Time.cpp
+++ b/src/server/internals/Time.cpp
@@ -14,9 +14,8 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "internals/Time.hpp"
+#include "Time.hpp"
-#include "BlockImpl.hpp"
#include "Buffer.hpp"
#include "BufferFactory.hpp"
#include "BufferRef.hpp"
@@ -27,19 +26,18 @@
#include "PortType.hpp"
#include "RunContext.hpp"
-#include "ingen/Atom.hpp"
-#include "ingen/Forge.hpp"
-#include "ingen/URI.hpp"
-#include "ingen/URIs.hpp"
-#include "lv2/atom/atom.h"
-#include "raul/Array.hpp"
-#include "raul/Maid.hpp"
-#include "raul/Symbol.hpp"
+#include <ingen/Atom.hpp>
+#include <ingen/Forge.hpp>
+#include <ingen/URI.hpp>
+#include <ingen/URIs.hpp>
+#include <lv2/atom/atom.h>
+#include <raul/Array.hpp>
+#include <raul/Maid.hpp>
+#include <raul/Symbol.hpp>
#include <memory>
-namespace ingen {
-namespace server {
+namespace ingen::server {
class GraphImpl;
@@ -73,8 +71,8 @@ TimeNode::TimeNode(InternalPlugin* plugin,
void
TimeNode::run(RunContext& ctx)
{
- BufferRef buf = _notify_port->buffer(0);
- auto* seq = buf->get<LV2_Atom_Sequence>();
+ const BufferRef buf = _notify_port->buffer(0);
+ auto* const seq = buf->get<LV2_Atom_Sequence>();
// Initialise output to the empty sequence
seq->atom.type = _notify_port->bufs().uris().atom_Sequence;
@@ -87,5 +85,4 @@ TimeNode::run(RunContext& ctx)
}
} // namespace internals
-} // namespace server
-} // namespace ingen
+} // namespace ingen::server
diff --git a/src/server/internals/Time.hpp b/src/server/internals/Time.hpp
index fa3e90e5..228e67a8 100644
--- a/src/server/internals/Time.hpp
+++ b/src/server/internals/Time.hpp
@@ -34,7 +34,6 @@ class BufferFactory;
class GraphImpl;
class InternalPlugin;
class OutputPort;
-class RunContext;
namespace internals {
diff --git a/src/server/internals/Trigger.cpp b/src/server/internals/Trigger.cpp
index 645ffabb..f033a345 100644
--- a/src/server/internals/Trigger.cpp
+++ b/src/server/internals/Trigger.cpp
@@ -14,9 +14,8 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "internals/Trigger.hpp"
+#include "Trigger.hpp"
-#include "BlockImpl.hpp"
#include "Buffer.hpp"
#include "BufferFactory.hpp"
#include "BufferRef.hpp"
@@ -26,23 +25,22 @@
#include "PortType.hpp"
#include "RunContext.hpp"
-#include "ingen/Atom.hpp"
-#include "ingen/Forge.hpp"
-#include "ingen/URI.hpp"
-#include "ingen/URIs.hpp"
-#include "lv2/atom/atom.h"
-#include "lv2/atom/util.h"
-#include "lv2/midi/midi.h"
-#include "raul/Array.hpp"
-#include "raul/Maid.hpp"
-#include "raul/Symbol.hpp"
+#include <ingen/Atom.hpp>
+#include <ingen/Forge.hpp>
+#include <ingen/URI.hpp>
+#include <ingen/URIs.hpp>
+#include <lv2/atom/atom.h>
+#include <lv2/atom/util.h>
+#include <lv2/midi/midi.h>
+#include <raul/Array.hpp>
+#include <raul/Maid.hpp>
+#include <raul/Symbol.hpp>
#include <cassert>
#include <cmath>
#include <memory>
-namespace ingen {
-namespace server {
+namespace ingen::server {
class GraphImpl;
@@ -60,7 +58,6 @@ TriggerNode::TriggerNode(InternalPlugin* plugin,
GraphImpl* parent,
SampleRate srate)
: InternalBlock(plugin, symbol, false, parent, srate)
- , _learning(false)
{
const ingen::URIs& uris = bufs.uris();
_ports = bufs.maid().make_managed<Ports>(6);
@@ -124,7 +121,7 @@ TriggerNode::run(RunContext& ctx)
// Initialise output to the empty sequence
midi_out->prepare_write(ctx);
- LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
+ LV2_ATOM_SEQUENCE_FOREACH (seq, ev) {
const int64_t t = ev->time.frames;
const auto* buf =
static_cast<const uint8_t*>(LV2_ATOM_BODY_CONST(&ev->body));
@@ -199,5 +196,4 @@ TriggerNode::note_off(RunContext& ctx, uint8_t note_num, FrameTime time)
}
} // namespace internals
-} // namespace server
-} // namespace ingen
+} // namespace ingen::server
diff --git a/src/server/internals/Trigger.hpp b/src/server/internals/Trigger.hpp
index d9553c3e..74634202 100644
--- a/src/server/internals/Trigger.hpp
+++ b/src/server/internals/Trigger.hpp
@@ -71,7 +71,7 @@ public:
static InternalPlugin* internal_plugin(URIs& uris);
private:
- bool _learning;
+ bool _learning{false};
InputPort* _midi_in_port;
OutputPort* _midi_out_port;