From bb1c49dfa484db080938cff6f8f70167c9026a1c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 24 Jul 2007 19:26:47 +0000 Subject: Consistently rename all C++ files .cpp/.hpp. Fix (some) inclusion guard names to not clash with other libs. git-svn-id: http://svn.drobilla.net/lad/ingen@613 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/ConnectionModel.cpp | 6 +- src/libs/client/ConnectionModel.h | 77 ----------- src/libs/client/ConnectionModel.hpp | 77 +++++++++++ src/libs/client/ControlModel.h | 56 -------- src/libs/client/ControlModel.hpp | 56 ++++++++ src/libs/client/DeprecatedLoader.cpp | 18 +-- src/libs/client/DeprecatedLoader.h | 92 ------------- src/libs/client/DeprecatedLoader.hpp | 92 +++++++++++++ src/libs/client/DirectSigClientInterface.h | 115 ----------------- src/libs/client/DirectSigClientInterface.hpp | 115 +++++++++++++++++ src/libs/client/Makefile.am | 52 ++++---- src/libs/client/NodeModel.cpp | 4 +- src/libs/client/NodeModel.h | 98 -------------- src/libs/client/NodeModel.hpp | 98 ++++++++++++++ src/libs/client/OSCClientReceiver.cpp | 6 +- src/libs/client/OSCClientReceiver.h | 111 ---------------- src/libs/client/OSCClientReceiver.hpp | 111 ++++++++++++++++ src/libs/client/OSCEngineSender.cpp | 6 +- src/libs/client/OSCEngineSender.h | 160 ----------------------- src/libs/client/OSCEngineSender.hpp | 160 +++++++++++++++++++++++ src/libs/client/ObjectModel.cpp | 2 +- src/libs/client/ObjectModel.h | 96 -------------- src/libs/client/ObjectModel.hpp | 96 ++++++++++++++ src/libs/client/PatchModel.cpp | 6 +- src/libs/client/PatchModel.h | 106 --------------- src/libs/client/PatchModel.hpp | 106 +++++++++++++++ src/libs/client/PluginModel.cpp | 6 +- src/libs/client/PluginModel.h | 131 ------------------- src/libs/client/PluginModel.hpp | 131 +++++++++++++++++++ src/libs/client/PortModel.cpp | 2 +- src/libs/client/PortModel.h | 105 --------------- src/libs/client/PortModel.hpp | 105 +++++++++++++++ src/libs/client/PresetModel.h | 69 ---------- src/libs/client/PresetModel.hpp | 69 ++++++++++ src/libs/client/Serializer.cpp | 28 ++-- src/libs/client/Serializer.h | 86 ------------- src/libs/client/Serializer.hpp | 86 +++++++++++++ src/libs/client/SigClientInterface.h | 142 -------------------- src/libs/client/SigClientInterface.hpp | 142 ++++++++++++++++++++ src/libs/client/Store.cpp | 16 +-- src/libs/client/Store.h | 132 ------------------- src/libs/client/Store.hpp | 132 +++++++++++++++++++ src/libs/client/ThreadedSigClientInterface.cpp | 2 +- src/libs/client/ThreadedSigClientInterface.h | 171 ------------------------- src/libs/client/ThreadedSigClientInterface.hpp | 171 +++++++++++++++++++++++++ src/libs/client/client.cpp | 4 +- src/libs/client/client.h | 43 ------- src/libs/client/client.hpp | 43 +++++++ 48 files changed, 1869 insertions(+), 1869 deletions(-) delete mode 100644 src/libs/client/ConnectionModel.h create mode 100644 src/libs/client/ConnectionModel.hpp delete mode 100644 src/libs/client/ControlModel.h create mode 100644 src/libs/client/ControlModel.hpp delete mode 100644 src/libs/client/DeprecatedLoader.h create mode 100644 src/libs/client/DeprecatedLoader.hpp delete mode 100644 src/libs/client/DirectSigClientInterface.h create mode 100644 src/libs/client/DirectSigClientInterface.hpp delete mode 100644 src/libs/client/NodeModel.h create mode 100644 src/libs/client/NodeModel.hpp delete mode 100644 src/libs/client/OSCClientReceiver.h create mode 100644 src/libs/client/OSCClientReceiver.hpp delete mode 100644 src/libs/client/OSCEngineSender.h create mode 100644 src/libs/client/OSCEngineSender.hpp delete mode 100644 src/libs/client/ObjectModel.h create mode 100644 src/libs/client/ObjectModel.hpp delete mode 100644 src/libs/client/PatchModel.h create mode 100644 src/libs/client/PatchModel.hpp delete mode 100644 src/libs/client/PluginModel.h create mode 100644 src/libs/client/PluginModel.hpp delete mode 100644 src/libs/client/PortModel.h create mode 100644 src/libs/client/PortModel.hpp delete mode 100644 src/libs/client/PresetModel.h create mode 100644 src/libs/client/PresetModel.hpp delete mode 100644 src/libs/client/Serializer.h create mode 100644 src/libs/client/Serializer.hpp delete mode 100644 src/libs/client/SigClientInterface.h create mode 100644 src/libs/client/SigClientInterface.hpp delete mode 100644 src/libs/client/Store.h create mode 100644 src/libs/client/Store.hpp delete mode 100644 src/libs/client/ThreadedSigClientInterface.h create mode 100644 src/libs/client/ThreadedSigClientInterface.hpp delete mode 100644 src/libs/client/client.h create mode 100644 src/libs/client/client.hpp (limited to 'src/libs/client') diff --git a/src/libs/client/ConnectionModel.cpp b/src/libs/client/ConnectionModel.cpp index 4860a7db..a40da9e4 100644 --- a/src/libs/client/ConnectionModel.cpp +++ b/src/libs/client/ConnectionModel.cpp @@ -16,9 +16,9 @@ */ #include -#include "ConnectionModel.h" -#include "PortModel.h" -#include "PatchModel.h" +#include "ConnectionModel.hpp" +#include "PortModel.hpp" +#include "PatchModel.hpp" namespace Ingen { namespace Client { diff --git a/src/libs/client/ConnectionModel.h b/src/libs/client/ConnectionModel.h deleted file mode 100644 index 9e62d5b4..00000000 --- a/src/libs/client/ConnectionModel.h +++ /dev/null @@ -1,77 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef CONNECTIONMODEL_H -#define CONNECTIONMODEL_H - -#include -#include -#include -#include "PortModel.h" -#include -using std::string; - -namespace Ingen { -namespace Client { - -class Store; - - -/** Class to represent a port->port connection in the engine. - * - * This can either have pointers to the connection ports' models, or just - * paths as strings. The engine passes just strings (by necessity), but - * clients can set the pointers then they don't have to worry about port - * renaming, as the connections will always return the port's path, even - * if it changes. - * - * \ingroup IngenClient - */ -class ConnectionModel -{ -public: - SharedPtr src_port() const { return _src_port; } - SharedPtr dst_port() const { return _dst_port; } - - const Path& src_port_path() const; - const Path& dst_port_path() const; - -private: - friend class Store; - - ConnectionModel(const Path& src_port, const Path& dst_port); - ConnectionModel(SharedPtr src, SharedPtr dst); - - void set_src_port(SharedPtr port) { _src_port = port; _src_port_path = port->path(); } - void set_dst_port(SharedPtr port) { _dst_port = port; _dst_port_path = port->path(); } - - void src_port_path(const string& s) { _src_port_path = s; } - void dst_port_path(const string& s) { _dst_port_path = s; } - - Path _src_port_path; ///< Only used if _src_port == NULL - Path _dst_port_path; ///< Only used if _dst_port == NULL - SharedPtr _src_port; - SharedPtr _dst_port; -}; - -typedef list > ConnectionList; - - -} // namespace Client -} // namespace Ingen - -#endif // CONNECTIONMODEL_H diff --git a/src/libs/client/ConnectionModel.hpp b/src/libs/client/ConnectionModel.hpp new file mode 100644 index 00000000..59dacae7 --- /dev/null +++ b/src/libs/client/ConnectionModel.hpp @@ -0,0 +1,77 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CONNECTIONMODEL_H +#define CONNECTIONMODEL_H + +#include +#include +#include +#include "PortModel.hpp" +#include +using std::string; + +namespace Ingen { +namespace Client { + +class Store; + + +/** Class to represent a port->port connection in the engine. + * + * This can either have pointers to the connection ports' models, or just + * paths as strings. The engine passes just strings (by necessity), but + * clients can set the pointers then they don't have to worry about port + * renaming, as the connections will always return the port's path, even + * if it changes. + * + * \ingroup IngenClient + */ +class ConnectionModel +{ +public: + SharedPtr src_port() const { return _src_port; } + SharedPtr dst_port() const { return _dst_port; } + + const Path& src_port_path() const; + const Path& dst_port_path() const; + +private: + friend class Store; + + ConnectionModel(const Path& src_port, const Path& dst_port); + ConnectionModel(SharedPtr src, SharedPtr dst); + + void set_src_port(SharedPtr port) { _src_port = port; _src_port_path = port->path(); } + void set_dst_port(SharedPtr port) { _dst_port = port; _dst_port_path = port->path(); } + + void src_port_path(const string& s) { _src_port_path = s; } + void dst_port_path(const string& s) { _dst_port_path = s; } + + Path _src_port_path; ///< Only used if _src_port == NULL + Path _dst_port_path; ///< Only used if _dst_port == NULL + SharedPtr _src_port; + SharedPtr _dst_port; +}; + +typedef list > ConnectionList; + + +} // namespace Client +} // namespace Ingen + +#endif // CONNECTIONMODEL_H diff --git a/src/libs/client/ControlModel.h b/src/libs/client/ControlModel.h deleted file mode 100644 index 5729faec..00000000 --- a/src/libs/client/ControlModel.h +++ /dev/null @@ -1,56 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License alongCont - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef CONTROLMODEL_H -#define CONTROLMODEL_H - -#include -#include - -namespace Ingen { -namespace Client { - - -/** A single port's control setting (in a preset). - * - * \ingroup IngenClient - */ -class ControlModel -{ -public: - ControlModel(const Path& port_path, float value) - : _port_path(port_path), - _value(value) - { - assert(_port_path.find("//") == string::npos); - } - - const Path& port_path() const { return _port_path; } - void port_path(const string& p) { _port_path = p; } - float value() const { return _value; } - void value(float v) { _value = v; } - -private: - Path _port_path; - float _value; -}; - - -} // namespace Client -} // namespace Ingen - -#endif // CONTROLMODEL diff --git a/src/libs/client/ControlModel.hpp b/src/libs/client/ControlModel.hpp new file mode 100644 index 00000000..db0e156b --- /dev/null +++ b/src/libs/client/ControlModel.hpp @@ -0,0 +1,56 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License alongCont + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CONTROLMODEL_H +#define CONTROLMODEL_H + +#include +#include + +namespace Ingen { +namespace Client { + + +/** A single port's control setting (in a preset). + * + * \ingroup IngenClient + */ +class ControlModel +{ +public: + ControlModel(const Path& port_path, float value) + : _port_path(port_path), + _value(value) + { + assert(_port_path.find("//") == string::npos); + } + + const Path& port_path() const { return _port_path; } + void port_path(const string& p) { _port_path = p; } + float value() const { return _value; } + void value(float v) { _value = v; } + +private: + Path _port_path; + float _value; +}; + + +} // namespace Client +} // namespace Ingen + +#endif // CONTROLMODEL diff --git a/src/libs/client/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp index 3c95d9ac..c5354c5a 100644 --- a/src/libs/client/DeprecatedLoader.cpp +++ b/src/libs/client/DeprecatedLoader.cpp @@ -29,15 +29,15 @@ #include #include #include -#include -#include "interface/EngineInterface.h" -#include "PatchModel.h" -#include "NodeModel.h" -#include "ConnectionModel.h" -#include "PortModel.h" -#include "PresetModel.h" -#include "PluginModel.h" -#include "DeprecatedLoader.h" +#include +#include "interface/EngineInterface.hpp" +#include "PatchModel.hpp" +#include "NodeModel.hpp" +#include "ConnectionModel.hpp" +#include "PortModel.hpp" +#include "PresetModel.hpp" +#include "PluginModel.hpp" +#include "DeprecatedLoader.hpp" using std::string; using std::vector; using std::pair; using std::cerr; using std::cout; using std::endl; diff --git a/src/libs/client/DeprecatedLoader.h b/src/libs/client/DeprecatedLoader.h deleted file mode 100644 index 1bf81c9d..00000000 --- a/src/libs/client/DeprecatedLoader.h +++ /dev/null @@ -1,92 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PATCHLIBRARIAN_H -#define PATCHLIBRARIAN_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "interface/EngineInterface.h" -#include "ObjectModel.h" - -using std::string; -using Ingen::Shared::EngineInterface; - -namespace Ingen { -namespace Client { - -class PatchModel; -class NodeModel; -class ConnectionModel; -class PresetModel; - - -/** Loads deprecated (XML) patch files (from the Om days). - * - * \ingroup IngenClient - */ -class DeprecatedLoader -{ -public: - DeprecatedLoader(SharedPtr engine) - : /*_patch_search_path(".")*/ _engine(engine) - { - assert(_engine); - } - - /*void path(const string& path) { _patch_search_path = path; } - const string& path() { return _patch_search_path; }*/ - - string find_file(const string& filename, const string& additional_path = ""); - - string load_patch(const Glib::ustring& filename, - boost::optional parent_path, - string name, - size_t poly, - MetadataMap initial_data, - bool existing = false); - -private: - void add_metadata(MetadataMap& data, string key, string value); - - string nameify_if_invalid(const string& name); - string translate_load_path(const string& path); - - //string _patch_search_path; - SharedPtr _engine; - - /// Translations of paths from the loading file to actual paths (for deprecated patches) - std::map _load_path_translations; - - bool load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr cur); - bool load_connection(const Path& parent, xmlDocPtr doc, const xmlNodePtr cur); - bool load_preset(const Path& parent, xmlDocPtr doc, const xmlNodePtr cur); - bool load_subpatch(const Path& parent, xmlDocPtr doc, const xmlNodePtr cur); -}; - - -} // namespace Client -} // namespace Ingen - -#endif // PATCHLIBRARIAN_H diff --git a/src/libs/client/DeprecatedLoader.hpp b/src/libs/client/DeprecatedLoader.hpp new file mode 100644 index 00000000..593cfb33 --- /dev/null +++ b/src/libs/client/DeprecatedLoader.hpp @@ -0,0 +1,92 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PATCHLIBRARIAN_H +#define PATCHLIBRARIAN_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "interface/EngineInterface.hpp" +#include "ObjectModel.hpp" + +using std::string; +using Ingen::Shared::EngineInterface; + +namespace Ingen { +namespace Client { + +class PatchModel; +class NodeModel; +class ConnectionModel; +class PresetModel; + + +/** Loads deprecated (XML) patch files (from the Om days). + * + * \ingroup IngenClient + */ +class DeprecatedLoader +{ +public: + DeprecatedLoader(SharedPtr engine) + : /*_patch_search_path(".")*/ _engine(engine) + { + assert(_engine); + } + + /*void path(const string& path) { _patch_search_path = path; } + const string& path() { return _patch_search_path; }*/ + + string find_file(const string& filename, const string& additional_path = ""); + + string load_patch(const Glib::ustring& filename, + boost::optional parent_path, + string name, + size_t poly, + MetadataMap initial_data, + bool existing = false); + +private: + void add_metadata(MetadataMap& data, string key, string value); + + string nameify_if_invalid(const string& name); + string translate_load_path(const string& path); + + //string _patch_search_path; + SharedPtr _engine; + + /// Translations of paths from the loading file to actual paths (for deprecated patches) + std::map _load_path_translations; + + bool load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr cur); + bool load_connection(const Path& parent, xmlDocPtr doc, const xmlNodePtr cur); + bool load_preset(const Path& parent, xmlDocPtr doc, const xmlNodePtr cur); + bool load_subpatch(const Path& parent, xmlDocPtr doc, const xmlNodePtr cur); +}; + + +} // namespace Client +} // namespace Ingen + +#endif // PATCHLIBRARIAN_H diff --git a/src/libs/client/DirectSigClientInterface.h b/src/libs/client/DirectSigClientInterface.h deleted file mode 100644 index 18b1247b..00000000 --- a/src/libs/client/DirectSigClientInterface.h +++ /dev/null @@ -1,115 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef DIRECTSIGCLIENTINTERFACE_H -#define DIRECTSIGCLIENTINTERFACE_H - -#include -#include -#include -#include "SigClientInterface.h" -using std::string; - -namespace Ingen { -namespace Client { - - -/** A direct (nonthreaded) LibSigC++ signal emitting interface for clients to use. - * - * The signals from SigClientInterface will be emitted in the same thread as the - * ClientInterface functions are called. You can not set this directly as an - * in-engine client interface and connect the signals to GTK. - * - * For maximum performance of a monolithic single-client GUI app, it would be - * nice if the post processing thread in the engine could actually be the GTK - * thread, then you could use this directly and minimize queueing of events and - * thread/scheduling overhead. - * - * sed would have the copyright to this code if it was a legal person. - */ -class DirectSigClientInterface : virtual public SigClientInterface -{ -public: - DirectSigClientInterface(); - -private: - - // ClientInterface function implementations to drive SigClientInterface signals - - virtual void bundle_begin() - { bundle_begin_sig.emit(); } - - virtual void bundle_end() - { bundle_end_sig.emit(); } - - virtual void error(const string& msg) - { error_sig.emit(msg); } - - virtual void num_plugins(uint32_t num) - { num_plugins_sig.emit(num); } - - virtual void new_plugin(const string& type, const string& uri, const string& name) - { new_plugin_sig.emit(type, uri, name); } - - virtual void new_patch(const string& path, uint32_t poly) - { new_patch_sig.emit(path, poly); } - - virtual void new_node(const string& plugin_type, const string& plugin_uri, const string& node_path, bool is_polyphonic, uint32_t num_ports) - { new_node_sig.emit(plugin_type, plugin_uri, node_path, is_polyphonic, num_ports); } - - virtual void new_port(const string& path, const string& data_type, bool is_output) - { new_port_sig.emit(path, data_type, is_output); } - - virtual void patch_enabled(const string& path) - { patch_enabled_sig.emit(path); } - - virtual void patch_disabled(const string& path) - { patch_disabled_sig.emit(path); } - - virtual void patch_cleared(const string& path) - { patch_cleared_sig.emit(path); } - - virtual void object_renamed(const string& old_path, const string& new_path) - { object_renamed_sig.emit(old_path, new_path); } - - virtual void object_destroyed(const string& path) - { object_destroyed_sig.emit(path); } - - virtual void connection(const string& src_port_path, const string& dst_port_path) - { connection_sig.emit(src_port_path, dst_port_path); } - - virtual void disconnection(const string& src_port_path, const string& dst_port_path) - { disconnection_sig.emit(src_port_path, dst_port_path); } - - virtual void metadata_update(const string& subject_path, const string& predicate, const string& value) - { metadata_update_sig.emit(subject_path, predicate, value); } - - virtual void control_change(const string& port_path, float value) - { control_change_sig.emit(port_path, value); } - - virtual void program_add(const string& node_path, uint32_t bank, uint32_t program, const string& program_name) - { program_add_sig.emit(node_path, bank, program, program_name); } - - virtual void program_remove(const string& node_path, uint32_t bank, uint32_t program) - { program_remove_sig.emit(node_path, bank, program); } -}; - - -} // namespace Client -} // namespace Ingen - -#endif diff --git a/src/libs/client/DirectSigClientInterface.hpp b/src/libs/client/DirectSigClientInterface.hpp new file mode 100644 index 00000000..43877992 --- /dev/null +++ b/src/libs/client/DirectSigClientInterface.hpp @@ -0,0 +1,115 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef DIRECTSIGCLIENTINTERFACE_H +#define DIRECTSIGCLIENTINTERFACE_H + +#include +#include +#include +#include "SigClientInterface.hpp" +using std::string; + +namespace Ingen { +namespace Client { + + +/** A direct (nonthreaded) LibSigC++ signal emitting interface for clients to use. + * + * The signals from SigClientInterface will be emitted in the same thread as the + * ClientInterface functions are called. You can not set this directly as an + * in-engine client interface and connect the signals to GTK. + * + * For maximum performance of a monolithic single-client GUI app, it would be + * nice if the post processing thread in the engine could actually be the GTK + * thread, then you could use this directly and minimize queueing of events and + * thread/scheduling overhead. + * + * sed would have the copyright to this code if it was a legal person. + */ +class DirectSigClientInterface : virtual public SigClientInterface +{ +public: + DirectSigClientInterface(); + +private: + + // ClientInterface function implementations to drive SigClientInterface signals + + virtual void bundle_begin() + { bundle_begin_sig.emit(); } + + virtual void bundle_end() + { bundle_end_sig.emit(); } + + virtual void error(const string& msg) + { error_sig.emit(msg); } + + virtual void num_plugins(uint32_t num) + { num_plugins_sig.emit(num); } + + virtual void new_plugin(const string& type, const string& uri, const string& name) + { new_plugin_sig.emit(type, uri, name); } + + virtual void new_patch(const string& path, uint32_t poly) + { new_patch_sig.emit(path, poly); } + + virtual void new_node(const string& plugin_type, const string& plugin_uri, const string& node_path, bool is_polyphonic, uint32_t num_ports) + { new_node_sig.emit(plugin_type, plugin_uri, node_path, is_polyphonic, num_ports); } + + virtual void new_port(const string& path, const string& data_type, bool is_output) + { new_port_sig.emit(path, data_type, is_output); } + + virtual void patch_enabled(const string& path) + { patch_enabled_sig.emit(path); } + + virtual void patch_disabled(const string& path) + { patch_disabled_sig.emit(path); } + + virtual void patch_cleared(const string& path) + { patch_cleared_sig.emit(path); } + + virtual void object_renamed(const string& old_path, const string& new_path) + { object_renamed_sig.emit(old_path, new_path); } + + virtual void object_destroyed(const string& path) + { object_destroyed_sig.emit(path); } + + virtual void connection(const string& src_port_path, const string& dst_port_path) + { connection_sig.emit(src_port_path, dst_port_path); } + + virtual void disconnection(const string& src_port_path, const string& dst_port_path) + { disconnection_sig.emit(src_port_path, dst_port_path); } + + virtual void metadata_update(const string& subject_path, const string& predicate, const string& value) + { metadata_update_sig.emit(subject_path, predicate, value); } + + virtual void control_change(const string& port_path, float value) + { control_change_sig.emit(port_path, value); } + + virtual void program_add(const string& node_path, uint32_t bank, uint32_t program, const string& program_name) + { program_add_sig.emit(node_path, bank, program, program_name); } + + virtual void program_remove(const string& node_path, uint32_t bank, uint32_t program) + { program_remove_sig.emit(node_path, bank, program); } +}; + + +} // namespace Client +} // namespace Ingen + +#endif diff --git a/src/libs/client/Makefile.am b/src/libs/client/Makefile.am index 1c009868..45ec0bea 100644 --- a/src/libs/client/Makefile.am +++ b/src/libs/client/Makefile.am @@ -20,38 +20,38 @@ libingen_client_la_LIBADD = \ @LSIGCPP_LIBS@ @GLIBMM_LIBS@ libingen_client_la_SOURCES = \ - client.h \ - client.cpp \ - OSCEngineSender.h \ - OSCEngineSender.cpp \ - OSCClientReceiver.h \ + $(top_srcdir)/ingen/src/common/interface/ClientInterface.hpp \ + $(top_srcdir)/ingen/src/common/interface/EngineInterface.hpp \ + ConnectionModel.cpp \ + ConnectionModel.hpp \ + ControlModel.hpp \ + DeprecatedLoader.cpp \ + DeprecatedLoader.hpp \ + DirectSigClientInterface.hpp \ + NodeModel.cpp \ + NodeModel.hpp \ OSCClientReceiver.cpp \ - SigClientInterface.h \ - DirectSigClientInterface.h \ - ThreadedSigClientInterface.h \ - ThreadedSigClientInterface.cpp \ - PresetModel.h \ - ControlModel.h \ - ObjectModel.h \ + OSCClientReceiver.hpp \ + OSCEngineSender.cpp \ + OSCEngineSender.hpp \ ObjectModel.cpp \ - NodeModel.h \ - NodeModel.cpp \ - PortModel.h \ - PortModel.cpp \ - PatchModel.h \ + ObjectModel.hpp \ PatchModel.cpp \ - PluginModel.h \ + PatchModel.hpp \ PluginModel.cpp \ - Serializer.h \ + PluginModel.hpp \ + PortModel.cpp \ + PortModel.hpp \ + PresetModel.hpp \ Serializer.cpp \ - DeprecatedLoader.h \ - DeprecatedLoader.cpp \ - ConnectionModel.h \ - ConnectionModel.cpp \ - Store.h \ + Serializer.hpp \ + SigClientInterface.hpp \ Store.cpp \ - $(top_srcdir)/ingen/src/common/interface/ClientInterface.h \ - $(top_srcdir)/ingen/src/common/interface/EngineInterface.h + Store.hpp \ + ThreadedSigClientInterface.cpp \ + ThreadedSigClientInterface.hpp \ + client.cpp \ + client.hpp endif # BUILD_CLIENT_LIB diff --git a/src/libs/client/NodeModel.cpp b/src/libs/client/NodeModel.cpp index c3414c79..39c31c82 100644 --- a/src/libs/client/NodeModel.cpp +++ b/src/libs/client/NodeModel.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "NodeModel.h" -#include "PatchModel.h" +#include "NodeModel.hpp" +#include "PatchModel.hpp" #include namespace Ingen { diff --git a/src/libs/client/NodeModel.h b/src/libs/client/NodeModel.h deleted file mode 100644 index f8866f15..00000000 --- a/src/libs/client/NodeModel.h +++ /dev/null @@ -1,98 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef NODEMODEL_H -#define NODEMODEL_H - -#include -#include -#include -#include -#include -#include "ObjectModel.h" -#include "PortModel.h" -#include -#include -#include "PluginModel.h" - -using std::string; using std::map; using std::find; -using std::cout; using std::cerr; using std::endl; - -namespace Ingen { -namespace Client { - -class PluginModel; -class Store; - - -/** Node model class, used by the client to store engine's state. - * - * \ingroup IngenClient - */ -class NodeModel : public ObjectModel -{ -public: - virtual ~NodeModel(); - - SharedPtr get_port(const string& port_name) const; - - const map >& get_programs() const { return _banks; } - const string& plugin_uri() const { return _plugin_uri; } - SharedPtr plugin() const { return _plugin; } - int num_ports() const { return _ports.size(); } - const PortModelList& ports() const { return _ports; } - virtual bool polyphonic() const { return _polyphonic; } - - // Signals - sigc::signal > new_port_sig; - sigc::signal > removed_port_sig; - -protected: - friend class Store; - - NodeModel(const string& plugin_uri, const Path& path, bool polyphonic); - NodeModel(SharedPtr plugin, const Path& path, bool polyphonic); - - NodeModel(const Path& path); - void add_child(SharedPtr c); - void remove_child(SharedPtr c); - void add_port(SharedPtr pm); - void remove_port(SharedPtr pm); - void remove_port(const Path& port_path); - void add_program(int bank, int program, const string& name); - void remove_program(int bank, int program); - - virtual void clear(); - - friend class PatchModel; - void set_path(const Path& p); - - bool _polyphonic; - PortModelList _ports; ///< List of ports (not a map to preserve order) - string _plugin_uri; ///< Plugin URI (if PluginModel is unknown) - SharedPtr _plugin; ///< The plugin this node is an instance of - map > _banks; ///< DSSI banks -}; - - -typedef map > NodeModelMap; - - -} // namespace Client -} // namespace Ingen - -#endif // NODEMODEL_H diff --git a/src/libs/client/NodeModel.hpp b/src/libs/client/NodeModel.hpp new file mode 100644 index 00000000..68027526 --- /dev/null +++ b/src/libs/client/NodeModel.hpp @@ -0,0 +1,98 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef NODEMODEL_H +#define NODEMODEL_H + +#include +#include +#include +#include +#include +#include "ObjectModel.hpp" +#include "PortModel.hpp" +#include +#include +#include "PluginModel.hpp" + +using std::string; using std::map; using std::find; +using std::cout; using std::cerr; using std::endl; + +namespace Ingen { +namespace Client { + +class PluginModel; +class Store; + + +/** Node model class, used by the client to store engine's state. + * + * \ingroup IngenClient + */ +class NodeModel : public ObjectModel +{ +public: + virtual ~NodeModel(); + + SharedPtr get_port(const string& port_name) const; + + const map >& get_programs() const { return _banks; } + const string& plugin_uri() const { return _plugin_uri; } + SharedPtr plugin() const { return _plugin; } + int num_ports() const { return _ports.size(); } + const PortModelList& ports() const { return _ports; } + virtual bool polyphonic() const { return _polyphonic; } + + // Signals + sigc::signal > new_port_sig; + sigc::signal > removed_port_sig; + +protected: + friend class Store; + + NodeModel(const string& plugin_uri, const Path& path, bool polyphonic); + NodeModel(SharedPtr plugin, const Path& path, bool polyphonic); + + NodeModel(const Path& path); + void add_child(SharedPtr c); + void remove_child(SharedPtr c); + void add_port(SharedPtr pm); + void remove_port(SharedPtr pm); + void remove_port(const Path& port_path); + void add_program(int bank, int program, const string& name); + void remove_program(int bank, int program); + + virtual void clear(); + + friend class PatchModel; + void set_path(const Path& p); + + bool _polyphonic; + PortModelList _ports; ///< List of ports (not a map to preserve order) + string _plugin_uri; ///< Plugin URI (if PluginModel is unknown) + SharedPtr _plugin; ///< The plugin this node is an instance of + map > _banks; ///< DSSI banks +}; + + +typedef map > NodeModelMap; + + +} // namespace Client +} // namespace Ingen + +#endif // NODEMODEL_H diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp index d56b8f2e..96533db2 100644 --- a/src/libs/client/OSCClientReceiver.cpp +++ b/src/libs/client/OSCClientReceiver.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "OSCClientReceiver.h" -#include +#include "OSCClientReceiver.hpp" +#include #include #include #include @@ -132,7 +132,7 @@ OSCClientReceiver::error_cb(int num, const char* msg, const char* path) int OSCClientReceiver::unknown_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* user_data) { - string msg = "Received unknown OSC message: "; + std::string msg = "Received unknown OSC message: "; msg += path; cerr << msg << endl; diff --git a/src/libs/client/OSCClientReceiver.h b/src/libs/client/OSCClientReceiver.h deleted file mode 100644 index 91bd3d09..00000000 --- a/src/libs/client/OSCClientReceiver.h +++ /dev/null @@ -1,111 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef OSCCLIENTRECEIVER_H -#define OSCCLIENTRECEIVER_H - -#include -#include -#include -#include "interface/ClientInterface.h" - -namespace Ingen { - -/** Client library */ -namespace Client { - -//class NodeModel; -//class PresetModel; - -/* Some boilerplate killing macros... */ -#define LO_HANDLER_ARGS const char* path, const char* types, lo_arg** argv, int argc, lo_message msg - -/* Defines a static handler to be passed to lo_add_method, which is a trivial - * wrapper around a non-static method that does the real work. Makes a whoole - * lot of ugly boiler plate go away */ -#define LO_HANDLER(name) \ -int _##name##_cb (LO_HANDLER_ARGS);\ -inline static int name##_cb(LO_HANDLER_ARGS, void* osc_listener)\ -{ return ((OSCClientReceiver*)osc_listener)->_##name##_cb(path, types, argv, argc, msg); } - - -/** Callbacks for "notification band" OSC messages. - * - * Receives all notification of engine state, but not replies on the "control - * band". See OSC namespace documentation for details. - * - * Right now this class and Comm share the same lo_server_thread and the barrier - * between them is a bit odd, but eventually this class will be able to listen - * on a completely different port (ie have it's own lo_server_thread) to allow - * things like listening to the notification band over TCP while sending commands - * on the control band over UDP. - * - * \ingroup IngenClient - */ -class OSCClientReceiver : boost::noncopyable, virtual public Ingen::Shared::ClientInterface -{ -public: - OSCClientReceiver(int listen_port); - ~OSCClientReceiver(); - - // Engine side only - //void enable() {} - //void disable() {} - - void start(); - void stop(); - - int listen_port() { return _listen_port; } - string listen_url() { return lo_server_thread_get_url(_st); } - -private: - void setup_callbacks(); - - static void error_cb(int num, const char* msg, const char* path); - static int generic_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* user_data); - static int unknown_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* osc_receiver); - - int _listen_port; - lo_server_thread _st; - - LO_HANDLER(error); - LO_HANDLER(response); - LO_HANDLER(num_plugins); - LO_HANDLER(plugin); - LO_HANDLER(plugin_list_end); - LO_HANDLER(new_patch); - LO_HANDLER(destroyed); - LO_HANDLER(patch_enabled); - LO_HANDLER(patch_disabled); - LO_HANDLER(patch_cleared); - LO_HANDLER(object_renamed); - LO_HANDLER(connection); - LO_HANDLER(disconnection); - LO_HANDLER(new_node); - LO_HANDLER(new_port); - LO_HANDLER(metadata_update); - LO_HANDLER(control_change); - LO_HANDLER(program_add); - LO_HANDLER(program_remove); -}; - - -} // namespace Client - -} // namespace Ingen - -#endif // OSCCLIENTRECEIVER_H diff --git a/src/libs/client/OSCClientReceiver.hpp b/src/libs/client/OSCClientReceiver.hpp new file mode 100644 index 00000000..b27e7f78 --- /dev/null +++ b/src/libs/client/OSCClientReceiver.hpp @@ -0,0 +1,111 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef OSCCLIENTRECEIVER_H +#define OSCCLIENTRECEIVER_H + +#include +#include +#include +#include "interface/ClientInterface.hpp" + +namespace Ingen { + +/** Client library */ +namespace Client { + +//class NodeModel; +//class PresetModel; + +/* Some boilerplate killing macros... */ +#define LO_HANDLER_ARGS const char* path, const char* types, lo_arg** argv, int argc, lo_message msg + +/* Defines a static handler to be passed to lo_add_method, which is a trivial + * wrapper around a non-static method that does the real work. Makes a whoole + * lot of ugly boiler plate go away */ +#define LO_HANDLER(name) \ +int _##name##_cb (LO_HANDLER_ARGS);\ +inline static int name##_cb(LO_HANDLER_ARGS, void* osc_listener)\ +{ return ((OSCClientReceiver*)osc_listener)->_##name##_cb(path, types, argv, argc, msg); } + + +/** Callbacks for "notification band" OSC messages. + * + * Receives all notification of engine state, but not replies on the "control + * band". See OSC namespace documentation for details. + * + * Right now this class and Comm share the same lo_server_thread and the barrier + * between them is a bit odd, but eventually this class will be able to listen + * on a completely different port (ie have it's own lo_server_thread) to allow + * things like listening to the notification band over TCP while sending commands + * on the control band over UDP. + * + * \ingroup IngenClient + */ +class OSCClientReceiver : boost::noncopyable, virtual public Ingen::Shared::ClientInterface +{ +public: + OSCClientReceiver(int listen_port); + ~OSCClientReceiver(); + + // Engine side only + //void enable() {} + //void disable() {} + + void start(); + void stop(); + + int listen_port() { return _listen_port; } + std::string listen_url() { return lo_server_thread_get_url(_st); } + +private: + void setup_callbacks(); + + static void error_cb(int num, const char* msg, const char* path); + static int generic_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* user_data); + static int unknown_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* osc_receiver); + + int _listen_port; + lo_server_thread _st; + + LO_HANDLER(error); + LO_HANDLER(response); + LO_HANDLER(num_plugins); + LO_HANDLER(plugin); + LO_HANDLER(plugin_list_end); + LO_HANDLER(new_patch); + LO_HANDLER(destroyed); + LO_HANDLER(patch_enabled); + LO_HANDLER(patch_disabled); + LO_HANDLER(patch_cleared); + LO_HANDLER(object_renamed); + LO_HANDLER(connection); + LO_HANDLER(disconnection); + LO_HANDLER(new_node); + LO_HANDLER(new_port); + LO_HANDLER(metadata_update); + LO_HANDLER(control_change); + LO_HANDLER(program_add); + LO_HANDLER(program_remove); +}; + + +} // namespace Client + +} // namespace Ingen + +#endif // OSCCLIENTRECEIVER_H diff --git a/src/libs/client/OSCEngineSender.cpp b/src/libs/client/OSCEngineSender.cpp index 6ebf8df0..2e49eac3 100644 --- a/src/libs/client/OSCEngineSender.cpp +++ b/src/libs/client/OSCEngineSender.cpp @@ -16,9 +16,9 @@ */ #include -#include "OSCEngineSender.h" -#include "interface/ClientKey.h" -#include +#include "OSCEngineSender.hpp" +#include "interface/ClientKey.hpp" +#include using std::cout; using std::cerr; using std::endl; namespace Ingen { diff --git a/src/libs/client/OSCEngineSender.h b/src/libs/client/OSCEngineSender.h deleted file mode 100644 index 68163ec6..00000000 --- a/src/libs/client/OSCEngineSender.h +++ /dev/null @@ -1,160 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef OSCENGINESENDER_H -#define OSCENGINESENDER_H - -#include -#include -#include -#include "interface/EngineInterface.h" -#include "interface/Responder.h" -using std::string; -using Ingen::Shared::EngineInterface; -using Ingen::Shared::ClientInterface; -using Ingen::Shared::ClientKey; -using Ingen::Shared::Responder; - -namespace Ingen { -namespace Client { - - -/* OSC (via liblo) interface to the engine. - * - * Clients can use this opaquely as an EngineInterface* to control the engine - * over OSC (whether over a network or not, etc). - * - * \ingroup IngenClient - */ -class OSCEngineSender : public EngineInterface -{ -public: - OSCEngineSender(const string& engine_url); - - ~OSCEngineSender(); - - string engine_url() { return _engine_url; } - - inline size_t next_id() - { int32_t ret = (_id == -1) ? -1 : _id++; return ret; } - - void set_responder(SharedPtr responder) { throw; } - void set_next_response_id(int32_t id) { _id = id; } - void disable_responses() { _id = -1; } - - void attach(int32_t ping_id, bool block); - - - /* *** EngineInterface implementation below here *** */ - - // Client registration - void register_client(ClientKey key, SharedPtr client); - void unregister_client(ClientKey key); - - - // Engine commands - void load_plugins(); - void activate(); - void deactivate(); - void quit(); - - - // Object commands - - void create_patch(const string& path, - uint32_t poly); - - void create_port(const string& path, - const string& data_type, - bool is_output); - - void create_node(const string& path, - const string& plugin_uri, - bool polyphonic); - - void create_node(const string& path, - const string& plugin_type, - const string& library_name, - const string& plugin_label, - bool polyphonic); - - void rename(const string& old_path, - const string& new_name); - - void destroy(const string& path); - - void clear_patch(const string& patch_path); - - void enable_patch(const string& patch_path); - - void disable_patch(const string& patch_path); - - void connect(const string& src_port_path, - const string& dst_port_path); - - void disconnect(const string& src_port_path, - const string& dst_port_path); - - void disconnect_all(const string& node_path); - - void set_port_value(const string& port_path, - float val); - - void set_port_value(const string& port_path, - uint32_t voice, - float val); - - void set_port_value_queued(const string& port_path, - float val); - - void set_program(const string& node_path, - uint32_t bank, - uint32_t program); - - void midi_learn(const string& node_path); - - void set_metadata(const string& obj_path, - const string& predicate, - const Raul::Atom& value); - - // Requests // - - void ping(); - - void request_plugin(const string& uri); - - void request_object(const string& path); - - void request_port_value(const string& port_path); - - void request_plugins(); - - void request_all_objects(); - -protected: - string _engine_url; - lo_address _engine_addr; - int _client_port; - int32_t _id; -}; - - -} // namespace Client -} // namespace Ingen - -#endif // OSCENGINESENDER_H - diff --git a/src/libs/client/OSCEngineSender.hpp b/src/libs/client/OSCEngineSender.hpp new file mode 100644 index 00000000..c9b37ec8 --- /dev/null +++ b/src/libs/client/OSCEngineSender.hpp @@ -0,0 +1,160 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef OSCENGINESENDER_H +#define OSCENGINESENDER_H + +#include +#include +#include +#include "interface/EngineInterface.hpp" +#include "interface/Responder.hpp" +using std::string; +using Ingen::Shared::EngineInterface; +using Ingen::Shared::ClientInterface; +using Ingen::Shared::ClientKey; +using Ingen::Shared::Responder; + +namespace Ingen { +namespace Client { + + +/* OSC (via liblo) interface to the engine. + * + * Clients can use this opaquely as an EngineInterface* to control the engine + * over OSC (whether over a network or not, etc). + * + * \ingroup IngenClient + */ +class OSCEngineSender : public EngineInterface +{ +public: + OSCEngineSender(const string& engine_url); + + ~OSCEngineSender(); + + string engine_url() { return _engine_url; } + + inline size_t next_id() + { int32_t ret = (_id == -1) ? -1 : _id++; return ret; } + + void set_responder(SharedPtr responder) { throw; } + void set_next_response_id(int32_t id) { _id = id; } + void disable_responses() { _id = -1; } + + void attach(int32_t ping_id, bool block); + + + /* *** EngineInterface implementation below here *** */ + + // Client registration + void register_client(ClientKey key, SharedPtr client); + void unregister_client(ClientKey key); + + + // Engine commands + void load_plugins(); + void activate(); + void deactivate(); + void quit(); + + + // Object commands + + void create_patch(const string& path, + uint32_t poly); + + void create_port(const string& path, + const string& data_type, + bool is_output); + + void create_node(const string& path, + const string& plugin_uri, + bool polyphonic); + + void create_node(const string& path, + const string& plugin_type, + const string& library_name, + const string& plugin_label, + bool polyphonic); + + void rename(const string& old_path, + const string& new_name); + + void destroy(const string& path); + + void clear_patch(const string& patch_path); + + void enable_patch(const string& patch_path); + + void disable_patch(const string& patch_path); + + void connect(const string& src_port_path, + const string& dst_port_path); + + void disconnect(const string& src_port_path, + const string& dst_port_path); + + void disconnect_all(const string& node_path); + + void set_port_value(const string& port_path, + float val); + + void set_port_value(const string& port_path, + uint32_t voice, + float val); + + void set_port_value_queued(const string& port_path, + float val); + + void set_program(const string& node_path, + uint32_t bank, + uint32_t program); + + void midi_learn(const string& node_path); + + void set_metadata(const string& obj_path, + const string& predicate, + const Raul::Atom& value); + + // Requests // + + void ping(); + + void request_plugin(const string& uri); + + void request_object(const string& path); + + void request_port_value(const string& port_path); + + void request_plugins(); + + void request_all_objects(); + +protected: + string _engine_url; + lo_address _engine_addr; + int _client_port; + int32_t _id; +}; + + +} // namespace Client +} // namespace Ingen + +#endif // OSCENGINESENDER_H + diff --git a/src/libs/client/ObjectModel.cpp b/src/libs/client/ObjectModel.cpp index 7adc1edc..699d1ce7 100644 --- a/src/libs/client/ObjectModel.cpp +++ b/src/libs/client/ObjectModel.cpp @@ -15,7 +15,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "ObjectModel.h" +#include "ObjectModel.hpp" namespace Ingen { namespace Client { diff --git a/src/libs/client/ObjectModel.h b/src/libs/client/ObjectModel.h deleted file mode 100644 index d388475a..00000000 --- a/src/libs/client/ObjectModel.h +++ /dev/null @@ -1,96 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef OBJECTMODEL_H -#define OBJECTMODEL_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using std::string; using std::map; using std::find; -using std::cout; using std::cerr; using std::endl; -using Raul::Atom; -using Raul::Path; - -namespace Ingen { -namespace Client { - -typedef map MetadataMap; - - -/** Base class for all GraphObject models (NodeModel, PatchModel, PortModel). - * - * There are no non-const public methods intentionally, models are not allowed - * to be manipulated directly by anything (but the Store) because of the - * asynchronous nature of engine control. To change something, use the - * controller (which the model probably shouldn't have a reference to but oh - * well, it reduces Collection Hell) and wait for the result (as a signal - * from this Model). - * - * \ingroup IngenClient - */ -class ObjectModel : boost::noncopyable -{ -public: - virtual ~ObjectModel(); - - const Atom& get_metadata(const string& key) const; - void set_metadata(const string& key, const Atom& value) - { _metadata[key] = value; metadata_update_sig.emit(key, value); } - - const MetadataMap& metadata() const { return _metadata; } - inline const Path& path() const { return _path; } - SharedPtr parent() const { return _parent; } - - // Signals - sigc::signal metadata_update_sig; - sigc::signal destroyed_sig; - -protected: - friend class Store; - - ObjectModel(const Path& path); - - virtual void set_path(const Path& p) { _path = p; } - virtual void set_parent(SharedPtr p) { assert(p); _parent = p; } - virtual void add_child(SharedPtr c) = 0; - virtual void remove_child(SharedPtr c) = 0; - - void add_metadata(const MetadataMap& data); - - void set(SharedPtr model); - - Path _path; - SharedPtr _parent; - - MetadataMap _metadata; -}; - - -} // namespace Client -} // namespace Ingen - -#endif // OBJECTMODEL_H diff --git a/src/libs/client/ObjectModel.hpp b/src/libs/client/ObjectModel.hpp new file mode 100644 index 00000000..03abafba --- /dev/null +++ b/src/libs/client/ObjectModel.hpp @@ -0,0 +1,96 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef OBJECTMODEL_H +#define OBJECTMODEL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using std::string; using std::map; using std::find; +using std::cout; using std::cerr; using std::endl; +using Raul::Atom; +using Raul::Path; + +namespace Ingen { +namespace Client { + +typedef map MetadataMap; + + +/** Base class for all GraphObject models (NodeModel, PatchModel, PortModel). + * + * There are no non-const public methods intentionally, models are not allowed + * to be manipulated directly by anything (but the Store) because of the + * asynchronous nature of engine control. To change something, use the + * controller (which the model probably shouldn't have a reference to but oh + * well, it reduces Collection Hell) and wait for the result (as a signal + * from this Model). + * + * \ingroup IngenClient + */ +class ObjectModel : boost::noncopyable +{ +public: + virtual ~ObjectModel(); + + const Atom& get_metadata(const string& key) const; + void set_metadata(const string& key, const Atom& value) + { _metadata[key] = value; metadata_update_sig.emit(key, value); } + + const MetadataMap& metadata() const { return _metadata; } + inline const Path& path() const { return _path; } + SharedPtr parent() const { return _parent; } + + // Signals + sigc::signal metadata_update_sig; + sigc::signal destroyed_sig; + +protected: + friend class Store; + + ObjectModel(const Path& path); + + virtual void set_path(const Path& p) { _path = p; } + virtual void set_parent(SharedPtr p) { assert(p); _parent = p; } + virtual void add_child(SharedPtr c) = 0; + virtual void remove_child(SharedPtr c) = 0; + + void add_metadata(const MetadataMap& data); + + void set(SharedPtr model); + + Path _path; + SharedPtr _parent; + + MetadataMap _metadata; +}; + + +} // namespace Client +} // namespace Ingen + +#endif // OBJECTMODEL_H diff --git a/src/libs/client/PatchModel.cpp b/src/libs/client/PatchModel.cpp index 406dcbe9..85cf3dc7 100644 --- a/src/libs/client/PatchModel.cpp +++ b/src/libs/client/PatchModel.cpp @@ -15,9 +15,9 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "PatchModel.h" -#include "NodeModel.h" -#include "ConnectionModel.h" +#include "PatchModel.hpp" +#include "NodeModel.hpp" +#include "ConnectionModel.hpp" #include #include diff --git a/src/libs/client/PatchModel.h b/src/libs/client/PatchModel.h deleted file mode 100644 index faceef72..00000000 --- a/src/libs/client/PatchModel.h +++ /dev/null @@ -1,106 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PATCHMODEL_H -#define PATCHMODEL_H - -#include -#include -#include -#include -#include -#include "NodeModel.h" -#include -#include "ConnectionModel.h" - -using std::list; using std::string; using std::map; - -namespace Ingen { -namespace Client { - -class Store; - - -/** Client's model of a patch. - * - * \ingroup IngenClient - */ -class PatchModel : public NodeModel -{ -public: - const NodeModelMap& nodes() const { return _nodes; } - const ConnectionList& connections() const { return _connections; } - - SharedPtr get_connection(const string& src_port_path, const string& dst_port_path) const; - SharedPtr get_node(const string& node_name) const; - - void set_filename(const string& filename) { _filename = filename; } - - size_t poly() const { return _poly; } - const string& filename() const { return _filename; } - bool enabled() const { return _enabled; } - bool polyphonic() const; - - // Signals - sigc::signal > new_node_sig; - sigc::signal > removed_node_sig; - sigc::signal > new_connection_sig; - sigc::signal > removed_connection_sig; - sigc::signal enabled_sig; - sigc::signal disabled_sig; - -private: - friend class Store; - - PatchModel(const Path& patch_path, size_t internal_poly) - : NodeModel("ingen:patch", patch_path, false), // FIXME - _enabled(false), - _poly(internal_poly) - { - } - - void filename(const string& f) { _filename = f; } - void poly(size_t p) { _poly = p; } - void enable(); - void disable(); - void clear(); - void set_path(const Path& path); - void add_node(SharedPtr nm); - void remove_node(SharedPtr nm); - void add_child(SharedPtr c); - void remove_child(SharedPtr c); - - void add_connection(SharedPtr cm); - void remove_connection(const string& src_port_path, const string& dst_port_path); - - void rename_node(const Path& old_path, const Path& new_path); - void rename_node_port(const Path& old_path, const Path& new_path); - - NodeModelMap _nodes; - ConnectionList _connections; - string _filename; - bool _enabled; - size_t _poly; -}; - -typedef map > PatchModelMap; - - -} // namespace Client -} // namespace Ingen - -#endif // PATCHMODEL_H diff --git a/src/libs/client/PatchModel.hpp b/src/libs/client/PatchModel.hpp new file mode 100644 index 00000000..55040858 --- /dev/null +++ b/src/libs/client/PatchModel.hpp @@ -0,0 +1,106 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PATCHMODEL_H +#define PATCHMODEL_H + +#include +#include +#include +#include +#include +#include "NodeModel.hpp" +#include +#include "ConnectionModel.hpp" + +using std::list; using std::string; using std::map; + +namespace Ingen { +namespace Client { + +class Store; + + +/** Client's model of a patch. + * + * \ingroup IngenClient + */ +class PatchModel : public NodeModel +{ +public: + const NodeModelMap& nodes() const { return _nodes; } + const ConnectionList& connections() const { return _connections; } + + SharedPtr get_connection(const string& src_port_path, const string& dst_port_path) const; + SharedPtr get_node(const string& node_name) const; + + void set_filename(const string& filename) { _filename = filename; } + + size_t poly() const { return _poly; } + const string& filename() const { return _filename; } + bool enabled() const { return _enabled; } + bool polyphonic() const; + + // Signals + sigc::signal > new_node_sig; + sigc::signal > removed_node_sig; + sigc::signal > new_connection_sig; + sigc::signal > removed_connection_sig; + sigc::signal enabled_sig; + sigc::signal disabled_sig; + +private: + friend class Store; + + PatchModel(const Path& patch_path, size_t internal_poly) + : NodeModel("ingen:patch", patch_path, false), // FIXME + _enabled(false), + _poly(internal_poly) + { + } + + void filename(const string& f) { _filename = f; } + void poly(size_t p) { _poly = p; } + void enable(); + void disable(); + void clear(); + void set_path(const Path& path); + void add_node(SharedPtr nm); + void remove_node(SharedPtr nm); + void add_child(SharedPtr c); + void remove_child(SharedPtr c); + + void add_connection(SharedPtr cm); + void remove_connection(const string& src_port_path, const string& dst_port_path); + + void rename_node(const Path& old_path, const Path& new_path); + void rename_node_port(const Path& old_path, const Path& new_path); + + NodeModelMap _nodes; + ConnectionList _connections; + string _filename; + bool _enabled; + size_t _poly; +}; + +typedef map > PatchModelMap; + + +} // namespace Client +} // namespace Ingen + +#endif // PATCHMODEL_H diff --git a/src/libs/client/PluginModel.cpp b/src/libs/client/PluginModel.cpp index c8d44837..886a2fa6 100644 --- a/src/libs/client/PluginModel.cpp +++ b/src/libs/client/PluginModel.cpp @@ -16,9 +16,9 @@ */ #include -#include -#include "PluginModel.h" -#include "PatchModel.h" +#include +#include "PluginModel.hpp" +#include "PatchModel.hpp" namespace Ingen { diff --git a/src/libs/client/PluginModel.h b/src/libs/client/PluginModel.h deleted file mode 100644 index 6da388d6..00000000 --- a/src/libs/client/PluginModel.h +++ /dev/null @@ -1,131 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PLUGINMODEL_H -#define PLUGINMODEL_H - -#include "../../../../config/config.h" -#include -#include -#include -#include -#ifdef HAVE_SLV2 -#include -#endif -using std::string; using std::cerr; using std::endl; - -namespace Ingen { -namespace Client { - -class PatchModel; - - -/** Model for a plugin available for loading. - * - * \ingroup IngenClient - */ -class PluginModel -{ -public: - enum Type { Internal=0, LV2, DSSI, LADSPA, Patch }; - - PluginModel(const string& uri, const string& type_uri, const string& name) - : _uri(uri) - , _name(name) - { - set_type_from_uri(type_uri); -#ifdef HAVE_SLV2 - _slv2_plugin = slv2_plugins_get_by_uri(_slv2_plugins, uri.c_str()); -#endif - } - - Type type() const { return _type; } - void type(Type t) { _type = t; } - const string& uri() const { return _uri; } - void uri(const string& s) { _uri = s; } - const string& name() const { return _name; } - void name(const string& s) { _name = s; } - - /*const char* const type_string() const { - if (_type == LV2) return "LV2"; - else if (_type == LADSPA) return "LADSPA"; - else if (_type == DSSI) return "DSSI"; - else if (_type == Internal) return "Internal"; - else if (_type == Patch) return "Patch"; - else return ""; - }*/ - - const char* const type_uri() const { - if (_type == LV2) return "ingen:LV2"; - else if (_type == LADSPA) return "ingen:LADSPA"; - else if (_type == DSSI) return "ingen:DSSI"; - else if (_type == Internal) return "ingen:Internal"; - else if (_type == Patch) return "ingen:Patch"; - else return ""; - } - - /** DEPRECATED */ - void set_type(const string& type_string) { - if (type_string == "LV2") _type = LV2; - else if (type_string == "LADSPA") _type = LADSPA; - else if (type_string == "DSSI") _type = DSSI; - else if (type_string == "Internal") _type = Internal; - else if (type_string == "Patch") _type = Patch; - } - - void set_type_from_uri(const string& type_uri) { - if (type_uri.substr(0, 6) != "ingen:") { - cerr << "INVALID TYPE STRING!" << endl; - } else { - set_type(type_uri.substr(6)); - } - } - - string default_node_name(SharedPtr parent); - -#ifdef HAVE_SLV2 - SLV2Plugin slv2_plugin() { return _slv2_plugin; } - static SLV2World slv2_world() { return _slv2_world; } - - static void set_slv2_world(SLV2World world) { - _slv2_world = world; - slv2_world_load_all(_slv2_world); - _slv2_plugins = slv2_world_get_all_plugins(_slv2_world); - } - - void* gui(); -#endif - -private: - Type _type; - string _uri; - string _name; - -#ifdef HAVE_SLV2 - static SLV2World _slv2_world; - static SLV2Plugins _slv2_plugins; - - SLV2Plugin _slv2_plugin; -#endif -}; - - -} // namespace Client -} // namespace Ingen - -#endif // PLUGINMODEL_H - diff --git a/src/libs/client/PluginModel.hpp b/src/libs/client/PluginModel.hpp new file mode 100644 index 00000000..f02528d1 --- /dev/null +++ b/src/libs/client/PluginModel.hpp @@ -0,0 +1,131 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PLUGINMODEL_H +#define PLUGINMODEL_H + +#include "../../../../config/config.h" +#include +#include +#include +#include +#ifdef HAVE_SLV2 +#include +#endif +using std::string; using std::cerr; using std::endl; + +namespace Ingen { +namespace Client { + +class PatchModel; + + +/** Model for a plugin available for loading. + * + * \ingroup IngenClient + */ +class PluginModel +{ +public: + enum Type { Internal=0, LV2, DSSI, LADSPA, Patch }; + + PluginModel(const string& uri, const string& type_uri, const string& name) + : _uri(uri) + , _name(name) + { + set_type_from_uri(type_uri); +#ifdef HAVE_SLV2 + _slv2_plugin = slv2_plugins_get_by_uri(_slv2_plugins, uri.c_str()); +#endif + } + + Type type() const { return _type; } + void type(Type t) { _type = t; } + const string& uri() const { return _uri; } + void uri(const string& s) { _uri = s; } + const string& name() const { return _name; } + void name(const string& s) { _name = s; } + + /*const char* const type_string() const { + if (_type == LV2) return "LV2"; + else if (_type == LADSPA) return "LADSPA"; + else if (_type == DSSI) return "DSSI"; + else if (_type == Internal) return "Internal"; + else if (_type == Patch) return "Patch"; + else return ""; + }*/ + + const char* const type_uri() const { + if (_type == LV2) return "ingen:LV2"; + else if (_type == LADSPA) return "ingen:LADSPA"; + else if (_type == DSSI) return "ingen:DSSI"; + else if (_type == Internal) return "ingen:Internal"; + else if (_type == Patch) return "ingen:Patch"; + else return ""; + } + + /** DEPRECATED */ + void set_type(const string& type_string) { + if (type_string == "LV2") _type = LV2; + else if (type_string == "LADSPA") _type = LADSPA; + else if (type_string == "DSSI") _type = DSSI; + else if (type_string == "Internal") _type = Internal; + else if (type_string == "Patch") _type = Patch; + } + + void set_type_from_uri(const string& type_uri) { + if (type_uri.substr(0, 6) != "ingen:") { + cerr << "INVALID TYPE STRING!" << endl; + } else { + set_type(type_uri.substr(6)); + } + } + + string default_node_name(SharedPtr parent); + +#ifdef HAVE_SLV2 + SLV2Plugin slv2_plugin() { return _slv2_plugin; } + static SLV2World slv2_world() { return _slv2_world; } + + static void set_slv2_world(SLV2World world) { + _slv2_world = world; + slv2_world_load_all(_slv2_world); + _slv2_plugins = slv2_world_get_all_plugins(_slv2_world); + } + + void* gui(); +#endif + +private: + Type _type; + string _uri; + string _name; + +#ifdef HAVE_SLV2 + static SLV2World _slv2_world; + static SLV2Plugins _slv2_plugins; + + SLV2Plugin _slv2_plugin; +#endif +}; + + +} // namespace Client +} // namespace Ingen + +#endif // PLUGINMODEL_H + diff --git a/src/libs/client/PortModel.cpp b/src/libs/client/PortModel.cpp index 9be019ed..af80e250 100644 --- a/src/libs/client/PortModel.cpp +++ b/src/libs/client/PortModel.cpp @@ -15,7 +15,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "PortModel.h" +#include "PortModel.hpp" namespace Ingen { namespace Client { diff --git a/src/libs/client/PortModel.h b/src/libs/client/PortModel.h deleted file mode 100644 index c19db582..00000000 --- a/src/libs/client/PortModel.h +++ /dev/null @@ -1,105 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PORTMODEL_H -#define PORTMODEL_H - -#include -#include -#include -#include -#include -#include "ObjectModel.h" -#include -#include -using std::string; using std::list; using std::cerr; using std::endl; - -namespace Ingen { -namespace Client { - - -/** Model of a port. - * - * \ingroup IngenClient - */ -class PortModel : public ObjectModel -{ -public: - enum Direction { INPUT, OUTPUT }; - - inline string type() const { return _type; } - inline float value() const { return _current_val; } - inline bool connected() const { return (_connections > 0); } - inline bool is_input() const { return (_direction == INPUT); } - inline bool is_output() const { return (_direction == OUTPUT); } - inline bool is_audio() const { return (_type == "ingen:audio"); } - inline bool is_control() const { return (_type == "ingen:control"); } - inline bool is_midi() const { return (_type == "ingen:midi"); } - inline bool is_osc() const { return (_type == "ingen:osc"); } - - bool is_logarithmic() const; - bool is_integer() const; - bool is_toggle() const; - - inline bool operator==(const PortModel& pm) const { return (_path == pm._path); } - - inline void value(float val) - { - if (val != _current_val) { - _current_val = val; - control_change_sig.emit(val); - } - } - - // Signals - sigc::signal control_change_sig; ///< "Control" ports only - sigc::signal > connection_sig; - sigc::signal > disconnection_sig; - -private: - friend class Store; - - PortModel(const Path& path, const string& type, Direction dir) - : ObjectModel(path), - _type(type), - _direction(dir), - _current_val(0.0f), - _connections(0) - { - if (!is_audio() && !is_control() && !is_input()) - cerr << "[PortModel] Warning: Unknown port type" << endl; - } - - void add_child(SharedPtr c) { throw; } - void remove_child(SharedPtr c) { throw; } - - void connected_to(SharedPtr p) { ++_connections; connection_sig.emit(p); } - void disconnected_from(SharedPtr p) { --_connections; disconnection_sig.emit(p); } - - string _type; - Direction _direction; - float _current_val; - size_t _connections; -}; - -typedef list > PortModelList; - - -} // namespace Client -} // namespace Ingen - -#endif // PORTMODEL_H diff --git a/src/libs/client/PortModel.hpp b/src/libs/client/PortModel.hpp new file mode 100644 index 00000000..25573226 --- /dev/null +++ b/src/libs/client/PortModel.hpp @@ -0,0 +1,105 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PORTMODEL_H +#define PORTMODEL_H + +#include +#include +#include +#include +#include +#include "ObjectModel.hpp" +#include +#include +using std::string; using std::list; using std::cerr; using std::endl; + +namespace Ingen { +namespace Client { + + +/** Model of a port. + * + * \ingroup IngenClient + */ +class PortModel : public ObjectModel +{ +public: + enum Direction { INPUT, OUTPUT }; + + inline string type() const { return _type; } + inline float value() const { return _current_val; } + inline bool connected() const { return (_connections > 0); } + inline bool is_input() const { return (_direction == INPUT); } + inline bool is_output() const { return (_direction == OUTPUT); } + inline bool is_audio() const { return (_type == "ingen:audio"); } + inline bool is_control() const { return (_type == "ingen:control"); } + inline bool is_midi() const { return (_type == "ingen:midi"); } + inline bool is_osc() const { return (_type == "ingen:osc"); } + + bool is_logarithmic() const; + bool is_integer() const; + bool is_toggle() const; + + inline bool operator==(const PortModel& pm) const { return (_path == pm._path); } + + inline void value(float val) + { + if (val != _current_val) { + _current_val = val; + control_change_sig.emit(val); + } + } + + // Signals + sigc::signal control_change_sig; ///< "Control" ports only + sigc::signal > connection_sig; + sigc::signal > disconnection_sig; + +private: + friend class Store; + + PortModel(const Path& path, const string& type, Direction dir) + : ObjectModel(path), + _type(type), + _direction(dir), + _current_val(0.0f), + _connections(0) + { + if (!is_audio() && !is_control() && !is_input()) + cerr << "[PortModel] Warning: Unknown port type" << endl; + } + + void add_child(SharedPtr c) { throw; } + void remove_child(SharedPtr c) { throw; } + + void connected_to(SharedPtr p) { ++_connections; connection_sig.emit(p); } + void disconnected_from(SharedPtr p) { --_connections; disconnection_sig.emit(p); } + + string _type; + Direction _direction; + float _current_val; + size_t _connections; +}; + +typedef list > PortModelList; + + +} // namespace Client +} // namespace Ingen + +#endif // PORTMODEL_H diff --git a/src/libs/client/PresetModel.h b/src/libs/client/PresetModel.h deleted file mode 100644 index 69c42ed7..00000000 --- a/src/libs/client/PresetModel.h +++ /dev/null @@ -1,69 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License alongCont - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef PRESETMODEL_H -#define PRESETMODEL_H - -#include -#include -#include "ControlModel.h" - -using std::string; using std::list; - -namespace Ingen { -namespace Client { - - -/** Model of a preset (a collection of control settings). - * - * \ingroup IngenClient - */ -class PresetModel -{ -public: - PresetModel(const string& base_path) - : _base_path(base_path) - {} - - /** Add a control value to this preset. An empty string for a node_name - * means the port is on the patch itself (not a node in the patch). - */ - void add_control(const string& node_name, - const string& port_name, float value) - { - if (node_name != "") - _controls.push_back(ControlModel(_base_path + node_name +"/"+ port_name, value)); - else - _controls.push_back(ControlModel(_base_path + port_name, value)); - } - - const string& name() const { return _name; } - void name(const string& n) { _name = n; } - - const list& controls() const { return _controls; } - -private: - string _name; - string _base_path; - list _controls; -}; - - -} // namespace Client -} // namespace Ingen - -#endif // PRESETMODEL diff --git a/src/libs/client/PresetModel.hpp b/src/libs/client/PresetModel.hpp new file mode 100644 index 00000000..6cc557a5 --- /dev/null +++ b/src/libs/client/PresetModel.hpp @@ -0,0 +1,69 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License alongCont + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PRESETMODEL_H +#define PRESETMODEL_H + +#include +#include +#include "ControlModel.hpp" + +using std::string; using std::list; + +namespace Ingen { +namespace Client { + + +/** Model of a preset (a collection of control settings). + * + * \ingroup IngenClient + */ +class PresetModel +{ +public: + PresetModel(const string& base_path) + : _base_path(base_path) + {} + + /** Add a control value to this preset. An empty string for a node_name + * means the port is on the patch itself (not a node in the patch). + */ + void add_control(const string& node_name, + const string& port_name, float value) + { + if (node_name != "") + _controls.push_back(ControlModel(_base_path + node_name +"/"+ port_name, value)); + else + _controls.push_back(ControlModel(_base_path + port_name, value)); + } + + const string& name() const { return _name; } + void name(const string& n) { _name = n; } + + const list& controls() const { return _controls; } + +private: + string _name; + string _base_path; + list _controls; +}; + + +} // namespace Client +} // namespace Ingen + +#endif // PRESETMODEL diff --git a/src/libs/client/Serializer.cpp b/src/libs/client/Serializer.cpp index a59ec6cf..f0920be5 100644 --- a/src/libs/client/Serializer.cpp +++ b/src/libs/client/Serializer.cpp @@ -28,20 +28,20 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include "interface/EngineInterface.h" -#include "Serializer.h" -#include "PatchModel.h" -#include "NodeModel.h" -#include "ConnectionModel.h" -#include "PortModel.h" -#include "PresetModel.h" -#include "PluginModel.h" +#include +#include +#include +#include +#include +#include +#include "interface/EngineInterface.hpp" +#include "Serializer.hpp" +#include "PatchModel.hpp" +#include "NodeModel.hpp" +#include "ConnectionModel.hpp" +#include "PortModel.hpp" +#include "PresetModel.hpp" +#include "PluginModel.hpp" using namespace std; using namespace Raul; diff --git a/src/libs/client/Serializer.h b/src/libs/client/Serializer.h deleted file mode 100644 index 6095cb25..00000000 --- a/src/libs/client/Serializer.h +++ /dev/null @@ -1,86 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef SERIALIZER_H -#define SERIALIZER_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "ObjectModel.h" - -namespace Ingen { -namespace Client { - -class PluginModel; -class PatchModel; -class NodeModel; -class PortModel; -class ConnectionModel; -class PresetModel; - - -/** Serializes Ingen objects (patches, nodes, etc) to RDF. - * - * \ingroup IngenClient - */ -class Serializer -{ -public: - Serializer(Raul::RDF::World& world); - - void start_to_filename(const string& filename); - void start_to_string(); - - void serialize(SharedPtr object) throw (std::logic_error); - void serialize_connection(SharedPtr c) throw (std::logic_error); - - string finish(); - -private: - enum Mode { TO_FILE, TO_STRING }; - - void setup_prefixes(); - - void serialize_plugin(SharedPtr p); - - void serialize_patch(SharedPtr p, const Raul::RDF::Node& id); - void serialize_node(SharedPtr n, const Raul::RDF::Node& id); - void serialize_port(SharedPtr p, const Raul::RDF::Node& id); - - Raul::RDF::Node path_to_node_id(const Path& path); - - typedef std::map NodeMap; - Mode _mode; - NodeMap _node_map; - string _base_uri; - Raul::RDF::World& _world; - Raul::RDF::Model* _model; -}; - - -} // namespace Client -} // namespace Ingen - -#endif // SERIALIZER_H diff --git a/src/libs/client/Serializer.hpp b/src/libs/client/Serializer.hpp new file mode 100644 index 00000000..a42d99fa --- /dev/null +++ b/src/libs/client/Serializer.hpp @@ -0,0 +1,86 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SERIALIZER_H +#define SERIALIZER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ObjectModel.hpp" + +namespace Ingen { +namespace Client { + +class PluginModel; +class PatchModel; +class NodeModel; +class PortModel; +class ConnectionModel; +class PresetModel; + + +/** Serializes Ingen objects (patches, nodes, etc) to RDF. + * + * \ingroup IngenClient + */ +class Serializer +{ +public: + Serializer(Raul::RDF::World& world); + + void start_to_filename(const string& filename); + void start_to_string(); + + void serialize(SharedPtr object) throw (std::logic_error); + void serialize_connection(SharedPtr c) throw (std::logic_error); + + string finish(); + +private: + enum Mode { TO_FILE, TO_STRING }; + + void setup_prefixes(); + + void serialize_plugin(SharedPtr p); + + void serialize_patch(SharedPtr p, const Raul::RDF::Node& id); + void serialize_node(SharedPtr n, const Raul::RDF::Node& id); + void serialize_port(SharedPtr p, const Raul::RDF::Node& id); + + Raul::RDF::Node path_to_node_id(const Path& path); + + typedef std::map NodeMap; + Mode _mode; + NodeMap _node_map; + string _base_uri; + Raul::RDF::World& _world; + Raul::RDF::Model* _model; +}; + + +} // namespace Client +} // namespace Ingen + +#endif // SERIALIZER_H diff --git a/src/libs/client/SigClientInterface.h b/src/libs/client/SigClientInterface.h deleted file mode 100644 index a7f7761b..00000000 --- a/src/libs/client/SigClientInterface.h +++ /dev/null @@ -1,142 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef SIGCLIENTINTERFACE_H -#define SIGCLIENTINTERFACE_H - -#include -#include -#include -#include "interface/ClientInterface.h" -using std::string; - -namespace Ingen { -namespace Client { - - -/** A LibSigC++ signal emitting interface for clients to use. - * - * This simply emits an sigc signal for every event (eg OSC message) coming from - * the engine. Use Store (which extends this) if you want a nice client-side - * model of the engine. - * - * The signals here match the calls to ClientInterface exactly. See the - * documentation for ClientInterface for meanings of signal parameters. - */ -class SigClientInterface : virtual public Ingen::Shared::ClientInterface, public sigc::trackable -{ -public: - - // Signal parameters math up directly with ClientInterface calls - - sigc::signal response_sig; - sigc::signal bundle_begin_sig; - sigc::signal bundle_end_sig; - sigc::signal error_sig; - sigc::signal num_plugins_sig; - sigc::signal new_plugin_sig; - sigc::signal new_patch_sig; - sigc::signal new_node_sig; - sigc::signal new_port_sig; - sigc::signal patch_enabled_sig; - sigc::signal patch_disabled_sig; - sigc::signal patch_cleared_sig; - sigc::signal object_renamed_sig; - sigc::signal object_destroyed_sig; - sigc::signal connection_sig; - sigc::signal disconnection_sig; - sigc::signal metadata_update_sig; - sigc::signal control_change_sig; - sigc::signal program_add_sig; - sigc::signal program_remove_sig; - -protected: - - // ClientInterface hooks that fire the above signals - - // FIXME: implement for this (is implemented for ThreadedSigClientInterface) - void enable() { } - void disable() { } - - void bundle_begin() {} - void bundle_end() {} - - void transfer_begin() {} - void transfer_end() {} - - void num_plugins(uint32_t num) { num_plugins_sig.emit(num); } - - void response(int32_t id, bool success, string msg) - { response_sig.emit(id, success, msg); } - - void error(string msg) - { error_sig.emit(msg); } - - void new_plugin(string uri, string type_uri, string name) - { new_plugin_sig.emit(uri, type_uri, name); } - - void new_patch(string path, uint32_t poly) - { new_patch_sig.emit(path, poly); } - - void new_node(string plugin_uri, string node_path, bool is_polyphonic, uint32_t num_ports) - { new_node_sig.emit(plugin_uri, node_path, is_polyphonic, num_ports); } - - void new_port(string path, string data_type, bool is_output) - { new_port_sig.emit(path, data_type, is_output); } - - void connection(string src_port_path, string dst_port_path) - { connection_sig.emit(src_port_path, dst_port_path); } - - void object_destroyed(string path) - { object_destroyed_sig.emit(path); } - - void patch_enabled(string path) - { patch_enabled_sig.emit(path); } - - void patch_disabled(string path) - { patch_disabled_sig.emit(path); } - - void patch_cleared(string path) - { patch_cleared_sig.emit(path); } - - void object_renamed(string old_path, string new_path) - { object_renamed_sig.emit(old_path, new_path); } - - void disconnection(string src_port_path, string dst_port_path) - { disconnection_sig.emit(src_port_path, dst_port_path); } - - void metadata_update(string path, string key, Raul::Atom value) - { metadata_update_sig.emit(path, key, value); } - - void control_change(string port_path, float value) - { control_change_sig.emit(port_path, value); } - - void program_add(string path, uint32_t bank, uint32_t program, string name) - { program_add_sig.emit(path, bank, program, name); } - - void program_remove(string path, uint32_t bank, uint32_t program) - { program_remove_sig.emit(path, bank, program); } - -protected: - SigClientInterface() {} -}; - - -} // namespace Client -} // namespace Ingen - -#endif diff --git a/src/libs/client/SigClientInterface.hpp b/src/libs/client/SigClientInterface.hpp new file mode 100644 index 00000000..f19f4a5e --- /dev/null +++ b/src/libs/client/SigClientInterface.hpp @@ -0,0 +1,142 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SIGCLIENTINTERFACE_H +#define SIGCLIENTINTERFACE_H + +#include +#include +#include +#include "interface/ClientInterface.hpp" +using std::string; + +namespace Ingen { +namespace Client { + + +/** A LibSigC++ signal emitting interface for clients to use. + * + * This simply emits an sigc signal for every event (eg OSC message) coming from + * the engine. Use Store (which extends this) if you want a nice client-side + * model of the engine. + * + * The signals here match the calls to ClientInterface exactly. See the + * documentation for ClientInterface for meanings of signal parameters. + */ +class SigClientInterface : virtual public Ingen::Shared::ClientInterface, public sigc::trackable +{ +public: + + // Signal parameters math up directly with ClientInterface calls + + sigc::signal response_sig; + sigc::signal bundle_begin_sig; + sigc::signal bundle_end_sig; + sigc::signal error_sig; + sigc::signal num_plugins_sig; + sigc::signal new_plugin_sig; + sigc::signal new_patch_sig; + sigc::signal new_node_sig; + sigc::signal new_port_sig; + sigc::signal patch_enabled_sig; + sigc::signal patch_disabled_sig; + sigc::signal patch_cleared_sig; + sigc::signal object_renamed_sig; + sigc::signal object_destroyed_sig; + sigc::signal connection_sig; + sigc::signal disconnection_sig; + sigc::signal metadata_update_sig; + sigc::signal control_change_sig; + sigc::signal program_add_sig; + sigc::signal program_remove_sig; + +protected: + + // ClientInterface hooks that fire the above signals + + // FIXME: implement for this (is implemented for ThreadedSigClientInterface) + void enable() { } + void disable() { } + + void bundle_begin() {} + void bundle_end() {} + + void transfer_begin() {} + void transfer_end() {} + + void num_plugins(uint32_t num) { num_plugins_sig.emit(num); } + + void response(int32_t id, bool success, string msg) + { response_sig.emit(id, success, msg); } + + void error(string msg) + { error_sig.emit(msg); } + + void new_plugin(string uri, string type_uri, string name) + { new_plugin_sig.emit(uri, type_uri, name); } + + void new_patch(string path, uint32_t poly) + { new_patch_sig.emit(path, poly); } + + void new_node(string plugin_uri, string node_path, bool is_polyphonic, uint32_t num_ports) + { new_node_sig.emit(plugin_uri, node_path, is_polyphonic, num_ports); } + + void new_port(string path, string data_type, bool is_output) + { new_port_sig.emit(path, data_type, is_output); } + + void connection(string src_port_path, string dst_port_path) + { connection_sig.emit(src_port_path, dst_port_path); } + + void object_destroyed(string path) + { object_destroyed_sig.emit(path); } + + void patch_enabled(string path) + { patch_enabled_sig.emit(path); } + + void patch_disabled(string path) + { patch_disabled_sig.emit(path); } + + void patch_cleared(string path) + { patch_cleared_sig.emit(path); } + + void object_renamed(string old_path, string new_path) + { object_renamed_sig.emit(old_path, new_path); } + + void disconnection(string src_port_path, string dst_port_path) + { disconnection_sig.emit(src_port_path, dst_port_path); } + + void metadata_update(string path, string key, Raul::Atom value) + { metadata_update_sig.emit(path, key, value); } + + void control_change(string port_path, float value) + { control_change_sig.emit(port_path, value); } + + void program_add(string path, uint32_t bank, uint32_t program, string name) + { program_add_sig.emit(path, bank, program, name); } + + void program_remove(string path, uint32_t bank, uint32_t program) + { program_remove_sig.emit(path, bank, program); } + +protected: + SigClientInterface() {} +}; + + +} // namespace Client +} // namespace Ingen + +#endif diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index 5a989c3c..61c02698 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -15,14 +15,14 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "Store.h" -#include "ObjectModel.h" -#include "PatchModel.h" -#include "NodeModel.h" -#include "PortModel.h" -#include "PluginModel.h" -#include "PatchModel.h" -#include "SigClientInterface.h" +#include "Store.hpp" +#include "ObjectModel.hpp" +#include "PatchModel.hpp" +#include "NodeModel.hpp" +#include "PortModel.hpp" +#include "PluginModel.hpp" +#include "PatchModel.hpp" +#include "SigClientInterface.hpp" namespace Ingen { namespace Client { diff --git a/src/libs/client/Store.h b/src/libs/client/Store.h deleted file mode 100644 index e481fc2d..00000000 --- a/src/libs/client/Store.h +++ /dev/null @@ -1,132 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef STORE_H -#define STORE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include "interface/EngineInterface.h" -using std::string; using std::map; using std::list; -using Ingen::Shared::EngineInterface; -using Raul::Path; -using Raul::Atom; - -namespace Ingen { -namespace Client { - -class SigClientInterface; -class ObjectModel; -class PluginModel; -class PatchModel; -class NodeModel; -class PortModel; -class ConnectionModel; - - -/** Automatically manages models of objects in the engine. - * - * \ingroup IngenClient - */ -class Store : public sigc::trackable { // FIXME: is trackable necessary? -public: - Store(SharedPtr engine, SharedPtr emitter); - - SharedPtr plugin(const string& uri); - SharedPtr object(const Path& path); - - void clear(); - - size_t num_object() { return _objects.size(); } - - typedef map > Plugins; - const Plugins& plugins() const { return _plugins; } - - typedef map > Objects; - const Objects& objects() const { return _objects; } - - sigc::signal > new_object_sig; -private: - - void add_object(SharedPtr object); - SharedPtr remove_object(const Path& path); - - void add_plugin(SharedPtr plugin); - - SharedPtr connection_patch(const Path& src_port_path, const Path& dst_port_path); - - // It would be nice to integrate these somehow.. - - void add_orphan(SharedPtr orphan); - void resolve_orphans(SharedPtr parent); - - void add_connection_orphan(SharedPtr orphan); - void resolve_connection_orphans(SharedPtr port); - - void add_plugin_orphan(SharedPtr orphan); - void resolve_plugin_orphans(SharedPtr plugin); - - void add_metadata_orphan(const Path& subject, const string& predicate, const Atom& value); - void resolve_metadata_orphans(SharedPtr subject); - - // Slots for SigClientInterface signals - void destruction_event(const Path& path); - void new_plugin_event(const string& uri, const string& type_uri, const string& name); - void new_patch_event(const Path& path, uint32_t poly); - void new_node_event(const string& plugin_uri, const Path& node_path, bool is_polyphonic, uint32_t num_ports); - void new_port_event(const Path& path, const string& data_type, bool is_output); - void patch_enabled_event(const Path& path); - void patch_disabled_event(const Path& path); - void patch_cleared_event(const Path& path); - void metadata_update_event(const Path& subject_path, const string& predicate, const Atom& value); - void control_change_event(const Path& port_path, float value); - void connection_event(const Path& src_port_path, const Path& dst_port_path); - void disconnection_event(const Path& src_port_path, const Path& dst_port_path); - - SharedPtr _engine; - SharedPtr _emitter; - - - Objects _objects; ///< Map, keyed by Ingen path - Plugins _plugins; ///< Map, keyed by plugin URI - - /** Objects we've received, but depend on the existance of another unknown object. - * Keyed by the path of the depended-on object (for tolerance of orderless comms) */ - map > > _orphans; - - /** Same idea, except with plugins instead of parents. - * It's unfortunate everything doesn't just have a URI and this was the same.. ahem.. */ - map > > _plugin_orphans; - - /** Not orphans OF metadata like the above, but orphans which are metadata */ - map > > _metadata_orphans; - - /** Ditto */ - list > _connection_orphans; -}; - - -} // namespace Client -} // namespace Ingen - -#endif // STORE_H diff --git a/src/libs/client/Store.hpp b/src/libs/client/Store.hpp new file mode 100644 index 00000000..38814200 --- /dev/null +++ b/src/libs/client/Store.hpp @@ -0,0 +1,132 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef STORE_H +#define STORE_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "interface/EngineInterface.hpp" +using std::string; using std::map; using std::list; +using Ingen::Shared::EngineInterface; +using Raul::Path; +using Raul::Atom; + +namespace Ingen { +namespace Client { + +class SigClientInterface; +class ObjectModel; +class PluginModel; +class PatchModel; +class NodeModel; +class PortModel; +class ConnectionModel; + + +/** Automatically manages models of objects in the engine. + * + * \ingroup IngenClient + */ +class Store : public sigc::trackable { // FIXME: is trackable necessary? +public: + Store(SharedPtr engine, SharedPtr emitter); + + SharedPtr plugin(const string& uri); + SharedPtr object(const Path& path); + + void clear(); + + size_t num_object() { return _objects.size(); } + + typedef map > Plugins; + const Plugins& plugins() const { return _plugins; } + + typedef map > Objects; + const Objects& objects() const { return _objects; } + + sigc::signal > new_object_sig; +private: + + void add_object(SharedPtr object); + SharedPtr remove_object(const Path& path); + + void add_plugin(SharedPtr plugin); + + SharedPtr connection_patch(const Path& src_port_path, const Path& dst_port_path); + + // It would be nice to integrate these somehow.. + + void add_orphan(SharedPtr orphan); + void resolve_orphans(SharedPtr parent); + + void add_connection_orphan(SharedPtr orphan); + void resolve_connection_orphans(SharedPtr port); + + void add_plugin_orphan(SharedPtr orphan); + void resolve_plugin_orphans(SharedPtr plugin); + + void add_metadata_orphan(const Path& subject, const string& predicate, const Atom& value); + void resolve_metadata_orphans(SharedPtr subject); + + // Slots for SigClientInterface signals + void destruction_event(const Path& path); + void new_plugin_event(const string& uri, const string& type_uri, const string& name); + void new_patch_event(const Path& path, uint32_t poly); + void new_node_event(const string& plugin_uri, const Path& node_path, bool is_polyphonic, uint32_t num_ports); + void new_port_event(const Path& path, const string& data_type, bool is_output); + void patch_enabled_event(const Path& path); + void patch_disabled_event(const Path& path); + void patch_cleared_event(const Path& path); + void metadata_update_event(const Path& subject_path, const string& predicate, const Atom& value); + void control_change_event(const Path& port_path, float value); + void connection_event(const Path& src_port_path, const Path& dst_port_path); + void disconnection_event(const Path& src_port_path, const Path& dst_port_path); + + SharedPtr _engine; + SharedPtr _emitter; + + + Objects _objects; ///< Map, keyed by Ingen path + Plugins _plugins; ///< Map, keyed by plugin URI + + /** Objects we've received, but depend on the existance of another unknown object. + * Keyed by the path of the depended-on object (for tolerance of orderless comms) */ + map > > _orphans; + + /** Same idea, except with plugins instead of parents. + * It's unfortunate everything doesn't just have a URI and this was the same.. ahem.. */ + map > > _plugin_orphans; + + /** Not orphans OF metadata like the above, but orphans which are metadata */ + map > > _metadata_orphans; + + /** Ditto */ + list > _connection_orphans; +}; + + +} // namespace Client +} // namespace Ingen + +#endif // STORE_H diff --git a/src/libs/client/ThreadedSigClientInterface.cpp b/src/libs/client/ThreadedSigClientInterface.cpp index 6d4ac074..3b7af80c 100644 --- a/src/libs/client/ThreadedSigClientInterface.cpp +++ b/src/libs/client/ThreadedSigClientInterface.cpp @@ -15,7 +15,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "ThreadedSigClientInterface.h" +#include "ThreadedSigClientInterface.hpp" #include using std::cerr; using std::endl; diff --git a/src/libs/client/ThreadedSigClientInterface.h b/src/libs/client/ThreadedSigClientInterface.h deleted file mode 100644 index d0cb4e89..00000000 --- a/src/libs/client/ThreadedSigClientInterface.h +++ /dev/null @@ -1,171 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef THREADEDSIGCLIENTINTERFACE_H -#define THREADEDSIGCLIENTINTERFACE_H - -#include -#include -#include -#include "interface/ClientInterface.h" -#include "SigClientInterface.h" -#include -#include -using std::string; - -/** Returns nothing and takes no parameters (because they have all been bound) */ -typedef sigc::slot Closure; - -namespace Ingen { -namespace Client { - - -/** A LibSigC++ signal emitting interface for clients to use. - * - * This emits signals (possibly) in a different thread than the ClientInterface - * functions are called. It must be explicitly driven with the emit_signals() - * function, which fires all enqueued signals up until the present. You can - * use this in a GTK idle callback for receiving thread safe engine signals. - */ -class ThreadedSigClientInterface : public SigClientInterface -{ -public: - ThreadedSigClientInterface(uint32_t queue_size) - : _enabled(true) - , _sigs(queue_size) - , response_slot(response_sig.make_slot()) - , error_slot(error_sig.make_slot()) - , new_plugin_slot(new_plugin_sig.make_slot()) - , new_patch_slot(new_patch_sig.make_slot()) - , new_node_slot(new_node_sig.make_slot()) - , new_port_slot(new_port_sig.make_slot()) - , connection_slot(connection_sig.make_slot()) - , patch_enabled_slot(patch_enabled_sig.make_slot()) - , patch_disabled_slot(patch_disabled_sig.make_slot()) - , patch_cleared_slot(patch_cleared_sig.make_slot()) - , object_destroyed_slot(object_destroyed_sig.make_slot()) - , object_renamed_slot(object_renamed_sig.make_slot()) - , disconnection_slot(disconnection_sig.make_slot()) - , metadata_update_slot(metadata_update_sig.make_slot()) - , control_change_slot(control_change_sig.make_slot()) - , program_add_slot(program_add_sig.make_slot()) - , program_remove_slot(program_remove_sig.make_slot()) - {} - - void enable() { _enabled = true; } - void disable() { _enabled = false ; } - - // FIXME: make this insert bundle-boundary-events, where the GTK thread - // process all events between start and finish in one cycle, guaranteed - // (no more node jumping) - void bundle_begin() {} - void bundle_end() {} - - void transfer_begin() {} - void transfer_end() {} - - void num_plugins(uint32_t num) { _num_plugins = num; } - - void response(int32_t id, bool success, string msg) - { push_sig(sigc::bind(response_slot, id, success, msg)); } - - void error(string msg) - { push_sig(sigc::bind(error_slot, msg)); } - - void new_plugin(string uri, string type_uri, string name) - { push_sig(sigc::bind(new_plugin_slot, uri, type_uri, name)); } - - void new_patch(string path, uint32_t poly) - { push_sig(sigc::bind(new_patch_slot, path, poly)); } - - void new_node(string plugin_uri, string node_path, bool is_polyphonic, uint32_t num_ports) - { push_sig(sigc::bind(new_node_slot, plugin_uri, node_path, is_polyphonic, num_ports)); } - - void new_port(string path, string data_type, bool is_output) - { push_sig(sigc::bind(new_port_slot, path, data_type, is_output)); } - - void connection(string src_port_path, string dst_port_path) - { push_sig(sigc::bind(connection_slot, src_port_path, dst_port_path)); } - - void object_destroyed(string path) - { push_sig(sigc::bind(object_destroyed_slot, path)); } - - void patch_enabled(string path) - { push_sig(sigc::bind(patch_enabled_slot, path)); } - - void patch_disabled(string path) - { push_sig(sigc::bind(patch_disabled_slot, path)); } - - void patch_cleared(string path) - { push_sig(sigc::bind(patch_cleared_slot, path)); } - - void object_renamed(string old_path, string new_path) - { push_sig(sigc::bind(object_renamed_slot, old_path, new_path)); } - - void disconnection(string src_port_path, string dst_port_path) - { push_sig(sigc::bind(disconnection_slot, src_port_path, dst_port_path)); } - - void metadata_update(string path, string key, Raul::Atom value) - { push_sig(sigc::bind(metadata_update_slot, path, key, value)); } - - void control_change(string port_path, float value) - { push_sig(sigc::bind(control_change_slot, port_path, value)); } - - void program_add(string path, uint32_t bank, uint32_t program, string name) - { push_sig(sigc::bind(program_add_slot, path, bank, program, name)); } - - void program_remove(string path, uint32_t bank, uint32_t program) - { push_sig(sigc::bind(program_remove_slot, path, bank, program)); } - - /** Process all queued events - Called from GTK thread to emit signals. */ - bool emit_signals(); - -private: - void push_sig(Closure ev); - - bool _enabled; - - Raul::SRSWQueue _sigs; - uint32_t _num_plugins; - - sigc::slot bundle_begin_slot; - sigc::slot bundle_end_slot; - sigc::slot num_plugins_slot; - sigc::slot response_slot; - sigc::slot error_slot; - sigc::slot new_plugin_slot; - sigc::slot new_patch_slot; - sigc::slot new_node_slot; - sigc::slot new_port_slot; - sigc::slot connection_slot; - sigc::slot patch_enabled_slot; - sigc::slot patch_disabled_slot; - sigc::slot patch_cleared_slot; - sigc::slot object_destroyed_slot; - sigc::slot object_renamed_slot; - sigc::slot disconnection_slot; - sigc::slot metadata_update_slot; - sigc::slot control_change_slot; - sigc::slot program_add_slot; - sigc::slot program_remove_slot; -}; - - -} // namespace Client -} // namespace Ingen - -#endif diff --git a/src/libs/client/ThreadedSigClientInterface.hpp b/src/libs/client/ThreadedSigClientInterface.hpp new file mode 100644 index 00000000..b6908a1c --- /dev/null +++ b/src/libs/client/ThreadedSigClientInterface.hpp @@ -0,0 +1,171 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef THREADEDSIGCLIENTINTERFACE_H +#define THREADEDSIGCLIENTINTERFACE_H + +#include +#include +#include +#include "interface/ClientInterface.hpp" +#include "SigClientInterface.hpp" +#include +#include +using std::string; + +/** Returns nothing and takes no parameters (because they have all been bound) */ +typedef sigc::slot Closure; + +namespace Ingen { +namespace Client { + + +/** A LibSigC++ signal emitting interface for clients to use. + * + * This emits signals (possibly) in a different thread than the ClientInterface + * functions are called. It must be explicitly driven with the emit_signals() + * function, which fires all enqueued signals up until the present. You can + * use this in a GTK idle callback for receiving thread safe engine signals. + */ +class ThreadedSigClientInterface : public SigClientInterface +{ +public: + ThreadedSigClientInterface(uint32_t queue_size) + : _enabled(true) + , _sigs(queue_size) + , response_slot(response_sig.make_slot()) + , error_slot(error_sig.make_slot()) + , new_plugin_slot(new_plugin_sig.make_slot()) + , new_patch_slot(new_patch_sig.make_slot()) + , new_node_slot(new_node_sig.make_slot()) + , new_port_slot(new_port_sig.make_slot()) + , connection_slot(connection_sig.make_slot()) + , patch_enabled_slot(patch_enabled_sig.make_slot()) + , patch_disabled_slot(patch_disabled_sig.make_slot()) + , patch_cleared_slot(patch_cleared_sig.make_slot()) + , object_destroyed_slot(object_destroyed_sig.make_slot()) + , object_renamed_slot(object_renamed_sig.make_slot()) + , disconnection_slot(disconnection_sig.make_slot()) + , metadata_update_slot(metadata_update_sig.make_slot()) + , control_change_slot(control_change_sig.make_slot()) + , program_add_slot(program_add_sig.make_slot()) + , program_remove_slot(program_remove_sig.make_slot()) + {} + + void enable() { _enabled = true; } + void disable() { _enabled = false ; } + + // FIXME: make this insert bundle-boundary-events, where the GTK thread + // process all events between start and finish in one cycle, guaranteed + // (no more node jumping) + void bundle_begin() {} + void bundle_end() {} + + void transfer_begin() {} + void transfer_end() {} + + void num_plugins(uint32_t num) { _num_plugins = num; } + + void response(int32_t id, bool success, string msg) + { push_sig(sigc::bind(response_slot, id, success, msg)); } + + void error(string msg) + { push_sig(sigc::bind(error_slot, msg)); } + + void new_plugin(string uri, string type_uri, string name) + { push_sig(sigc::bind(new_plugin_slot, uri, type_uri, name)); } + + void new_patch(string path, uint32_t poly) + { push_sig(sigc::bind(new_patch_slot, path, poly)); } + + void new_node(string plugin_uri, string node_path, bool is_polyphonic, uint32_t num_ports) + { push_sig(sigc::bind(new_node_slot, plugin_uri, node_path, is_polyphonic, num_ports)); } + + void new_port(string path, string data_type, bool is_output) + { push_sig(sigc::bind(new_port_slot, path, data_type, is_output)); } + + void connection(string src_port_path, string dst_port_path) + { push_sig(sigc::bind(connection_slot, src_port_path, dst_port_path)); } + + void object_destroyed(string path) + { push_sig(sigc::bind(object_destroyed_slot, path)); } + + void patch_enabled(string path) + { push_sig(sigc::bind(patch_enabled_slot, path)); } + + void patch_disabled(string path) + { push_sig(sigc::bind(patch_disabled_slot, path)); } + + void patch_cleared(string path) + { push_sig(sigc::bind(patch_cleared_slot, path)); } + + void object_renamed(string old_path, string new_path) + { push_sig(sigc::bind(object_renamed_slot, old_path, new_path)); } + + void disconnection(string src_port_path, string dst_port_path) + { push_sig(sigc::bind(disconnection_slot, src_port_path, dst_port_path)); } + + void metadata_update(string path, string key, Raul::Atom value) + { push_sig(sigc::bind(metadata_update_slot, path, key, value)); } + + void control_change(string port_path, float value) + { push_sig(sigc::bind(control_change_slot, port_path, value)); } + + void program_add(string path, uint32_t bank, uint32_t program, string name) + { push_sig(sigc::bind(program_add_slot, path, bank, program, name)); } + + void program_remove(string path, uint32_t bank, uint32_t program) + { push_sig(sigc::bind(program_remove_slot, path, bank, program)); } + + /** Process all queued events - Called from GTK thread to emit signals. */ + bool emit_signals(); + +private: + void push_sig(Closure ev); + + bool _enabled; + + Raul::SRSWQueue _sigs; + uint32_t _num_plugins; + + sigc::slot bundle_begin_slot; + sigc::slot bundle_end_slot; + sigc::slot num_plugins_slot; + sigc::slot response_slot; + sigc::slot error_slot; + sigc::slot new_plugin_slot; + sigc::slot new_patch_slot; + sigc::slot new_node_slot; + sigc::slot new_port_slot; + sigc::slot connection_slot; + sigc::slot patch_enabled_slot; + sigc::slot patch_disabled_slot; + sigc::slot patch_cleared_slot; + sigc::slot object_destroyed_slot; + sigc::slot object_renamed_slot; + sigc::slot disconnection_slot; + sigc::slot metadata_update_slot; + sigc::slot control_change_slot; + sigc::slot program_add_slot; + sigc::slot program_remove_slot; +}; + + +} // namespace Client +} // namespace Ingen + +#endif diff --git a/src/libs/client/client.cpp b/src/libs/client/client.cpp index da28a342..8b86e958 100644 --- a/src/libs/client/client.cpp +++ b/src/libs/client/client.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "client.h" -#include "OSCEngineSender.h" +#include "client.hpp" +#include "OSCEngineSender.hpp" namespace Ingen { namespace Client { diff --git a/src/libs/client/client.h b/src/libs/client/client.h deleted file mode 100644 index fa4ad6c9..00000000 --- a/src/libs/client/client.h +++ /dev/null @@ -1,43 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef INGEN_CLIENT_H -#define INGEN_CLIENT_H - -#include - -namespace Ingen { - -class Engine; - -namespace Shared { class EngineInterface; } - -namespace Client { - -extern "C" { - - SharedPtr new_osc_interface(const std::string& url); - SharedPtr new_queued_interface(SharedPtr engine); - -} - - -} // namespace Client -} // namespace Ingen - -#endif // INGEN_CLIENT_H - diff --git a/src/libs/client/client.hpp b/src/libs/client/client.hpp new file mode 100644 index 00000000..931e4c45 --- /dev/null +++ b/src/libs/client/client.hpp @@ -0,0 +1,43 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard + * + * Ingen is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at your option) 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 General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef INGEN_CLIENT_H +#define INGEN_CLIENT_H + +#include + +namespace Ingen { + +class Engine; + +namespace Shared { class EngineInterface; } + +namespace Client { + +extern "C" { + + SharedPtr new_osc_interface(const std::string& url); + SharedPtr new_queued_interface(SharedPtr engine); + +} + + +} // namespace Client +} // namespace Ingen + +#endif // INGEN_CLIENT_H + -- cgit v1.2.1