summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy2
-rw-r--r--ingen/Clock.hpp12
-rw-r--r--ingen/Forge.hpp4
-rw-r--r--ingen/Log.hpp2
-rw-r--r--ingen/URIMap.hpp2
-rw-r--r--ingen/client/PluginModel.hpp2
-rw-r--r--src/Log.cpp2
-rw-r--r--src/Serialiser.cpp4
-rw-r--r--src/URIMap.cpp2
-rw-r--r--src/client/PluginModel.cpp2
-rw-r--r--src/gui/LoadPluginWindow.hpp5
-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
20 files changed, 36 insertions, 37 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 683b7aab..d4ee6314 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -72,10 +72,8 @@ Checks: >
-portability-simd-intrinsics,
-readability-avoid-const-params-in-decls,
-readability-const-return-type,
- -readability-convert-member-functions-to-static,
-readability-else-after-return,
-readability-implicit-bool-conversion,
- -readability-make-member-function-const,
-readability-named-parameter,
-readability-redundant-member-init,
-readability-static-accessed-through-instance,
diff --git a/ingen/Clock.hpp b/ingen/Clock.hpp
index c3b0f64d..5345d7a6 100644
--- a/ingen/Clock.hpp
+++ b/ingen/Clock.hpp
@@ -47,15 +47,17 @@ private:
inline uint64_t now_microseconds() const {
struct timespec time;
-# if defined(CLOCK_MONOTONIC_RAW)
- clock_gettime(CLOCK_MONOTONIC_RAW, &time);
-# else
- clock_gettime(CLOCK_MONOTONIC, &time);
-# endif
+ clock_gettime(_clock, &time);
return static_cast<uint64_t>(time.tv_sec) * 1e6 +
static_cast<uint64_t>(time.tv_nsec) / 1e3;
}
+private:
+# if defined(CLOCK_MONOTONIC_RAW)
+ const clockid_t _clock = CLOCK_MONOTONIC_RAW;
+# else
+ const clockid_t _clock = CLOCK_MONOTONIC;
+# endif
#endif
};
diff --git a/ingen/Forge.hpp b/ingen/Forge.hpp
index b414a6ab..10b4e622 100644
--- a/ingen/Forge.hpp
+++ b/ingen/Forge.hpp
@@ -43,7 +43,7 @@ public:
return atom.type() == URI || atom.type() == URID;
}
- Atom make() { return Atom(); }
+ static Atom make() { return Atom(); }
Atom make(int32_t v) { return Atom(sizeof(v), Int, &v); }
Atom make(float v) { return Atom(sizeof(v), Float, &v); }
Atom make(bool v) {
@@ -55,7 +55,7 @@ public:
Atom make_urid(const ingen::URI& u);
- Atom alloc(uint32_t size, uint32_t type, const void* val) {
+ static Atom alloc(uint32_t size, uint32_t type, const void* val) {
return Atom(size, type, val);
}
diff --git a/ingen/Log.hpp b/ingen/Log.hpp
index 0a04c8f0..e6bc2b39 100644
--- a/ingen/Log.hpp
+++ b/ingen/Log.hpp
@@ -93,7 +93,7 @@ public:
void set_sink(Sink s) { _sink = s; }
private:
- void print(FILE* stream, const std::string& msg);
+ void print(FILE* stream, const std::string& msg) const;
LV2_Log_Log* _log;
URIs& _uris;
diff --git a/ingen/URIMap.hpp b/ingen/URIMap.hpp
index a3b9f219..db10241f 100644
--- a/ingen/URIMap.hpp
+++ b/ingen/URIMap.hpp
@@ -74,7 +74,7 @@ public:
struct URIDUnmapFeature : public Feature {
URIDUnmapFeature(URIMap* map, LV2_URID_Unmap* impl);
- const char* unmap(const LV2_URID urid);
+ const char* unmap(const LV2_URID urid) const;
static const char* default_unmap(LV2_URID_Map_Handle h, LV2_URID urid);
LV2_URID_Unmap urid_unmap;
};
diff --git a/ingen/client/PluginModel.hpp b/ingen/client/PluginModel.hpp
index 142f28bf..dc0c724f 100644
--- a/ingen/client/PluginModel.hpp
+++ b/ingen/client/PluginModel.hpp
@@ -109,7 +109,7 @@ protected:
void add_preset(const URI& uri, const std::string& label);
private:
- std::string get_documentation(const LilvNode* subject, bool html) const;
+ static std::string get_documentation(const LilvNode* subject, bool html);
static Sord::World* _rdf_world;
static LilvWorld* _lilv_world;
diff --git a/src/Log.cpp b/src/Log.cpp
index 26112877..06bb1955 100644
--- a/src/Log.cpp
+++ b/src/Log.cpp
@@ -75,7 +75,7 @@ Log::trace(const std::string& msg)
}
void
-Log::print(FILE* stream, const std::string& msg)
+Log::print(FILE* stream, const std::string& msg) const
{
fprintf(stream, "%s", msg.c_str());
if (_flush) {
diff --git a/src/Serialiser.cpp b/src/Serialiser.cpp
index b6545e0d..1f102dba 100644
--- a/src/Serialiser.cpp
+++ b/src/Serialiser.cpp
@@ -92,7 +92,7 @@ struct Serialiser::Impl {
void write_bundle(const SPtr<const Node>& graph, const URI& uri);
- Sord::Node path_rdf_node(const Raul::Path& path);
+ Sord::Node path_rdf_node(const Raul::Path& path) const;
void write_manifest(const FilePath& bundle_path,
const SPtr<const Node>& graph);
@@ -278,7 +278,7 @@ Serialiser::Impl::finish()
}
Sord::Node
-Serialiser::Impl::path_rdf_node(const Raul::Path& path)
+Serialiser::Impl::path_rdf_node(const Raul::Path& path) const
{
assert(_model);
assert(path == _root_path || path.is_child_of(_root_path));
diff --git a/src/URIMap.cpp b/src/URIMap.cpp
index abab309b..5f1ea43f 100644
--- a/src/URIMap.cpp
+++ b/src/URIMap.cpp
@@ -101,7 +101,7 @@ URIMap::URIDUnmapFeature::default_unmap(LV2_URID_Unmap_Handle h,
}
const char*
-URIMap::URIDUnmapFeature::unmap(LV2_URID urid)
+URIMap::URIDUnmapFeature::unmap(LV2_URID urid) const
{
return urid_unmap.unmap(urid_unmap.handle, urid);
}
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 744bdb7d..517bed70 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -274,7 +274,7 @@ link(const std::string& addr, bool html)
}
std::string
-PluginModel::get_documentation(const LilvNode* subject, bool html) const
+PluginModel::get_documentation(const LilvNode* subject, bool html)
{
std::string doc;
diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp
index 31843dde..49c61c76 100644
--- a/src/gui/LoadPluginWindow.hpp
+++ b/src/gui/LoadPluginWindow.hpp
@@ -121,8 +121,9 @@ private:
void plugin_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* col);
void plugin_selection_changed();
- std::string generate_module_name(SPtr<const client::PluginModel> plugin,
- int offset=0);
+ static std::string
+ generate_module_name(SPtr<const client::PluginModel> plugin,
+ int offset = 0);
void load_plugin(const Gtk::TreeModel::iterator& iter);
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