From 671f6b557aceba0ffa82b0107e692e2a667b0965 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 13 Aug 2008 19:14:47 +0000 Subject: Move crap (now) only used internally by deprecated loader to DeprecatedLoader.cpp. git-svn-id: http://svn.drobilla.net/lad/ingen@1352 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/ControlModel.hpp | 56 --------------------------- src/libs/client/DeprecatedLoader.cpp | 60 ++++++++++++++++++++++++++++- src/libs/client/DeprecatedLoader.hpp | 2 +- src/libs/client/Makefile.am | 2 - src/libs/client/OSCClientReceiver.hpp | 1 - src/libs/client/PresetModel.hpp | 72 ----------------------------------- src/libs/gui/NodeModule.hpp | 1 - src/libs/gui/PatchPortModule.hpp | 1 - src/libs/gui/PatchView.hpp | 1 - src/libs/gui/PatchWindow.hpp | 1 - src/libs/gui/Port.cpp | 1 - 11 files changed, 60 insertions(+), 138 deletions(-) delete mode 100644 src/libs/client/ControlModel.hpp delete mode 100644 src/libs/client/PresetModel.hpp (limited to 'src/libs') diff --git a/src/libs/client/ControlModel.hpp b/src/libs/client/ControlModel.hpp deleted file mode 100644 index b2a192e4..00000000 --- a/src/libs/client/ControlModel.hpp +++ /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/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp index e5179fa0..d064830b 100644 --- a/src/libs/client/DeprecatedLoader.cpp +++ b/src/libs/client/DeprecatedLoader.cpp @@ -35,7 +35,6 @@ #include "NodeModel.hpp" #include "ConnectionModel.hpp" #include "PortModel.hpp" -#include "PresetModel.hpp" #include "PluginModel.hpp" #include "DeprecatedLoader.hpp" @@ -44,6 +43,65 @@ using namespace std; 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; +}; + + +/** 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, string port_name, float value) { + if (port_name == "note_number") // FIXME: filthy kludge + port_name = "note"; + + 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; +}; + + string DeprecatedLoader::nameify_if_invalid(const string& name) { diff --git a/src/libs/client/DeprecatedLoader.hpp b/src/libs/client/DeprecatedLoader.hpp index 209e1f1c..c1af52c2 100644 --- a/src/libs/client/DeprecatedLoader.hpp +++ b/src/libs/client/DeprecatedLoader.hpp @@ -41,7 +41,7 @@ namespace Client { class PatchModel; class NodeModel; class ConnectionModel; -class PresetModel; +class PresetModel; // defined in DeprecatedLoader.cpp /** Loads deprecated (XML) patch files (from the Om days). diff --git a/src/libs/client/Makefile.am b/src/libs/client/Makefile.am index 6c55ab57..f111a54d 100644 --- a/src/libs/client/Makefile.am +++ b/src/libs/client/Makefile.am @@ -30,7 +30,6 @@ libingen_client_la_SOURCES = \ $(top_srcdir)/ingen/src/common/interface/ClientInterface.hpp \ $(top_srcdir)/ingen/src/common/interface/EngineInterface.hpp \ ConnectionModel.hpp \ - ControlModel.hpp \ DeprecatedLoader.cpp \ DeprecatedLoader.hpp \ NodeModel.cpp \ @@ -49,7 +48,6 @@ libingen_client_la_SOURCES = \ PluginUI.cpp \ PortModel.cpp \ PortModel.hpp \ - PresetModel.hpp \ SigClientInterface.hpp \ Store.cpp \ Store.hpp \ diff --git a/src/libs/client/OSCClientReceiver.hpp b/src/libs/client/OSCClientReceiver.hpp index 8963d3ca..2dcc4906 100644 --- a/src/libs/client/OSCClientReceiver.hpp +++ b/src/libs/client/OSCClientReceiver.hpp @@ -29,7 +29,6 @@ namespace Ingen { 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 diff --git a/src/libs/client/PresetModel.hpp b/src/libs/client/PresetModel.hpp deleted file mode 100644 index 9bf0467b..00000000 --- a/src/libs/client/PresetModel.hpp +++ /dev/null @@ -1,72 +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.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, string port_name, float value) - { - // FIXME: filthy, filthy kludge for old Om patches - if (port_name == "note_number") - port_name = "note"; - - 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/gui/NodeModule.hpp b/src/libs/gui/NodeModule.hpp index 413020f5..4f877b74 100644 --- a/src/libs/gui/NodeModule.hpp +++ b/src/libs/gui/NodeModule.hpp @@ -29,7 +29,6 @@ class Atom; namespace Ingen { namespace Client { class PortModel; class NodeModel; - class ControlModel; } } using namespace Ingen::Client; diff --git a/src/libs/gui/PatchPortModule.hpp b/src/libs/gui/PatchPortModule.hpp index c9c5625d..5e103bbf 100644 --- a/src/libs/gui/PatchPortModule.hpp +++ b/src/libs/gui/PatchPortModule.hpp @@ -29,7 +29,6 @@ using std::string; namespace Ingen { namespace Client { class PortModel; class NodeModel; - class ControlModel; } } using namespace Ingen::Client; diff --git a/src/libs/gui/PatchView.hpp b/src/libs/gui/PatchView.hpp index dac708ca..7cc72f5a 100644 --- a/src/libs/gui/PatchView.hpp +++ b/src/libs/gui/PatchView.hpp @@ -29,7 +29,6 @@ using std::string; namespace Ingen { namespace Client { class PortModel; - class ControlModel; class MetadataModel; } } using namespace Ingen::Client; diff --git a/src/libs/gui/PatchWindow.hpp b/src/libs/gui/PatchWindow.hpp index def419fe..a3851dc1 100644 --- a/src/libs/gui/PatchWindow.hpp +++ b/src/libs/gui/PatchWindow.hpp @@ -35,7 +35,6 @@ using std::string; using std::list; namespace Ingen { namespace Client { class PatchModel; class PortModel; - class ControlModel; class MetadataModel; } } using namespace Ingen::Client; diff --git a/src/libs/gui/Port.cpp b/src/libs/gui/Port.cpp index 7508a47f..8d0e230a 100644 --- a/src/libs/gui/Port.cpp +++ b/src/libs/gui/Port.cpp @@ -21,7 +21,6 @@ #include "flowcanvas/Module.hpp" #include "client/PatchModel.hpp" #include "client/PortModel.hpp" -#include "client/ControlModel.hpp" #include "Configuration.hpp" #include "App.hpp" #include "Port.hpp" -- cgit v1.2.1