summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 14:28:50 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commit6a1ce7d1ee5e6f20aa011fe994341d9d79ac35ea (patch)
treee541fcd73c05f2338840f1fcfa36dcb6a0d8895d /src/server
parent7fe8260c6c0a53fdc9ba04130c577122402a82ec (diff)
downloadingen-6a1ce7d1ee5e6f20aa011fe994341d9d79ac35ea.tar.gz
ingen-6a1ce7d1ee5e6f20aa011fe994341d9d79ac35ea.tar.bz2
ingen-6a1ce7d1ee5e6f20aa011fe994341d9d79ac35ea.zip
Make member functions const or static where possible
Diffstat (limited to 'src/server')
-rw-r--r--src/server/ControlBindings.cpp2
-rw-r--r--src/server/ControlBindings.hpp2
-rw-r--r--src/server/GraphPlugin.hpp4
-rw-r--r--src/server/JackDriver.cpp6
-rw-r--r--src/server/JackDriver.hpp8
-rw-r--r--src/server/LV2Block.hpp2
-rw-r--r--src/server/PortImpl.cpp4
-rw-r--r--src/server/PortImpl.hpp4
-rw-r--r--src/server/ingen_lv2.cpp2
9 files changed, 16 insertions, 18 deletions
diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp
index 8ab4aef7..4664b590 100644
--- a/src/server/ControlBindings.cpp
+++ b/src/server/ControlBindings.cpp
@@ -340,7 +340,7 @@ void
ControlBindings::set_port_value(RunContext& context,
PortImpl* port,
Type type,
- int16_t value)
+ int16_t value) const
{
float min = 0.0f;
float max = 1.0f;
diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp
index bb113666..7505aad8 100644
--- a/src/server/ControlBindings.hpp
+++ b/src/server/ControlBindings.hpp
@@ -128,7 +128,7 @@ private:
void set_port_value(RunContext& context,
PortImpl* port,
Type type,
- int16_t value);
+ int16_t value) const;
bool finish_learn(RunContext& context, Key key);
diff --git a/src/server/GraphPlugin.hpp b/src/server/GraphPlugin.hpp
index bb97e9c2..3ac8ec30 100644
--- a/src/server/GraphPlugin.hpp
+++ b/src/server/GraphPlugin.hpp
@@ -50,8 +50,8 @@ public:
return nullptr;
}
- Raul::Symbol symbol() const override { return Raul::Symbol("graph"); }
- std::string name() const { return "Ingen Graph"; }
+ Raul::Symbol symbol() const override { return Raul::Symbol("graph"); }
+ static std::string name() { return "Ingen Graph"; }
private:
const std::string _symbol;
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index 71ebe308..6209174f 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -388,7 +388,7 @@ JackDriver::pre_process_port(RunContext& context, EnginePort* port)
}
void
-JackDriver::post_process_port(RunContext& context, EnginePort* port)
+JackDriver::post_process_port(RunContext& context, EnginePort* port) const
{
const URIs& uris = context.engine().world().uris();
const SampleCount nframes = context.nframes();
@@ -413,7 +413,7 @@ JackDriver::post_process_port(RunContext& context, EnginePort* port)
const uint8_t* buf =
static_cast<const uint8_t*>(LV2_ATOM_BODY(&ev->body));
- if (ev->body.type == _midi_event_type) {
+ if (ev->body.type == this->_midi_event_type) {
jack_midi_event_write(
jack_buf, ev->time.frames, buf, ev->body.size);
}
@@ -527,7 +527,7 @@ JackDriver::_process_cb(jack_nframes_t nframes)
}
void
-JackDriver::_thread_init_cb()
+JackDriver::thread_init_cb(void*)
{
ThreadManager::set_flag(THREAD_PROCESS);
ThreadManager::set_flag(THREAD_IS_REAL_TIME);
diff --git a/src/server/JackDriver.hpp b/src/server/JackDriver.hpp
index 433fd21a..fa71779c 100644
--- a/src/server/JackDriver.hpp
+++ b/src/server/JackDriver.hpp
@@ -106,10 +106,9 @@ public:
private:
friend class JackPort;
+ static void thread_init_cb(void* jack_driver);
+
// Static JACK callbacks which call the non-static callbacks (methods)
- inline static void thread_init_cb(void* const jack_driver) {
- return static_cast<JackDriver*>(jack_driver)->_thread_init_cb();
- }
inline static void shutdown_cb(void* const jack_driver) {
return static_cast<JackDriver*>(jack_driver)->_shutdown_cb();
}
@@ -126,14 +125,13 @@ private:
#endif
void pre_process_port(RunContext& context, EnginePort* port);
- void post_process_port(RunContext& context, EnginePort* port);
+ void post_process_port(RunContext& context, EnginePort* port) const;
void port_property_internal(const jack_port_t* jport,
const URI& uri,
const Atom& value);
// Non static callbacks (methods)
- void _thread_init_cb();
void _shutdown_cb();
int _process_cb(jack_nframes_t nframes);
int _block_length_cb(jack_nframes_t nframes);
diff --git a/src/server/LV2Block.hpp b/src/server/LV2Block.hpp
index d42da499..e935ade1 100644
--- a/src/server/LV2Block.hpp
+++ b/src/server/LV2Block.hpp
@@ -112,7 +112,7 @@ protected:
using Instances = Raul::Array<SPtr<Instance>>;
- void drop_instances(const MPtr<Instances>& instances) {
+ static void drop_instances(const MPtr<Instances>& instances) {
if (instances) {
for (size_t i = 0; i < instances->size(); ++i) {
(*instances)[i].reset();
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index 7bbb5185..0fa389e6 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -527,7 +527,7 @@ PortImpl::monitor(RunContext& context, bool send_now)
}
BufferRef
-PortImpl::value_buffer(uint32_t voice)
+PortImpl::value_buffer(uint32_t voice) const
{
return buffer(voice)->value_buffer();
}
@@ -546,7 +546,7 @@ PortImpl::next_value_offset(SampleCount offset, SampleCount end) const
}
void
-PortImpl::update_values(SampleCount offset, uint32_t voice)
+PortImpl::update_values(SampleCount offset, uint32_t voice) const
{
buffer(voice)->update_value_buffer(offset);
}
diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp
index bde5a946..86e98661 100644
--- a/src/server/PortImpl.hpp
+++ b/src/server/PortImpl.hpp
@@ -230,7 +230,7 @@ public:
BufferFactory& bufs() const { return _bufs; }
- BufferRef value_buffer(uint32_t voice);
+ BufferRef value_buffer(uint32_t voice) const;
BufferRef user_buffer(RunContext&) const { return _user_buffer; }
void set_user_buffer(RunContext&, BufferRef b) { _user_buffer = b; }
@@ -240,7 +240,7 @@ public:
SampleCount end) const;
/** Update value buffer for `voice` to be current as of `offset`. */
- void update_values(SampleCount offset, uint32_t voice);
+ void update_values(SampleCount offset, uint32_t voice) const;
void force_monitor_update() { _force_monitor_update = true; }
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index bccae02d..7f6a430e 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -178,7 +178,7 @@ public:
}
}
- void post_process_port(RunContext& context, EnginePort* port) {
+ static void post_process_port(RunContext& context, EnginePort* port) {
DuplexPort* graph_port = port->graph_port();
// No copying necessary, host buffers are used directly