diff options
author | David Robillard <d@drobilla.net> | 2019-12-08 19:27:09 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-08 20:59:06 +0100 |
commit | ffe238b426ab7ad7b3d6f8efd49cf4c7861fbf6f (patch) | |
tree | f3e45d28bc3ee42ec1426045278fbf3dfe7d296a | |
parent | 951fa5cfd11f702340a98a7fbef7d806e454f866 (diff) | |
download | ingen-ffe238b426ab7ad7b3d6f8efd49cf4c7861fbf6f.tar.gz ingen-ffe238b426ab7ad7b3d6f8efd49cf4c7861fbf6f.tar.bz2 ingen-ffe238b426ab7ad7b3d6f8efd49cf4c7861fbf6f.zip |
Cleanup: Make methods static where possible
-rw-r--r-- | ingen/FilePath.hpp | 3 | ||||
-rw-r--r-- | src/FilePath.cpp | 2 | ||||
-rw-r--r-- | src/server/Broadcaster.hpp | 4 | ||||
-rw-r--r-- | src/server/BufferFactory.hpp | 2 | ||||
-rw-r--r-- | src/server/ControlBindings.cpp | 4 | ||||
-rw-r--r-- | src/server/ControlBindings.hpp | 15 |
6 files changed, 17 insertions, 13 deletions
diff --git a/ingen/FilePath.hpp b/ingen/FilePath.hpp index e4f22b88..98893dfc 100644 --- a/ingen/FilePath.hpp +++ b/ingen/FilePath.hpp @@ -83,7 +83,8 @@ public: operator string_type() const { return _str; } - FilePath root_name() const; + static FilePath root_name(); + FilePath root_directory() const; FilePath root_path() const; FilePath relative_path() const; diff --git a/src/FilePath.cpp b/src/FilePath.cpp index c015d2ee..ad739e95 100644 --- a/src/FilePath.cpp +++ b/src/FilePath.cpp @@ -95,7 +95,7 @@ FilePath::operator+=(boost::basic_string_view<value_type> sv) } FilePath -FilePath::root_name() const +FilePath::root_name() { #ifdef USE_WINDOWS_FILE_PATHS if (_str.length() >= 2 && _str[0] >= 'A' && _str[0] <= 'Z' && diff --git a/src/server/Broadcaster.hpp b/src/server/Broadcaster.hpp index bf586c38..d8857356 100644 --- a/src/server/Broadcaster.hpp +++ b/src/server/Broadcaster.hpp @@ -91,7 +91,9 @@ public: }; void send_plugins(const BlockFactory::Plugins& plugins); - void send_plugins_to(Interface*, const BlockFactory::Plugins& plugins); + + static void + send_plugins_to(Interface*, const BlockFactory::Plugins& plugins); void message(const Message& msg) override { std::lock_guard<std::mutex> lock(_clients_mutex); diff --git a/src/server/BufferFactory.hpp b/src/server/BufferFactory.hpp index eafec0b8..03a85d1c 100644 --- a/src/server/BufferFactory.hpp +++ b/src/server/BufferFactory.hpp @@ -94,7 +94,7 @@ private: } } - void free_list(Buffer* head); + static void free_list(Buffer* head); std::atomic<Buffer*> _free_audio; std::atomic<Buffer*> _free_control; diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index ce08950e..41f00742 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -230,7 +230,7 @@ float ControlBindings::control_to_port_value(RunContext& context, const PortImpl* port, Type type, - int16_t value) const + int16_t value) { float normal = 0.0f; switch (type) { @@ -262,7 +262,7 @@ int16_t ControlBindings::port_value_to_control(RunContext& context, PortImpl* port, Type type, - const Atom& value_atom) const + const Atom& value_atom) { if (value_atom.type() != port->bufs().forge().Float) { return 0; diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp index 3a39c664..bb113666 100644 --- a/src/server/ControlBindings.hpp +++ b/src/server/ControlBindings.hpp @@ -122,7 +122,8 @@ private: boost::intrusive::multiset<Binding, boost::intrusive::compare<BindingLess>>; - Key midi_event_key(uint16_t size, const uint8_t* buf, uint16_t& value); + static Key + midi_event_key(uint16_t size, const uint8_t* buf, uint16_t& value); void set_port_value(RunContext& context, PortImpl* port, @@ -131,15 +132,15 @@ private: bool finish_learn(RunContext& context, Key key); - float control_to_port_value(RunContext& context, + static float control_to_port_value(RunContext& context, const PortImpl* port, Type type, - int16_t value) const; + int16_t value); - int16_t port_value_to_control(RunContext& context, - PortImpl* port, - Type type, - const Atom& value_atom) const; + static int16_t port_value_to_control(RunContext& context, + PortImpl* port, + Type type, + const Atom& value_atom); Engine& _engine; std::atomic<Binding*> _learn_binding; |