diff options
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/AudioBuffer.hpp | 6 | ||||
-rw-r--r-- | src/server/BufferFactory.hpp | 2 | ||||
-rw-r--r-- | src/server/EngineStore.hpp | 2 | ||||
-rw-r--r-- | src/server/NodeImpl.cpp | 2 | ||||
-rw-r--r-- | src/server/NodeImpl.hpp | 5 | ||||
-rw-r--r-- | src/server/PatchImpl.cpp | 4 | ||||
-rw-r--r-- | src/server/PostProcessor.hpp | 2 | ||||
-rw-r--r-- | src/server/ServerInterfaceImpl.hpp | 2 | ||||
-rw-r--r-- | src/server/ingen_lv2.cpp | 4 | ||||
-rw-r--r-- | src/server/internals/Delay.cpp | 16 | ||||
-rw-r--r-- | src/server/internals/Delay.hpp | 17 | ||||
-rw-r--r-- | src/server/internals/Note.hpp | 8 | ||||
-rw-r--r-- | src/server/util.hpp | 16 |
13 files changed, 46 insertions, 40 deletions
diff --git a/src/server/AudioBuffer.hpp b/src/server/AudioBuffer.hpp index 087c799f..51fb9ec2 100644 --- a/src/server/AudioBuffer.hpp +++ b/src/server/AudioBuffer.hpp @@ -62,8 +62,10 @@ public: : (_capacity - sizeof(LV2_Atom_Vector)) / sizeof(Sample); } - inline Sample& value_at(size_t offset) const - { assert(offset < nframes()); return data()[offset]; } + inline Sample& value_at(size_t offset) const { + assert(offset < nframes()); + return data()[offset]; + } void prepare_read(Context& context); void prepare_write(Context& context) {} diff --git a/src/server/BufferFactory.hpp b/src/server/BufferFactory.hpp index 08f7680b..1ec11ca1 100644 --- a/src/server/BufferFactory.hpp +++ b/src/server/BufferFactory.hpp @@ -61,7 +61,7 @@ public: void set_block_length(SampleCount block_length); Ingen::Forge& forge(); - Ingen::Shared::URIs& uris() { assert(_uris); return *_uris.get(); } + Ingen::Shared::URIs& uris() { return *_uris.get(); } Engine& engine() { return _engine; } private: diff --git a/src/server/EngineStore.hpp b/src/server/EngineStore.hpp index d2bc9b64..e6e05f00 100644 --- a/src/server/EngineStore.hpp +++ b/src/server/EngineStore.hpp @@ -45,7 +45,7 @@ class PortImpl; class EngineStore : public Ingen::Shared::Store { public: - EngineStore(SharedPtr<BufferFactory> f) : _factory(f) {} + explicit EngineStore(SharedPtr<BufferFactory> f) : _factory(f) {} ~EngineStore(); SharedPtr<BufferFactory> buffer_factory() const { return _factory; } diff --git a/src/server/NodeImpl.cpp b/src/server/NodeImpl.cpp index 36074649..f6d57146 100644 --- a/src/server/NodeImpl.cpp +++ b/src/server/NodeImpl.cpp @@ -109,7 +109,7 @@ NodeImpl::deactivate() assert(_activated); _activated = false; for (uint32_t i = 0; i < _polyphony; ++i) { - for (unsigned long j = 0; j < num_ports(); ++j) { + for (uint32_t j = 0; j < num_ports(); ++j) { PortImpl* const port = _ports->at(j); if (port->is_output() && port->buffer(i)) port->buffer(i)->clear(); diff --git a/src/server/NodeImpl.hpp b/src/server/NodeImpl.hpp index db13bf17..10ed41eb 100644 --- a/src/server/NodeImpl.hpp +++ b/src/server/NodeImpl.hpp @@ -32,7 +32,10 @@ #include "PortType.hpp" #include "types.hpp" -namespace Raul { template <typename T> class List; class Maid; } +namespace Raul { +template <typename T> class List; +class Maid; +} namespace Ingen { diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp index 08c66c38..3f8905f1 100644 --- a/src/server/PatchImpl.cpp +++ b/src/server/PatchImpl.cpp @@ -425,10 +425,10 @@ PatchImpl::build_ports_array() const size_t i = 0; - for (Ports::const_iterator p = _inputs.begin(); p != _inputs.end(); ++p,++i) + for (Ports::const_iterator p = _inputs.begin(); p != _inputs.end(); ++p, ++i) result->at(i) = *p; - for (Ports::const_iterator p = _outputs.begin(); p != _outputs.end(); ++p,++i) + for (Ports::const_iterator p = _outputs.begin(); p != _outputs.end(); ++p, ++i) result->at(i) = *p; assert(i == n); diff --git a/src/server/PostProcessor.hpp b/src/server/PostProcessor.hpp index d2920411..0f99a572 100644 --- a/src/server/PostProcessor.hpp +++ b/src/server/PostProcessor.hpp @@ -42,7 +42,7 @@ class Engine; class PostProcessor { public: - PostProcessor(Engine& engine); + explicit PostProcessor(Engine& engine); ~PostProcessor(); /** Push a list of events on to the process queue. diff --git a/src/server/ServerInterfaceImpl.hpp b/src/server/ServerInterfaceImpl.hpp index 160f4219..be725cd8 100644 --- a/src/server/ServerInterfaceImpl.hpp +++ b/src/server/ServerInterfaceImpl.hpp @@ -45,7 +45,7 @@ class ServerInterfaceImpl : public EventSource, public Interface { public: - ServerInterfaceImpl(Engine& engine); + explicit ServerInterfaceImpl(Engine& engine); virtual ~ServerInterfaceImpl(); Raul::URI uri() const { return "http://drobilla.net/ns/ingen#internal"; } diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index dace8087..cb144c49 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -67,7 +67,7 @@ struct LV2Patch { /** Ingen LV2 library. */ class Lib { public: - Lib(const char* bundle_path); + explicit Lib(const char* bundle_path); typedef std::vector< SharedPtr<const LV2Patch> > Patches; @@ -307,7 +307,7 @@ using namespace Ingen::Server; class MainThread : public Raul::Thread { public: - MainThread(SharedPtr<Engine> engine) : _engine(engine) {} + explicit MainThread(SharedPtr<Engine> engine) : _engine(engine) {} private: virtual void _run() { diff --git a/src/server/internals/Delay.cpp b/src/server/internals/Delay.cpp index 7d735eb7..e2838d31 100644 --- a/src/server/internals/Delay.cpp +++ b/src/server/internals/Delay.cpp @@ -156,7 +156,7 @@ DelayNode::process(ProcessContext& context) const uint32_t buffer_mask = plugin_data->_buffer_mask; const unsigned int sample_rate = plugin_data->_srate; float delay_samples = plugin_data->_delay_samples; - long write_phase = plugin_data->_write_phase; + int64_t write_phase = plugin_data->_write_phase; const uint32_t sample_count = context.nframes(); if (write_phase == 0) { @@ -165,11 +165,11 @@ DelayNode::process(ProcessContext& context) } if (delay_time == _last_delay_time) { - const long idelay_samples = (long)delay_samples; - const float frac = delay_samples - idelay_samples; + const int64_t idelay_samples = (int64_t)delay_samples; + const float frac = delay_samples - idelay_samples; for (uint32_t i = 0; i < sample_count; i++) { - long read_phase = write_phase - (long)delay_samples; + int64_t read_phase = write_phase - (int64_t)delay_samples; const float read = cube_interp(frac, buffer_at(read_phase - 1), buffer_at(read_phase), @@ -185,10 +185,10 @@ DelayNode::process(ProcessContext& context) for (uint32_t i = 0; i < sample_count; i++) { delay_samples += delay_samples_slope; write_phase++; - const long read_phase = write_phase - (long)delay_samples; - const long idelay_samples = (long)delay_samples; - const float frac = delay_samples - idelay_samples; - const float read = cube_interp(frac, + const int64_t read_phase = write_phase - (int64_t)delay_samples; + const int64_t idelay_samples = (int64_t)delay_samples; + const float frac = delay_samples - idelay_samples; + const float read = cube_interp(frac, buffer_at(read_phase - 1), buffer_at(read_phase), buffer_at(read_phase + 1), diff --git a/src/server/internals/Delay.hpp b/src/server/internals/Delay.hpp index 7c7c05e6..4cca4ed7 100644 --- a/src/server/internals/Delay.hpp +++ b/src/server/internals/Delay.hpp @@ -54,20 +54,17 @@ public: float delay_samples() const { return _delay_samples; } private: - inline float& buffer_at(long phase) const { return _buffer[phase & _buffer_mask]; } + inline float& buffer_at(int64_t phase) const { return _buffer[phase & _buffer_mask]; } InputPort* _delay_port; InputPort* _in_port; OutputPort* _out_port; - - typedef long Phase; - - float* _buffer; - uint32_t _buffer_length; - uint32_t _buffer_mask; - Phase _write_phase; - float _last_delay_time; - float _delay_samples; + float* _buffer; + uint32_t _buffer_length; + uint32_t _buffer_mask; + uint64_t _write_phase; + float _last_delay_time; + float _delay_samples; }; } // namespace Server diff --git a/src/server/internals/Note.hpp b/src/server/internals/Note.hpp index 4053c052..8e83a404 100644 --- a/src/server/internals/Note.hpp +++ b/src/server/internals/Note.hpp @@ -68,14 +68,18 @@ private: struct Key { enum State { OFF, ON_ASSIGNED, ON_UNASSIGNED }; Key() : state(OFF), voice(0), time(0) {} - State state; uint32_t voice; SampleCount time; + State state; + uint32_t voice; + SampleCount time; }; /** Voice, one of these always exists for each voice */ struct Voice { enum State { FREE, ACTIVE, HOLDING }; Voice() : state(FREE), note(0), time(0) {} - State state; uint8_t note; SampleCount time; + State state; + uint8_t note; + SampleCount time; }; float note_to_freq(int num); diff --git a/src/server/util.hpp b/src/server/util.hpp index d0b4f2bd..372ae084 100644 --- a/src/server/util.hpp +++ b/src/server/util.hpp @@ -32,9 +32,9 @@ #ifdef USE_ASSEMBLY # if SIZEOF_VOID_P==8 -# define cpuid(a,b,c,d,n) asm("xchgq %%rbx, %1; cpuid; xchgq %%rbx, %1": "=a" (a), "=r" (b), "=c" (c), "=d" (d) : "a" (n)); +# define cpuid(a, b, c, d, n) asm("xchgq %%rbx, %1; cpuid; xchgq %%rbx, %1": "=a" (a), "=r" (b), "=c" (c), "=d" (d) : "a" (n)); # else -# define cpuid(a,b,c,d,n) asm("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1": "=a" (a), "=r" (b), "=c" (c), "=d" (d) : "a" (n)); +# define cpuid(a, b, c, d, n) asm("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1": "=a" (a), "=r" (b), "=c" (c), "=d" (d) : "a" (n)); # endif #endif @@ -51,14 +51,14 @@ set_denormal_flags() unsigned long a, b, c, d0, d1; int stepping, model, family, extfamily; - cpuid(a,b,c,d1,1); + cpuid(a, b, c, d1, 1); if (d1 & 1<<25) { /* It has SSE support */ _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); - family = (a >> 8) & 0xf; - extfamily = (a >> 20) & 0xff; - model = (a >> 4) & 0xf; - stepping = a & 0xf; - cpuid(a,b,c,d0,0); + family = (a >> 8) & 0xF; + extfamily = (a >> 20) & 0xFF; + model = (a >> 4) & 0xF; + stepping = a & 0xF; + cpuid(a, b, c, d0, 0); if (b == 0x756e6547) { /* It's an Intel */ if (family == 15 && extfamily == 0 && model == 0 && stepping < 7) { return; |