diff options
Diffstat (limited to 'include/ingen/client')
-rw-r--r-- | include/ingen/client/ArcModel.hpp | 14 | ||||
-rw-r--r-- | include/ingen/client/BlockModel.hpp | 12 | ||||
-rw-r--r-- | include/ingen/client/ClientStore.hpp | 26 | ||||
-rw-r--r-- | include/ingen/client/GraphModel.hpp | 20 | ||||
-rw-r--r-- | include/ingen/client/ObjectModel.hpp | 14 | ||||
-rw-r--r-- | include/ingen/client/PluginModel.hpp | 22 | ||||
-rw-r--r-- | include/ingen/client/PluginUI.hpp | 36 | ||||
-rw-r--r-- | include/ingen/client/PortModel.hpp | 28 | ||||
-rw-r--r-- | include/ingen/client/SigClientInterface.hpp | 18 | ||||
-rw-r--r-- | include/ingen/client/SocketClient.hpp | 27 | ||||
-rw-r--r-- | include/ingen/client/client.h | 31 |
11 files changed, 133 insertions, 115 deletions
diff --git a/include/ingen/client/ArcModel.hpp b/include/ingen/client/ArcModel.hpp index a76f274f..21238831 100644 --- a/include/ingen/client/ArcModel.hpp +++ b/include/ingen/client/ArcModel.hpp @@ -17,18 +17,17 @@ #ifndef INGEN_CLIENT_ARCMODEL_HPP #define INGEN_CLIENT_ARCMODEL_HPP -#include "ingen/Arc.hpp" -#include "ingen/client/PortModel.hpp" -#include "ingen/ingen.h" -#include "raul/Path.hpp" +#include <ingen/Arc.hpp> +#include <ingen/client/PortModel.hpp> +#include <ingen/ingen.h> +#include <raul/Path.hpp> #include <cassert> #include <memory> #include <string> #include <utility> -namespace ingen { -namespace client { +namespace ingen::client { /** Class to represent a port->port connections in the engine. * @@ -61,7 +60,6 @@ private: const std::shared_ptr<PortModel> _head; }; -} // namespace client -} // namespace ingen +} // namespace ingen::client #endif // INGEN_CLIENT_ARCMODEL_HPP diff --git a/include/ingen/client/BlockModel.hpp b/include/ingen/client/BlockModel.hpp index 060d454f..db41f4ef 100644 --- a/include/ingen/client/BlockModel.hpp +++ b/include/ingen/client/BlockModel.hpp @@ -17,12 +17,12 @@ #ifndef INGEN_CLIENT_BLOCKMODEL_HPP #define INGEN_CLIENT_BLOCKMODEL_HPP -#include "ingen/Node.hpp" -#include "ingen/URI.hpp" -#include "ingen/client/ObjectModel.hpp" -#include "ingen/client/PluginModel.hpp" // IWYU pragma: keep -#include "ingen/client/signal.hpp" -#include "ingen/ingen.h" +#include <ingen/Node.hpp> +#include <ingen/URI.hpp> +#include <ingen/client/ObjectModel.hpp> +#include <ingen/client/PluginModel.hpp> +#include <ingen/client/signal.hpp> +#include <ingen/ingen.h> #include <cstdint> #include <memory> diff --git a/include/ingen/client/ClientStore.hpp b/include/ingen/client/ClientStore.hpp index 3aec363f..c649aab3 100644 --- a/include/ingen/client/ClientStore.hpp +++ b/include/ingen/client/ClientStore.hpp @@ -17,12 +17,12 @@ #ifndef INGEN_CLIENT_CLIENTSTORE_HPP #define INGEN_CLIENT_CLIENTSTORE_HPP -#include "ingen/Interface.hpp" -#include "ingen/Message.hpp" -#include "ingen/Store.hpp" -#include "ingen/URI.hpp" -#include "ingen/client/signal.hpp" -#include "ingen/ingen.h" +#include <ingen/Interface.hpp> +#include <ingen/Message.hpp> +#include <ingen/Store.hpp> +#include <ingen/URI.hpp> +#include <ingen/client/signal.hpp> +#include <ingen/ingen.h> #include <map> #include <memory> @@ -78,22 +78,22 @@ public: void message(const Message& msg) override; - void operator()(const BundleBegin&) {} - void operator()(const BundleEnd&) {} + void operator()(const BundleBegin&) noexcept {} + void operator()(const BundleEnd&) noexcept {} void operator()(const Connect&); void operator()(const Copy&); void operator()(const Del&); void operator()(const Delta&); void operator()(const Disconnect&); void operator()(const DisconnectAll&); - void operator()(const Error&) {} - void operator()(const Get&) {} + void operator()(const Error&) noexcept {} + void operator()(const Get&) noexcept {} void operator()(const Move&); void operator()(const Put&); - void operator()(const Redo&) {} - void operator()(const Response&) {} + void operator()(const Redo&) noexcept {} + void operator()(const Response&) noexcept {} void operator()(const SetProperty&); - void operator()(const Undo&) {} + void operator()(const Undo&) noexcept {} INGEN_SIGNAL(new_object, void, std::shared_ptr<ObjectModel>) INGEN_SIGNAL(new_plugin, void, std::shared_ptr<PluginModel>) diff --git a/include/ingen/client/GraphModel.hpp b/include/ingen/client/GraphModel.hpp index 59d1bb65..837a28a5 100644 --- a/include/ingen/client/GraphModel.hpp +++ b/include/ingen/client/GraphModel.hpp @@ -17,11 +17,10 @@ #ifndef INGEN_CLIENT_GRAPHMODEL_HPP #define INGEN_CLIENT_GRAPHMODEL_HPP -#include "ingen/Node.hpp" -#include "ingen/URIs.hpp" -#include "ingen/client/BlockModel.hpp" -#include "ingen/client/signal.hpp" -#include "ingen/ingen.h" +#include <ingen/Node.hpp> +#include <ingen/client/BlockModel.hpp> +#include <ingen/client/signal.hpp> +#include <ingen/ingen.h> #include <cstdint> #include <memory> @@ -32,12 +31,11 @@ class Path; namespace ingen { -class URI; +class URIs; namespace client { class ArcModel; -class ObjectModel; class PortModel; /** Client's model of a graph. @@ -55,7 +53,6 @@ public: get_arc(const ingen::Node* tail, const ingen::Node* head); bool enabled() const; - bool polyphonic() const; uint32_t internal_poly() const; // Signals @@ -67,12 +64,7 @@ public: private: friend class ClientStore; - GraphModel(URIs& uris, const raul::Path& graph_path) - : BlockModel(uris, - static_cast<const URI&>(uris.ingen_Graph), - graph_path) - { - } + GraphModel(URIs& uris, const raul::Path& graph_path); void clear() override; void add_child(const std::shared_ptr<ObjectModel>& c) override; diff --git a/include/ingen/client/ObjectModel.hpp b/include/ingen/client/ObjectModel.hpp index e92618f8..f9f0e041 100644 --- a/include/ingen/client/ObjectModel.hpp +++ b/include/ingen/client/ObjectModel.hpp @@ -21,19 +21,19 @@ #ifndef INGEN_CLIENT_OBJECTMODEL_HPP #define INGEN_CLIENT_OBJECTMODEL_HPP -#include "ingen/Node.hpp" -#include "ingen/URI.hpp" -#include "ingen/URIs.hpp" -#include "ingen/client/signal.hpp" -#include "ingen/ingen.h" -#include "raul/Path.hpp" -#include "raul/Symbol.hpp" +#include <ingen/Node.hpp> +#include <ingen/URIs.hpp> +#include <ingen/client/signal.hpp> +#include <ingen/ingen.h> +#include <raul/Path.hpp> +#include <raul/Symbol.hpp> #include <memory> namespace ingen { class Atom; +class URI; namespace client { diff --git a/include/ingen/client/PluginModel.hpp b/include/ingen/client/PluginModel.hpp index b0a61e94..37b71d0d 100644 --- a/include/ingen/client/PluginModel.hpp +++ b/include/ingen/client/PluginModel.hpp @@ -17,16 +17,16 @@ #ifndef INGEN_CLIENT_PLUGINMODEL_HPP #define INGEN_CLIENT_PLUGINMODEL_HPP -#include "ingen/Atom.hpp" -#include "ingen/Forge.hpp" -#include "ingen/Properties.hpp" -#include "ingen/Resource.hpp" -#include "ingen/URI.hpp" -#include "ingen/URIs.hpp" -#include "ingen/client/signal.hpp" -#include "ingen/ingen.h" -#include "lilv/lilv.h" -#include "raul/Symbol.hpp" +#include <ingen/Atom.hpp> +#include <ingen/Forge.hpp> +#include <ingen/Properties.hpp> +#include <ingen/Resource.hpp> +#include <ingen/URI.hpp> +#include <ingen/URIs.hpp> +#include <ingen/client/signal.hpp> +#include <ingen/ingen.h> +#include <lilv/lilv.h> +#include <raul/Symbol.hpp> #include <cstdint> #include <map> @@ -124,7 +124,7 @@ private: Atom _type; const LilvPlugin* _lilv_plugin; Presets _presets; - bool _fetched; + bool _fetched{false}; }; } // namespace client diff --git a/include/ingen/client/PluginUI.hpp b/include/ingen/client/PluginUI.hpp index 35a14bd2..6ecaed89 100644 --- a/include/ingen/client/PluginUI.hpp +++ b/include/ingen/client/PluginUI.hpp @@ -19,11 +19,11 @@ #include "signal.hpp" -#include "ingen/LV2Features.hpp" -#include "ingen/Resource.hpp" -#include "ingen/ingen.h" -#include "lilv/lilv.h" -#include "suil/suil.h" +#include <ingen/LV2Features.hpp> +#include <ingen/Resource.hpp> +#include <ingen/ingen.h> +#include <lilv/lilv.h> +#include <suil/suil.h> #include <cstdint> #include <memory> @@ -43,7 +43,8 @@ class BlockModel; * * @ingroup IngenClient */ -class INGEN_API PluginUI { +class INGEN_API PluginUI +{ public: ~PluginUI(); @@ -60,7 +61,7 @@ public: /** Instantiate the UI. * - * If true is returned, instantiation was successfull and the widget can be + * If true is returned, instantiation was successful and the widget can be * obtained with get_widget(). Otherwise, instantiation failed, so there is * no widget and the UI can not be used. */ @@ -81,11 +82,12 @@ public: * The application must connect to this signal to communicate with the * engine and/or update itself as necessary. */ - INGEN_SIGNAL(property_changed, void, - const URI&, // Subject - const URI&, // Predicate - const Atom&, // Object - Resource::Graph) // Context + INGEN_SIGNAL(property_changed, + void, + const URI&, // Subject + const URI&, // Predicate + const Atom&, // Object + Resource::Graph) // Context ingen::World& world() const { return _world; } std::shared_ptr<const BlockModel> block() const { return _block; } @@ -99,11 +101,11 @@ private: ingen::World& _world; std::shared_ptr<const BlockModel> _block; - SuilInstance* _instance; - LilvUIs* _uis; - const LilvUI* _ui; - LilvNode* _ui_node; - LilvNode* _ui_type; + SuilInstance* _instance{nullptr}; + LilvUIs* _uis{nullptr}; + const LilvUI* _ui{nullptr}; + LilvNode* _ui_node{nullptr}; + LilvNode* _ui_type{nullptr}; std::set<uint32_t> _subscribed_ports; static SuilHost* ui_host; diff --git a/include/ingen/client/PortModel.hpp b/include/ingen/client/PortModel.hpp index 9323b84b..c87f2f03 100644 --- a/include/ingen/client/PortModel.hpp +++ b/include/ingen/client/PortModel.hpp @@ -17,16 +17,14 @@ #ifndef INGEN_CLIENT_PORTMODEL_HPP #define INGEN_CLIENT_PORTMODEL_HPP -#include "ingen/Node.hpp" -#include "ingen/URI.hpp" -#include "ingen/URIs.hpp" -#include "ingen/client/ObjectModel.hpp" -#include "ingen/client/signal.hpp" -#include "ingen/ingen.h" -#include "raul/Path.hpp" +#include <ingen/Node.hpp> +#include <ingen/URIs.hpp> +#include <ingen/client/ObjectModel.hpp> +#include <ingen/client/signal.hpp> +#include <ingen/ingen.h> +#include <raul/Path.hpp> #include <cstdint> -#include <memory> #include <string> namespace ingen { @@ -48,10 +46,10 @@ public: bool supports(const URIs::Quark& value_type) const; - inline uint32_t index() const { return _index; } - inline const Atom& value() const { return get_property(_uris.ingen_value); } - inline bool is_input() const { return (_direction == Direction::INPUT); } - inline bool is_output() const { return (_direction == Direction::OUTPUT); } + uint32_t index() const { return _index; } + const Atom& value() const { return get_property(_uris.ingen_value); } + bool is_input() const { return (_direction == Direction::INPUT); } + bool is_output() const { return (_direction == Direction::OUTPUT); } bool port_property(const URIs::Quark& uri) const; @@ -65,7 +63,7 @@ public: } bool is_uri() const; - inline bool operator==(const PortModel& pm) const { return (path() == pm.path()); } + bool operator==(const PortModel& pm) const { return (path() == pm.path()); } void on_property(const URI& uri, const Atom& value) override; @@ -86,8 +84,8 @@ private: , _direction(dir) {} - void add_child(const std::shared_ptr<ObjectModel>& c) override { throw; } - bool remove_child(const std::shared_ptr<ObjectModel>& c) override { throw; } + void add_child(const std::shared_ptr<ObjectModel>& c) override; + bool remove_child(const std::shared_ptr<ObjectModel>& c) override; void set(const std::shared_ptr<ObjectModel>& model) override; diff --git a/include/ingen/client/SigClientInterface.hpp b/include/ingen/client/SigClientInterface.hpp index 51e05b50..52bceacc 100644 --- a/include/ingen/client/SigClientInterface.hpp +++ b/include/ingen/client/SigClientInterface.hpp @@ -17,14 +17,13 @@ #ifndef INGEN_CLIENT_SIGCLIENTINTERFACE_HPP #define INGEN_CLIENT_SIGCLIENTINTERFACE_HPP -#include "ingen/Interface.hpp" -#include "ingen/Message.hpp" -#include "ingen/URI.hpp" -#include "ingen/client/signal.hpp" -#include "ingen/ingen.h" +#include <ingen/Interface.hpp> +#include <ingen/Message.hpp> +#include <ingen/URI.hpp> +#include <ingen/client/signal.hpp> +#include <ingen/ingen.h> -namespace ingen { -namespace client { +namespace ingen::client { /** A LibSigC++ signal emitting interface for clients to use. * @@ -46,7 +45,7 @@ public: INGEN_SIGNAL(message, void, Message) - /** Fire pending signals. Only does anything on derived classes (that may queue) */ + /** Fire pending signals (for derived classes that may queue). */ virtual bool emit_signals() { return false; } protected: @@ -55,7 +54,6 @@ protected: } }; -} // namespace client -} // namespace ingen +} // namespace ingen::client #endif diff --git a/include/ingen/client/SocketClient.hpp b/include/ingen/client/SocketClient.hpp index 1e75ae80..23f8a3ff 100644 --- a/include/ingen/client/SocketClient.hpp +++ b/include/ingen/client/SocketClient.hpp @@ -14,21 +14,20 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef INGEN_CLIENT_SOCKET_CLIENT_HPP -#define INGEN_CLIENT_SOCKET_CLIENT_HPP +#ifndef INGEN_CLIENT_SOCKETCLIENT_HPP +#define INGEN_CLIENT_SOCKETCLIENT_HPP -#include "ingen/Log.hpp" -#include "ingen/SocketReader.hpp" -#include "ingen/SocketWriter.hpp" -#include "ingen/URI.hpp" -#include "ingen/World.hpp" -#include "ingen/ingen.h" -#include "raul/Socket.hpp" +#include <ingen/Log.hpp> +#include <ingen/SocketReader.hpp> +#include <ingen/SocketWriter.hpp> +#include <ingen/URI.hpp> +#include <ingen/World.hpp> +#include <ingen/ingen.h> +#include <raul/Socket.hpp> #include <cerrno> #include <cstring> #include <memory> -#include <string> namespace ingen { @@ -67,7 +66,7 @@ public: ? raul::Socket::Type::UNIX : raul::Socket::Type::TCP); - std::shared_ptr<raul::Socket> sock(new raul::Socket(type)); + const std::shared_ptr<raul::Socket> sock{new raul::Socket(type)}; if (!sock->connect(uri)) { world.log().error("Failed to connect <%1%> (%2%)\n", sock->uri(), strerror(errno)); @@ -87,7 +86,7 @@ private: SocketReader _reader; }; -} // namespace client -} // namespace ingen +} // namespace client +} // namespace ingen -#endif // INGEN_CLIENT_SOCKET_CLIENT_HPP +#endif // INGEN_CLIENT_SOCKETCLIENT_HPP diff --git a/include/ingen/client/client.h b/include/ingen/client/client.h new file mode 100644 index 00000000..6f7ac9b5 --- /dev/null +++ b/include/ingen/client/client.h @@ -0,0 +1,31 @@ +/* + This file is part of Ingen. + Copyright 2014-2022 David Robillard <http://drobilla.net/> + + Ingen is free software: you can redistribute it and/or modify it under the + terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or any later version. + + Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. + + You should have received a copy of the GNU Affero General Public License + along with Ingen. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef INGEN_CLIENT_CLIENT_H +#define INGEN_CLIENT_CLIENT_H + +#if defined(_WIN32) && !defined(INGEN_CLIENT_STATIC) && \ + defined(INGEN_CLIENT_INTERNAL) +# define INGEN_CLIENT_API __declspec(dllexport) +#elif defined(_WIN32) && !defined(INGEN_CLIENT_STATIC) +# define INGEN_CLIENT_API __declspec(dllimport) +#elif defined(__GNUC__) +# define INGEN_CLIENT_API __attribute__((visibility("default"))) +#else +# define INGEN_CLIENT_API +#endif + +#endif // INGEN_CLIENT_CLIENT_H |