diff options
author | David Robillard <d@drobilla.net> | 2007-05-02 23:58:28 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-05-02 23:58:28 +0000 |
commit | 40ff85e256ca9094fb75cdcbabd3442339f91ecd (patch) | |
tree | bc2c23a9802110f14836fc87413e08be1b7b7266 | |
parent | 10e23868c8199335ebd360afb62911174075658c (diff) | |
download | ingen-40ff85e256ca9094fb75cdcbabd3442339f91ecd.tar.gz ingen-40ff85e256ca9094fb75cdcbabd3442339f91ecd.tar.bz2 ingen-40ff85e256ca9094fb75cdcbabd3442339f91ecd.zip |
Added svn:ignore property to everything.
Made engine and patch loader separate dynamically loaded modules.
No more monolithic ingenuity (module loaded at runtime).
git-svn-id: http://svn.drobilla.net/lad/ingen@491 a436a847-0d15-0410-975c-d299462d15a1
135 files changed, 1016 insertions, 715 deletions
diff --git a/configure.ac b/configure.ac index 5f41349f..ad46411b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,8 +2,10 @@ AC_PREREQ(2.59) AC_INIT([ingen],[0.4.0pre],[dave@drobilla.net]) AC_CONFIG_SRCDIR([src/common/interface/EngineInterface.h]) AC_CONFIG_SRCDIR([src/common/lv2ext/lv2-miditype.h]) +AC_CONFIG_SRCDIR([src/libs/module/Module.cpp]) AC_CONFIG_SRCDIR([src/libs/engine/JackAudioDriver.cpp]) AC_CONFIG_SRCDIR([src/libs/engine/tests/node_tree_test.cpp]) +AC_CONFIG_SRCDIR([src/libs/serialisation/Loader.cpp]) AC_CONFIG_SRCDIR([src/libs/client/OSCController.cpp]) AC_CONFIG_SRCDIR([src/progs/server/main.cpp]) AC_CONFIG_SRCDIR([src/progs/patch_loader/patch_loader.cpp]) @@ -198,19 +200,12 @@ AC_ARG_ENABLE([gtk-client], AS_HELP_STRING(--enable-gtk-client, [Build GTK client, Ingenuity (true)]), [ if test x$enable_gtk_client = xno ; then build_gtk_client=no ; fi ]) -# Ingenuity with internal engine -monolithic_ingenuity="$build_gtk_client" -AC_ARG_ENABLE([monolithic-ingenuity], - AS_HELP_STRING(--enable-monolithic-ingenuity [Build Ingenuity with internal engine (true, if building Ingenuity)]), - [ if test x$enable_monolithic_ingenuity = xno ; then monolithic_ingenuity=no ; fi ]) - - ########################################################################## ## SERVER ########################################################################## -if test "$build_server" = "yes" -o "$monolothic_ingenuity"; then +if test "$build_server" = "yes"; then # Check for standard lib stuff AC_CHECK_FUNCS([posix_memalign, fesetround]) AC_CHECK_HEADERS([float.h stddef.h fenv.h]) @@ -349,15 +344,10 @@ if test "$build_gtk_client" = "yes"; then PKG_CHECK_MODULES(FLOWCANVAS, flowcanvas >= 0.1.0) PKG_CHECK_MODULES(CURL, libcurl >= 7.15.0, build_curl="yes", build_curl="no") - if test "$monolithic_ingenuity" = "yes"; then - AC_DEFINE(MONOLITHIC_INGENUITY, 1, [Whether to build an internal engine into Ingenuity]) - fi - else AC_MSG_WARN([GTK client will NOT be built!]) fi AM_CONDITIONAL(BUILD_GTK_CLIENT, [test "$build_gtk_client" = "yes"]) -AM_CONDITIONAL(MONOLITHIC_INGENUITY, [test "$monolithic_ingenuity" = "yes"]) # Build client lib if anything above that depends on it is to be built AM_CONDITIONAL(BUILD_CLIENT_LIB, [test "$build_console_clients" = "yes" -o "$build_gtk_client" = "yes"]) @@ -369,9 +359,11 @@ AC_CONFIG_FILES([src/common/Makefile]) AC_CONFIG_FILES([src/common/interface/Makefile]) AC_CONFIG_FILES([src/common/lv2ext/Makefile]) AC_CONFIG_FILES([src/libs/Makefile]) +AC_CONFIG_FILES([src/libs/module/Makefile]) AC_CONFIG_FILES([src/libs/engine/Makefile]) AC_CONFIG_FILES([src/libs/engine/tests/Makefile]) AC_CONFIG_FILES([src/libs/engine/events/Makefile]) +AC_CONFIG_FILES([src/libs/serialisation/Makefile]) AC_CONFIG_FILES([src/libs/client/Makefile]) AC_CONFIG_FILES([src/progs/Makefile]) AC_CONFIG_FILES([src/progs/server/Makefile]) @@ -403,7 +395,6 @@ AC_MSG_RESULT([]) AC_MSG_RESULT([Building console clients: $build_console_clients]) AC_MSG_RESULT([]) AC_MSG_RESULT([Building Ingenuity (GTK): $build_gtk_client]) -AC_MSG_RESULT([ Monolithic: $monolithic_ingenuity]) AC_MSG_RESULT([]) AC_MSG_RESULT([AGAIN, LASH SUPPORT IS NOT AVAILABLE.]) AC_MSG_RESULT([THERE IS NO LASH SUPPORT IN INGEN AT THIS TIME]) diff --git a/patches/decimated_delay.ingen.ttl b/patches/decimated_delay.ingen.ttl new file mode 100644 index 00000000..3273cd1f --- /dev/null +++ b/patches/decimated_delay.ingen.ttl @@ -0,0 +1,141 @@ +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix ingen: <http://drobilla.net/ns/ingen#> . +@prefix ingenuity: <http://drobilla.net/ns/ingenuity#> . +@prefix lv2: <http://lv2plug.in/ontology#> . + +<> + a ingen:Patch; + ingen:polyphony 1; + doap:name "Decimated Delay"; + lv2:symbol "decimated_delay"; + ingen:node [ + a ingen:Node; + ingen:name "Delayorama"; + ingen:plugin <http://plugin.org.uk/swh-plugins/delayorama>; + ingen:port [ + a ingen:InputPort; + ingen:name "seed"; + ingen:dataType "ingen:control"; + ingen:value 0.0 + ], [ + a ingen:InputPort; + ingen:name "gain"; + ingen:dataType "ingen:control"; + ingen:value -0.7 + ], [ + a ingen:InputPort; + ingen:name "feedback_pc"; + ingen:dataType "ingen:control"; + ingen:value 39.2 + ], [ + a ingen:InputPort; + ingen:name "tap_count"; + ingen:dataType "ingen:control"; + ingen:value 15.8 + ], [ + a ingen:InputPort; + ingen:name "first_delay"; + ingen:dataType "ingen:control"; + ingen:value 0.2 + ], [ + a ingen:InputPort; + ingen:name "delay_range"; + ingen:dataType "ingen:control"; + ingen:value 3.9 + ], [ + a ingen:InputPort; + ingen:name "delay_scale"; + ingen:dataType "ingen:control"; + ingen:value 4.4 + ], [ + a ingen:InputPort; + ingen:name "delay_rand_pc"; + ingen:dataType "ingen:control"; + ingen:value 0.0 + ], [ + a ingen:InputPort; + ingen:name "gain_scale"; + ingen:dataType "ingen:control"; + ingen:value 0.2 + ], [ + a ingen:InputPort; + ingen:name "gain_rand_pc"; + ingen:dataType "ingen:control"; + ingen:value 0.0 + ], [ + a ingen:InputPort; + ingen:name "wet"; + ingen:dataType "ingen:control"; + ingen:value 0.5 + ], [ + a ingen:InputPort; + ingen:name "input"; + ingen:dataType "ingen:audio"; + ingen:connectedTo _:n21, _:n19 + ], _:n13; + ingenuity:canvas-x 1520.5; + ingenuity:canvas-y 1056.6 + ], [ + a ingen:Node; + ingen:name "SmoothDecimator"; + ingen:plugin <http://plugin.org.uk/swh-plugins/smoothDecimate>; + ingen:port [ + a ingen:InputPort; + ingen:name "rate"; + ingen:dataType "ingen:control"; + ingen:value 2794.2; + ], [ + a ingen:InputPort; + ingen:name "smooth"; + ingen:dataType "ingen:control"; + ingen:value 0.1 + ], [ + a ingen:InputPort; + ingen:name "input"; + ingen:dataType "ingen:audio"; + ingen:connectedTo _:n13 + ], _:n18; + ingenuity:canvas-x 1644.5; + ingenuity:canvas-y 1124.1 + ]; + ingen:port _:n19, [ + a ingen:OutputPort; + ingen:name "audio_output_1"; + ingen:dataType "ingen:audio"; + ingenuity:canvas-x 1804.5; + ingenuity:canvas-y 1128.1; + ingen:connectedTo _:n18 + ], _:n21, [ + a ingen:OutputPort; + ingen:name "audio_output_2"; + ingen:dataType "ingen:audio"; + ingenuity:canvas-x 1804.5; + ingenuity:canvas-y 1180.6; + ingen:connectedTo _:n18 + ] . + +_:n13 + a ingen:OutputPort; + ingen:name "output"; + ingen:dataType "ingen:audio" . + +_:n18 + a ingen:OutputPort; + ingen:name "output"; + ingen:dataType "ingen:audio" . + +_:n19 + a ingen:InputPort; + ingen:name "audio_input_1"; + ingen:dataType "ingen:audio"; + ingenuity:canvas-x 1384.5; + ingenuity:canvas-y 1128.1 . + +_:n21 + a ingen:InputPort; + ingen:name "audio_input_2"; + ingen:dataType "ingen:audio"; + ingenuity:canvas-x 1384.5; + ingenuity:canvas-y 1180.6 . + diff --git a/src/common/Makefile.am b/src/common/Makefile.am index e6c5258e..676fa95d 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1 +1,2 @@ DIST_SUBDIRS = interface lv2ext + diff --git a/src/common/interface/ClientInterface.h b/src/common/interface/ClientInterface.h index d6fb1da0..68dcaac3 100644 --- a/src/common/interface/ClientInterface.h +++ b/src/common/interface/ClientInterface.h @@ -19,7 +19,7 @@ #define CLIENTINTERFACE_H #include <inttypes.h> -#include "raul/Atom.h" +#include <raul/Atom.h> #include <string> using std::string; diff --git a/src/common/interface/EngineInterface.h b/src/common/interface/EngineInterface.h index 264c78f0..8a10c840 100644 --- a/src/common/interface/EngineInterface.h +++ b/src/common/interface/EngineInterface.h @@ -20,7 +20,7 @@ #include <inttypes.h> #include <string> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include "interface/ClientInterface.h" using std::string; diff --git a/src/libs/Makefile.am b/src/libs/Makefile.am index b509598e..81422435 100644 --- a/src/libs/Makefile.am +++ b/src/libs/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS = engine client +SUBDIRS = module engine serialisation client diff --git a/src/libs/client/ConnectionModel.h b/src/libs/client/ConnectionModel.h index 7024d058..9e62d5b4 100644 --- a/src/libs/client/ConnectionModel.h +++ b/src/libs/client/ConnectionModel.h @@ -19,8 +19,8 @@ #define CONNECTIONMODEL_H #include <string> -#include "raul/Path.h" -#include "raul/SharedPtr.h" +#include <raul/Path.h> +#include <raul/SharedPtr.h> #include "PortModel.h" #include <cassert> using std::string; diff --git a/src/libs/client/ControlModel.h b/src/libs/client/ControlModel.h index dc709944..5729faec 100644 --- a/src/libs/client/ControlModel.h +++ b/src/libs/client/ControlModel.h @@ -19,7 +19,7 @@ #define CONTROLMODEL_H #include <string> -#include "raul/Path.h" +#include <raul/Path.h> namespace Ingen { namespace Client { diff --git a/src/libs/client/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp index 97e6583d..d4b650df 100644 --- a/src/libs/client/DeprecatedLoader.cpp +++ b/src/libs/client/DeprecatedLoader.cpp @@ -15,28 +15,29 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "DeprecatedLoader.h" -#include <libxml/parser.h> -#include <libxml/tree.h> -#include <libxml/xpath.h> -#include <algorithm> -#include "PatchModel.h" -#include "NodeModel.h" -#include "ConnectionModel.h" -#include "PortModel.h" -#include "PresetModel.h" -#include "ModelEngineInterface.h" -#include "PluginModel.h" -#include "raul/Path.h" + #include <iostream> #include <fstream> #include <vector> +#include <algorithm> #include <utility> // for pair, make_pair #include <cassert> #include <cstring> #include <string> #include <cstdlib> // for atof #include <cmath> +#include <libxml/parser.h> +#include <libxml/tree.h> +#include <libxml/xpath.h> +#include <raul/Path.h> +#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" using std::string; using std::vector; using std::pair; using std::cerr; using std::cout; using std::endl; @@ -245,8 +246,11 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, poly = 1; // Create it, if we're not merging - if (!existing) - _engine->create_patch_with_data(path, poly, initial_data); + if (!existing) { + _engine->create_patch(path, poly); + for (MetadataMap::const_iterator i = initial_data.begin(); i != initial_data.end(); ++i) + _engine->set_metadata(path, i->first, i->second); + } // Load nodes cur = xmlDocGetRootElement(doc)->xmlChildrenNode; @@ -294,7 +298,8 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, xmlCleanupParser(); // Done above.. late enough? - //_engine->set_metadata_map(path, initial_data); + //for (MetadataMap::const_iterator i = data.begin(); i != data.end(); ++i) + // _engine->set_metadata(subject, i->first, i->second); if (!existing) _engine->enable_patch(path); @@ -485,7 +490,8 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr path = new_path; - _engine->set_metadata_map(path, initial_data); + for (MetadataMap::const_iterator i = initial_data.begin(); i != initial_data.end(); ++i) + _engine->set_metadata(path, i->first, i->second); return SharedPtr<NodeModel>(); @@ -508,7 +514,8 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr else _engine->create_node(path, plugin_type, library_name, plugin_label, polyphonic); - _engine->set_metadata_map(path, initial_data); + for (MetadataMap::const_iterator i = initial_data.begin(); i != initial_data.end(); ++i) + _engine->set_metadata(path, i->first, i->second); return true; } @@ -516,7 +523,8 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr // Not deprecated } else { _engine->create_node(path, plugin_uri, polyphonic); - _engine->set_metadata_map(path, initial_data); + for (MetadataMap::const_iterator i = initial_data.begin(); i != initial_data.end(); ++i) + _engine->set_metadata(path, i->first, i->second); return true; } diff --git a/src/libs/client/DeprecatedLoader.h b/src/libs/client/DeprecatedLoader.h index aa9557f5..dde9f631 100644 --- a/src/libs/client/DeprecatedLoader.h +++ b/src/libs/client/DeprecatedLoader.h @@ -25,11 +25,13 @@ #include <boost/optional.hpp> #include <glibmm/ustring.h> #include <libxml/tree.h> -#include "raul/SharedPtr.h" -#include "raul/Path.h" +#include <raul/SharedPtr.h> +#include <raul/Path.h> +#include "interface/EngineInterface.h" #include "ObjectModel.h" using std::string; +using Ingen::Shared::EngineInterface; namespace Ingen { namespace Client { @@ -38,7 +40,6 @@ class PatchModel; class NodeModel; class ConnectionModel; class PresetModel; -class ModelEngineInterface; /** Loads deprecated (XML) patch files (from the Om days). @@ -48,7 +49,7 @@ class ModelEngineInterface; class DeprecatedLoader { public: - DeprecatedLoader(SharedPtr<ModelEngineInterface> engine) + DeprecatedLoader(SharedPtr<EngineInterface> engine) : /*_patch_search_path(".")*/ _engine(engine) { assert(_engine); @@ -72,7 +73,7 @@ private: string translate_load_path(const string& path); //string _patch_search_path; - SharedPtr<ModelEngineInterface> _engine; + SharedPtr<EngineInterface> _engine; /// Translations of paths from the loading file to actual paths (for deprecated patches) std::map<string, string> _load_path_translations; diff --git a/src/libs/client/Makefile.am b/src/libs/client/Makefile.am index b226c381..1a0aa61d 100644 --- a/src/libs/client/Makefile.am +++ b/src/libs/client/Makefile.am @@ -1,23 +1,20 @@ if BUILD_CLIENT_LIB -noinst_LTLIBRARIES = libingenclient.la +noinst_LTLIBRARIES = libingen_client.la -libingenclient_la_CXXFLAGS = @RAUL_CFLAGS@ @SLV2_CFLAGS@ @LXML2_CFLAGS@ @RASQAL_CFLAGS@ @RAPTOR_CFLAGS@ @LSIGCPP_CFLAGS@ @GLIBMM_CFLAGS@ -I$(top_srcdir)/src/common -DPKGDATADIR=\"$(pkgdatadir)\" +libingen_client_la_CXXFLAGS = @RAUL_CFLAGS@ @SLV2_CFLAGS@ @LXML2_CFLAGS@ @RASQAL_CFLAGS@ @RAPTOR_CFLAGS@ @LSIGCPP_CFLAGS@ @GLIBMM_CFLAGS@ -I$(top_srcdir)/src/common -DPKGDATADIR=\"$(pkgdatadir)\" -libingenclient_la_LIBADD = @RAUL_LIBS@ @SLV2_LIBS@ @LXML2_LIBS@ @LOSC_LIBS@ @RASQAL_LIBS@ @RAPTOR_LIBS@ @LSIGCPP_LIBS@ @GLIBMM_LIBS@ +libingen_client_la_LIBADD = @RAUL_LIBS@ @SLV2_LIBS@ @LXML2_LIBS@ @LOSC_LIBS@ @RASQAL_LIBS@ @RAPTOR_LIBS@ @LSIGCPP_LIBS@ @GLIBMM_LIBS@ -libingenclient_la_SOURCES = \ +libingen_client_la_SOURCES = \ OSCEngineSender.h \ OSCEngineSender.cpp \ - OSCModelEngineInterface.h \ OSCClientReceiver.h \ OSCClientReceiver.cpp \ SigClientInterface.h \ DirectSigClientInterface.h \ ThreadedSigClientInterface.h \ ThreadedSigClientInterface.cpp \ - ModelEngineInterface.h \ - ModelEngineInterface.cpp \ PresetModel.h \ ControlModel.h \ ObjectModel.h \ @@ -31,8 +28,6 @@ libingenclient_la_SOURCES = \ PluginModel.cpp \ Serializer.h \ Serializer.cpp \ - Loader.h \ - Loader.cpp \ DeprecatedLoader.h \ DeprecatedLoader.cpp \ ConnectionModel.h \ diff --git a/src/libs/client/ModelEngineInterface.cpp b/src/libs/client/ModelEngineInterface.cpp deleted file mode 100644 index 9401a937..00000000 --- a/src/libs/client/ModelEngineInterface.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard <http://drobilla.net> - * - * 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 - */ - -#include "ModelEngineInterface.h" -#include "PatchModel.h" -#include "PresetModel.h" - -namespace Ingen { -namespace Client { - - -/** Load a node. - */ -void -ModelEngineInterface::create_node_with_data(const string& plugin_uri, - const Path& path, - bool is_polyphonic, - const MetadataMap& initial_data) -{ - // Load by URI - if (plugin_uri.length() > 0) { - create_node(path, plugin_uri, is_polyphonic); - - // Load by libname, label - } else { - cerr << "FIXME: non-uri" << endl; - #if 0 - //assert(nm->plugin()->lib_name().length() > 0); - assert(nm->plugin()->plug_label().length() > 0); - - create_node(nm->path(), - nm->plugin()->type_string(), - nm->plugin()->lib_name().c_str(), - nm->plugin()->plug_label().c_str(), - nm->polyphonic()); - #endif - } - - set_metadata_map(path, initial_data); -} - - -/** Create a patch. - */ -void -ModelEngineInterface::create_patch_with_data(const Path& path, size_t poly, const MetadataMap& data) -{ - create_patch(path, poly); - set_metadata_map(path, data); -} - - -void -ModelEngineInterface::create_port_with_data(const Path& path, - const string& data_type, - bool direction, - const MetadataMap& data) -{ - create_port(path, data_type, direction); - set_metadata_map(path, data); -} - -/** Set all pieces of metadata in a map. - */ -void -ModelEngineInterface::set_metadata_map(const Path& subject, const MetadataMap& data) -{ - for (MetadataMap::const_iterator i = data.begin(); i != data.end(); ++i) - set_metadata(subject, i->first, i->second); -} - - -/** Set a preset by setting all relevant controls for a patch. - */ -void -ModelEngineInterface::set_preset(const Path& patch_path, const PresetModel* const pm) -{ - for (list<ControlModel>::const_iterator i = pm->controls().begin(); i != pm->controls().end(); ++i) { - set_port_value_queued((*i).port_path(), (*i).value()); - } -} - - -} // namespace Client -} // namespace Ingen diff --git a/src/libs/client/ModelEngineInterface.h b/src/libs/client/ModelEngineInterface.h deleted file mode 100644 index d93d6564..00000000 --- a/src/libs/client/ModelEngineInterface.h +++ /dev/null @@ -1,72 +0,0 @@ -/* This file is part of Ingen. - * Copyright (C) 2007 Dave Robillard <http://drobilla.net> - * - * 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 MODELENGINEINTERFACE_H -#define MODELENGINEINTERFACE_H - -#include <string> -#include <lo/lo.h> -#include "interface/EngineInterface.h" -#include "ObjectModel.h" -using std::string; - -class Path; - -/** \defgroup IngenClient Client Library */ -namespace Ingen { -namespace Client { - -class ObjectModel; -class NodeModel; -class PresetModel; -class PatchModel; - - -/** Model-based engine command interface. - * - * \ingroup IngenClient - */ -class ModelEngineInterface : public virtual Shared::EngineInterface -{ -public: - virtual ~ModelEngineInterface() {} - - virtual void create_patch_with_data(const Path& path, - size_t poly, - const MetadataMap& initial_data); - - virtual void create_node_with_data(const string& plugin_uri, - const Path& path, - bool is_polyphonicc, - const MetadataMap& initial_data); - - virtual void create_port_with_data(const Path& path, - const string& data_type, - bool direction, - const MetadataMap& data); - - virtual void set_metadata_map(const Path& subject, const MetadataMap& data); - virtual void set_preset(const Path& patch_path, const PresetModel* pm); - -protected: - ModelEngineInterface() {} -}; - -} // namespace Client -} // namespace Ingen - -#endif // MODELENGINEINTERFACE_H diff --git a/src/libs/client/NodeModel.h b/src/libs/client/NodeModel.h index 2dd96f35..f8866f15 100644 --- a/src/libs/client/NodeModel.h +++ b/src/libs/client/NodeModel.h @@ -25,8 +25,8 @@ #include <sigc++/sigc++.h> #include "ObjectModel.h" #include "PortModel.h" -#include "raul/Path.h" -#include "raul/SharedPtr.h" +#include <raul/Path.h> +#include <raul/SharedPtr.h> #include "PluginModel.h" using std::string; using std::map; using std::find; diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp index 7545b141..d56b8f2e 100644 --- a/src/libs/client/OSCClientReceiver.cpp +++ b/src/libs/client/OSCClientReceiver.cpp @@ -16,7 +16,7 @@ */ #include "OSCClientReceiver.h" -#include "raul/AtomLiblo.h" +#include <raul/AtomLiblo.h> #include <list> #include <cassert> #include <cstring> diff --git a/src/libs/client/OSCEngineSender.cpp b/src/libs/client/OSCEngineSender.cpp index 11bbc3d7..6ebf8df0 100644 --- a/src/libs/client/OSCEngineSender.cpp +++ b/src/libs/client/OSCEngineSender.cpp @@ -18,7 +18,7 @@ #include <iostream> #include "OSCEngineSender.h" #include "interface/ClientKey.h" -#include "raul/AtomLiblo.h" +#include <raul/AtomLiblo.h> using std::cout; using std::cerr; using std::endl; namespace Ingen { diff --git a/src/libs/client/ObjectModel.h b/src/libs/client/ObjectModel.h index 882ff911..d388475a 100644 --- a/src/libs/client/ObjectModel.h +++ b/src/libs/client/ObjectModel.h @@ -26,9 +26,9 @@ #include <cassert> #include <boost/utility.hpp> #include <sigc++/sigc++.h> -#include "raul/Atom.h" -#include "raul/Path.h" -#include "raul/SharedPtr.h" +#include <raul/Atom.h> +#include <raul/Path.h> +#include <raul/SharedPtr.h> using std::string; using std::map; using std::find; using std::cout; using std::cerr; using std::endl; diff --git a/src/libs/client/PatchModel.h b/src/libs/client/PatchModel.h index c55bce89..faceef72 100644 --- a/src/libs/client/PatchModel.h +++ b/src/libs/client/PatchModel.h @@ -24,7 +24,7 @@ #include <map> #include <sigc++/sigc++.h> #include "NodeModel.h" -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include "ConnectionModel.h" using std::list; using std::string; using std::map; diff --git a/src/libs/client/PluginModel.h b/src/libs/client/PluginModel.h index aba4d1cf..20777bd9 100644 --- a/src/libs/client/PluginModel.h +++ b/src/libs/client/PluginModel.h @@ -21,8 +21,8 @@ #include "../../../config.h" #include <string> #include <iostream> -#include "raul/Path.h" -#include "raul/SharedPtr.h" +#include <raul/Path.h> +#include <raul/SharedPtr.h> #ifdef HAVE_SLV2 #include <slv2/slv2.h> #endif diff --git a/src/libs/client/PortModel.h b/src/libs/client/PortModel.h index 15a381d4..139e2a97 100644 --- a/src/libs/client/PortModel.h +++ b/src/libs/client/PortModel.h @@ -24,8 +24,8 @@ #include <list> #include <sigc++/sigc++.h> #include "ObjectModel.h" -#include "raul/SharedPtr.h" -#include "raul/Path.h" +#include <raul/SharedPtr.h> +#include <raul/Path.h> using std::string; using std::list; using std::cerr; using std::endl; namespace Ingen { diff --git a/src/libs/client/Serializer.cpp b/src/libs/client/Serializer.cpp index 85a13331..4a746ae1 100644 --- a/src/libs/client/Serializer.cpp +++ b/src/libs/client/Serializer.cpp @@ -33,13 +33,13 @@ #include <raul/Path.h> #include <raul/Atom.h> #include <raul/AtomRedland.h> +#include "interface/EngineInterface.h" #include "Serializer.h" #include "PatchModel.h" #include "NodeModel.h" #include "ConnectionModel.h" #include "PortModel.h" #include "PresetModel.h" -#include "ModelEngineInterface.h" #include "PluginModel.h" using namespace std; diff --git a/src/libs/client/Serializer.h b/src/libs/client/Serializer.h index ad91afac..ee7d3dff 100644 --- a/src/libs/client/Serializer.h +++ b/src/libs/client/Serializer.h @@ -39,7 +39,6 @@ class NodeModel; class PortModel; class ConnectionModel; class PresetModel; -class ModelEngineInterface; /** Serializes Ingen objects (patches, nodes, etc) to RDF. diff --git a/src/libs/client/Store.h b/src/libs/client/Store.h index 2059f55f..e481fc2d 100644 --- a/src/libs/client/Store.h +++ b/src/libs/client/Store.h @@ -22,10 +22,10 @@ #include <string> #include <map> #include <list> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include <sigc++/sigc++.h> -#include "raul/Path.h" -#include "raul/Atom.h" +#include <raul/Path.h> +#include <raul/Atom.h> #include "interface/EngineInterface.h" using std::string; using std::map; using std::list; using Ingen::Shared::EngineInterface; diff --git a/src/libs/client/ThreadedSigClientInterface.h b/src/libs/client/ThreadedSigClientInterface.h index c0b1ce73..d0cb4e89 100644 --- a/src/libs/client/ThreadedSigClientInterface.h +++ b/src/libs/client/ThreadedSigClientInterface.h @@ -23,8 +23,8 @@ #include <sigc++/sigc++.h> #include "interface/ClientInterface.h" #include "SigClientInterface.h" -#include "raul/SRSWQueue.h" -#include "raul/Atom.h" +#include <raul/SRSWQueue.h> +#include <raul/Atom.h> using std::string; /** Returns nothing and takes no parameters (because they have all been bound) */ diff --git a/src/libs/engine/ClientBroadcaster.h b/src/libs/engine/ClientBroadcaster.h index 4cdecaa2..8b6d4616 100644 --- a/src/libs/engine/ClientBroadcaster.h +++ b/src/libs/engine/ClientBroadcaster.h @@ -26,7 +26,7 @@ #include <pthread.h> #include "types.h" #include "interface/ClientInterface.h" -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> using std::list; using std::string; using std::pair; diff --git a/src/libs/engine/DirectResponder.h b/src/libs/engine/DirectResponder.h index d38693b1..c9e50f76 100644 --- a/src/libs/engine/DirectResponder.h +++ b/src/libs/engine/DirectResponder.h @@ -19,7 +19,7 @@ #ifndef DIRECTRESPONDER_H #define DIRECTRESPONDER_H -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include "interface/ClientInterface.h" #include "Responder.h" diff --git a/src/libs/engine/Driver.h b/src/libs/engine/Driver.h index fbddc828..bb65fe9b 100644 --- a/src/libs/engine/Driver.h +++ b/src/libs/engine/Driver.h @@ -20,7 +20,7 @@ #include <string> #include <boost/utility.hpp> -#include "raul/Path.h" +#include <raul/Path.h> #include "DataType.h" namespace Ingen { diff --git a/src/libs/engine/Engine.cpp b/src/libs/engine/Engine.cpp index ddb9ea81..d9481786 100644 --- a/src/libs/engine/Engine.cpp +++ b/src/libs/engine/Engine.cpp @@ -35,6 +35,7 @@ #include "PostProcessor.h" #include "CreatePatchEvent.h" #include "EnablePatchEvent.h" +#include "OSCEngineReceiver.h" #ifdef HAVE_JACK_MIDI #include "JackMidiDriver.h" #endif @@ -139,14 +140,37 @@ Engine::main_iteration() } +void +Engine::start_jack_driver() +{ + _audio_driver = SharedPtr<AudioDriver>(new JackAudioDriver(*this)); +} + + +void +Engine::start_osc_driver(const std::string& port) +{ + _event_source = SharedPtr<EventSource>(new OSCEngineReceiver( + *this, pre_processor_queue_size, port.c_str())); +} + + +void +Engine::set_event_source(SharedPtr<EventSource> source) +{ + _event_source = source; +} + + bool -Engine::activate(SharedPtr<AudioDriver> ad, SharedPtr<EventSource> es) +Engine::activate() { if (_activated) return false; - // Setup drivers - _audio_driver = ad; + assert(_audio_driver); + assert(_event_source); + #ifdef HAVE_JACK_MIDI _midi_driver = new JackMidiDriver(((JackAudioDriver*)_audio_driver.get())->jack_client()); #elif HAVE_ALSA_MIDI @@ -155,9 +179,6 @@ Engine::activate(SharedPtr<AudioDriver> ad, SharedPtr<EventSource> es) _midi_driver = new DummyMidiDriver(); #endif - // Set event source (FIXME: handle multiple sources) - _event_source = es; - _event_source->activate(); // Create root patch diff --git a/src/libs/engine/Engine.h b/src/libs/engine/Engine.h index 38d638c3..e66e1125 100644 --- a/src/libs/engine/Engine.h +++ b/src/libs/engine/Engine.h @@ -54,19 +54,23 @@ class Engine : boost::noncopyable { public: Engine(); - ~Engine(); + virtual ~Engine(); - int main(); - bool main_iteration(); + virtual int main(); + virtual bool main_iteration(); /** Set the quit flag that should kill all threads and exit cleanly. * Note that it will take some time. */ - void quit() { _quit_flag = true; } + virtual void quit() { _quit_flag = true; } + + virtual void start_jack_driver(); + virtual void start_osc_driver(const std::string& port); + virtual void set_event_source(SharedPtr<EventSource> source); - bool activate(SharedPtr<AudioDriver> ad, SharedPtr<EventSource> es); - void deactivate(); + virtual bool activate(); + virtual void deactivate(); - bool activated() { return _activated; } + virtual bool activated() { return _activated; } Raul::Maid* maid() const { return _maid; } EventSource* event_source() const { return _event_source.get(); } diff --git a/src/libs/engine/Event.h b/src/libs/engine/Event.h index f0fd170a..9fd398e2 100644 --- a/src/libs/engine/Event.h +++ b/src/libs/engine/Event.h @@ -19,7 +19,7 @@ #define EVENT_H #include <cassert> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include "types.h" #include <raul/Deletable.h> #include "Responder.h" diff --git a/src/libs/engine/GraphObject.h b/src/libs/engine/GraphObject.h index 8754c28a..c5993595 100644 --- a/src/libs/engine/GraphObject.h +++ b/src/libs/engine/GraphObject.h @@ -23,8 +23,8 @@ #include <cstddef> #include <cassert> #include <raul/Deletable.h> -#include "raul/Path.h" -#include "raul/Atom.h" +#include <raul/Path.h> +#include <raul/Atom.h> #include "types.h" using std::string; diff --git a/src/libs/engine/Makefile.am b/src/libs/engine/Makefile.am index 98737957..5529898d 100644 --- a/src/libs/engine/Makefile.am +++ b/src/libs/engine/Makefile.am @@ -2,12 +2,16 @@ SUBDIRS = tests events MAINTAINERCLEANFILES = Makefile.in -noinst_LTLIBRARIES = libingen.la -libingen_la_CXXFLAGS = @RAUL_CFLAGS@ @JACK_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ @LASH_CFLAGS@ @SLV2_CFLAGS@ -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs/engine/events +moduledir = $(libdir)/ingen -libingen_la_LIBADD = @RAUL_LIBS@ @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ @LASH_LIBS@ @SLV2_LIBS@ +module_LTLIBRARIES = libingen_engine.la +libingen_engine_la_CXXFLAGS = @RAUL_CFLAGS@ @JACK_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ @LASH_CFLAGS@ @SLV2_CFLAGS@ -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs/engine/events +libingen_engine_la_LDFLAGS = -no-undefined -module -avoid-version +libingen_engine_la_LIBADD = @RAUL_LIBS@ @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ @LASH_LIBS@ @SLV2_LIBS@ -libingen_la_SOURCES = \ +libingen_engine_la_SOURCES = \ + engine.h \ + engine.cpp \ util.h \ tuning.h \ events.h \ @@ -160,26 +164,26 @@ libingen_la_SOURCES = \ # MidiOutputNode.cpp if WITH_JACK_MIDI -libingen_la_SOURCES += \ +libingen_engine_la_SOURCES += \ JackMidiDriver.h \ JackMidiDriver.cpp \ jack_compat.h endif if WITH_ALSA_MIDI -libingen_la_SOURCES += \ +libingen_engine_la_SOURCES += \ AlsaMidiDriver.h \ AlsaMidiDriver.cpp endif if WITH_LADSPA -libingen_la_SOURCES += \ +libingen_engine_la_SOURCES += \ LADSPANode.h \ LADSPANode.cpp endif if WITH_DSSI -libingen_la_SOURCES += \ +libingen_engine_la_SOURCES += \ DSSINode.h \ DSSINode.cpp \ events/DSSIConfigureEvent.cpp \ @@ -193,13 +197,13 @@ libingen_la_SOURCES += \ endif if WITH_LV2 -libingen_la_SOURCES += \ +libingen_engine_la_SOURCES += \ LV2Node.h \ LV2Node.cpp endif if WITH_LASH -libingen_la_SOURCES += \ +libingen_engine_la_SOURCES += \ LashDriver.h \ LashDriver.cpp endif diff --git a/src/libs/engine/OSCClientSender.cpp b/src/libs/engine/OSCClientSender.cpp index 1ba9491d..763574d1 100644 --- a/src/libs/engine/OSCClientSender.cpp +++ b/src/libs/engine/OSCClientSender.cpp @@ -30,7 +30,7 @@ #include "AudioDriver.h" #include "interface/ClientInterface.h" #include "Responder.h" -#include "raul/AtomLiblo.h" +#include <raul/AtomLiblo.h> using std::cout; using std::cerr; using std::endl; namespace Ingen { diff --git a/src/libs/engine/OSCEngineReceiver.cpp b/src/libs/engine/OSCEngineReceiver.cpp index 218af3c5..1d835190 100644 --- a/src/libs/engine/OSCEngineReceiver.cpp +++ b/src/libs/engine/OSCEngineReceiver.cpp @@ -15,17 +15,17 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "OSCEngineReceiver.h" #include <iostream> #include <cstdlib> #include <string> #include <lo/lo.h> #include "types.h" -#include "raul/SharedPtr.h" -#include "raul/AtomLiblo.h" -#include "QueuedEventSource.h" +#include <raul/SharedPtr.h> +#include <raul/AtomLiblo.h> #include "interface/ClientKey.h" #include "interface/ClientInterface.h" +#include "OSCEngineReceiver.h" +#include "QueuedEventSource.h" #include "OSCClientSender.h" #include "OSCResponder.h" #include "ClientBroadcaster.h" @@ -48,7 +48,7 @@ using Shared::ClientKey; */ -OSCEngineReceiver::OSCEngineReceiver(SharedPtr<Engine> engine, size_t queue_size, const char* const port) +OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, const char* const port) : EngineInterface(), QueuedEngineInterface(engine, queue_size, queue_size), // FIXME _port(port), @@ -227,7 +227,7 @@ OSCEngineReceiver::set_response_address_cb(const char* path, const char* types, // Shitty deal, make a new one //cerr << "** Setting response address to " << url << "(2)" << endl; me->_osc_responder = SharedPtr<OSCResponder>( - new OSCResponder(me->_engine->broadcaster(), id, url)); + new OSCResponder(me->_engine.broadcaster(), id, url)); me->set_responder(me->_osc_responder); @@ -237,7 +237,7 @@ OSCEngineReceiver::set_response_address_cb(const char* path, const char* types, // Otherwise we have a NULL responder, definitely need to set a new one } else { //cerr << "** null responder\n"; - me->_osc_responder = SharedPtr<OSCResponder>(new OSCResponder(me->_engine->broadcaster(), id, url)); + me->_osc_responder = SharedPtr<OSCResponder>(new OSCResponder(me->_engine.broadcaster(), id, url)); me->set_responder(me->_osc_responder); //cerr << "** Setting response address to " << url << "(2)" << endl; } @@ -247,7 +247,7 @@ OSCEngineReceiver::set_response_address_cb(const char* path, const char* types, // Don't respond } else { me->disable_responses(); - SharedPtr<ClientInterface> client = me->_engine->broadcaster()->client( + SharedPtr<ClientInterface> client = me->_engine.broadcaster()->client( ClientKey(ClientKey::OSC_URL, (const char*)url)); if (client) client->disable(); diff --git a/src/libs/engine/OSCEngineReceiver.h b/src/libs/engine/OSCEngineReceiver.h index 15fae6cd..04448fdf 100644 --- a/src/libs/engine/OSCEngineReceiver.h +++ b/src/libs/engine/OSCEngineReceiver.h @@ -21,7 +21,7 @@ #include "config.h" #include <string> #include <lo/lo.h> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include "QueuedEngineInterface.h" #include "OSCResponder.h" using std::string; @@ -61,7 +61,7 @@ inline static int name##_cb(LO_HANDLER_ARGS, void* myself)\ class OSCEngineReceiver : public QueuedEngineInterface { public: - OSCEngineReceiver(SharedPtr<Engine> engine, size_t queue_size, const char* const port); + OSCEngineReceiver(Engine& engine, size_t queue_size, const char* const port); ~OSCEngineReceiver(); void activate(); diff --git a/src/libs/engine/ObjectStore.h b/src/libs/engine/ObjectStore.h index 7cfa10c3..4c0a621a 100644 --- a/src/libs/engine/ObjectStore.h +++ b/src/libs/engine/ObjectStore.h @@ -20,7 +20,7 @@ #define OBJECTSTORE_H #include <string> -#include "raul/Path.h" +#include <raul/Path.h> #include "Tree.h" using std::string; diff --git a/src/libs/engine/PostProcessor.h b/src/libs/engine/PostProcessor.h index 4ab4ae2f..4e3d91a1 100644 --- a/src/libs/engine/PostProcessor.h +++ b/src/libs/engine/PostProcessor.h @@ -20,8 +20,8 @@ #include <pthread.h> #include "types.h" -#include "raul/SRSWQueue.h" -#include "raul/Slave.h" +#include <raul/SRSWQueue.h> +#include <raul/Slave.h> namespace Raul { class Maid; } diff --git a/src/libs/engine/QueuedEngineInterface.cpp b/src/libs/engine/QueuedEngineInterface.cpp index 681cf798..b38692ea 100644 --- a/src/libs/engine/QueuedEngineInterface.cpp +++ b/src/libs/engine/QueuedEngineInterface.cpp @@ -24,7 +24,7 @@ namespace Ingen { -QueuedEngineInterface::QueuedEngineInterface(SharedPtr<Engine> engine, size_t queued_size, size_t stamped_size) +QueuedEngineInterface::QueuedEngineInterface(Engine& engine, size_t queued_size, size_t stamped_size) : QueuedEventSource(queued_size, stamped_size) , _responder(SharedPtr<Responder>(new Responder())) // NULL responder , _engine(engine) @@ -37,7 +37,7 @@ QueuedEngineInterface::now() const { // Exactly one cycle latency (some could run ASAP if we get lucky, but not always, and a slight // constant latency is far better than jittery lower (average) latency - return _engine->audio_driver()->frame_time() + _engine->audio_driver()->buffer_size(); + return _engine.audio_driver()->frame_time() + _engine.audio_driver()->buffer_size(); } @@ -76,14 +76,14 @@ QueuedEngineInterface::disable_responses() void QueuedEngineInterface::register_client(ClientKey key, SharedPtr<ClientInterface> client) { - push_queued(new RegisterClientEvent(*_engine.get(), _responder, now(), key, client)); + push_queued(new RegisterClientEvent(_engine, _responder, now(), key, client)); } void QueuedEngineInterface::unregister_client(ClientKey key) { - push_queued(new UnregisterClientEvent(*_engine.get(), _responder, now(), key)); + push_queued(new UnregisterClientEvent(_engine, _responder, now(), key)); } @@ -92,7 +92,7 @@ QueuedEngineInterface::unregister_client(ClientKey key) void QueuedEngineInterface::load_plugins() { - push_queued(new LoadPluginsEvent(*_engine.get(), _responder, now())); + push_queued(new LoadPluginsEvent(_engine, _responder, now())); } @@ -100,14 +100,14 @@ QueuedEngineInterface::load_plugins() void QueuedEngineInterface::activate() { - push_queued(new PingQueuedEvent(*_engine.get(), _responder, now())); + push_queued(new PingQueuedEvent(_engine, _responder, now())); } void QueuedEngineInterface::deactivate() { - push_queued(new DeactivateEvent(*_engine.get(), _responder, now())); + push_queued(new DeactivateEvent(_engine, _responder, now())); } @@ -115,7 +115,7 @@ void QueuedEngineInterface::quit() { _responder->respond_ok(); - _engine->quit(); + _engine.quit(); } @@ -126,7 +126,7 @@ void QueuedEngineInterface::create_patch(const string& path, uint32_t poly) { - push_queued(new CreatePatchEvent(*_engine.get(), _responder, now(), path, poly)); + push_queued(new CreatePatchEvent(_engine, _responder, now(), path, poly)); } @@ -135,7 +135,7 @@ void QueuedEngineInterface::create_port(const string& path, const string& data_type, bool direction) { - push_queued(new AddPortEvent(*_engine.get(), _responder, now(), path, data_type, direction, this)); + push_queued(new AddPortEvent(_engine, _responder, now(), path, data_type, direction, this)); } @@ -144,7 +144,7 @@ QueuedEngineInterface::create_node(const string& path, const string& plugin_uri, bool polyphonic) { - push_queued(new AddNodeEvent(*_engine.get(), _responder, now(), + push_queued(new AddNodeEvent(_engine, _responder, now(), path, plugin_uri, polyphonic)); } @@ -156,7 +156,7 @@ QueuedEngineInterface::create_node(const string& path, const string& plugin_label, bool polyphonic) { - push_queued(new AddNodeEvent(*_engine.get(), _responder, now(), + push_queued(new AddNodeEvent(_engine, _responder, now(), path, plugin_type, plugin_lib, plugin_label, polyphonic)); } @@ -164,35 +164,35 @@ void QueuedEngineInterface::rename(const string& old_path, const string& new_name) { - push_queued(new RenameEvent(*_engine.get(), _responder, now(), old_path, new_name)); + push_queued(new RenameEvent(_engine, _responder, now(), old_path, new_name)); } void QueuedEngineInterface::destroy(const string& path) { - push_queued(new DestroyEvent(*_engine.get(), _responder, now(), this, path)); + push_queued(new DestroyEvent(_engine, _responder, now(), this, path)); } void QueuedEngineInterface::clear_patch(const string& patch_path) { - push_queued(new ClearPatchEvent(*_engine.get(), _responder, now(), this, patch_path)); + push_queued(new ClearPatchEvent(_engine, _responder, now(), this, patch_path)); } void QueuedEngineInterface::enable_patch(const string& patch_path) { - push_queued(new EnablePatchEvent(*_engine.get(), _responder, now(), patch_path)); + push_queued(new EnablePatchEvent(_engine, _responder, now(), patch_path)); } void QueuedEngineInterface::disable_patch(const string& patch_path) { - push_queued(new DisablePatchEvent(*_engine.get(), _responder, now(), patch_path)); + push_queued(new DisablePatchEvent(_engine, _responder, now(), patch_path)); } @@ -200,7 +200,7 @@ void QueuedEngineInterface::connect(const string& src_port_path, const string& dst_port_path) { - push_queued(new ConnectionEvent(*_engine.get(), _responder, now(), src_port_path, dst_port_path)); + push_queued(new ConnectionEvent(_engine, _responder, now(), src_port_path, dst_port_path)); } @@ -209,14 +209,14 @@ void QueuedEngineInterface::disconnect(const string& src_port_path, const string& dst_port_path) { - push_queued(new DisconnectionEvent(*_engine.get(), _responder, now(), src_port_path, dst_port_path)); + push_queued(new DisconnectionEvent(_engine, _responder, now(), src_port_path, dst_port_path)); } void QueuedEngineInterface::disconnect_all(const string& node_path) { - push_queued(new DisconnectNodeEvent(*_engine.get(), _responder, now(), node_path)); + push_queued(new DisconnectNodeEvent(_engine, _responder, now(), node_path)); } @@ -224,7 +224,7 @@ void QueuedEngineInterface::set_port_value(const string& port_path, float value) { - push_stamped(new SetPortValueEvent(*_engine.get(), _responder, now(), port_path, value)); + push_stamped(new SetPortValueEvent(_engine, _responder, now(), port_path, value)); } @@ -233,7 +233,7 @@ QueuedEngineInterface::set_port_value(const string& port_path, uint32_t voice, float value) { - push_stamped(new SetPortValueEvent(*_engine.get(), _responder, now(), voice, port_path, value)); + push_stamped(new SetPortValueEvent(_engine, _responder, now(), voice, port_path, value)); } @@ -241,7 +241,7 @@ void QueuedEngineInterface::set_port_value_queued(const string& port_path, float value) { - push_queued(new SetPortValueQueuedEvent(*_engine.get(), _responder, now(), port_path, value)); + push_queued(new SetPortValueQueuedEvent(_engine, _responder, now(), port_path, value)); } @@ -251,7 +251,7 @@ QueuedEngineInterface::set_program(const string& node_path, uint32_t program) { #ifdef HAVE_DSSI - push_queued(new DSSIProgramEvent(*_engine.get(), _responder, now(), node_path, bank, program)); + push_queued(new DSSIProgramEvent(_engine, _responder, now(), node_path, bank, program)); #endif } @@ -259,7 +259,7 @@ QueuedEngineInterface::set_program(const string& node_path, void QueuedEngineInterface::midi_learn(const string& node_path) { - push_queued(new MidiLearnEvent(*_engine.get(), _responder, now(), node_path)); + push_queued(new MidiLearnEvent(_engine, _responder, now(), node_path)); } @@ -268,7 +268,7 @@ QueuedEngineInterface::set_metadata(const string& path, const string& predicate, const Atom& value) { - push_queued(new SetMetadataEvent(*_engine.get(), _responder, now(), path, predicate, value)); + push_queued(new SetMetadataEvent(_engine, _responder, now(), path, predicate, value)); } @@ -277,8 +277,8 @@ QueuedEngineInterface::set_metadata(const string& path, void QueuedEngineInterface::ping() { - if (_engine->activated()) { - push_queued(new PingQueuedEvent(*_engine.get(), _responder, now())); + if (_engine.activated()) { + push_queued(new PingQueuedEvent(_engine, _responder, now())); } else if (_responder) { _responder->respond_ok(); } @@ -288,35 +288,35 @@ QueuedEngineInterface::ping() void QueuedEngineInterface::request_plugin(const string& uri) { - push_queued(new RequestPluginEvent(*_engine.get(), _responder, now(), uri)); + push_queued(new RequestPluginEvent(_engine, _responder, now(), uri)); } void QueuedEngineInterface::request_object(const string& path) { - push_queued(new RequestObjectEvent(*_engine.get(), _responder, now(), path)); + push_queued(new RequestObjectEvent(_engine, _responder, now(), path)); } void QueuedEngineInterface::request_port_value(const string& port_path) { - push_queued(new RequestPortValueEvent(*_engine.get(), _responder, now(), port_path)); + push_queued(new RequestPortValueEvent(_engine, _responder, now(), port_path)); } void QueuedEngineInterface::request_plugins() { - push_queued(new RequestPluginsEvent(*_engine.get(), _responder, now())); + push_queued(new RequestPluginsEvent(_engine, _responder, now())); } void QueuedEngineInterface::request_all_objects() { - push_queued(new RequestAllObjectsEvent(*_engine.get(), _responder, now())); + push_queued(new RequestAllObjectsEvent(_engine, _responder, now())); } diff --git a/src/libs/engine/QueuedEngineInterface.h b/src/libs/engine/QueuedEngineInterface.h index bfc4237f..ddf293dc 100644 --- a/src/libs/engine/QueuedEngineInterface.h +++ b/src/libs/engine/QueuedEngineInterface.h @@ -21,7 +21,7 @@ #include <inttypes.h> #include <string> #include <memory> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include "interface/EngineInterface.h" #include "interface/ClientInterface.h" #include "interface/ClientKey.h" @@ -61,7 +61,7 @@ class Engine; class QueuedEngineInterface : public QueuedEventSource, public virtual EngineInterface { public: - QueuedEngineInterface(SharedPtr<Engine> engine, size_t queued_size, size_t stamped_size); + QueuedEngineInterface(Engine& engine, size_t queued_size, size_t stamped_size); virtual ~QueuedEngineInterface() {} void set_next_response_id(int32_t id); @@ -158,7 +158,7 @@ protected: /** Where responses to current messages will go. */ SharedPtr<Responder> _responder; - SharedPtr<Engine> _engine; + Engine& _engine; private: SampleCount now() const; diff --git a/src/libs/engine/QueuedEventSource.h b/src/libs/engine/QueuedEventSource.h index 9bda226f..d0c17c0b 100644 --- a/src/libs/engine/QueuedEventSource.h +++ b/src/libs/engine/QueuedEventSource.h @@ -21,9 +21,9 @@ #include <cstdlib> #include <pthread.h> #include "types.h" -#include "raul/Semaphore.h" -#include "raul/SRSWQueue.h" -#include "raul/Slave.h" +#include <raul/Semaphore.h> +#include <raul/SRSWQueue.h> +#include <raul/Slave.h> #include "Event.h" #include "EventSource.h" diff --git a/src/libs/engine/Responder.h b/src/libs/engine/Responder.h index 9fa72dcf..f111b02a 100644 --- a/src/libs/engine/Responder.h +++ b/src/libs/engine/Responder.h @@ -20,7 +20,7 @@ #include <inttypes.h> #include <string> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include "interface/ClientKey.h" #include "interface/ClientInterface.h" using std::string; diff --git a/src/libs/engine/ThreadManager.h b/src/libs/engine/ThreadManager.h index a62431ff..dc415526 100644 --- a/src/libs/engine/ThreadManager.h +++ b/src/libs/engine/ThreadManager.h @@ -18,7 +18,7 @@ #ifndef THREADMANAGER_H #define THREADMANAGER_H -#include "raul/Thread.h" +#include <raul/Thread.h> using Raul::Thread; diff --git a/src/libs/engine/engine.cpp b/src/libs/engine/engine.cpp new file mode 100644 index 00000000..a2ba26da --- /dev/null +++ b/src/libs/engine/engine.cpp @@ -0,0 +1,42 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard <http://drobilla.net> + * + * 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 + */ + +#include "engine.h" +#include "Engine.h" +#include "QueuedEngineInterface.h" +#include "tuning.h" + +namespace Ingen { + + +Engine* +new_engine() +{ + return new Engine(); +} + + +QueuedEngineInterface* +new_queued_engine_interface(Engine& engine) +{ + return new QueuedEngineInterface(engine, + Ingen::event_queue_size, Ingen::event_queue_size); +} + + +} // namespace Ingen + diff --git a/src/libs/engine/engine.h b/src/libs/engine/engine.h new file mode 100644 index 00000000..aac69661 --- /dev/null +++ b/src/libs/engine/engine.h @@ -0,0 +1,38 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard <http://drobilla.net> + * + * 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_ENGINE_H +#define INGEN_ENGINE_H + +namespace Ingen { + +class Engine; +class QueuedEngineInterface; + + +extern "C" { + + extern Engine* new_engine(); + extern QueuedEngineInterface* new_queued_interface(Engine& engine); + +} + + +} // namespace Ingen + +#endif // INGEN_ENGINE_H + diff --git a/src/libs/engine/events/AddNodeEvent.cpp b/src/libs/engine/events/AddNodeEvent.cpp index 0e3fa56d..88efbb45 100644 --- a/src/libs/engine/events/AddNodeEvent.cpp +++ b/src/libs/engine/events/AddNodeEvent.cpp @@ -26,9 +26,9 @@ #include "NodeFactory.h" #include "ClientBroadcaster.h" #include <raul/Maid.h> -#include "raul/Path.h" +#include <raul/Path.h> #include "ObjectStore.h" -#include "raul/Path.h" +#include <raul/Path.h> #include "Port.h" namespace Ingen { diff --git a/src/libs/engine/events/AddNodeEvent.h b/src/libs/engine/events/AddNodeEvent.h index 6b68f627..7a88cd1c 100644 --- a/src/libs/engine/events/AddNodeEvent.h +++ b/src/libs/engine/events/AddNodeEvent.h @@ -19,7 +19,7 @@ #define ADDNODEEVENT_H #include "QueuedEvent.h" -#include "raul/Path.h" +#include <raul/Path.h> #include <string> using std::string; diff --git a/src/libs/engine/events/AddPortEvent.cpp b/src/libs/engine/events/AddPortEvent.cpp index c9f22cd1..1157d06a 100644 --- a/src/libs/engine/events/AddPortEvent.cpp +++ b/src/libs/engine/events/AddPortEvent.cpp @@ -23,11 +23,11 @@ #include "Engine.h" #include "Patch.h" #include <raul/Maid.h> -#include "raul/Path.h" +#include <raul/Path.h> #include "QueuedEventSource.h" #include "ObjectStore.h" #include "ClientBroadcaster.h" -#include "raul/Path.h" +#include <raul/Path.h> #include "Port.h" #include "AudioDriver.h" #include "MidiDriver.h" diff --git a/src/libs/engine/events/ConnectionEvent.h b/src/libs/engine/events/ConnectionEvent.h index bebb6cfd..9565d79f 100644 --- a/src/libs/engine/events/ConnectionEvent.h +++ b/src/libs/engine/events/ConnectionEvent.h @@ -20,7 +20,7 @@ #include <string> #include "QueuedEvent.h" -#include "raul/Path.h" +#include <raul/Path.h> #include "types.h" using std::string; diff --git a/src/libs/engine/events/CreatePatchEvent.cpp b/src/libs/engine/events/CreatePatchEvent.cpp index 344dbbe9..81d05368 100644 --- a/src/libs/engine/events/CreatePatchEvent.cpp +++ b/src/libs/engine/events/CreatePatchEvent.cpp @@ -25,7 +25,7 @@ #include <raul/Maid.h> #include "ClientBroadcaster.h" #include "AudioDriver.h" -#include "raul/Path.h" +#include <raul/Path.h> #include "ObjectStore.h" namespace Ingen { diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp index 14e6702c..c00306d8 100644 --- a/src/libs/engine/events/DestroyEvent.cpp +++ b/src/libs/engine/events/DestroyEvent.cpp @@ -30,7 +30,7 @@ #include "ClientBroadcaster.h" #include <raul/Maid.h> #include "ObjectStore.h" -#include "raul/Path.h" +#include <raul/Path.h> #include "QueuedEventSource.h" #include "Port.h" diff --git a/src/libs/engine/events/DisconnectNodeEvent.cpp b/src/libs/engine/events/DisconnectNodeEvent.cpp index 8f2a90f2..f304f0b1 100644 --- a/src/libs/engine/events/DisconnectNodeEvent.cpp +++ b/src/libs/engine/events/DisconnectNodeEvent.cpp @@ -32,7 +32,7 @@ #include "ClientBroadcaster.h" #include "util.h" #include "ObjectStore.h" -#include "raul/Path.h" +#include <raul/Path.h> using std::cerr; using std::endl; diff --git a/src/libs/engine/events/DisconnectPortEvent.h b/src/libs/engine/events/DisconnectPortEvent.h index f3058fa1..089508ea 100644 --- a/src/libs/engine/events/DisconnectPortEvent.h +++ b/src/libs/engine/events/DisconnectPortEvent.h @@ -19,7 +19,7 @@ #define DISCONNECTPORTEVENT_H #include <string> -#include "raul/Path.h" +#include <raul/Path.h> #include "QueuedEvent.h" #include <raul/List.h> diff --git a/src/libs/engine/events/RenameEvent.cpp b/src/libs/engine/events/RenameEvent.cpp index 52205046..a833c42e 100644 --- a/src/libs/engine/events/RenameEvent.cpp +++ b/src/libs/engine/events/RenameEvent.cpp @@ -22,7 +22,7 @@ #include "Tree.h" #include "Engine.h" #include "ClientBroadcaster.h" -#include "raul/Path.h" +#include <raul/Path.h> #include "ObjectStore.h" namespace Ingen { diff --git a/src/libs/engine/events/RequestMetadataEvent.h b/src/libs/engine/events/RequestMetadataEvent.h index e074b6ee..497a94bf 100644 --- a/src/libs/engine/events/RequestMetadataEvent.h +++ b/src/libs/engine/events/RequestMetadataEvent.h @@ -20,7 +20,7 @@ #include <string> #include "QueuedEvent.h" -#include "raul/Atom.h" +#include <raul/Atom.h> using std::string; namespace Ingen { diff --git a/src/libs/engine/events/SetMetadataEvent.h b/src/libs/engine/events/SetMetadataEvent.h index ca50adda..fae167a4 100644 --- a/src/libs/engine/events/SetMetadataEvent.h +++ b/src/libs/engine/events/SetMetadataEvent.h @@ -20,7 +20,7 @@ #include <string> #include "QueuedEvent.h" -#include "raul/Atom.h" +#include <raul/Atom.h> using std::string; diff --git a/src/libs/module/Makefile.am b/src/libs/module/Makefile.am new file mode 100644 index 00000000..28cd2822 --- /dev/null +++ b/src/libs/module/Makefile.am @@ -0,0 +1,9 @@ +noinst_LTLIBRARIES = libingen_module.la + +libingen_module_la_CXXFLAGS = @RAUL_CFLAGS@ @GLIBMM_CFLAGS@ -DINGEN_MODULE_DIR=\"$(libdir)/ingen\" + +libingen_module_la_LIBADD = @RAUL_LIBS@ @GLIBMM_LIBS@ + +libingen_module_la_SOURCES = \ + Module.h \ + Module.cpp diff --git a/src/libs/module/Module.cpp b/src/libs/module/Module.cpp new file mode 100644 index 00000000..d92ee97a --- /dev/null +++ b/src/libs/module/Module.cpp @@ -0,0 +1,80 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard <http://drobilla.net> + * + * 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 + */ + +#include <string> +#include <sstream> +#include <iostream> +#include <glibmm/module.h> +#include <glibmm/miscutils.h> +#include <raul/SharedPtr.h> + +#ifndef INGEN_MODULE_DIR +#error This file expects INGEN_MODULE_DIR to be defined. +#endif + +using namespace std; + +namespace Ingen { +namespace Shared { + + +/** Load a dynamic module from the default path. + * + * This will check in the directories specified in the environment variable + * INGEN_MODULE_PATH (typical colon delimited format), then the default module + * installation directory (ie /usr/local/lib/ingen), in that order. + * + * \param name The base name of the module, e.g. "ingen_serialisation" + */ +SharedPtr<Glib::Module> +load_module(const string& name) +{ + SharedPtr<Glib::Module> module; + + // Search INGEN_MODULE_PATH first + bool module_path_found; + string module_path = Glib::getenv("INGEN_MODULE_PATH", module_path_found); + if (module_path_found) { + string dir; + istringstream iss(module_path); + while (getline(iss, dir, ':')) { + module = SharedPtr<Glib::Module>(new Glib::Module( + Glib::Module::build_path(dir, name), + Glib::MODULE_BIND_LAZY)); + + if (module && *module.get()) + return module; + } + } + + // Try default directory if not found + module = SharedPtr<Glib::Module>(new Glib::Module( + Glib::Module::build_path(INGEN_MODULE_DIR, name), + Glib::MODULE_BIND_LAZY)); + + if (*module.get()) { + return module; + } else { + cerr << "Unable to load module \"" << name << "\" (you may want to set INGEN_MODULE_PATH)." << endl; + return SharedPtr<Glib::Module>(); + } +} + + +} // namespace Shared +} // namespace Ingen + diff --git a/src/libs/client/OSCModelEngineInterface.h b/src/libs/module/Module.h index a4a19c95..b0fdee1b 100644 --- a/src/libs/client/OSCModelEngineInterface.h +++ b/src/libs/module/Module.h @@ -15,28 +15,25 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef OSCMODELENGINEINTERFACE_H -#define OSCMODELENGINEINTERFACE_H - #include <string> -#include "OSCEngineSender.h" -#include "ModelEngineInterface.h" +#include <glibmm/module.h> +#include <raul/SharedPtr.h> -using std::string; +#ifndef INGEN_MODULE_DIR +#error This file expects INGEN_MODULE_DIR to be defined. +#endif -/** \defgroup IngenClient Client Library */ namespace Ingen { -namespace Client { +namespace Shared { -class OSCModelEngineInterface : public OSCEngineSender, public ModelEngineInterface -{ -public: - OSCModelEngineInterface(const string& engine_url) : OSCEngineSender(engine_url) {} -}; +/** Load a dynamic module from the default path. + * + * \param name The base name of the module, e.g. "ingen_serialisation" + */ +SharedPtr<Glib::Module> load_module(const std::string& name); -} // namespace Client +} // namespace Shared } // namespace Ingen -#endif // OSCMODELENGINEINTERFACE_H diff --git a/src/libs/client/Loader.cpp b/src/libs/serialisation/Loader.cpp index 8ebea580..157756b1 100644 --- a/src/libs/client/Loader.cpp +++ b/src/libs/serialisation/Loader.cpp @@ -19,8 +19,8 @@ #include <glibmm/ustring.h> #include <raul/RDFModel.h> #include <raul/RDFQuery.h> -#include "Loader.h" #include "interface/EngineInterface.h" +#include "Loader.h" using namespace std; using namespace Raul; @@ -37,13 +37,13 @@ namespace Serialisation { * @return whether or not load was successful. */ bool -load(SharedPtr<EngineInterface> engine, - Raul::RDF::World* rdf_world, - const Glib::ustring& document_uri, - boost::optional<Path> parent, - string patch_name, - Glib::ustring patch_uri, - map<string,Atom> data) +Loader::load(SharedPtr<EngineInterface> engine, + Raul::RDF::World* rdf_world, + const Glib::ustring& document_uri, + boost::optional<Path> parent, + string patch_name, + Glib::ustring patch_uri, + map<string,Atom> data) { // FIXME: this whole thing is a mess diff --git a/src/libs/client/Loader.h b/src/libs/serialisation/Loader.h index 74aa7cbb..a02e5cdb 100644 --- a/src/libs/client/Loader.h +++ b/src/libs/serialisation/Loader.h @@ -24,6 +24,7 @@ #include <boost/optional.hpp> #include <raul/SharedPtr.h> #include <raul/Path.h> +#include <raul/Atom.h> namespace Raul { class Atom; namespace RDF { class World; } } namespace Ingen { namespace Shared { class EngineInterface; } } @@ -31,16 +32,22 @@ namespace Ingen { namespace Shared { class EngineInterface; } } namespace Ingen { namespace Serialisation { -typedef std::map<std::string, Raul::Atom> Metadata; -bool -load(SharedPtr<Ingen::Shared::EngineInterface> engine, - Raul::RDF::World* world, - const Glib::ustring& uri, - boost::optional<Raul::Path> parent, - std::string patch_name, - Glib::ustring patch_uri = "", - Metadata data = Metadata()); +class Loader { +public: + virtual ~Loader() {} + + typedef std::map<std::string, Raul::Atom> Metadata; + + virtual bool + load(SharedPtr<Ingen::Shared::EngineInterface> engine, + Raul::RDF::World* world, + const Glib::ustring& uri, + boost::optional<Raul::Path> parent, + std::string patch_name, + Glib::ustring patch_uri = "", + Metadata data = Metadata()); +}; } // namespace Serialisation diff --git a/src/libs/serialisation/Makefile.am b/src/libs/serialisation/Makefile.am new file mode 100644 index 00000000..f1343463 --- /dev/null +++ b/src/libs/serialisation/Makefile.am @@ -0,0 +1,16 @@ +MAINTAINERCLEANFILES = Makefile.in + +moduledir = $(libdir)/ingen + +module_LTLIBRARIES = libingen_serialisation.la + +libingen_serialisation_la_CXXFLAGS = @RAUL_CFLAGS@ -I$(top_srcdir)/src/common +libingen_serialisation_la_LDFLAGS = -no-undefined -module -avoid-version +libingen_serialisation_la_LIBADD = @RAUL_LIBS@ + +libingen_serialisation_la_SOURCES = \ + serialisation.h \ + serialisation.cpp \ + Loader.h \ + Loader.cpp + diff --git a/src/libs/serialisation/serialisation.cpp b/src/libs/serialisation/serialisation.cpp new file mode 100644 index 00000000..e0764fc1 --- /dev/null +++ b/src/libs/serialisation/serialisation.cpp @@ -0,0 +1,34 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard <http://drobilla.net> + * + * 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 + */ + +#include "serialisation.h" +#include "Loader.h" + +namespace Ingen { +namespace Serialisation { + + +Ingen::Serialisation::Loader* +new_loader() +{ + return new Loader(); +} + + +} // namespace Serialisation +} // namespace Ingen + diff --git a/src/libs/serialisation/serialisation.h b/src/libs/serialisation/serialisation.h new file mode 100644 index 00000000..f65b9c2e --- /dev/null +++ b/src/libs/serialisation/serialisation.h @@ -0,0 +1,38 @@ +/* This file is part of Ingen. + * Copyright (C) 2007 Dave Robillard <http://drobilla.net> + * + * 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_SERIALISATION_H +#define INGEN_SERIALISATION_H + +namespace Ingen { +namespace Serialisation { + +class Loader; + + +extern "C" { + + extern Loader* new_loader(); + +} + + +} // namespace Serialisation +} // namespace Ingen + +#endif // INGEN_SERIALISATION_H + diff --git a/src/progs/demolition/demolition.cpp b/src/progs/demolition/demolition.cpp index 2998f774..feba204a 100644 --- a/src/progs/demolition/demolition.cpp +++ b/src/progs/demolition/demolition.cpp @@ -23,7 +23,7 @@ #include "Store.h" #include "PatchLibrarian.h" #include "PluginModel.h" -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include <iostream> #include <unistd.h> #include <stdlib.h> diff --git a/src/progs/ingenuity/App.cpp b/src/progs/ingenuity/App.cpp index 0e726db9..20b61da6 100644 --- a/src/progs/ingenuity/App.cpp +++ b/src/progs/ingenuity/App.cpp @@ -23,6 +23,11 @@ #include <libgnomecanvasmm.h> #include <time.h> #include <sys/time.h> +#include <raul/Path.h> +#include "interface/EngineInterface.h" +#include "client/ObjectModel.h" +#include "client/PatchModel.h" +#include "client/Store.h" #include "NodeModule.h" #include "ControlPanel.h" #include "SubpatchModule.h" @@ -31,16 +36,11 @@ #include "MessagesWindow.h" #include "ConfigWindow.h" #include "GladeFactory.h" -#include "raul/Path.h" -#include "ObjectModel.h" -#include "PatchModel.h" #include "PatchTreeWindow.h" #include "Configuration.h" #include "ConnectWindow.h" -#include "Store.h" #include "ThreadedLoader.h" #include "WindowFactory.h" -#include "ModelEngineInterface.h" #ifdef HAVE_LASH #include "LashController.h" #endif @@ -102,7 +102,7 @@ App::instantiate() void -App::attach(const SharedPtr<ModelEngineInterface>& engine, const SharedPtr<SigClientInterface>& client) +App::attach(const SharedPtr<EngineInterface>& engine, const SharedPtr<SigClientInterface>& client) { assert( ! _engine); assert( ! _client); diff --git a/src/progs/ingenuity/App.h b/src/progs/ingenuity/App.h index aaf33893..2ef0891d 100644 --- a/src/progs/ingenuity/App.h +++ b/src/progs/ingenuity/App.h @@ -31,14 +31,19 @@ using std::string; using std::map; using std::list; using std::cerr; using std::endl; -namespace Ingen { namespace Client { - class PatchModel; - class PluginModel; - class Store; - class SigClientInterface; - class ModelEngineInterface; -} } +namespace Ingen { + namespace Shared { + class EngineInterface; + } + namespace Client { + class PatchModel; + class PluginModel; + class Store; + class SigClientInterface; + } +} using namespace Ingen::Client; +using Ingen::Shared::EngineInterface; /** \defgroup Ingenuity GTK Client */ @@ -72,8 +77,8 @@ public: void error_message(const string& msg); - void attach(const SharedPtr<ModelEngineInterface>& engine, - const SharedPtr<SigClientInterface>& client); + void attach(const SharedPtr<EngineInterface>& engine, + const SharedPtr<SigClientInterface>& client); void detach(); @@ -89,10 +94,10 @@ public: Raul::RDF::World* rdf_world() { return &_rdf_world; } - const SharedPtr<ModelEngineInterface>& engine() const { return _engine; } - const SharedPtr<SigClientInterface>& client() const { return _client; } - const SharedPtr<Store>& store() const { return _store; } - const SharedPtr<ThreadedLoader>& loader() const { return _loader; } + const SharedPtr<EngineInterface>& engine() const { return _engine; } + const SharedPtr<SigClientInterface>& client() const { return _client; } + const SharedPtr<Store>& store() const { return _store; } + const SharedPtr<ThreadedLoader>& loader() const { return _loader; } static inline App& instance() { assert(_instance); return *_instance; } static void instantiate(); @@ -101,8 +106,8 @@ protected: App(); static App* _instance; - SharedPtr<ModelEngineInterface> _engine; - SharedPtr<SigClientInterface> _client; + SharedPtr<EngineInterface> _engine; + SharedPtr<SigClientInterface> _client; SharedPtr<Store> _store; SharedPtr<ThreadedLoader> _loader; diff --git a/src/progs/ingenuity/BreadCrumb.h b/src/progs/ingenuity/BreadCrumb.h index ae829dee..1e8b4c9b 100644 --- a/src/progs/ingenuity/BreadCrumb.h +++ b/src/progs/ingenuity/BreadCrumb.h @@ -19,8 +19,8 @@ #define BREADCRUMB_H #include <gtkmm.h> -#include "raul/Path.h" -#include "raul/SharedPtr.h" +#include <raul/Path.h> +#include <raul/SharedPtr.h> #include "PatchView.h" namespace Ingenuity { diff --git a/src/progs/ingenuity/BreadCrumbBox.h b/src/progs/ingenuity/BreadCrumbBox.h index f05a14d1..952e04f1 100644 --- a/src/progs/ingenuity/BreadCrumbBox.h +++ b/src/progs/ingenuity/BreadCrumbBox.h @@ -22,8 +22,8 @@ #include <gtkmm.h> #include <libglademm/xml.h> #include <libglademm.h> -#include "raul/Path.h" -#include "raul/SharedPtr.h" +#include <raul/Path.h> +#include <raul/SharedPtr.h> #include "PatchView.h" namespace Ingenuity { diff --git a/src/progs/ingenuity/ConfigWindow.cpp b/src/progs/ingenuity/ConfigWindow.cpp index decd18ef..eef81ce3 100644 --- a/src/progs/ingenuity/ConfigWindow.cpp +++ b/src/progs/ingenuity/ConfigWindow.cpp @@ -15,17 +15,18 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "ConfigWindow.h" #include <iostream> #include <cassert> #include <algorithm> #include <cctype> -#include "NodeModel.h" -using std::cout; using std::cerr; using std::endl; +#include "client/NodeModel.h" +#include "ConfigWindow.h" +using namespace std; namespace Ingenuity { + ConfigWindow::ConfigWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) : Gtk::Window(cobject), _configuration(NULL) diff --git a/src/progs/ingenuity/ConfigWindow.h b/src/progs/ingenuity/ConfigWindow.h index 04a25689..31e564bd 100644 --- a/src/progs/ingenuity/ConfigWindow.h +++ b/src/progs/ingenuity/ConfigWindow.h @@ -15,16 +15,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - #ifndef CONFIGWINDOW_H #define CONFIGWINDOW_H -#include "PluginModel.h" -#include "Configuration.h" #include <list> #include <libglademm/xml.h> #include <libglademm.h> #include <gtkmm.h> +#include "client/PluginModel.h" +#include "Configuration.h" using std::list; using Ingen::Client::PluginModel; diff --git a/src/progs/ingenuity/Configuration.cpp b/src/progs/ingenuity/Configuration.cpp index 4d2b8e07..d3d7f295 100644 --- a/src/progs/ingenuity/Configuration.cpp +++ b/src/progs/ingenuity/Configuration.cpp @@ -21,10 +21,10 @@ #include <iostream> #include <fstream> #include <map> -#include "PortModel.h" -#include "PluginModel.h" -#include "PatchModel.h" -#include "Loader.h" +#include "client/PortModel.h" +#include "client/PluginModel.h" +#include "client/PatchModel.h" +#include "serialisation/Loader.h" #include "App.h" using std::cerr; using std::cout; using std::endl; diff --git a/src/progs/ingenuity/ConnectWindow.cpp b/src/progs/ingenuity/ConnectWindow.cpp index 6e5b6c67..322750ea 100644 --- a/src/progs/ingenuity/ConnectWindow.cpp +++ b/src/progs/ingenuity/ConnectWindow.cpp @@ -21,25 +21,24 @@ #include <stdlib.h> #include <sys/time.h> #include <sys/resource.h> -#include "raul/Process.h" +#include <raul/Process.h> #include "config.h" -#include "ConnectWindow.h" #include "interface/ClientKey.h" -#include "OSCModelEngineInterface.h" -#include "OSCClientReceiver.h" -#include "ThreadedSigClientInterface.h" -#include "Store.h" -#include "PatchModel.h" +#include "interface/EngineInterface.h" +#include "engine/tuning.h" +#include "engine/Engine.h" +#include "engine/DirectResponder.h" +#include "engine/QueuedEngineInterface.h" +#include "client/OSCClientReceiver.h" +#include "client/OSCEngineSender.h" +#include "client/ThreadedSigClientInterface.h" +#include "client/Store.h" +#include "client/PatchModel.h" +#include "module/Module.h" #include "App.h" #include "WindowFactory.h" -#ifdef MONOLITHIC_INGENUITY - #include "engine/Engine.h" - #include "engine/JackAudioDriver.h" - #include "engine/QueuedEngineInterface.h" - #include "engine/DirectResponder.h" - #include "engine/tuning.h" +#include "ConnectWindow.h" using Ingen::QueuedEngineInterface; -#endif using Ingen::Client::ThreadedSigClientInterface; namespace Ingenuity { @@ -58,18 +57,6 @@ struct OSCSigEmitter : public OSCClientReceiver, public ThreadedSigClientInterfa }; -#ifdef MONOLITHIC_INGENUITY -struct QueuedModelEngineInterface : public QueuedEngineInterface, public ModelEngineInterface { - QueuedModelEngineInterface(SharedPtr<Ingen::Engine> engine) - : Ingen::Shared::EngineInterface() - , Ingen::QueuedEngineInterface(engine, Ingen::event_queue_size, Ingen::event_queue_size) - { - QueuedEventSource::start(); - } -}; -#endif - - // ConnectWindow @@ -79,6 +66,8 @@ ConnectWindow::ConnectWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome:: , _ping_id(-1) , _attached(false) , _connect_stage(0) + , _new_engine(NULL) + , _new_queued_engine_interface(NULL) { xml->get_widget("connect_icon", _icon); xml->get_widget("connect_progress_bar", _progress_bar); @@ -91,13 +80,29 @@ ConnectWindow::ConnectWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome:: xml->get_widget("connect_disconnect_button", _disconnect_button); xml->get_widget("connect_connect_button", _connect_button); xml->get_widget("connect_quit_button", _quit_button); - + _server_radio->signal_toggled().connect(sigc::mem_fun(this, &ConnectWindow::server_toggled)); _launch_radio->signal_toggled().connect(sigc::mem_fun(this, &ConnectWindow::launch_toggled)); _internal_radio->signal_clicked().connect(sigc::mem_fun(this, &ConnectWindow::internal_toggled)); _disconnect_button->signal_clicked().connect(sigc::mem_fun(this, &ConnectWindow::disconnect)); _connect_button->signal_clicked().connect(sigc::mem_fun(this, &ConnectWindow::connect)); _quit_button->signal_clicked().connect(sigc::mem_fun(this, &ConnectWindow::quit)); + + _engine_module = Ingen::Shared::load_module("ingen_engine"); + + if (!_engine_module) { + cerr << "Unable to load ingen_engine module, internal engine unavailable." << endl; + cerr << "If you are running from the source tree, run ingenuity_dev." << endl; + } + + bool found1 = _engine_module->get_symbol("new_engine", (void*&)_new_engine); + bool found2 = _engine_module->get_symbol("new_queued_engine_interface", + (void*&)_new_queued_engine_interface); + + if (!found1 || !found2) { + cerr << "Unable to find module entry point, internal engine unavailable." << endl; + _engine_module.reset(); + } } @@ -121,11 +126,10 @@ ConnectWindow::init() _disconnect_button->set_sensitive(false); _port_spinbutton->set_sensitive(false); _launch_radio->set_sensitive(true); -#ifdef MONOLITHIC_INGENUITY - _internal_radio->set_sensitive(true); -#else - _internal_radio->set_sensitive(false); -#endif + if (_new_engine) + _internal_radio->set_sensitive(true); + else + _internal_radio->set_sensitive(false); server_toggled(); _progress_label->set_text(string("Disconnected")); @@ -151,8 +155,8 @@ ConnectWindow::connect() _connect_stage = 0; if (_mode == CONNECT_REMOTE) { - SharedPtr<ModelEngineInterface> engine( - new OSCModelEngineInterface(_url_entry->get_text())); + SharedPtr<EngineInterface> engine( + new OSCEngineSender(_url_entry->get_text())); OSCSigEmitter* ose = new OSCSigEmitter(1024, 16181); // FIXME: args SharedPtr<SigClientInterface> client(ose); @@ -172,8 +176,8 @@ ConnectWindow::connect() const string cmd = string("ingen --port=").append(port_str); if (Raul::Process::launch(cmd)) { - SharedPtr<ModelEngineInterface> engine( - new OSCModelEngineInterface(string("osc.udp://localhost:").append(port_str))); + SharedPtr<EngineInterface> engine( + new OSCEngineSender(string("osc.udp://localhost:").append(port_str))); OSCSigEmitter* ose = new OSCSigEmitter(1024, 16181); // FIXME: args SharedPtr<SigClientInterface> client(ose); @@ -189,13 +193,14 @@ ConnectWindow::connect() cerr << "Failed to launch ingen process." << endl; } -#ifdef MONOLITHIC_INGENUITY } else if (_mode == INTERNAL) { - SharedPtr<Ingen::Engine> engine(new Ingen::Engine()); - SharedPtr<Ingen::AudioDriver> audio_driver( - new Ingen::JackAudioDriver(*engine.get()) ); - SharedPtr<QueuedModelEngineInterface> engine_interface( - new QueuedModelEngineInterface(engine) ); + assert(_new_engine); + SharedPtr<Ingen::Engine> engine(_new_engine()); + engine->start_jack_driver(); + + assert(_new_queued_engine_interface); + SharedPtr<Ingen::QueuedEngineInterface> engine_interface(_new_queued_engine_interface(*engine.get())); + ThreadedSigClientInterface* tsci = new ThreadedSigClientInterface(Ingen::event_queue_size); SharedPtr<SigClientInterface> client(tsci); @@ -203,7 +208,9 @@ ConnectWindow::connect() engine_interface->set_responder(SharedPtr<Ingen::Responder>(new Ingen::DirectResponder(client, 1))); - engine->activate(audio_driver, engine_interface); + engine->set_event_source(engine_interface); + + engine->activate(); Glib::signal_timeout().connect( sigc::mem_fun(engine.get(), &Ingen::Engine::main_iteration), 1000); @@ -213,7 +220,6 @@ ConnectWindow::connect() Glib::signal_timeout().connect( sigc::mem_fun(tsci, &ThreadedSigClientInterface::emit_signals), 2, G_PRIORITY_HIGH_IDLE); -#endif } } diff --git a/src/progs/ingenuity/ConnectWindow.h b/src/progs/ingenuity/ConnectWindow.h index 7e137066..fb1a012f 100644 --- a/src/progs/ingenuity/ConnectWindow.h +++ b/src/progs/ingenuity/ConnectWindow.h @@ -21,10 +21,12 @@ #include <gtkmm.h> #include <libglademm/xml.h> #include <libglademm.h> -#include "raul/SharedPtr.h" -#include "ThreadedSigClientInterface.h" +#include <raul/SharedPtr.h> +#include "client/ThreadedSigClientInterface.h" using Ingen::Client::SigClientInterface; +namespace Ingen { class Engine; class QueuedEngineInterface; } + namespace Ingenuity { class App; @@ -66,6 +68,10 @@ private: int _connect_stage; + SharedPtr<Glib::Module> _engine_module; + Ingen::Engine* (*_new_engine)(); + Ingen::QueuedEngineInterface* (*_new_queued_engine_interface)(Ingen::Engine&); + Gtk::Image* _icon; Gtk::ProgressBar* _progress_bar; Gtk::Label* _progress_label; diff --git a/src/progs/ingenuity/Connection.h b/src/progs/ingenuity/Connection.h index 7e0f3cc5..d7b3a9cc 100644 --- a/src/progs/ingenuity/Connection.h +++ b/src/progs/ingenuity/Connection.h @@ -21,8 +21,8 @@ #include <cassert> #include <string> #include <flowcanvas/Connection.h> -#include "ConnectionModel.h" -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> +#include "client/ConnectionModel.h" using Ingen::Client::ConnectionModel; namespace Ingenuity { diff --git a/src/progs/ingenuity/ControlGroups.cpp b/src/progs/ingenuity/ControlGroups.cpp index f775709a..2cdbf0a3 100644 --- a/src/progs/ingenuity/ControlGroups.cpp +++ b/src/progs/ingenuity/ControlGroups.cpp @@ -17,12 +17,12 @@ #include <cmath> #include <iostream> -#include "ModelEngineInterface.h" +#include "interface/EngineInterface.h" +#include "client/PluginModel.h" +#include "client/NodeModel.h" +#include "client/PortModel.h" #include "ControlGroups.h" #include "ControlPanel.h" -#include "PluginModel.h" -#include "NodeModel.h" -#include "PortModel.h" #include "PortPropertiesWindow.h" #include "GladeFactory.h" #include "App.h" diff --git a/src/progs/ingenuity/ControlGroups.h b/src/progs/ingenuity/ControlGroups.h index 020b7bf7..70b8bb72 100644 --- a/src/progs/ingenuity/ControlGroups.h +++ b/src/progs/ingenuity/ControlGroups.h @@ -22,8 +22,8 @@ #include <gtkmm.h> #include <libglademm/xml.h> #include <libglademm.h> -#include "PortModel.h" -#include "raul/SharedPtr.h" +#include "client/PortModel.h" +#include <raul/SharedPtr.h> namespace Ingen { namespace Client { class PortModel; } } using namespace Ingen::Client; diff --git a/src/progs/ingenuity/ControlPanel.cpp b/src/progs/ingenuity/ControlPanel.cpp index fa28f0b2..7e153ba5 100644 --- a/src/progs/ingenuity/ControlPanel.cpp +++ b/src/progs/ingenuity/ControlPanel.cpp @@ -15,13 +15,13 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" +#include "client/NodeModel.h" +#include "client/PortModel.h" +#include "client/PluginModel.h" #include "App.h" -#include "ModelEngineInterface.h" #include "ControlPanel.h" -#include "PatchModel.h" -#include "NodeModel.h" -#include "PortModel.h" -#include "PluginModel.h" #include "ControlGroups.h" #include "GladeFactory.h" diff --git a/src/progs/ingenuity/ControlPanel.h b/src/progs/ingenuity/ControlPanel.h index 309d2e50..f7da37ad 100644 --- a/src/progs/ingenuity/ControlPanel.h +++ b/src/progs/ingenuity/ControlPanel.h @@ -18,16 +18,17 @@ #ifndef CONTROLPANEL_H #define CONTROLPANEL_H -#include <gtkmm.h> -#include <sigc++/sigc++.h> -#include <libglademm/xml.h> -#include <libglademm.h> #include <vector> #include <string> #include <iostream> #include <utility> // for pair<> +#include <sigc++/sigc++.h> +#include <gtkmm.h> +#include <libglademm/xml.h> +#include <libglademm.h> +#include <raul/Path.h> #include "ControlGroups.h" -#include "raul/Path.h" + using std::vector; using std::string; using std::pair; using std::cerr; using std::cout; using std::endl; diff --git a/src/progs/ingenuity/DSSIController.cpp b/src/progs/ingenuity/DSSIController.cpp index 811d6f1a..01ef96c4 100644 --- a/src/progs/ingenuity/DSSIController.cpp +++ b/src/progs/ingenuity/DSSIController.cpp @@ -21,10 +21,10 @@ #include <dirent.h> #include <unistd.h> #include <sys/stat.h> +#include "interface/EngineInterface.h" +#include "client/NodeModel.h" #include "App.h" -#include "NodeModel.h" #include "DSSIModule.h" -#include "ModelEngineInterface.h" namespace Ingenuity { diff --git a/src/progs/ingenuity/DSSIController.h b/src/progs/ingenuity/DSSIController.h index 78ae3a35..3d5922c9 100644 --- a/src/progs/ingenuity/DSSIController.h +++ b/src/progs/ingenuity/DSSIController.h @@ -20,8 +20,8 @@ #include <string> #include <gtkmm.h> -#include "raul/Path.h" -#include "NodeModel.h" +#include <raul/Path.h> +#include "client/NodeModel.h" using std::string; using namespace Ingen::Client; diff --git a/src/progs/ingenuity/LoadPatchWindow.cpp b/src/progs/ingenuity/LoadPatchWindow.cpp index cc7ff7bd..70d5c409 100644 --- a/src/progs/ingenuity/LoadPatchWindow.cpp +++ b/src/progs/ingenuity/LoadPatchWindow.cpp @@ -19,10 +19,10 @@ #include <sys/types.h> #include <dirent.h> #include <boost/optional/optional.hpp> +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" #include "App.h" #include "Configuration.h" -#include "PatchModel.h" -#include "ModelEngineInterface.h" #include "ThreadedLoader.h" using namespace Ingen::Serialisation; diff --git a/src/progs/ingenuity/LoadPatchWindow.h b/src/progs/ingenuity/LoadPatchWindow.h index 3ac3d137..7f17cef7 100644 --- a/src/progs/ingenuity/LoadPatchWindow.h +++ b/src/progs/ingenuity/LoadPatchWindow.h @@ -18,12 +18,11 @@ #ifndef LOADPATCHWINDOW_H #define LOADPATCHWINDOW_H -#include "PluginModel.h" - #include <libglademm/xml.h> #include <gtkmm.h> -#include "raul/SharedPtr.h" -#include "PatchModel.h" +#include <raul/SharedPtr.h> +#include "client/PluginModel.h" +#include "client/PatchModel.h" using Ingen::Client::PatchModel; using Ingen::Client::MetadataMap; diff --git a/src/progs/ingenuity/LoadPluginWindow.cpp b/src/progs/ingenuity/LoadPluginWindow.cpp index d0311446..5d314db2 100644 --- a/src/progs/ingenuity/LoadPluginWindow.cpp +++ b/src/progs/ingenuity/LoadPluginWindow.cpp @@ -15,17 +15,17 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "LoadPluginWindow.h" #include <iostream> #include <cassert> #include <algorithm> #include <cctype> -#include "NodeModel.h" +#include "interface/EngineInterface.h" +#include "client/NodeModel.h" +#include "client/PatchModel.h" +#include "client/Store.h" #include "App.h" +#include "LoadPluginWindow.h" #include "PatchWindow.h" -#include "PatchModel.h" -#include "Store.h" -#include "ModelEngineInterface.h" #include "PatchView.h" #include "PatchCanvas.h" using std::cout; using std::cerr; using std::endl; @@ -341,7 +341,9 @@ LoadPluginWindow::add_clicked() dialog.run(); } else { Path path = _patch->path().base() + Path::nameify(name); - App::instance().engine()->create_node_with_data(plugin->uri(), path, polyphonic, _initial_data); + App::instance().engine()->create_node(plugin->uri(), path, polyphonic); + for (MetadataMap::const_iterator i = _initial_data.begin(); i != _initial_data.end(); ++i) + App::instance().engine()->set_metadata(path, i->first, i->second); ++_plugin_name_offset; _node_name_entry->set_text(generate_module_name(_plugin_name_offset)); diff --git a/src/progs/ingenuity/LoadPluginWindow.h b/src/progs/ingenuity/LoadPluginWindow.h index 39329f0e..7bfb63e1 100644 --- a/src/progs/ingenuity/LoadPluginWindow.h +++ b/src/progs/ingenuity/LoadPluginWindow.h @@ -19,13 +19,13 @@ #ifndef LOADPLUGINWINDOW_H #define LOADPLUGINWINDOW_H -#include "PluginModel.h" #include <map> #include <libglademm/xml.h> #include <libglademm.h> #include <gtkmm.h> -#include "raul/SharedPtr.h" -#include "PatchModel.h" +#include <raul/SharedPtr.h> +#include "client/PatchModel.h" +#include "client/PluginModel.h" using Ingen::Client::PluginModel; using Ingen::Client::PatchModel; using Ingen::Client::MetadataMap; diff --git a/src/progs/ingenuity/LoadRemotePatchWindow.cpp b/src/progs/ingenuity/LoadRemotePatchWindow.cpp index d1aa0db3..f42c0849 100644 --- a/src/progs/ingenuity/LoadRemotePatchWindow.cpp +++ b/src/progs/ingenuity/LoadRemotePatchWindow.cpp @@ -19,11 +19,11 @@ #include <sys/types.h> #include <dirent.h> #include <boost/optional/optional.hpp> -#include "raul/RDFQuery.h" +#include <raul/RDFQuery.h> +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" #include "App.h" #include "Configuration.h" -#include "PatchModel.h" -#include "ModelEngineInterface.h" #include "ThreadedLoader.h" using boost::optional; diff --git a/src/progs/ingenuity/LoadRemotePatchWindow.h b/src/progs/ingenuity/LoadRemotePatchWindow.h index 5c399888..5a9de63a 100644 --- a/src/progs/ingenuity/LoadRemotePatchWindow.h +++ b/src/progs/ingenuity/LoadRemotePatchWindow.h @@ -18,12 +18,11 @@ #ifndef LOADREMOTEPATCHWINDOW_H #define LOADREMOTEPATCHWINDOW_H -#include "PluginModel.h" - #include <libglademm/xml.h> #include <gtkmm.h> -#include "raul/SharedPtr.h" -#include "PatchModel.h" +#include <raul/SharedPtr.h> +#include "client/PatchModel.h" +#include "client/PluginModel.h" using Ingen::Client::PatchModel; using Ingen::Client::MetadataMap; diff --git a/src/progs/ingenuity/LoadSubpatchWindow.cpp b/src/progs/ingenuity/LoadSubpatchWindow.cpp index 37648ca8..d1f4b953 100644 --- a/src/progs/ingenuity/LoadSubpatchWindow.cpp +++ b/src/progs/ingenuity/LoadSubpatchWindow.cpp @@ -15,17 +15,17 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "LoadSubpatchWindow.h" #include <sys/types.h> #include <dirent.h> #include <cassert> #include <boost/optional.hpp> +#include "interface/EngineInterface.h" +#include "client/NodeModel.h" +#include "client/PatchModel.h" #include "App.h" +#include "LoadSubpatchWindow.h" #include "PatchView.h" -#include "NodeModel.h" -#include "PatchModel.h" #include "Configuration.h" -#include "ModelEngineInterface.h" #include "ThreadedLoader.h" using boost::optional; diff --git a/src/progs/ingenuity/LoadSubpatchWindow.h b/src/progs/ingenuity/LoadSubpatchWindow.h index 6580bce1..54693504 100644 --- a/src/progs/ingenuity/LoadSubpatchWindow.h +++ b/src/progs/ingenuity/LoadSubpatchWindow.h @@ -18,11 +18,11 @@ #ifndef LOADSUBPATCHWINDOW_H #define LOADSUBPATCHWINDOW_H -#include "PluginModel.h" #include <libglademm/xml.h> #include <gtkmm.h> -#include "raul/SharedPtr.h" -#include "PatchModel.h" +#include <raul/SharedPtr.h> +#include "client/PatchModel.h" +#include "client/PluginModel.h" using Ingen::Client::PatchModel; using Ingen::Client::MetadataMap; diff --git a/src/progs/ingenuity/Makefile.am b/src/progs/ingenuity/Makefile.am index 07420b48..82d96b15 100644 --- a/src/progs/ingenuity/Makefile.am +++ b/src/progs/ingenuity/Makefile.am @@ -1,6 +1,6 @@ if BUILD_GTK_CLIENT -EXTRA_DIST = ingenuity.gladep +EXTRA_DIST = ingenuity.gladep ingenuity_dev MAINTAINERCLEANFILES = Makefile.in sharefilesdir = $(pkgdatadir) @@ -12,16 +12,9 @@ dist_desktopfiles_DATA = ingenuity.desktop globalpixmapsdir = $(datadir)/pixmaps dist_globalpixmaps_DATA = ingen.svg -ingenuity_CXXFLAGS = -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs/client -DPKGDATADIR=\"$(pkgdatadir)\" @RAUL_CFLAGS@ @GTKMM_CFLAGS@ @LIBGLADEMM_CFLAGS@ @GNOMECANVASMM_CFLAGS@ @LOSC_CFLAGS@ @LASH_CFLAGS@ @FLOWCANVAS_CFLAGS@ @SLV2_CFLAGS@ @CURL_CFLAGS@ -ingenuity_LDADD = @RAUL_LIBS@ @GTKMM_LIBS@ @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @LOSC_LIBS@ @LASH_LIBS@ @FLOWCANVAS_LIBS@ @SLV2_LIBS@ @CURL_LIBS@ ../../libs/client/libingenclient.la -ingenuity_DEPENDENCIES = ../../libs/client/libingenclient.la - -# FIXME: make engine have a separate include dir -if MONOLITHIC_INGENUITY -ingenuity_CXXFLAGS += -I$(top_srcdir)/src/libs -ingenuity_LDADD += ../../libs/engine/libingen.la -ingenuity_DEPENDENCIES += ../../libs/engine/libingen.la -endif +ingenuity_CXXFLAGS = -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs -DPKGDATADIR=\"$(pkgdatadir)\" @RAUL_CFLAGS@ @GTKMM_CFLAGS@ @LIBGLADEMM_CFLAGS@ @GNOMECANVASMM_CFLAGS@ @LOSC_CFLAGS@ @LASH_CFLAGS@ @FLOWCANVAS_CFLAGS@ @SLV2_CFLAGS@ @CURL_CFLAGS@ -DINGEN_MODULE_DIR=\"$(libdir)/ingen\" +ingenuity_LDADD = @RAUL_LIBS@ @GTKMM_LIBS@ @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @LOSC_LIBS@ @LASH_LIBS@ @FLOWCANVAS_LIBS@ @SLV2_LIBS@ @CURL_LIBS@ ../../libs/client/libingen_client.la ../../libs/module/libingen_module.la +ingenuity_DEPENDENCIES = ../../libs/client/libingen_client.la ../../libs/module/libingen_module.la bin_PROGRAMS = ingenuity ingenuity_SOURCES = \ diff --git a/src/progs/ingenuity/NewSubpatchWindow.cpp b/src/progs/ingenuity/NewSubpatchWindow.cpp index b30003e7..e49340b8 100644 --- a/src/progs/ingenuity/NewSubpatchWindow.cpp +++ b/src/progs/ingenuity/NewSubpatchWindow.cpp @@ -16,10 +16,10 @@ */ #include "App.h" -#include "ModelEngineInterface.h" +#include "interface/EngineInterface.h" +#include "client/NodeModel.h" +#include "client/PatchModel.h" #include "NewSubpatchWindow.h" -#include "NodeModel.h" -#include "PatchModel.h" #include "PatchView.h" namespace Ingenuity { @@ -89,7 +89,10 @@ NewSubpatchWindow::ok_clicked() const Path path = _patch->path().base() + Path::nameify(_name_entry->get_text()); const size_t poly = _poly_spinbutton->get_value_as_int(); - App::instance().engine()->create_patch_with_data(path, poly, _initial_data); + App::instance().engine()->create_patch(path, poly); + for (MetadataMap::const_iterator i = _initial_data.begin(); i != _initial_data.end(); ++i) + App::instance().engine()->set_metadata(path, i->first, i->second); + App::instance().engine()->enable_patch(path); hide(); diff --git a/src/progs/ingenuity/NewSubpatchWindow.h b/src/progs/ingenuity/NewSubpatchWindow.h index 554005fa..28730137 100644 --- a/src/progs/ingenuity/NewSubpatchWindow.h +++ b/src/progs/ingenuity/NewSubpatchWindow.h @@ -18,11 +18,11 @@ #ifndef NEWSUBPATCHWINDOW_H #define NEWSUBPATCHWINDOW_H -#include "PluginModel.h" #include <libglademm/xml.h> #include <gtkmm.h> -#include "raul/SharedPtr.h" -#include "PatchModel.h" +#include <raul/SharedPtr.h> +#include "client/PatchModel.h" +#include "client/PluginModel.h" using Ingen::Client::PatchModel; using Ingen::Client::MetadataMap; diff --git a/src/progs/ingenuity/NodeControlWindow.cpp b/src/progs/ingenuity/NodeControlWindow.cpp index 49578c1d..8d324a65 100644 --- a/src/progs/ingenuity/NodeControlWindow.cpp +++ b/src/progs/ingenuity/NodeControlWindow.cpp @@ -15,17 +15,18 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <iostream> +#include <cmath> +#include "interface/EngineInterface.h" +#include "client/NodeModel.h" #include "App.h" -#include "ModelEngineInterface.h" #include "NodeControlWindow.h" #include "GladeFactory.h" -#include "NodeModel.h" #include "ControlGroups.h" #include "ControlPanel.h" #include "PatchWindow.h" -#include <iostream> -#include <cmath> -using std::cerr; using std::cout; using std::endl; + +using namespace std; namespace Ingenuity { diff --git a/src/progs/ingenuity/NodeControlWindow.h b/src/progs/ingenuity/NodeControlWindow.h index ab3e7e85..62ab497d 100644 --- a/src/progs/ingenuity/NodeControlWindow.h +++ b/src/progs/ingenuity/NodeControlWindow.h @@ -23,7 +23,7 @@ #include <gtkmm.h> #include <libglademm.h> #include <sigc++/sigc++.h> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> using std::string; using std::vector; namespace Ingen { namespace Client { diff --git a/src/progs/ingenuity/NodeMenu.cpp b/src/progs/ingenuity/NodeMenu.cpp index d8a64184..a0efe441 100644 --- a/src/progs/ingenuity/NodeMenu.cpp +++ b/src/progs/ingenuity/NodeMenu.cpp @@ -17,10 +17,10 @@ #include <iostream> #include <gtkmm.h> -#include "NodeMenu.h" -#include "NodeModel.h" +#include "interface/EngineInterface.h" +#include "client/NodeModel.h" #include "App.h" -#include "ModelEngineInterface.h" +#include "NodeMenu.h" #include "WindowFactory.h" using std::cerr; using std::endl; diff --git a/src/progs/ingenuity/NodeMenu.h b/src/progs/ingenuity/NodeMenu.h index 23e7c890..d6f598ad 100644 --- a/src/progs/ingenuity/NodeMenu.h +++ b/src/progs/ingenuity/NodeMenu.h @@ -20,9 +20,9 @@ #include <string> #include <gtkmm.h> -#include "raul/Path.h" -#include "raul/SharedPtr.h" -#include "NodeModel.h" +#include <raul/Path.h> +#include <raul/SharedPtr.h> +#include "client/NodeModel.h" using Ingen::Client::NodeModel; using std::string; diff --git a/src/progs/ingenuity/NodeModule.cpp b/src/progs/ingenuity/NodeModule.cpp index c927114d..dd03fde8 100644 --- a/src/progs/ingenuity/NodeModule.cpp +++ b/src/progs/ingenuity/NodeModule.cpp @@ -15,14 +15,14 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "NodeModule.h" #include <cassert> -#include "raul/Atom.h" +#include <raul/Atom.h> +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" +#include "client/NodeModel.h" #include "App.h" -#include "ModelEngineInterface.h" +#include "NodeModule.h" #include "PatchCanvas.h" -#include "PatchModel.h" -#include "NodeModel.h" #include "Port.h" #include "GladeFactory.h" #include "RenameWindow.h" diff --git a/src/progs/ingenuity/NodeModule.h b/src/progs/ingenuity/NodeModule.h index 77829e93..d87bcfcc 100644 --- a/src/progs/ingenuity/NodeModule.h +++ b/src/progs/ingenuity/NodeModule.h @@ -20,7 +20,7 @@ #include <string> #include <libgnomecanvasmm.h> #include <flowcanvas/Module.h> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> #include "Port.h" #include "NodeMenu.h" using std::string; diff --git a/src/progs/ingenuity/NodePropertiesWindow.cpp b/src/progs/ingenuity/NodePropertiesWindow.cpp index 87e09c99..428119a3 100644 --- a/src/progs/ingenuity/NodePropertiesWindow.cpp +++ b/src/progs/ingenuity/NodePropertiesWindow.cpp @@ -15,11 +15,11 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "NodePropertiesWindow.h" #include <cassert> #include <string> -#include "NodeModel.h" -#include "PluginModel.h" +#include "client/NodeModel.h" +#include "client/PluginModel.h" +#include "NodePropertiesWindow.h" namespace Ingenuity { using std::string; diff --git a/src/progs/ingenuity/NodePropertiesWindow.h b/src/progs/ingenuity/NodePropertiesWindow.h index b6d90062..eae9bfdc 100644 --- a/src/progs/ingenuity/NodePropertiesWindow.h +++ b/src/progs/ingenuity/NodePropertiesWindow.h @@ -20,8 +20,8 @@ #include <gtkmm.h> #include <libglademm.h> -#include "raul/SharedPtr.h" -#include "NodeModel.h" +#include <raul/SharedPtr.h> +#include "client/NodeModel.h" using namespace Ingen::Client; namespace Ingenuity { diff --git a/src/progs/ingenuity/PatchCanvas.cpp b/src/progs/ingenuity/PatchCanvas.cpp index 38fd0d87..e6397a3d 100644 --- a/src/progs/ingenuity/PatchCanvas.cpp +++ b/src/progs/ingenuity/PatchCanvas.cpp @@ -15,12 +15,16 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "PatchCanvas.h" #include <cassert> #include <flowcanvas/FlowCanvas.h> +#include "interface/EngineInterface.h" +#include "client/PluginModel.h" +#include "client/PatchModel.h" +#include "client/NodeModel.h" +#include "client/Store.h" +#include "client/Serializer.h" #include "App.h" -#include "ModelEngineInterface.h" -#include "PatchModel.h" +#include "PatchCanvas.h" #include "PatchWindow.h" #include "PatchPortModule.h" #include "LoadPluginWindow.h" @@ -28,14 +32,10 @@ #include "NewSubpatchWindow.h" #include "Port.h" #include "Connection.h" -#include "NodeModel.h" #include "NodeModule.h" #include "SubpatchModule.h" #include "GladeFactory.h" #include "WindowFactory.h" -#include "Serializer.h" -#include "Store.h" -#include "PluginModel.h" #include "config.h" using Ingen::Client::Store; using Ingen::Client::Serializer; @@ -456,7 +456,10 @@ void PatchCanvas::menu_add_port(const string& name, const string& type, bool is_output) { const Path& path = _patch->path().base() + generate_port_name(name); - App::instance().engine()->create_port_with_data(path, type, is_output, get_initial_data()); + App::instance().engine()->create_port(path, type, is_output); + MetadataMap data = get_initial_data(); + for (MetadataMap::const_iterator i = data.begin(); i != data.end(); ++i) + App::instance().engine()->set_metadata(path, i->first, i->second); } @@ -465,7 +468,10 @@ PatchCanvas::load_plugin(SharedPtr<PluginModel> plugin) { const Path& path = _patch->path().base() + plugin->default_node_name(_patch); // FIXME: polyphony? - App::instance().engine()->create_node_with_data(plugin->uri(), path, false, get_initial_data()); + App::instance().engine()->create_node(plugin->uri(), path, false); + MetadataMap data = get_initial_data(); + for (MetadataMap::const_iterator i = data.begin(); i != data.end(); ++i) + App::instance().engine()->set_metadata(path, i->first, i->second); } diff --git a/src/progs/ingenuity/PatchCanvas.h b/src/progs/ingenuity/PatchCanvas.h index b36bd115..297e9874 100644 --- a/src/progs/ingenuity/PatchCanvas.h +++ b/src/progs/ingenuity/PatchCanvas.h @@ -25,8 +25,8 @@ #include <flowcanvas/Module.h> #include <raul/SharedPtr.h> #include <raul/Path.h> -#include "ConnectionModel.h" -#include "PatchModel.h" +#include "client/ConnectionModel.h" +#include "client/PatchModel.h" #include "NodeModule.h" using std::string; diff --git a/src/progs/ingenuity/PatchPortModule.cpp b/src/progs/ingenuity/PatchPortModule.cpp index 048d0ee7..08e7dbbd 100644 --- a/src/progs/ingenuity/PatchPortModule.cpp +++ b/src/progs/ingenuity/PatchPortModule.cpp @@ -17,11 +17,11 @@ #include "PatchPortModule.h" #include <cassert> +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" +#include "client/NodeModel.h" #include "App.h" -#include "ModelEngineInterface.h" #include "PatchCanvas.h" -#include "PatchModel.h" -#include "NodeModel.h" #include "Port.h" #include "GladeFactory.h" #include "RenameWindow.h" diff --git a/src/progs/ingenuity/PatchPortModule.h b/src/progs/ingenuity/PatchPortModule.h index 21455089..f42b7592 100644 --- a/src/progs/ingenuity/PatchPortModule.h +++ b/src/progs/ingenuity/PatchPortModule.h @@ -22,7 +22,7 @@ #include <boost/enable_shared_from_this.hpp> #include <libgnomecanvasmm.h> #include <flowcanvas/Module.h> -#include "raul/Atom.h" +#include <raul/Atom.h> #include "Port.h" using std::string; diff --git a/src/progs/ingenuity/PatchPropertiesWindow.cpp b/src/progs/ingenuity/PatchPropertiesWindow.cpp index 33afd1fb..17b28d34 100644 --- a/src/progs/ingenuity/PatchPropertiesWindow.cpp +++ b/src/progs/ingenuity/PatchPropertiesWindow.cpp @@ -15,9 +15,9 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "PatchPropertiesWindow.h" #include <string> -#include "PatchModel.h" +#include "client/PatchModel.h" +#include "PatchPropertiesWindow.h" namespace Ingenuity { using std::string; diff --git a/src/progs/ingenuity/PatchPropertiesWindow.h b/src/progs/ingenuity/PatchPropertiesWindow.h index f5dc3b79..8e461381 100644 --- a/src/progs/ingenuity/PatchPropertiesWindow.h +++ b/src/progs/ingenuity/PatchPropertiesWindow.h @@ -21,7 +21,7 @@ #include <string> #include <gtkmm.h> #include <libglademm/xml.h> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> using std::string; namespace Ingen { namespace Client { class PatchModel; } } diff --git a/src/progs/ingenuity/PatchTreeWindow.cpp b/src/progs/ingenuity/PatchTreeWindow.cpp index 5f17a774..77caf6dd 100644 --- a/src/progs/ingenuity/PatchTreeWindow.cpp +++ b/src/progs/ingenuity/PatchTreeWindow.cpp @@ -15,16 +15,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <raul/Path.h> +#include "interface/EngineInterface.h" +#include "client/OSCEngineSender.h" +#include "client/Store.h" +#include "client/PatchModel.h" #include "App.h" -#include "ModelEngineInterface.h" -#include "OSCEngineSender.h" #include "PatchTreeWindow.h" -#include "PatchWindow.h" -#include "Store.h" #include "SubpatchModule.h" -#include "PatchModel.h" #include "WindowFactory.h" -#include "raul/Path.h" namespace Ingenuity { diff --git a/src/progs/ingenuity/PatchTreeWindow.h b/src/progs/ingenuity/PatchTreeWindow.h index 00dcf25c..c7fc3c10 100644 --- a/src/progs/ingenuity/PatchTreeWindow.h +++ b/src/progs/ingenuity/PatchTreeWindow.h @@ -20,7 +20,7 @@ #include <gtkmm.h> #include <libglademm.h> -#include "raul/Path.h" +#include <raul/Path.h> namespace Ingen { namespace Client { class Store; diff --git a/src/progs/ingenuity/PatchView.cpp b/src/progs/ingenuity/PatchView.cpp index aafe798a..076eaa40 100644 --- a/src/progs/ingenuity/PatchView.cpp +++ b/src/progs/ingenuity/PatchView.cpp @@ -15,15 +15,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "PatchView.h" #include <iostream> #include <cassert> #include <fstream> +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" #include "App.h" -#include "ModelEngineInterface.h" +#include "PatchView.h" #include "PatchCanvas.h" #include "LoadPluginWindow.h" -#include "PatchModel.h" #include "NewSubpatchWindow.h" #include "LoadSubpatchWindow.h" #include "NodeControlWindow.h" diff --git a/src/progs/ingenuity/PatchView.h b/src/progs/ingenuity/PatchView.h index 3ea52932..95683251 100644 --- a/src/progs/ingenuity/PatchView.h +++ b/src/progs/ingenuity/PatchView.h @@ -22,8 +22,8 @@ #include <gtkmm.h> #include <libglademm/xml.h> #include <libglademm.h> -#include "raul/SharedPtr.h" -#include "PatchModel.h" +#include <raul/SharedPtr.h> +#include "client/PatchModel.h" using std::string; diff --git a/src/progs/ingenuity/PatchWindow.cpp b/src/progs/ingenuity/PatchWindow.cpp index 606674bb..2e764ff0 100644 --- a/src/progs/ingenuity/PatchWindow.cpp +++ b/src/progs/ingenuity/PatchWindow.cpp @@ -19,11 +19,12 @@ #include <iostream> #include <cassert> #include <fstream> +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" +#include "client/Store.h" #include "App.h" -#include "ModelEngineInterface.h" #include "PatchCanvas.h" #include "LoadPluginWindow.h" -#include "PatchModel.h" #include "NewSubpatchWindow.h" #include "LoadPatchWindow.h" #include "LoadSubpatchWindow.h" @@ -33,7 +34,6 @@ #include "MessagesWindow.h" #include "PatchTreeWindow.h" #include "BreadCrumbBox.h" -#include "Store.h" #include "ConnectWindow.h" #include "ThreadedLoader.h" #include "WindowFactory.h" diff --git a/src/progs/ingenuity/PatchWindow.h b/src/progs/ingenuity/PatchWindow.h index a5ce150d..f4399a20 100644 --- a/src/progs/ingenuity/PatchWindow.h +++ b/src/progs/ingenuity/PatchWindow.h @@ -23,9 +23,9 @@ #include <gtkmm.h> #include <libglademm/xml.h> #include <libglademm.h> -#include "raul/Path.h" -#include "raul/SharedPtr.h" -#include "PatchModel.h" +#include <raul/Path.h> +#include <raul/SharedPtr.h> +#include "client/PatchModel.h" #include "PatchView.h" using Ingen::Client::PatchModel; diff --git a/src/progs/ingenuity/Port.cpp b/src/progs/ingenuity/Port.cpp index 4c27c3b1..b13ccda9 100644 --- a/src/progs/ingenuity/Port.cpp +++ b/src/progs/ingenuity/Port.cpp @@ -15,15 +15,15 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "Port.h" #include <cassert> #include <iostream> -#include "PatchModel.h" -#include "PortModel.h" -#include "ControlModel.h" +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" +#include "client/PortModel.h" +#include "client/ControlModel.h" #include "Configuration.h" -#include "ModelEngineInterface.h" #include "App.h" +#include "Port.h" using std::cerr; using std::endl; using namespace Ingen::Client; diff --git a/src/progs/ingenuity/Port.h b/src/progs/ingenuity/Port.h index 78950040..b006ba45 100644 --- a/src/progs/ingenuity/Port.h +++ b/src/progs/ingenuity/Port.h @@ -21,7 +21,7 @@ #include <cassert> #include <string> #include <flowcanvas/Port.h> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> namespace Ingen { namespace Client { class PortModel; } } using Ingen::Client::PortModel; diff --git a/src/progs/ingenuity/PortPropertiesWindow.cpp b/src/progs/ingenuity/PortPropertiesWindow.cpp index 3a490a74..eb23c542 100644 --- a/src/progs/ingenuity/PortPropertiesWindow.cpp +++ b/src/progs/ingenuity/PortPropertiesWindow.cpp @@ -15,14 +15,14 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "PortPropertiesWindow.h" #include <cassert> #include <string> -#include "NodeModel.h" -#include "PluginModel.h" -#include "ModelEngineInterface.h" -#include "ControlGroups.h" +#include "interface/EngineInterface.h" +#include "client/NodeModel.h" +#include "client/PluginModel.h" #include "App.h" +#include "ControlGroups.h" +#include "PortPropertiesWindow.h" using std::string; diff --git a/src/progs/ingenuity/PortPropertiesWindow.h b/src/progs/ingenuity/PortPropertiesWindow.h index cd22cb09..adb0a2f0 100644 --- a/src/progs/ingenuity/PortPropertiesWindow.h +++ b/src/progs/ingenuity/PortPropertiesWindow.h @@ -20,8 +20,8 @@ #include <gtkmm.h> #include <libglademm.h> -#include "raul/SharedPtr.h" -#include "PortModel.h" +#include <raul/SharedPtr.h> +#include "client/PortModel.h" using namespace Ingen::Client; namespace Ingenuity { diff --git a/src/progs/ingenuity/RenameWindow.cpp b/src/progs/ingenuity/RenameWindow.cpp index c2dca012..28a8ddfe 100644 --- a/src/progs/ingenuity/RenameWindow.cpp +++ b/src/progs/ingenuity/RenameWindow.cpp @@ -15,13 +15,14 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "RenameWindow.h" #include <cassert> #include <string> -#include "ObjectModel.h" -#include "Store.h" +#include "interface/EngineInterface.h" +#include "client/ObjectModel.h" +#include "client/Store.h" #include "App.h" -#include "ModelEngineInterface.h" +#include "RenameWindow.h" + using std::string; namespace Ingenuity { diff --git a/src/progs/ingenuity/RenameWindow.h b/src/progs/ingenuity/RenameWindow.h index 11adbff8..04f765d4 100644 --- a/src/progs/ingenuity/RenameWindow.h +++ b/src/progs/ingenuity/RenameWindow.h @@ -20,8 +20,8 @@ #include <gtkmm.h> #include <libglademm.h> -#include "raul/SharedPtr.h" -#include "ObjectModel.h" +#include <raul/SharedPtr.h> +#include "client/ObjectModel.h" using Ingen::Client::ObjectModel; namespace Ingenuity { diff --git a/src/progs/ingenuity/SubpatchModule.cpp b/src/progs/ingenuity/SubpatchModule.cpp index ec4d7fd9..53958375 100644 --- a/src/progs/ingenuity/SubpatchModule.cpp +++ b/src/progs/ingenuity/SubpatchModule.cpp @@ -18,11 +18,11 @@ #include "SubpatchModule.h" #include <cassert> #include <iostream> +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" #include "App.h" -#include "ModelEngineInterface.h" #include "NodeModule.h" #include "NodeControlWindow.h" -#include "PatchModel.h" #include "PatchWindow.h" #include "PatchCanvas.h" #include "Port.h" diff --git a/src/progs/ingenuity/SubpatchModule.h b/src/progs/ingenuity/SubpatchModule.h index 4bf33431..36e9a2d3 100644 --- a/src/progs/ingenuity/SubpatchModule.h +++ b/src/progs/ingenuity/SubpatchModule.h @@ -21,10 +21,10 @@ #include <string> #include <libgnomecanvasmm.h> -#include "NodeModule.h" -#include "raul/SharedPtr.h" -#include "PatchModel.h" +#include <raul/SharedPtr.h> +#include "client/PatchModel.h" #include "PatchPortModule.h" +#include "NodeModule.h" using std::string; using std::list; namespace Ingen { namespace Client { diff --git a/src/progs/ingenuity/ThreadedLoader.cpp b/src/progs/ingenuity/ThreadedLoader.cpp index bf195dce..43bc76c8 100644 --- a/src/progs/ingenuity/ThreadedLoader.cpp +++ b/src/progs/ingenuity/ThreadedLoader.cpp @@ -15,24 +15,38 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "ThreadedLoader.h" #include <fstream> #include <cassert> #include <string> -#include "PatchModel.h" +#include "client/PatchModel.h" +#include "module/Module.h" #include "App.h" +#include "ThreadedLoader.h" using std::cout; using std::endl; namespace Ingenuity { -ThreadedLoader::ThreadedLoader(SharedPtr<ModelEngineInterface> engine) - : _engine(engine) +ThreadedLoader::ThreadedLoader(SharedPtr<EngineInterface> engine) + : _serialisation_module(Ingen::Shared::load_module("ingen_serialisation")) + , _engine(engine) , _deprecated_loader(engine) , _serializer(*App::instance().rdf_world()) { // FIXME: rework this so the thread is only present when it's doing something (save mem) - start(); + if (_serialisation_module) { + Loader* (*new_loader)() = NULL; + bool found = _serialisation_module->get_symbol("new_loader", (void*&)new_loader); + if (found) + _loader = SharedPtr<Loader>(new_loader()); + } + + if (_loader) { + start(); + } else { + cerr << "WARNING: Failed to load ingen_serialisation module, unable to load patches." << endl;; + cerr << "If you are running from the source tree, run ingenuity_dev." << endl; + } } @@ -78,7 +92,7 @@ ThreadedLoader::load_patch(bool merge, false))); } else { _events.push_back(sigc::hide_return(sigc::bind( - sigc::ptr_fun(&Ingen::Serialisation::load), + sigc::mem_fun(_loader.get(), &Ingen::Serialisation::Loader::load), App::instance().engine(), App::instance().rdf_world(), data_base_uri, diff --git a/src/progs/ingenuity/ThreadedLoader.h b/src/progs/ingenuity/ThreadedLoader.h index bf2c2ed5..1846cece 100644 --- a/src/progs/ingenuity/ThreadedLoader.h +++ b/src/progs/ingenuity/ThreadedLoader.h @@ -26,16 +26,17 @@ #include <raul/Slave.h> #include <raul/Mutex.h> #include <raul/Condition.h> -#include "ModelEngineInterface.h" -#include "Serializer.h" -#include "DeprecatedLoader.h" -#include "Loader.h" -#include "PatchModel.h" +#include "interface/EngineInterface.h" +#include "client/PatchModel.h" +#include "client/Serializer.h" +#include "client/DeprecatedLoader.h" +#include "serialisation/Loader.h" using std::string; using std::list; using boost::optional; using namespace Ingen::Client; +using namespace Ingen::Serialisation; namespace Ingenuity { @@ -54,7 +55,7 @@ namespace Ingenuity { class ThreadedLoader : public Raul::Slave { public: - ThreadedLoader(SharedPtr<ModelEngineInterface> engine); + ThreadedLoader(SharedPtr<EngineInterface> engine); ~ThreadedLoader(); // FIXME: there's a pattern here.... @@ -79,7 +80,10 @@ private: void _whipped(); - SharedPtr<ModelEngineInterface> _engine; + SharedPtr<Glib::Module> _serialisation_module; + + SharedPtr<EngineInterface> _engine; + SharedPtr<Loader> _loader; DeprecatedLoader _deprecated_loader; Serializer _serializer; diff --git a/src/progs/ingenuity/UploadPatchWindow.cpp b/src/progs/ingenuity/UploadPatchWindow.cpp index 6c68236d..400c2369 100644 --- a/src/progs/ingenuity/UploadPatchWindow.cpp +++ b/src/progs/ingenuity/UploadPatchWindow.cpp @@ -21,13 +21,13 @@ #include <dirent.h> #include <boost/optional/optional.hpp> #include <curl/curl.h> -#include "Serializer.h" -#include "raul/RDFQuery.h" +#include <raul/RDFQuery.h> +#include "interface/EngineInterface.h" +#include "client/Serializer.h" +#include "client/PatchModel.h" #include "UploadPatchWindow.h" #include "App.h" #include "Configuration.h" -#include "PatchModel.h" -#include "ModelEngineInterface.h" #include "ThreadedLoader.h" using boost::optional; diff --git a/src/progs/ingenuity/UploadPatchWindow.h b/src/progs/ingenuity/UploadPatchWindow.h index ffc0f17c..36b39b07 100644 --- a/src/progs/ingenuity/UploadPatchWindow.h +++ b/src/progs/ingenuity/UploadPatchWindow.h @@ -22,11 +22,11 @@ #include <libglademm/xml.h> #include <gtkmm.h> #include <curl/curl.h> -#include "raul/SharedPtr.h" -#include "raul/Thread.h" -#include "raul/AtomicInt.h" -#include "PatchModel.h" -#include "PluginModel.h" +#include <raul/SharedPtr.h> +#include <raul/Thread.h> +#include <raul/AtomicInt.h> +#include "client/PatchModel.h" +#include "client/PluginModel.h" using Ingen::Client::PatchModel; using Ingen::Client::MetadataMap; diff --git a/src/progs/ingenuity/WindowFactory.h b/src/progs/ingenuity/WindowFactory.h index 9c6cfa0a..085ff9b6 100644 --- a/src/progs/ingenuity/WindowFactory.h +++ b/src/progs/ingenuity/WindowFactory.h @@ -20,9 +20,10 @@ #include <map> #include <gtkmm.h> -#include "raul/SharedPtr.h" +#include <raul/SharedPtr.h> +#include "client/PatchModel.h" #include "PatchView.h" -#include "PatchModel.h" + using Ingen::Client::PatchModel; namespace Ingenuity { diff --git a/src/progs/ingenuity/ingenuity_dev b/src/progs/ingenuity/ingenuity_dev new file mode 100755 index 00000000..b77d2fe6 --- /dev/null +++ b/src/progs/ingenuity/ingenuity_dev @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +INGEN_MODULE_PATH=../../libs/engine/.libs:../../libs/serialisation/.libs ./ingenuity diff --git a/src/progs/patch_loader/Makefile.am b/src/progs/patch_loader/Makefile.am index 9913411a..f16cc495 100644 --- a/src/progs/patch_loader/Makefile.am +++ b/src/progs/patch_loader/Makefile.am @@ -1,11 +1,11 @@ EXTRA_DIST = README -ingen_load_CXXFLAGS = -I$(top_srcdir)/src/libs/client -I$(top_srcdir)/src/common @LSIGCPP_CFLAGS@ @RAUL_CFLAGS@ @GLIBMM_CFLAGS@ @RASQAL_CFLAGS@ -ingen_load_LDADD = ../../libs/client/libingenclient.la @RAUL_LIBS@ @LSIGCPP_LIBS@ @GLIBMM_LIBS@ @RASQAL_LIBS@ +ingen_load_CXXFLAGS = -I$(top_srcdir)/src/libs -I$(top_srcdir)/src/common @LSIGCPP_CFLAGS@ @RAUL_CFLAGS@ @GLIBMM_CFLAGS@ @RASQAL_CFLAGS@ -DINGEN_MODULE_DIR=\"$(libdir)/ingen\" +ingen_load_LDADD = ../../libs/client/libingen_client.la ../../libs/module/libingen_module.la @RAUL_LIBS@ @LSIGCPP_LIBS@ @GLIBMM_LIBS@ @RASQAL_LIBS@ bin_PROGRAMS = ingen_load -#ingen_load_DEPENDENCIES = ../../libs/client/libingenclient.la +#ingen_load_DEPENDENCIES = ../../libs/client/libingen_client.la ingen_load_SOURCES = \ patch_loader.cpp \ diff --git a/src/progs/patch_loader/new_patch_loader.cpp b/src/progs/patch_loader/new_patch_loader.cpp index 6c879f43..cee48827 100644 --- a/src/progs/patch_loader/new_patch_loader.cpp +++ b/src/progs/patch_loader/new_patch_loader.cpp @@ -17,8 +17,8 @@ #include <iostream> #include <unistd.h> +#include <raul/Path.h> #include "cmdline.h" // generated by gengetopt -#include "raul/Path.h" #include "OSCEngineInterface.h" #include "PatchLibrarian.h" diff --git a/src/progs/patch_loader/patch_loader.cpp b/src/progs/patch_loader/patch_loader.cpp index cc3c1903..57bba0e0 100644 --- a/src/progs/patch_loader/patch_loader.cpp +++ b/src/progs/patch_loader/patch_loader.cpp @@ -17,16 +17,20 @@ #include <iostream> #include <unistd.h> +#include <glibmm/module.h> #include <raul/Path.h> #include <raul/RDFWorld.h> -#include "OSCModelEngineInterface.h" -#include "Loader.h" -#include "PatchModel.h" +#include "client/OSCEngineSender.h" +#include "client/PatchModel.h" +#include "module/Module.h" +#include "serialisation/serialisation.h" +#include "serialisation/Loader.h" #include "cmdline.h" // generated by gengetopt -using std::cout; using std::endl; - +using namespace std; using namespace Ingen::Client; +using namespace Ingen::Serialisation; + int main(int argc, char** argv) { @@ -60,7 +64,7 @@ int main(int argc, char** argv) rdf_world.add_prefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#"); rdf_world.add_prefix("doap", "http://usefulinc.com/ns/doap#"); - SharedPtr<OSCModelEngineInterface> engine(new OSCModelEngineInterface(engine_url)); + SharedPtr<OSCEngineSender> engine(new OSCEngineSender(engine_url)); /* Connect to engine */ engine->attach(-1, client_port); @@ -76,11 +80,29 @@ int main(int argc, char** argv) * engine->wait_for_response(); */ + SharedPtr<Glib::Module> module = Ingen::Shared::load_module("ingen_serialisation"); + + if (!module) { + cerr << "Unable to load ingen_serialisation module, exiting." << endl; + return -1; + } + + Loader* (*new_loader)() = NULL; + + bool found = module->get_symbol("new_loader", (void*&)new_loader); + + if (!found) { + cerr << "Unable to find module entry point, exiting." << endl; + return -1; + } + + SharedPtr<Loader> loader(new_loader()); + // Load patches for (uint i=0; i < args_info.inputs_num; ++i) { cerr << "FIXME: load patch under root" << endl; cerr << "Load " << args_info.inputs[i] << endl; - Ingen::Serialisation::load(engine, &rdf_world, + loader->load(engine, &rdf_world, string("file:") + args_info.inputs[i], Path("/"), ""); } diff --git a/src/progs/server/Makefile.am b/src/progs/server/Makefile.am index 7584ee87..ab384494 100644 --- a/src/progs/server/Makefile.am +++ b/src/progs/server/Makefile.am @@ -1,6 +1,7 @@ -AM_CXXFLAGS = @RAUL_CFLAGS@ @SLV2_CFLAGS@ @JACK_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ @LASH_CFLAGS@ -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs/engine -I$(top_srcdir)/src/libs/engine/events +AM_CXXFLAGS = @RAUL_CFLAGS@ @JACK_CFLAGS@ @LOSC_CFLAGS@ @ALSA_CFLAGS@ @LASH_CFLAGS@ @SLV2_CFLAGS@ -I$(top_srcdir)/src/common -I$(top_srcdir)/src/libs -DINGEN_MODULE_DIR=\"$(libdir)/ingen\" MAINTAINERCLEANFILES = Makefile.in +EXTRA_DIST = ingen_dev # # Stand-alone engine @@ -8,8 +9,8 @@ MAINTAINERCLEANFILES = Makefile.in if BUILD_SERVER bin_PROGRAMS = ingen -ingen_DEPENDENCIES = ../../libs/engine/libingen.la -ingen_LDADD = @RAUL_LIBS@ @SLV2_LIBS@ @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ @LASH_LIBS@ -lrt ../../libs/engine/libingen.la +ingen_LDADD = @RAUL_LIBS@ @JACK_LIBS@ @LOSC_LIBS@ @ALSA_LIBS@ @LASH_LIBS@ @SLV2_LIBS@ -lrt ../../libs/module/libingen_module.la +ingen_DEPENDENCIES = ../../libs/module/libingen_module.la ingen_SOURCES = \ main.cpp \ diff --git a/src/progs/server/cmdline.c b/src/progs/server/cmdline.c index 6a697a04..1e97e1ef 100644 --- a/src/progs/server/cmdline.c +++ b/src/progs/server/cmdline.c @@ -1,5 +1,5 @@ /* - File autogenerated by gengetopt version 2.18 + File autogenerated by gengetopt version 2.19.1 generated with the following command: gengetopt -u @@ -23,14 +23,15 @@ const char *gengetopt_args_info_purpose = ""; -const char *gengetopt_args_info_usage = "Usage: Om - An OSC controlled realtime modular synthesizer [OPTIONS]... [FILES]..."; +const char *gengetopt_args_info_usage = "Usage: Om - An OSC controlled realtime modular synthesizer [OPTIONS]... \n [FILES]..."; + +const char *gengetopt_args_info_description = ""; const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -p, --port=STRING OSC port to listen on (default=`16180')", - " -j, --jack-server=STRING Name of Jack server to attach to", - " -i, --in-jackd Run engine as in-process JACK client (default=off)", + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -p, --port=STRING OSC port to listen on (default=`16180')", + " -i, --in-jackd Run engine as in-process JACK client (default=off)", 0 }; @@ -52,7 +53,6 @@ void clear_given (struct gengetopt_args_info *args_info) args_info->help_given = 0 ; args_info->version_given = 0 ; args_info->port_given = 0 ; - args_info->jack_server_given = 0 ; args_info->in_jackd_given = 0 ; } @@ -61,8 +61,6 @@ void clear_args (struct gengetopt_args_info *args_info) { args_info->port_arg = gengetopt_strdup ("16180"); args_info->port_orig = NULL; - args_info->jack_server_arg = NULL; - args_info->jack_server_orig = NULL; args_info->in_jackd_flag = 0; } @@ -73,8 +71,7 @@ void init_args_info(struct gengetopt_args_info *args_info) args_info->help_help = gengetopt_args_info_help[0] ; args_info->version_help = gengetopt_args_info_help[1] ; args_info->port_help = gengetopt_args_info_help[2] ; - args_info->jack_server_help = gengetopt_args_info_help[3] ; - args_info->in_jackd_help = gengetopt_args_info_help[4] ; + args_info->in_jackd_help = gengetopt_args_info_help[3] ; } @@ -94,6 +91,10 @@ cmdline_parser_print_help (void) printf("\n%s\n", gengetopt_args_info_purpose); printf("\n%s\n\n", gengetopt_args_info_usage); + + if (strlen(gengetopt_args_info_description) > 0) + printf("%s\n", gengetopt_args_info_description); + while (gengetopt_args_info_help[i]) printf("%s\n", gengetopt_args_info_help[i++]); } @@ -124,16 +125,6 @@ cmdline_parser_release (struct gengetopt_args_info *args_info) free (args_info->port_orig); /* free previous argument */ args_info->port_orig = 0; } - if (args_info->jack_server_arg) - { - free (args_info->jack_server_arg); /* free previous argument */ - args_info->jack_server_arg = 0; - } - if (args_info->jack_server_orig) - { - free (args_info->jack_server_orig); /* free previous argument */ - args_info->jack_server_orig = 0; - } for (i = 0; i < args_info->inputs_num; ++i) free (args_info->inputs [i]); @@ -171,13 +162,6 @@ cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_ fprintf(outfile, "%s\n", "port"); } } - if (args_info->jack_server_given) { - if (args_info->jack_server_orig) { - fprintf(outfile, "%s=\"%s\"\n", "jack-server", args_info->jack_server_orig); - } else { - fprintf(outfile, "%s\n", "jack-server"); - } - } if (args_info->in_jackd_given) { fprintf(outfile, "%s\n", "in-jackd"); } @@ -266,13 +250,12 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, { "port", 1, NULL, 'p' }, - { "jack-server", 1, NULL, 'j' }, { "in-jackd", 0, NULL, 'i' }, { NULL, 0, NULL, 0 } }; stop_char = 0; - c = getopt_long (argc, argv, "hVp:j:i", long_options, &option_index); + c = getopt_long (argc, argv, "hVp:i", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -306,24 +289,6 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf args_info->port_orig = gengetopt_strdup (optarg); break; - case 'j': /* Name of Jack server to attach to. */ - if (local_args_info.jack_server_given) - { - fprintf (stderr, "%s: `--jack-server' (`-j') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); - goto failure; - } - if (args_info->jack_server_given && ! override) - continue; - local_args_info.jack_server_given = 1; - args_info->jack_server_given = 1; - if (args_info->jack_server_arg) - free (args_info->jack_server_arg); /* free previous string */ - args_info->jack_server_arg = gengetopt_strdup (optarg); - if (args_info->jack_server_orig) - free (args_info->jack_server_orig); /* free previous string */ - args_info->jack_server_orig = gengetopt_strdup (optarg); - break; - case 'i': /* Run engine as in-process JACK client. */ if (local_args_info.in_jackd_given) { diff --git a/src/progs/server/cmdline.ggo b/src/progs/server/cmdline.ggo index ce50cea1..9635a8f5 100644 --- a/src/progs/server/cmdline.ggo +++ b/src/progs/server/cmdline.ggo @@ -3,6 +3,5 @@ package "Om - An OSC controlled realtime modular synthesizer" option "port" p "OSC port to listen on" string default="16180" no -option "jack-server" j "Name of Jack server to attach to" string no option "in-jackd" i "Run engine as in-process JACK client" flag off diff --git a/src/progs/server/cmdline.h b/src/progs/server/cmdline.h index 8ced9534..5253162c 100644 --- a/src/progs/server/cmdline.h +++ b/src/progs/server/cmdline.h @@ -1,6 +1,6 @@ /* cmdline.h */ -/* File autogenerated by gengetopt version 2.18 */ +/* File autogenerated by gengetopt version 2.19.1 */ #ifndef CMDLINE_H #define CMDLINE_H @@ -29,16 +29,12 @@ struct gengetopt_args_info char * port_arg; /* OSC port to listen on (default='16180'). */ char * port_orig; /* OSC port to listen on original value given at command line. */ const char *port_help; /* OSC port to listen on help description. */ - char * jack_server_arg; /* Name of Jack server to attach to. */ - char * jack_server_orig; /* Name of Jack server to attach to original value given at command line. */ - const char *jack_server_help; /* Name of Jack server to attach to help description. */ int in_jackd_flag; /* Run engine as in-process JACK client (default=off). */ const char *in_jackd_help; /* Run engine as in-process JACK client help description. */ int help_given ; /* Whether help was given. */ int version_given ; /* Whether version was given. */ int port_given ; /* Whether port was given. */ - int jack_server_given ; /* Whether jack-server was given. */ int in_jackd_given ; /* Whether in-jackd was given. */ char **inputs ; /* unamed options */ diff --git a/src/progs/server/ingen_dev b/src/progs/server/ingen_dev new file mode 100755 index 00000000..bd8857f7 --- /dev/null +++ b/src/progs/server/ingen_dev @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +INGEN_MODULE_PATH=../../libs/engine/.libs ./ingen diff --git a/src/progs/server/main.cpp b/src/progs/server/main.cpp index ea9b37d8..e92b635f 100644 --- a/src/progs/server/main.cpp +++ b/src/progs/server/main.cpp @@ -19,19 +19,18 @@ #include <cstddef> #include <signal.h> #include "config.h" -#include "util.h" -#include "cmdline.h" -#include "tuning.h" -#include "Engine.h" -#include "JackAudioDriver.h" -#include "OSCEngineReceiver.h" +#include "module/Module.h" +#include "engine/util.h" +#include "engine/Engine.h" +#include "engine/EventSource.h" #ifdef HAVE_LASH -#include "LashDriver.h" +#include "engine/LashDriver.h" #endif #ifdef BUILD_IN_PROCESS_ENGINE #include <jack/jack.h> #include <jack/intclient.h> #endif +#include "cmdline.h" using std::cout; using std::endl; using std::cerr; using namespace Ingen; @@ -139,18 +138,28 @@ main(int argc, char** argv) set_denormal_flags(); - engine = SharedPtr<Engine>(new Engine()); + SharedPtr<Glib::Module> module = Ingen::Shared::load_module("ingen_engine"); + + if (!module) { + cerr << "Aborting. If you are running from the source tree, run ingen_dev." << endl; + return -1; + } - std::string jack_name - = (args_info.jack_server_given) ? args_info.jack_server_arg : ""; + Engine* (*new_engine)() = NULL; + + bool found = module->get_symbol("new_engine", (void*&)new_engine); + + if (!found) { + cerr << "Unable to find module entry point, exiting." << endl; + return -1; + } - SharedPtr<AudioDriver> audio_driver( - new JackAudioDriver(*engine.get(), jack_name) ); + SharedPtr<Engine> engine(new_engine()); - SharedPtr<EventSource> event_source(new OSCEngineReceiver( - engine, pre_processor_queue_size, args_info.port_arg )); + engine->start_jack_driver(); + engine->start_osc_driver(args_info.port_arg); - engine->activate(audio_driver, event_source); + engine->activate(); #ifdef HAVE_LASH lash_driver = new LashDriver(engine, lash_args); @@ -158,7 +167,7 @@ main(int argc, char** argv) engine->main(); - event_source->deactivate(); + engine->event_source()->deactivate(); #ifdef HAVE_LASH delete lash_driver; diff --git a/src/set_dev_environment.sh b/src/set_dev_environment.sh new file mode 100755 index 00000000..09807f5c --- /dev/null +++ b/src/set_dev_environment.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +# Source this file (e.g ". set_dev_environment.sh") to set up a development +# environment so dynamic modules in the source tree will be found and the +# executables can be run directly, or in gdb/valgrind/etc. + +export INGEN_MODULE_PATH="`pwd`/libs/engine/.libs:`pwd`/libs/serialisation/.libs" + |