summaryrefslogtreecommitdiffstats
path: root/src/engine/NodeFactory.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-20 16:26:40 +0000
committerDavid Robillard <d@drobilla.net>2011-04-20 16:26:40 +0000
commit138a87e915ad3aff184730415105f94c874174bf (patch)
tree0d942bdddfdbcc3d969b4fce5592e770ab851b86 /src/engine/NodeFactory.cpp
parent1f1758f4dda0ddaf01c0b1d3a756f9db8ddc979d (diff)
downloadingen-138a87e915ad3aff184730415105f94c874174bf.tar.gz
ingen-138a87e915ad3aff184730415105f94c874174bf.tar.bz2
ingen-138a87e915ad3aff184730415105f94c874174bf.zip
Rename Ingen::Engine to Ingen::Server (hopefully avoid odd name clases and fix #675).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3184 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/NodeFactory.cpp')
-rw-r--r--src/engine/NodeFactory.cpp148
1 files changed, 0 insertions, 148 deletions
diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp
deleted file mode 100644
index 20ad9fc2..00000000
--- a/src/engine/NodeFactory.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/* This file is part of Ingen.
- * Copyright 2007-2011 David 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 <cstdlib>
-#include <string>
-#include <pthread.h>
-#include <dirent.h>
-#include <float.h>
-#include <cmath>
-#include <glibmm/miscutils.h>
-#include "sord/sordmm.hpp"
-#include "raul/log.hpp"
-#include "ingen-config.h"
-#include "shared/World.hpp"
-#include "internals/Controller.hpp"
-#include "internals/Delay.hpp"
-#include "internals/Note.hpp"
-#include "internals/Trigger.hpp"
-#include "Engine.hpp"
-#include "InternalPlugin.hpp"
-#include "NodeFactory.hpp"
-#include "PatchImpl.hpp"
-#include "ThreadManager.hpp"
-#ifdef HAVE_SLV2
-#include "slv2/slv2.h"
-#include "LV2Plugin.hpp"
-#include "LV2Node.hpp"
-#endif
-
-using namespace std;
-using namespace Raul;
-
-namespace Ingen {
-namespace Engine {
-
-using namespace Internals;
-
-NodeFactory::NodeFactory(Ingen::Shared::World* world)
- : _world(world)
- , _has_loaded(false)
-#ifdef HAVE_SLV2
- , _lv2_info(new LV2Info(world))
-#endif
-{
-}
-
-NodeFactory::~NodeFactory()
-{
- for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i)
- delete i->second;
-
- _plugins.clear();
-}
-
-const NodeFactory::Plugins&
-NodeFactory::plugins()
-{
- if (!_has_loaded) {
- // TODO: Plugin list refreshing
- load_plugins();
- }
- return _plugins;
-}
-
-PluginImpl*
-NodeFactory::plugin(const Raul::URI& uri)
-{
- const Plugins::const_iterator i = _plugins.find(uri);
- return ((i != _plugins.end()) ? i->second : NULL);
-}
-
-void
-NodeFactory::load_plugins()
-{
- ThreadManager::assert_thread(THREAD_PRE_PROCESS);
-
- // Only load if we havn't already, so every client connecting doesn't cause
- // this (expensive!) stuff to happen. Not the best solution - would be nice
- // if clients could refresh plugins list for whatever reason :/
- if (!_has_loaded) {
- _plugins.clear(); // FIXME: assert empty?
-
- load_internal_plugins();
-
-#ifdef HAVE_SLV2
- load_lv2_plugins();
-#endif
-
- _has_loaded = true;
- }
-}
-
-void
-NodeFactory::load_internal_plugins()
-{
- Ingen::Shared::LV2URIMap& uris = *_world->uris().get();
- InternalPlugin* controller_plug = ControllerNode::internal_plugin(uris);
- _plugins.insert(make_pair(controller_plug->uri(), controller_plug));
-
- InternalPlugin* delay_plug = DelayNode::internal_plugin(uris);
- _plugins.insert(make_pair(delay_plug->uri(), delay_plug));
-
- InternalPlugin* note_plug = NoteNode::internal_plugin(uris);
- _plugins.insert(make_pair(note_plug->uri(), note_plug));
-
- InternalPlugin* trigger_plug = TriggerNode::internal_plugin(uris);
- _plugins.insert(make_pair(trigger_plug->uri(), trigger_plug));
-}
-
-#ifdef HAVE_SLV2
-/** Loads information about all LV2 plugins into internal plugin database.
- */
-void
-NodeFactory::load_lv2_plugins()
-{
- SLV2Plugins plugins = slv2_world_get_all_plugins(_world->slv2_world());
-
- SLV2_FOREACH(i, plugins) {
- SLV2Plugin lv2_plug = slv2_plugins_get(plugins, i);
-
- const string uri(slv2_value_as_uri(slv2_plugin_get_uri(lv2_plug)));
-
- assert(_plugins.find(uri) == _plugins.end());
-
- LV2Plugin* const plugin = new LV2Plugin(_lv2_info, uri);
-
- plugin->slv2_plugin(lv2_plug);
- _plugins.insert(make_pair(uri, plugin));
- }
-}
-#endif // HAVE_SLV2
-
-} // namespace Engine
-} // namespace Ingen