diff options
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/BlockImpl.cpp | 2 | ||||
-rw-r--r-- | src/server/BlockImpl.hpp | 2 | ||||
-rw-r--r-- | src/server/Buffer.cpp | 8 | ||||
-rw-r--r-- | src/server/CompiledGraph.hpp | 2 | ||||
-rw-r--r-- | src/server/ControlBindings.cpp | 4 | ||||
-rw-r--r-- | src/server/GraphImpl.hpp | 18 | ||||
-rw-r--r-- | src/server/PortImpl.cpp | 2 | ||||
-rw-r--r-- | src/server/PostProcessor.cpp | 2 | ||||
-rw-r--r-- | src/server/PreProcessor.cpp | 6 | ||||
-rw-r--r-- | src/server/PreProcessor.hpp | 10 | ||||
-rw-r--r-- | src/server/SocketListener.cpp | 2 | ||||
-rw-r--r-- | src/server/SocketServer.hpp | 2 | ||||
-rw-r--r-- | src/server/Task.cpp | 2 | ||||
-rw-r--r-- | src/server/Task.hpp | 6 | ||||
-rw-r--r-- | src/server/Worker.cpp | 3 | ||||
-rw-r--r-- | src/server/events/Delta.cpp | 8 | ||||
-rw-r--r-- | src/server/ingen_lv2.cpp | 6 | ||||
-rw-r--r-- | src/server/internals/Note.cpp | 2 | ||||
-rw-r--r-- | src/server/internals/Note.hpp | 2 | ||||
-rw-r--r-- | src/server/mix.cpp | 6 |
20 files changed, 49 insertions, 46 deletions
diff --git a/src/server/BlockImpl.cpp b/src/server/BlockImpl.cpp index ee6b5786..81474126 100644 --- a/src/server/BlockImpl.cpp +++ b/src/server/BlockImpl.cpp @@ -206,7 +206,7 @@ BlockImpl::bypass(RunContext& ctx) PortImpl* in = nth_port_by_type(i, true, t); PortImpl* out = nth_port_by_type(i, false, t); if (!out) { - break; // Finished writing all outputs + break; // Finished writing all outputs } if (in) { diff --git a/src/server/BlockImpl.hpp b/src/server/BlockImpl.hpp index 448ebb99..ed3566aa 100644 --- a/src/server/BlockImpl.hpp +++ b/src/server/BlockImpl.hpp @@ -62,7 +62,7 @@ class Worker; * \ingroup engine */ class BlockImpl : public NodeImpl - , public boost::intrusive::slist_base_hook<> // In GraphImpl + , public boost::intrusive::slist_base_hook<> // In GraphImpl { public: using Ports = raul::Array<PortImpl*>; diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp index 426cdb27..f561871f 100644 --- a/src/server/Buffer.cpp +++ b/src/server/Buffer.cpp @@ -217,7 +217,7 @@ Buffer::port_data(PortType port_type, SampleCount offset) const static inline __m128 mm_abs_ps(__m128 x) { - const __m128 sign_mask = _mm_set1_ps(-0.0f); // -0.0f = 1 << 31 + const __m128 sign_mask = _mm_set1_ps(-0.0f); // -0.0f = 1 << 31 return _mm_andnot_ps(sign_mask, x); } #endif @@ -299,7 +299,7 @@ Buffer::append_event(int64_t frames, auto* atom = get<LV2_Atom>(); if (atom->type == _factory.uris().atom_Chunk) { - clear(); // Chunk initialized with prepare_output_write(), clear + clear(); // Chunk initialized with prepare_output_write(), clear } if (sizeof(LV2_Atom) + atom->size + lv2_atom_pad_size(size) > _capacity) { @@ -339,14 +339,14 @@ Buffer::append_event_buffer(const Buffer* buf) reinterpret_cast<const LV2_Atom_Sequence*>(buf->get<LV2_Atom>()); if (seq->atom.type == _factory.uris().atom_Chunk) { - clear(); // Chunk initialized with prepare_output_write(), clear + clear(); // Chunk initialized with prepare_output_write(), clear } const uint32_t total_size = lv2_atom_total_size(&seq->atom); uint8_t* const end = reinterpret_cast<uint8_t*>(seq) + total_size; const uint32_t n_bytes = bseq->atom.size - sizeof(bseq->body); if (sizeof(LV2_Atom) + total_size + n_bytes >= _capacity) { - return false; // Not enough space + return false; // Not enough space } memcpy(end, bseq + 1, n_bytes); diff --git a/src/server/CompiledGraph.hpp b/src/server/CompiledGraph.hpp index 8c2bb815..f33941aa 100644 --- a/src/server/CompiledGraph.hpp +++ b/src/server/CompiledGraph.hpp @@ -49,7 +49,7 @@ public: void run(RunContext& ctx); private: - friend class raul::Maid; ///< Allow make_managed to construct + friend class raul::Maid; ///< Allow make_managed to construct CompiledGraph(GraphImpl* graph); diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index ecbdf8cf..aefc8608 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -414,7 +414,7 @@ ControlBindings::pre_process(RunContext& ctx, Buffer* buffer) _feedback->clear(); if ((!_learn_binding && _bindings->empty()) || !buffer->get<LV2_Atom>()) { - return; // Don't bother reading input + return; // Don't bother reading input } auto* seq = buffer->get<LV2_Atom_Sequence>(); @@ -424,7 +424,7 @@ ControlBindings::pre_process(RunContext& ctx, Buffer* buffer) const Key key = midi_event_key(ev->body.size, buf, value); if (_learn_binding && !!key) { - finish_learn(ctx, key); // Learn new binding + finish_learn(ctx, key); // Learn new binding } // Set all controls bound to this key diff --git a/src/server/GraphImpl.hpp b/src/server/GraphImpl.hpp index 185b858c..3746961a 100644 --- a/src/server/GraphImpl.hpp +++ b/src/server/GraphImpl.hpp @@ -204,14 +204,16 @@ public: Engine& engine() { return _engine; } private: - Engine& _engine; - uint32_t _poly_pre; ///< Pre-process thread only - uint32_t _poly_process; ///< Process thread only - raul::managed_ptr<CompiledGraph> _compiled_graph; ///< Process thread only - PortList _inputs; ///< Pre-process thread only - PortList _outputs; ///< Pre-process thread only - Blocks _blocks; ///< Pre-process thread only - bool _process{false}; ///< True iff graph is enabled + using CompiledGraphPtr = raul::managed_ptr<CompiledGraph>; + + Engine& _engine; + uint32_t _poly_pre; ///< Pre-process thread only + uint32_t _poly_process; ///< Process thread only + CompiledGraphPtr _compiled_graph; ///< Process thread only + PortList _inputs; ///< Pre-process thread only + PortList _outputs; ///< Pre-process thread only + Blocks _blocks; ///< Pre-process thread only + bool _process{false}; ///< True iff graph is enabled }; } // namespace server diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index f5012c81..68613e65 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -42,7 +42,7 @@ namespace ingen { namespace server { -static const uint32_t monitor_rate = 25.0; // Hz +static const uint32_t monitor_rate = 25.0; // Hz /** The length of time between monitor updates in frames */ static inline uint32_t diff --git a/src/server/PostProcessor.cpp b/src/server/PostProcessor.cpp index 88df994c..0e94efea 100644 --- a/src/server/PostProcessor.cpp +++ b/src/server/PostProcessor.cpp @@ -99,7 +99,7 @@ PostProcessor::process() // Post-process event ev->post_process(); - next = ev->next(); // [1] (see below) + next = ev->next(); // [1] (see below) } while (next && next->time() < end_time); /* Reached the tail (as far as we're concerned). There may be successors diff --git a/src/server/PreProcessor.cpp b/src/server/PreProcessor.cpp index beba06e2..7746d1db 100644 --- a/src/server/PreProcessor.cpp +++ b/src/server/PreProcessor.cpp @@ -109,14 +109,14 @@ PreProcessor::process(RunContext& ctx, PostProcessor& dest, size_t limit) } if (_block_state == BlockState::BLOCKED) { - break; // Waiting for PRE_UNBLOCKED + break; // Waiting for PRE_UNBLOCKED } if (ev->time() < ctx.start()) { - ev->set_time(ctx.start()); // Too late, nudge to context start + ev->set_time(ctx.start()); // Too late, nudge to context start } else if (_block_state != BlockState::PROCESSING && ev->time() >= ctx.end()) { - break; // Event is for a future cycle + break; // Event is for a future cycle } // Execute event diff --git a/src/server/PreProcessor.hpp b/src/server/PreProcessor.hpp index 832b545e..ff0b5fff 100644 --- a/src/server/PreProcessor.hpp +++ b/src/server/PreProcessor.hpp @@ -61,11 +61,11 @@ protected: private: enum class BlockState { - UNBLOCKED, ///< Normal, unblocked execution - PRE_BLOCKED, ///< Preprocess thread has enqueued blocking event - BLOCKED, ///< Process thread has reached blocking event - PRE_UNBLOCKED, ///< Preprocess thread has enqueued unblocking event - PROCESSING ///< Process thread is executing all events in-between + UNBLOCKED, ///< Normal, unblocked execution + PRE_BLOCKED, ///< Preprocess thread has enqueued blocking event + BLOCKED, ///< Process thread has reached blocking event + PRE_UNBLOCKED, ///< Preprocess thread has enqueued unblocking event + PROCESSING ///< Process thread is executing all events in-between }; void wait_for_block_state(const BlockState state) { diff --git a/src/server/SocketListener.cpp b/src/server/SocketListener.cpp index 640d575f..0d377732 100644 --- a/src/server/SocketListener.cpp +++ b/src/server/SocketListener.cpp @@ -141,7 +141,7 @@ ingen_listen(Engine* engine, raul::Socket* unix_sock, raul::Socket* net_sock) } if (unix_sock->fd() == -1 && net_sock->fd() == -1) { - return; // No sockets to listen to, exit thread + return; // No sockets to listen to, exit thread } struct pollfd pfds[2]; diff --git a/src/server/SocketServer.hpp b/src/server/SocketServer.hpp index ac8aa611..0531c44c 100644 --- a/src/server/SocketServer.hpp +++ b/src/server/SocketServer.hpp @@ -89,4 +89,4 @@ private: } // namespace server } // namespace ingen -#endif // INGEN_SERVER_SOCKET_SERVER_HPP +#endif // INGEN_SERVER_SOCKET_SERVER_HPP diff --git a/src/server/Task.cpp b/src/server/Task.cpp index ec9568b3..43db78e8 100644 --- a/src/server/Task.cpp +++ b/src/server/Task.cpp @@ -93,7 +93,7 @@ Task::get_task(RunContext& ctx) } if (_done_end >= _children.size()) { - return nullptr; // All child tasks are finished + return nullptr; // All child tasks are finished } // All child tasks claimed, but some are unfinished, steal a task diff --git a/src/server/Task.hpp b/src/server/Task.hpp index 83782098..b4e9848c 100644 --- a/src/server/Task.hpp +++ b/src/server/Task.hpp @@ -36,9 +36,9 @@ class Task { public: enum class Mode { - SINGLE, ///< Single block to run - SEQUENTIAL, ///< Elements must be run sequentially in order - PARALLEL ///< Elements may be run in any order in parallel + SINGLE, ///< Single block to run + SEQUENTIAL, ///< Elements must be run sequentially in order + PARALLEL ///< Elements may be run in any order in parallel }; Task(Mode mode, BlockImpl* block = nullptr) diff --git a/src/server/Worker.cpp b/src/server/Worker.cpp index bb282365..2da96ae6 100644 --- a/src/server/Worker.cpp +++ b/src/server/Worker.cpp @@ -36,8 +36,9 @@ namespace server { /// A message in the Worker::_requests ring struct MessageHeader { - LV2Block* block; ///< Node this message is from + LV2Block* block; ///< Node this message is from uint32_t size; ///< Size of following data + // `size' bytes of data follow here }; diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 67319423..71d4b48f 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -246,7 +246,7 @@ Delta::pre_process(PreProcessContext& ctx) } if (_create_event) { if (_create_event->pre_process(ctx)) { - _object = _engine.store()->get(path); // Get object for setting + _object = _engine.store()->get(path); // Get object for setting } else { return Event::pre_process_done(Status::CREATION_FAILED, _subject); } @@ -358,7 +358,7 @@ Delta::pre_process(PreProcessContext& ctx) } } else if ((block = dynamic_cast<BlockImpl*>(_object))) { if (key == uris.midi_binding && value == uris.patch_wildcard) { - op = SpecialType::CONTROL_BINDING; // Internal block learn + op = SpecialType::CONTROL_BINDING; // Internal block learn } else if (key == uris.ingen_enabled) { if (value.type() == uris.forge.Bool) { op = SpecialType::ENABLE; @@ -599,13 +599,13 @@ Delta::post_process() if (_create_event) { _create_event->post_process(); if (_create_event->status() != Status::SUCCESS) { - return; // Creation failed, nothing else to do + return; // Creation failed, nothing else to do } } for (auto& s : _set_events) { if (s->synthetic() || s->status() != Status::SUCCESS) { - s->post_process(); // Set failed, report error + s->post_process(); // Set failed, report error } } diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index 8d8a2b75..851a83fb 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -146,7 +146,7 @@ public: lv2_atom_total_size( static_cast<LV2_Atom*>(lv2_buf))); - if (graph_port->symbol() == "control") { // TODO: Safe to use index? + if (graph_port->symbol() == "control") { // TODO: Safe to use index? auto* seq = reinterpret_cast<LV2_Atom_Sequence*>(lv2_buf); bool enqueued = false; @@ -360,14 +360,14 @@ public: if (seq->atom.size + lv2_atom_pad_size( sizeof(LV2_Atom_Event) + atom.size) > _notify_capacity) { - break; // Output port buffer full, resume next time + break; // Output port buffer full, resume next time } auto* ev = reinterpret_cast<LV2_Atom_Event*>( reinterpret_cast<uint8_t*>(seq) + lv2_atom_total_size(&seq->atom)); - ev->time.frames = 0; // TODO: Time? + ev->time.frames = 0; // TODO: Time? ev->body = atom; _to_ui.skip(sizeof(LV2_Atom)); diff --git a/src/server/internals/Note.cpp b/src/server/internals/Note.cpp index ea5019a8..976e43f9 100644 --- a/src/server/internals/Note.cpp +++ b/src/server/internals/Note.cpp @@ -359,7 +359,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); diff --git a/src/server/internals/Note.hpp b/src/server/internals/Note.hpp index 082a852c..3aa3217e 100644 --- a/src/server/internals/Note.hpp +++ b/src/server/internals/Note.hpp @@ -105,7 +105,7 @@ private: raul::managed_ptr<Voices> _prepared_voices; Key _keys[128]; - bool _sustain{false}; ///< 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/mix.cpp b/src/server/mix.cpp index a1e0c276..9c578d11 100644 --- a/src/server/mix.cpp +++ b/src/server/mix.cpp @@ -59,15 +59,15 @@ mix(const RunContext& ctx, const SampleCount end = ctx.nframes(); for (uint32_t i = 1; i < num_srcs; ++i) { const Sample* __restrict const in = srcs[i]->samples(); - if (srcs[i]->is_control()) { // control => audio + if (srcs[i]->is_control()) { // control => audio for (SampleCount j = 0; j < end; ++j) { out[j] += in[0]; } - } else if (srcs[i]->is_audio()) { // audio => audio + } else if (srcs[i]->is_audio()) { // audio => audio for (SampleCount j = 0; j < end; ++j) { out[j] += in[j]; } - } else if (srcs[i]->is_sequence()) { // sequence => audio + } else if (srcs[i]->is_sequence()) { // sequence => audio dst->render_sequence(ctx, srcs[i], true); } } |