diff options
author | David Robillard <d@drobilla.net> | 2007-10-07 19:59:13 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-07 19:59:13 +0000 |
commit | b1406a0e09b0cb27032ade94c58d9a471086b89a (patch) | |
tree | 783b407f0f9ce4504369849ea128375a447dec57 /src/libs | |
parent | 23683a3e4f03dd8f7cdb1dc1a1592fdaa9d18b23 (diff) | |
download | ingen-b1406a0e09b0cb27032ade94c58d9a471086b89a.tar.gz ingen-b1406a0e09b0cb27032ade94c58d9a471086b89a.tar.bz2 ingen-b1406a0e09b0cb27032ade94c58d9a471086b89a.zip |
Remove DSSI.
git-svn-id: http://svn.drobilla.net/lad/ingen@838 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs')
33 files changed, 13 insertions, 1780 deletions
diff --git a/src/libs/client/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp index 96305884..4913b038 100644 --- a/src/libs/client/DeprecatedLoader.cpp +++ b/src/libs/client/DeprecatedLoader.cpp @@ -355,58 +355,6 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr nm->add_port(pm); #endif - // DSSI hacks. Stored in the patch files as special elements, but sent to - // the engine as normal metadata with specially formatted key/values. Not - // sure if this is the best way to go about this, but it's the least damaging - // right now - } else if ((!xmlStrcmp(cur->name, (const xmlChar*)"dssi-program"))) { - cerr << "FIXME: load dssi program\n"; -#if 0 - xmlNodePtr child = cur->xmlChildrenNode; - - string bank; - string program; - - while (child != NULL) { - key = xmlNodeListGetString(doc, child->xmlChildrenNode, 1); - - if ((!xmlStrcmp(child->name, (const xmlChar*)"bank"))) { - bank = (char*)key; - } else if ((!xmlStrcmp(child->name, (const xmlChar*)"program"))) { - program = (char*)key; - } - - xmlFree(key); - key = NULL; // Avoid a (possible?) double free - child = child->next; - } - nm->set_metadata("dssi-program", Atom(bank.append("/").append(program).c_str())); -#endif - - } else if ((!xmlStrcmp(cur->name, (const xmlChar*)"dssi-configure"))) { - cerr << "FIXME: load dssi configure\n"; -#if 0 - xmlNodePtr child = cur->xmlChildrenNode; - - string dssi_key; - string dssi_value; - - while (child != NULL) { - key = xmlNodeListGetString(doc, child->xmlChildrenNode, 1); - - if ((!xmlStrcmp(child->name, (const xmlChar*)"key"))) { - dssi_key = (char*)key; - } else if ((!xmlStrcmp(child->name, (const xmlChar*)"value"))) { - dssi_value = (char*)key; - } - - xmlFree(key); - key = NULL; // Avoid a (possible?) double free - - child = child->next; - } - nm->set_metadata(string("dssi-configure--").append(dssi_key), Atom(dssi_value.c_str())); -#endif } else { // Don't know what this tag is, add it as metadata if (key) add_metadata(initial_data, (const char*)cur->name, (const char*)key); diff --git a/src/libs/client/NodeModel.cpp b/src/libs/client/NodeModel.cpp index 2816c7fa..c3348f89 100644 --- a/src/libs/client/NodeModel.cpp +++ b/src/libs/client/NodeModel.cpp @@ -137,22 +137,6 @@ NodeModel::get_port(const string& port_name) const } -void -NodeModel::add_program(int bank, int program, const string& name) -{ - _banks[bank][program] = name; -} - - -void -NodeModel::remove_program(int bank, int program) -{ - _banks[bank].erase(program); - if (_banks[bank].size() == 0) - _banks.erase(bank); -} - - void NodeModel::port_value_range(SharedPtr<PortModel> port, float& min, float& max) { diff --git a/src/libs/client/NodeModel.hpp b/src/libs/client/NodeModel.hpp index 080d8f4c..1df7f35e 100644 --- a/src/libs/client/NodeModel.hpp +++ b/src/libs/client/NodeModel.hpp @@ -51,8 +51,6 @@ public: SharedPtr<PortModel> get_port(const string& port_name) const; - const Table<int,Table<int,string> >& get_programs() const { return _banks; } - const string& plugin_uri() const { return _plugin_uri; } SharedPtr<PluginModel> plugin() const { return _plugin; } uint32_t num_ports() const { return _ports.size(); } @@ -84,7 +82,6 @@ protected: PortModelList _ports; ///< List of ports (not a Table to preserve order) string _plugin_uri; ///< Plugin URI (if PluginModel is unknown) SharedPtr<PluginModel> _plugin; ///< The plugin this node is an instance of - Table<int, Table<int, string> > _banks; ///< DSSI banks }; diff --git a/src/libs/client/PluginModel.hpp b/src/libs/client/PluginModel.hpp index f3d0a329..67a0295f 100644 --- a/src/libs/client/PluginModel.hpp +++ b/src/libs/client/PluginModel.hpp @@ -65,7 +65,6 @@ public: /*const char* const type_string() const { if (_type == LV2) return "LV2"; else if (_type == LADSPA) return "LADSPA"; - else if (_type == DSSI) return "DSSI"; else if (_type == Internal) return "Internal"; else if (_type == Patch) return "Patch"; else return ""; @@ -74,7 +73,6 @@ public: const char* const type_uri() const { if (_type == LV2) return "ingen:LV2"; else if (_type == LADSPA) return "ingen:LADSPA"; - else if (_type == DSSI) return "ingen:DSSI"; else if (_type == Internal) return "ingen:Internal"; else if (_type == Patch) return "ingen:Patch"; else return ""; @@ -84,7 +82,6 @@ public: void set_type(const string& type_string) { if (type_string == "LV2") _type = LV2; else if (type_string == "LADSPA") _type = LADSPA; - else if (type_string == "DSSI") _type = DSSI; else if (type_string == "Internal") _type = Internal; else if (type_string == "Patch") _type = Patch; } diff --git a/src/libs/engine/DSSINode.cpp b/src/libs/engine/DSSINode.cpp deleted file mode 100644 index 33f8b86c..00000000 --- a/src/libs/engine/DSSINode.cpp +++ /dev/null @@ -1,361 +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 <map> -//#include <set> -#include "DSSINode.hpp" -#include "ClientBroadcaster.hpp" -#include "interface/ClientInterface.hpp" -#include "InputPort.hpp" -#include "types.hpp" -#include "AudioBuffer.hpp" -#include "ProcessContext.hpp" - -using namespace std; - -namespace Ingen { - - -DSSINode::DSSINode(const PluginImpl* plugin, const string& name, bool polyphonic, Patch* parent, DSSI_Descriptor* descriptor, SampleRate srate, size_t buffer_size) -: LADSPANode(plugin, name, 1, parent, descriptor->LADSPA_Plugin, srate, buffer_size), - _dssi_descriptor(descriptor), - _ui_addr(NULL), - _bank(-1), - _program(-1), - _midi_in_port(NULL), - _midi_in_buffer(NULL), - _alsa_events(new snd_seq_event_t[_buffer_size]), - _alsa_encoder(NULL) -{ - snd_midi_event_new(3, &_alsa_encoder); -} - - -DSSINode::~DSSINode() -{ - if (_ui_addr != NULL) - lo_address_free(_ui_addr); - - snd_midi_event_free(_alsa_encoder); - delete [] _alsa_events; -} - - -/** This needs to be overridden here because LADSPANode::instantiate() - * allocates the port array, and we want to add the MIDI input port to that - * array. - */ -bool -DSSINode::instantiate() -{ - assert(!_ports); - - if (has_midi_input()) { - _ports = new Raul::Array<Port*>(_descriptor->PortCount + 1); - _midi_in_port = new InputPort(this, "MIDIIn", _ports->size()-1, 1, DataType::MIDI, _buffer_size); - _ports->at(_ports->size()-1) = _midi_in_port; - } - - // LADSPANode::instantiate checks if _ports is already allocated - if (!LADSPANode::instantiate()) { - delete _ports; - return false; - } - - return true; -} - - -void -DSSINode::activate() -{ - LADSPANode::activate(); - - update_programs(false); - set_default_program(); - - snd_midi_event_reset_encode(_alsa_encoder); -} - - -void -DSSINode::set_ui_url(const string& url) -{ - if (_ui_addr != NULL) - lo_address_free(_ui_addr); - - _ui_url = url; - _ui_addr = lo_address_new_from_url(url.c_str()); - char* base_path = lo_url_get_path(url.c_str()); - _ui_base_path = base_path; - free(base_path); - cerr << "Set UI base path to " << _ui_base_path << endl; -} - - -void -DSSINode::set_control(uint32_t port_num, Sample val) -{ - assert(port_num < _descriptor->PortCount); - Port* port = _ports->at(port_num); - assert(port->type() == DataType::FLOAT); - ((AudioBuffer*)port->buffer(0))->set(val, 0); -} - - -void -DSSINode::configure(const string& key, const string& val) -{ - _dssi_descriptor->configure(_instances[0], key.c_str(), val.c_str()); - _configures[key] = val; - update_programs(true); -} - - -void -DSSINode::program(int bank, int program) -{ - if (_dssi_descriptor->select_program) - _dssi_descriptor->select_program(_instances[0], bank, program); - - _bank = bank; - _program = program; -} - - -void -DSSINode::convert_events(SampleCount nframes) -{ - assert(has_midi_input()); - - _encoded_events = 0; - MidiBuffer& buffer = *_midi_in_buffer; - - if (_midi_in_buffer == 0) - return; - - buffer.prepare_read(nframes); - double timestamp; - uint32_t size; - unsigned char* data; - while (buffer.get_event(×tamp, &size, &data) < nframes && - _encoded_events < _buffer_size) { - snd_midi_event_encode(_alsa_encoder, data, size, - &_alsa_events[_encoded_events]); - _alsa_events[_encoded_events].time.tick = - (snd_seq_tick_time_t)timestamp; - if (_alsa_events[_encoded_events].type != SND_SEQ_EVENT_NONE) - ++_encoded_events; - buffer.increment(); - } -} - - -bool -DSSINode::has_midi_input() const -{ - return (_dssi_descriptor->run_synth || _dssi_descriptor->run_multiple_synths); -} - - -void -DSSINode::process(ProcessContext& context) -{ - NodeBase::pre_process(context); - - if (_dssi_descriptor->run_synth) { - convert_events(context.nframes()); - _dssi_descriptor->run_synth(_instances[0], context.nframes(), - _alsa_events, _encoded_events); - } else if (_dssi_descriptor->run_multiple_synths) { - convert_events(context.nframes()); - // I hate this stupid function - snd_seq_event_t* events[1] = { _alsa_events }; - long unsigned events_sizes[1] = { _encoded_events }; - _dssi_descriptor->run_multiple_synths(1, _instances, context.nframes(), - events, events_sizes); - } else { - LADSPANode::process(context); - } - - NodeBase::post_process(context); -} - - -void -DSSINode::set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf) -{ - assert(voice < _polyphony); - - // Could be a MIDI port after this - if (port_num < _descriptor->PortCount) { - AudioBuffer* audio_buffer = dynamic_cast<AudioBuffer*>(buf); - assert(audio_buffer); - _descriptor->connect_port(_instances[voice], port_num, - audio_buffer->data()); - } - - else if (port_num == _descriptor->PortCount && has_midi_input()) { - MidiBuffer* midi_buffer = dynamic_cast<MidiBuffer*>(buf); - assert(midi_buffer); - _midi_in_buffer = midi_buffer; - } -} - - -void -DSSINode::send_control(int port_num, float value) -{ - string path = _ui_base_path + "/control"; - lo_send(_ui_addr, path.c_str(), "if", port_num, value); -} - - -void -DSSINode::send_program(int bank, int value) -{ - string path = _ui_base_path + "/program"; - lo_send(_ui_addr, path.c_str(), "ii", bank, value); -} - - -void -DSSINode::send_configure(const string& key, const string& val) -{ - string path = _ui_base_path + "/configure"; - lo_send(_ui_addr, path.c_str(), "ss", key.c_str(), val.c_str()); -} - - -void -DSSINode::send_show() -{ - string path = _ui_base_path + "/show"; - lo_send(_ui_addr, path.c_str(), NULL); -} - - -void -DSSINode::send_hide() -{ - string path = _ui_base_path + "/hide"; - lo_send(_ui_addr, path.c_str(), NULL); -} - - -void -DSSINode::send_quit() -{ - string path = _ui_base_path + "/quit"; - lo_send(_ui_addr, path.c_str(), NULL); -} - - -void -DSSINode::send_update() -{ - // send "configure"s - for (map<string, string>::iterator i = _configures.begin(); i != _configures.end(); ++i) - send_configure((*i).first, (*i).second); - - // send "program" - send_program(_bank, _program); - - // send "control"s - for (size_t i=0; i < _ports->size(); ++i) - if (_ports->at(i)->type() == DataType::FLOAT && _ports->at(i)->buffer_size() == 1) - send_control(_ports->at(i)->num(), ((AudioBuffer*)_ports->at(i)->buffer(0))->value_at(0)); - - // send "show" FIXME: not to spec - send_show(); -} - - -bool -DSSINode::update_programs(bool send_events) -{ -#if 0 - // remember all old banks and programs - set<pair<int, int> > to_be_deleted; - map<int, Bank>::const_iterator iter; - Bank::const_iterator iter2; - for (iter = _banks.begin(); iter != _banks.end(); ++iter) { - for (iter2 = iter->second.begin(); iter2 != iter->second.end(); ++iter2) { - to_be_deleted.insert(make_pair(iter->first, iter2->first)); - } - } - - // iterate over all programs - if (_dssi_descriptor->get_program) { - for (int i = 0; true; ++i) { - const DSSI_Program_Descriptor* descriptor = - _dssi_descriptor->get_program(_instances[0], i); - if (!descriptor) - break; - - iter = _banks.find(descriptor->Bank); - if (iter == _banks.end() || - iter->second.find(descriptor->Program) == iter->second.end() || - iter->second.find(descriptor->Program)->second != descriptor->Name) { - _banks[descriptor->Bank][descriptor->Program] = descriptor->Name; - if (send_events) { - _engine.broadcaster()->send_program_add(path(), descriptor->Bank, - descriptor->Program, - descriptor->Name); - } - to_be_deleted.erase(make_pair(descriptor->Bank, descriptor->Program)); - } - } - } - - // remove programs that has disappeared from the plugin - set<pair<int, int> >::const_iterator set_iter; - for (set_iter = to_be_deleted.begin(); - set_iter != to_be_deleted.end(); ++set_iter) { - _banks[set_iter->first].erase(set_iter->second); - if (send_events) - _engine.broadcaster()->send_program_remove(path(), set_iter->first, set_iter->second); - if (_banks[set_iter->first].size() == 0) - _banks.erase(set_iter->first); - } -#endif - cerr << "FIXME: DSSI programs broken!" << endl; - - return true; -} - - -void -DSSINode::set_default_program() -{ - map<int, Bank>::const_iterator iter = _banks.begin(); - if (iter != _banks.end()) { - Bank::const_iterator iter2 = iter->second.begin(); - if (iter2 != iter->second.end()) - program(iter->first, iter2->first); - } -} - - -const map<int, DSSINode::Bank>& -DSSINode::get_programs() const -{ - return _banks; -} - - -} // namespace Ingen diff --git a/src/libs/engine/DSSINode.hpp b/src/libs/engine/DSSINode.hpp deleted file mode 100644 index 38d7ea3d..00000000 --- a/src/libs/engine/DSSINode.hpp +++ /dev/null @@ -1,104 +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 DSSINODE_H -#define DSSINODE_H - -#include <alsa/asoundlib.h> -#include <dssi.h> -#include <lo/lo.h> -#include "LADSPANode.hpp" -#include "MidiBuffer.hpp" - -namespace Ingen { - -class InputPort; -namespace Shared { - class ClientInterface; -} using Shared::ClientInterface; - - -/** An instance of a DSSI plugin. - */ -class DSSINode : public LADSPANode -{ -public: - - typedef std::map<int, string> Bank; - - DSSINode(const PluginImpl* plugin, const string& name, bool polyphonic, Patch* parent, DSSI_Descriptor* descriptor, SampleRate srate, size_t buffer_size); - ~DSSINode(); - - bool instantiate(); - - void activate(); - - void set_ui_url(const string& url); - void send_update(); - - void set_control(uint32_t port_num, Sample val); - void configure(const string& key, const string& val); - void program(int bank, int program); - - void process(ProcessContext& context); - - void set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf); - - bool update_programs(bool send_events); - void set_default_program(); - const std::map<int, Bank>& get_programs() const; - -private: - bool has_midi_input() const; - - // DSSI GUI messages - void send_control(int port_num, float value); - void send_program(int bank, int value); - void send_configure(const std::string& key, const std::string& val); - void send_show(); - void send_hide(); - void send_quit(); - - // Conversion to ALSA MIDI events - void convert_events(SampleCount nframes); - - - DSSI_Descriptor* _dssi_descriptor; - - std::string _ui_url; - std::string _ui_base_path; - lo_address _ui_addr; - - // Current values - int _bank; - int _program; - std::map<std::string, std::string> _configures; - std::map<int, Bank> _banks; - - InputPort* _midi_in_port; - MidiBuffer* _midi_in_buffer; - snd_seq_event_t* _alsa_events; - unsigned long _encoded_events; - snd_midi_event_t* _alsa_encoder; -}; - - -} // namespace Ingen - - -#endif // DSSINODE_H - diff --git a/src/libs/engine/LADSPANode.cpp b/src/libs/engine/LADSPANode.cpp index 6ddead2b..f7b32072 100644 --- a/src/libs/engine/LADSPANode.cpp +++ b/src/libs/engine/LADSPANode.cpp @@ -56,7 +56,6 @@ LADSPANode::LADSPANode(const PluginImpl* plugin, const string& path, bool polyph bool LADSPANode::instantiate() { - // Note that a DSSI plugin might tack more on to the end of this if (!_ports) _ports = new Raul::Array<Port*>(_descriptor->PortCount); diff --git a/src/libs/engine/Makefile.am b/src/libs/engine/Makefile.am index 5952a288..91d48fd7 100644 --- a/src/libs/engine/Makefile.am +++ b/src/libs/engine/Makefile.am @@ -178,20 +178,6 @@ libingen_engine_la_SOURCES += \ LADSPANode.cpp endif -if WITH_DSSI -libingen_engine_la_SOURCES += \ - DSSINode.hpp \ - DSSINode.cpp \ - events/DSSIConfigureEvent.cpp \ - events/DSSIConfigureEvent.hpp \ - events/DSSIControlEvent.cpp \ - events/DSSIControlEvent.hpp \ - events/DSSIProgramEvent.cpp \ - events/DSSIProgramEvent.hpp \ - events/DSSIUpdateEvent.cpp \ - events/DSSIUpdateEvent.hpp -endif - if WITH_LV2 libingen_engine_la_SOURCES += \ LV2Node.hpp \ diff --git a/src/libs/engine/NodeFactory.cpp b/src/libs/engine/NodeFactory.cpp index 3bbe87ff..1e05b923 100644 --- a/src/libs/engine/NodeFactory.cpp +++ b/src/libs/engine/NodeFactory.cpp @@ -36,9 +36,6 @@ #ifdef HAVE_LADSPA #include "LADSPANode.hpp" #endif -#ifdef HAVE_DSSI -#include "DSSINode.hpp" -#endif using namespace std; @@ -157,9 +154,6 @@ NodeFactory::load_plugins() #ifdef HAVE_SLV2 load_lv2_plugins(); #endif -#ifdef HAVE_DSSI - load_dssi_plugins(); -#endif #ifdef HAVE_LADSPA load_ladspa_plugins(); #endif @@ -228,11 +222,6 @@ NodeFactory::load_plugin(const PluginImpl* a_plugin, r = load_lv2_plugin(plugin->uri(), name, polyphonic, parent, srate, buffer_size); break; #endif -#ifdef HAVE_DSSI - case Plugin::DSSI: - r = load_dssi_plugin(plugin->uri(), name, polyphonic, parent, srate, buffer_size); - break; -#endif #ifdef HAVE_LADSPA case Plugin::LADSPA: r = load_ladspa_plugin(plugin->uri(), name, polyphonic, parent, srate, buffer_size); @@ -359,171 +348,6 @@ NodeFactory::load_lv2_plugin(const string& plug_uri, #endif // HAVE_SLV2 -#ifdef HAVE_DSSI - -/** Loads information about all DSSI plugins into internal plugin database. - */ -void -NodeFactory::load_dssi_plugins() -{ - // FIXME: too much code duplication with load_ladspa_plugin - - char* env_dssi_path = getenv("DSSI_PATH"); - string dssi_path; - if (!env_dssi_path) { - cerr << "[NodeFactory] DSSI_PATH is empty. Assuming /usr/lib/dssi:/usr/local/lib/dssi:~/.dssi" << endl; - dssi_path = string("/usr/lib/dssi:/usr/local/lib/dssi:").append( - getenv("HOME")).append("/.dssi"); - } else { - dssi_path = env_dssi_path; - } - - string dir; - string full_lib_name; - - // Yep, this should use an sstream alright.. - while (dssi_path != "") { - dir = dssi_path.substr(0, dssi_path.find(':')); - if (dssi_path.find(':') != string::npos) - dssi_path = dssi_path.substr(dssi_path.find(':')+1); - else - dssi_path = ""; - - DIR* pdir = opendir(dir.c_str()); - if (pdir == NULL) { - //cerr << "[NodeFactory] Unreadable directory in DSSI_PATH: " << dir.c_str() << endl; - continue; - } - - struct dirent* pfile; - while ((pfile = readdir(pdir))) { - - DSSI_Descriptor_Function df = NULL; - DSSI_Descriptor* descriptor = NULL; - - if (!strcmp(pfile->d_name, ".") || !strcmp(pfile->d_name, "..")) - continue; - - full_lib_name = dir +"/"+ pfile->d_name; - - Glib::Module* plugin_library = library(full_lib_name); - if (!plugin_library) { - cerr << "WARNING: Failed to load library " << full_lib_name << endl; - continue; - } - - bool found = plugin_library->get_symbol("dssi_descriptor", (void*&)df); - if (!found || !df) { - // Not a DSSI plugin library - cerr << "WARNING: Non-DSSI library found in DSSI path: " << - full_lib_name << endl; - _libraries.erase(full_lib_name); - delete plugin_library; - continue; - } - - const LADSPA_Descriptor* ld = NULL; - - for (unsigned long i=0; (descriptor = (DSSI_Descriptor*)df(i)) != NULL; ++i) { - ld = descriptor->LADSPA_Plugin; - assert(ld != NULL); - string uri = string("dssi:") + pfile->d_name +":"+ ld->Label; - PluginImpl* plugin = new PluginImpl(Plugin::DSSI, uri); - assert(plugin_library != NULL); - plugin->module(plugin_library); - plugin->lib_path(dir + "/" + pfile->d_name); - plugin->plug_label(ld->Label); - plugin->name(ld->Name); - plugin->type(Plugin::DSSI); - plugin->id(ld->UniqueID); - - bool found = false; - for (list<PluginImpl*>::const_iterator i = _plugins.begin(); i != _plugins.end(); ++i) { - if ((*i)->uri() == plugin->uri()) { - cerr << "Warning: Duplicate DSSI plugin (" << plugin->lib_name() << ":" - << plugin->plug_label() << ")" << " found.\nUsing " << (*i)->lib_path() - << " version." << endl; - found = true; - break; - } - } - if (!found) - _plugins.push_back(plugin); - else - delete plugin; - } - } - closedir(pdir); - } -} - - -/** Creates a Node by instancing a DSSI plugin. - */ -NodeImpl* -NodeFactory::load_dssi_plugin(const string& uri, - const string& name, - bool polyphonic, - Patch* parent, - SampleRate srate, - size_t buffer_size) -{ - // FIXME: awful code duplication here - - assert(uri != ""); - assert(name != ""); - - DSSI_Descriptor_Function df = NULL; - const PluginImpl* plugin = NULL; - NodeImpl* n = NULL; - - // Attempt to find the lib - list<PluginImpl*>::iterator i; - for (i = _plugins.begin(); i != _plugins.end(); ++i) { - plugin = (*i); - if (plugin->uri() == uri) break; - } - - assert(plugin->id() != 0); - - if (i == _plugins.end()) { - cerr << "Did not find DSSI plugin " << uri << " in database." << endl; - return NULL; - } else { - assert(plugin); - if (!plugin->module()->get_symbol("dssi_descriptor", (void*&)df)) { - cerr << "Looks like this isn't a DSSI plugin." << endl; - return NULL; - } - } - - // Attempt to find the plugin in lib - DSSI_Descriptor* descriptor = NULL; - for (unsigned long i=0; (descriptor = (DSSI_Descriptor*)df(i)) != NULL; ++i) { - if (descriptor->LADSPA_Plugin != NULL - && descriptor->LADSPA_Plugin->UniqueID == plugin->id()) { - break; - } - } - - if (descriptor == NULL) { - cerr << "Could not find plugin \"" << plugin->id() << "\" in " << plugin->lib_name() << endl; - return NULL; - } - - n = new DSSINode(plugin, name, polyphonic, parent, descriptor, srate, buffer_size); - - bool success = ((DSSINode*)n)->instantiate(); - if (!success) { - delete n; - n = NULL; - } - - return n; -} -#endif // HAVE_DSSI - - #ifdef HAVE_LADSPA /** Loads information about all LADSPA plugins into internal plugin database. */ diff --git a/src/libs/engine/NodeFactory.hpp b/src/libs/engine/NodeFactory.hpp index decf59c0..47bd4993 100644 --- a/src/libs/engine/NodeFactory.hpp +++ b/src/libs/engine/NodeFactory.hpp @@ -76,11 +76,6 @@ private: NodeImpl* load_lv2_plugin(const string& plugin_uri, const string& name, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size); #endif -#ifdef HAVE_DSSI - void load_dssi_plugins(); - NodeImpl* load_dssi_plugin(const string& plugin_uri, const string& name, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size); -#endif - NodeImpl* load_internal_plugin(const string& plug_label, const string& name, bool polyphonic, Patch* parent, SampleRate srate, size_t buffer_size); Glib::Module* library(const string& path); diff --git a/src/libs/engine/OSCClientSender.cpp b/src/libs/engine/OSCClientSender.cpp index 56971d70..1d1a9323 100644 --- a/src/libs/engine/OSCClientSender.cpp +++ b/src/libs/engine/OSCClientSender.cpp @@ -184,7 +184,7 @@ OSCClientSender::num_plugins(uint32_t num) /** \page client_osc_namespace * <p> \b /ingen/plugin - Notification of the existance of a plugin - * \arg \b type (string) - Type if plugin ("LADSPA", "DSSI", or "Internal") + * \arg \b type (string) - Type if plugin ("LADSPA", "LV2", or "Internal") * \arg \b uri (string) - URI of the plugin (see engine namespace documentation) \n * \arg \b lib-name (string) - Name of shared library plugin resides in (ie "cmt.so") * \arg \b plug-label (string) - Label of the plugin (ie "dahdsr_iaoa") @@ -302,7 +302,7 @@ OSCClientSender::new_port(const std::string& path, * \li This is a notification that the object is <em>externally</em> polyphonic, * i.e. its parent sees several independent buffers for a single port, one for each voice. * An object can be internally polyphonic but externally not if the voices are mixed down; - * this is true of DSSI plugins and subpatches with mismatched polyphony. </p> \n \n + * this is true of some instruments and subpatches with mismatched polyphony. </p> \n \n */ void OSCClientSender::polyphonic(const std::string& path, @@ -472,8 +472,8 @@ OSCClientSender::port_activity(const std::string& port_path) /** \page client_osc_namespace * <p> \b /ingen/plugin - Notification of the existance of a plugin - * \arg \b type (string) - Type of plugin ("LADSPA", "DSSI", or "Internal") - * \arg \b uri (string) - Type of plugin ("LADSPA", "DSSI", or "Internal") + * \arg \b type (string) - Type of plugin ("LADSPA", "LV2", or "Internal") + * \arg \b uri (string) - Type of plugin ("LADSPA", "LV2", or "Internal") * \arg \b name (string) - Descriptive human-readable name of plugin (ie "ADSR Envelope") */ void @@ -547,7 +547,7 @@ OSCClientSender::object_renamed(const std::string& old_path, const std::string& } -/** Sends information about a program associated with a DSSI plugin node. +/** Sends information about a program associated with a node. */ void OSCClientSender::program_add(const std::string& node_path, uint32_t bank, uint32_t program, const std::string& name) diff --git a/src/libs/engine/OSCEngineReceiver.cpp b/src/libs/engine/OSCEngineReceiver.cpp index 41437244..cfb3f860 100644 --- a/src/libs/engine/OSCEngineReceiver.cpp +++ b/src/libs/engine/OSCEngineReceiver.cpp @@ -116,13 +116,6 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t lo_server_add_method(_server, "/ingen/request_plugins", "i", request_plugins_cb, this); lo_server_add_method(_server, "/ingen/request_all_objects", "i", request_all_objects_cb, this); - - // DSSI support -#ifdef HAVE_DSSI - // XXX WARNING: notice this is a catch-all - lo_server_add_method(_server, NULL, NULL, dssi_cb, this); -#endif - lo_server_add_method(_server, NULL, NULL, unknown_cb, NULL); Thread::set_name("OSC Pre-Processor"); @@ -958,43 +951,6 @@ OSCEngineReceiver::_request_all_objects_cb(const char* path, const char* types, } -#ifdef HAVE_DSSI -int -OSCEngineReceiver::_dssi_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ -#if 0 - string node_path(path); - - if (node_path.substr(0, 5) != "/dssi") - return 1; - - string command = node_path.substr(node_path.find_last_of("/")+1); - node_path = node_path.substr(5); // chop off leading "/dssi/" - node_path = node_path.substr(0, node_path.find_last_of("/")); // chop off command at end - - //cout << "DSSI: Got message " << command << " for node " << node_path << endl; - - QueuedEvent* ev = NULL; - - if (command == "update" && !strcmp(types, "s")) - ev = new DSSIUpdateEvent(NULL, node_path, &argv[0]->s); - else if (command == "control" && !strcmp(types, "if")) - ev = new DSSIControlEvent(NULL, node_path, argv[0]->i, argv[1]->f); - else if (command == "configure" && ~strcmp(types, "ss")) - ev = new DSSIConfigureEvent(NULL, node_path, &argv[0]->s, &argv[1]->s); - else if (command == "program" && ~strcmp(types, "ii")) - ev = new DSSIProgramEvent(NULL, node_path, argv[0]->i, argv[1]->i); - - if (ev != NULL) - push(ev); - else - cerr << "[OSCEngineReceiver] Unknown DSSI command received: " << path << endl; -#endif - return 0; -} -#endif - - // Static Callbacks // diff --git a/src/libs/engine/OSCEngineReceiver.hpp b/src/libs/engine/OSCEngineReceiver.hpp index c4f86b8c..918c15e2 100644 --- a/src/libs/engine/OSCEngineReceiver.hpp +++ b/src/libs/engine/OSCEngineReceiver.hpp @@ -124,10 +124,6 @@ private: LO_HANDLER(request_plugins); LO_HANDLER(request_all_objects); -#ifdef HAVE_DSSI - LO_HANDLER(dssi); -#endif - lo_server _server; }; diff --git a/src/libs/engine/PluginImpl.hpp b/src/libs/engine/PluginImpl.hpp index e2aa4374..13f17ca6 100644 --- a/src/libs/engine/PluginImpl.hpp +++ b/src/libs/engine/PluginImpl.hpp @@ -95,7 +95,6 @@ public: const char* type_string() const { if (_type == LADSPA) return "LADSPA"; else if (_type == LV2) return "LV2"; - else if (_type == DSSI) return "DSSI"; else if (_type == Internal) return "Internal"; else if (_type == Patch) return "Patch"; else return ""; @@ -108,7 +107,6 @@ public: void set_type(const string& type_string) { if (type_string == "LADSPA") _type = LADSPA; else if (type_string == "LV2") _type = LV2; - else if (type_string == "DSSI") _type = DSSI; else if (type_string == "Internal") _type = Internal; else if (type_string == "Patch") _type = Patch; } @@ -124,11 +122,11 @@ public: private: Plugin::Type _type; string _uri; ///< LV2 only - string _lib_path; ///< LADSPA/DSSI only - string _lib_name; ///< LADSPA/DSSI only - string _plug_label; ///< LADSPA/DSSI only - string _name; ///< LADSPA/DSSI only - unsigned long _id; ///< LADSPA/DSSI only + string _lib_path; ///< LADSPA only + string _lib_name; ///< LADSPA only + string _plug_label; ///< LADSPA only + string _name; ///< LADSPA only + unsigned long _id; ///< LADSPA only Glib::Module* _module; diff --git a/src/libs/engine/QueuedEngineInterface.cpp b/src/libs/engine/QueuedEngineInterface.cpp index b7d18bde..9899916c 100644 --- a/src/libs/engine/QueuedEngineInterface.cpp +++ b/src/libs/engine/QueuedEngineInterface.cpp @@ -15,6 +15,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include <iostream> #include "QueuedEngineInterface.hpp" #include CONFIG_H_PATH #include "QueuedEventSource.hpp" @@ -292,9 +293,7 @@ QueuedEngineInterface::set_program(const string& node_path, uint32_t bank, uint32_t program) { -#ifdef HAVE_DSSI - push_queued(new DSSIProgramEvent(_engine, _responder, now(), node_path, bank, program)); -#endif + std::cerr << "FIXME: set program" << std::endl; } diff --git a/src/libs/engine/events.hpp b/src/libs/engine/events.hpp index 7f87888d..54b23cce 100644 --- a/src/libs/engine/events.hpp +++ b/src/libs/engine/events.hpp @@ -51,12 +51,5 @@ #include "SetPortValueQueuedEvent.hpp" #include "UnregisterClientEvent.hpp" -#ifdef HAVE_DSSI -#include "DSSIConfigureEvent.hpp" -#include "DSSIControlEvent.hpp" -#include "DSSIProgramEvent.hpp" -#include "DSSIUpdateEvent.hpp" -#endif - #endif // EVENTS_H diff --git a/src/libs/engine/events/DSSIConfigureEvent.cpp b/src/libs/engine/events/DSSIConfigureEvent.cpp deleted file mode 100644 index 25c9ab31..00000000 --- a/src/libs/engine/events/DSSIConfigureEvent.cpp +++ /dev/null @@ -1,76 +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 "DSSIConfigureEvent.hpp" -#include "Engine.hpp" -#include "NodeImpl.hpp" -#include "ClientBroadcaster.hpp" -#include "PluginImpl.hpp" -#include "ObjectStore.hpp" - -using namespace std; - -namespace Ingen { - - -DSSIConfigureEvent::DSSIConfigureEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, const string& key, const string& val) -: QueuedEvent(engine, responder, timestamp), - _node_path(node_path), - _key(key), - _val(val), - _node(NULL) -{ -} - - -void -DSSIConfigureEvent::pre_process() -{ - NodeImpl* node = _engine.object_store()->find_node(_node_path); - - if (node != NULL && node->plugin()->type() == Plugin::DSSI) { - _node = (DSSINode*)node; - _node->configure(_key, _val); - } - - QueuedEvent::pre_process(); -} - - -void -DSSIConfigureEvent::execute(ProcessContext& context) -{ - QueuedEvent::execute(context); - // Nothing. -} - - -void -DSSIConfigureEvent::post_process() -{ - if (_node == NULL) { - cerr << "Unable to find DSSI node " << _node_path << endl; - } else { - string key = "dssi-configure--"; - key += _key; - _engine.broadcaster()->send_metadata_update(_node_path, key, Atom(_val.c_str())); - } -} - - -} // namespace Ingen - diff --git a/src/libs/engine/events/DSSIConfigureEvent.hpp b/src/libs/engine/events/DSSIConfigureEvent.hpp deleted file mode 100644 index 5960daf9..00000000 --- a/src/libs/engine/events/DSSIConfigureEvent.hpp +++ /dev/null @@ -1,50 +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 DSSICONFIGUREEVENT_H -#define DSSICONFIGUREEVENT_H - -#include "QueuedEvent.hpp" -#include "DSSINode.hpp" - -namespace Ingen { - - -/** Change of a 'configure' key/value pair for a DSSI plugin. - * - * \ingroup engine - */ -class DSSIConfigureEvent : public QueuedEvent -{ -public: - DSSIConfigureEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, const string& key, const string& val); - - void pre_process(); - void execute(ProcessContext& context); - void post_process(); - -private: - string _node_path; - string _key; - string _val; - DSSINode* _node; -}; - - -} // namespace Ingen - -#endif // DSSICONFIGUREEVENT_H diff --git a/src/libs/engine/events/DSSIControlEvent.cpp b/src/libs/engine/events/DSSIControlEvent.cpp deleted file mode 100644 index 70c7dc99..00000000 --- a/src/libs/engine/events/DSSIControlEvent.cpp +++ /dev/null @@ -1,70 +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 "DSSIControlEvent.hpp" -#include "Engine.hpp" -#include "NodeImpl.hpp" -#include "PluginImpl.hpp" -#include "ObjectStore.hpp" - -namespace Ingen { - - -DSSIControlEvent::DSSIControlEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, int port_num, Sample val) -: QueuedEvent(engine, responder, timestamp), - _node_path(node_path), - _port_num(port_num), - _val(val), - _node(NULL) -{ -} - - -void -DSSIControlEvent::pre_process() -{ - NodeImpl* node = _engine.object_store()->find_node(_node_path); - - if (node->plugin()->type() != Plugin::DSSI) - _node = NULL; - else - _node = (DSSINode*)node; - - QueuedEvent::pre_process(); -} - - -void -DSSIControlEvent::execute(ProcessContext& context) -{ - QueuedEvent::execute(context); - - if (_node != NULL) - _node->set_control(_port_num, _val); -} - - -void -DSSIControlEvent::post_process() -{ - if (_node == NULL) - std::cerr << "Unable to find DSSI node " << _node_path << std::endl; -} - - -} // namespace Ingen - diff --git a/src/libs/engine/events/DSSIControlEvent.hpp b/src/libs/engine/events/DSSIControlEvent.hpp deleted file mode 100644 index 56fd05cf..00000000 --- a/src/libs/engine/events/DSSIControlEvent.hpp +++ /dev/null @@ -1,52 +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 DSSICONTROLEVENT_H -#define DSSICONTROLEVENT_H - -#include "QueuedEvent.hpp" -#include "DSSINode.hpp" - -namespace Ingen { - - -/** A control change event for a DSSI plugin. - * - * This does essentially the same thing as a SetPortValueEvent. - * - * \ingroup engine - */ -class DSSIControlEvent : public QueuedEvent -{ -public: - DSSIControlEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, int port_num, Sample val); - - void pre_process(); - void execute(ProcessContext& context); - void post_process(); - -private: - string _node_path; - int _port_num; - float _val; - DSSINode* _node; -}; - - -} // namespace Ingen - -#endif // DSSICONTROLEVENT_H diff --git a/src/libs/engine/events/DSSIProgramEvent.cpp b/src/libs/engine/events/DSSIProgramEvent.cpp deleted file mode 100644 index 94cd20dc..00000000 --- a/src/libs/engine/events/DSSIProgramEvent.cpp +++ /dev/null @@ -1,79 +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 "DSSIProgramEvent.hpp" -#include <cstdio> -#include <iostream> -#include "Engine.hpp" -#include "NodeImpl.hpp" -#include "ClientBroadcaster.hpp" -#include "PluginImpl.hpp" -#include "ObjectStore.hpp" -using std::cout; using std::cerr; using std::endl; - - -namespace Ingen { - - -DSSIProgramEvent::DSSIProgramEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, int bank, int program) -: QueuedEvent(engine, responder, timestamp), - _node_path(node_path), - _bank(bank), - _program(program), - _node(NULL) -{ -} - - -void -DSSIProgramEvent::pre_process() -{ - NodeImpl* node = _engine.object_store()->find_node(_node_path); - - if (node != NULL && node->plugin()->type() == Plugin::DSSI) - _node = (DSSINode*)node; - - QueuedEvent::pre_process(); -} - - -void -DSSIProgramEvent::execute(ProcessContext& context) -{ - QueuedEvent::execute(context); - - if (_node != NULL) - _node->program(_bank, _program); -} - - -void -DSSIProgramEvent::post_process() -{ - if (_node == NULL) { - cerr << "Unable to find DSSI node " << _node_path << endl; - } else { - // sends program as metadata in the form bank/program - char* temp_buf = new char[16]; - snprintf(temp_buf, 16, "%d/%d", _bank, _program); - _engine.broadcaster()->send_metadata_update(_node_path, "dssi-program", temp_buf); - } -} - - -} // namespace Ingen - diff --git a/src/libs/engine/events/DSSIProgramEvent.hpp b/src/libs/engine/events/DSSIProgramEvent.hpp deleted file mode 100644 index b66dcb87..00000000 --- a/src/libs/engine/events/DSSIProgramEvent.hpp +++ /dev/null @@ -1,50 +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 DSSIPROGRAMEVENT_H -#define DSSIPROGRAMEVENT_H - -#include "QueuedEvent.hpp" -#include "DSSINode.hpp" - -namespace Ingen { - - -/** A program change for a DSSI plugin. - * - * \ingroup engine - */ -class DSSIProgramEvent : public QueuedEvent -{ -public: - DSSIProgramEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, int bank, int program); - - void pre_process(); - void execute(ProcessContext& context); - void post_process(); - -private: - string _node_path; - int _bank; - int _program; - DSSINode* _node; -}; - - -} // namespace Ingen - -#endif // DSSIPROGRAMEVENT_H diff --git a/src/libs/engine/events/DSSIUpdateEvent.cpp b/src/libs/engine/events/DSSIUpdateEvent.cpp deleted file mode 100644 index 8f2eea6a..00000000 --- a/src/libs/engine/events/DSSIUpdateEvent.cpp +++ /dev/null @@ -1,80 +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 "DSSIUpdateEvent.hpp" -#include <iostream> -#include "NodeImpl.hpp" -#include "ObjectStore.hpp" -#include "Engine.hpp" -#include "DSSINode.hpp" -#include "PluginImpl.hpp" - -using std::cerr; using std::endl; - -namespace Ingen { - - -DSSIUpdateEvent::DSSIUpdateEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path, const string& url) -: QueuedEvent(engine, responder, timestamp), - _path(path), - _url(url), - _node(NULL) -{ -} - - -void -DSSIUpdateEvent::pre_process() -{ - NodeImpl* node = _engine.object_store()->find_node(_path); - - if (node == NULL || node->plugin()->type() != Plugin::DSSI) { - _node = NULL; - QueuedEvent::pre_process(); - return; - } else { - _node = (DSSINode*)node; - } - - QueuedEvent::pre_process(); -} - - -void -DSSIUpdateEvent::execute(ProcessContext& context) -{ - QueuedEvent::execute(context); - - if (_node != NULL) { - _node->set_ui_url(_url); - } -} - - -void -DSSIUpdateEvent::post_process() -{ - cerr << "DSSI update event: " << _url << endl; - - if (_node != NULL) { - _node->send_update(); - } -} - - -} // namespace Ingen - diff --git a/src/libs/engine/events/DSSIUpdateEvent.hpp b/src/libs/engine/events/DSSIUpdateEvent.hpp deleted file mode 100644 index 16a2b50a..00000000 --- a/src/libs/engine/events/DSSIUpdateEvent.hpp +++ /dev/null @@ -1,55 +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 DSSIUPDATEEVENT_H -#define DSSIUPDATEEVENT_H - -#include "QueuedEvent.hpp" -#include <string> - -using std::string; - -namespace Ingen { - -class DSSINode; - - -/** A DSSI "update" responder for a DSSI plugin/node. - * - * This sends all information about the plugin to the UI (over OSC). - * - * \ingroup engine - */ -class DSSIUpdateEvent : public QueuedEvent -{ -public: - DSSIUpdateEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path, const string& url); - - void pre_process(); - void execute(ProcessContext& context); - void post_process(); - -private: - string _path; - string _url; - DSSINode* _node; -}; - - -} // namespace Ingen - -#endif // DSSIUPDATEEVENT_H diff --git a/src/libs/engine/events/Makefile.am b/src/libs/engine/events/Makefile.am index 67ccf0e5..f437be2c 100644 --- a/src/libs/engine/events/Makefile.am +++ b/src/libs/engine/events/Makefile.am @@ -13,14 +13,6 @@ EXTRA_DIST = \ CreatePatchEvent.hpp \ CreatePortEvent.cpp \ CreatePortEvent.hpp \ - DSSIConfigureEvent.cpp \ - DSSIConfigureEvent.hpp \ - DSSIControlEvent.cpp \ - DSSIControlEvent.hpp \ - DSSIProgramEvent.cpp \ - DSSIProgramEvent.hpp \ - DSSIUpdateEvent.cpp \ - DSSIUpdateEvent.hpp \ DeactivateEvent.cpp \ DeactivateEvent.hpp \ DestroyEvent.cpp \ diff --git a/src/libs/gui/DSSIController.cpp b/src/libs/gui/DSSIController.cpp deleted file mode 100644 index 9bb037ba..00000000 --- a/src/libs/gui/DSSIController.cpp +++ /dev/null @@ -1,280 +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 "DSSIController.hpp" -#include <iomanip> -#include <sstream> -#include <dirent.h> -#include <unistd.h> -#include <sys/stat.h> -#include "interface/EngineInterface.hpp" -#include "client/NodeModel.hpp" -#include "App.hpp" -#include "DSSIModule.hpp" - -namespace Ingen { -namespace GUI { - - -DSSIController::DSSIController(SharedPtr<NodeModel> model) -: _banks_dirty(true) -{ -#if 0 - assert(model->plugin()->type() == PluginModel::DSSI); - Gtk::Menu::MenuList& items = _menu.items(); - items[0].property_sensitive() = true; // "Show Control Window" item - - Gtk::Menu_Helpers::MenuElem program_elem("Select Program", _program_menu); - items.push_front(program_elem); - _program_menu_item = program_elem.get_child(); - _program_menu_item->set_sensitive(false); - - items.push_front(Gtk::Menu_Helpers::MenuElem("Show Plugin GUI", - sigc::mem_fun(this, &DSSIController::show_gui))); -#endif -} - -void -DSSIController::program_add(int bank, int program, const string& name) -{ - cerr << "FIXME: DSSI add program\n"; - //node_model()->add_program(bank, program, name); - //m_banks_dirty = true; -} - - -void -DSSIController::program_remove(int bank, int program) -{ - cerr << "FIXME: DSSI add program\n"; - //node_model()->remove_program(bank, program); - //m_banks_dirty = true; -} - -/** Trivial wrapper of attempt_to_show_gui for libsigc - */ -void -DSSIController::show_gui() -{ - attempt_to_show_gui(); -} - - -void -DSSIController::update_program_menu() -{ - cerr << "FIXME: Program menu\n"; -#if 0 - _program_menu.items().clear(); - - const map<int, map<int, string> >& banks = node_model()->get_programs(); - std::ostringstream oss; - - map<int, map<int, string> >::const_iterator i; - for (i = banks.begin(); i != banks.end(); ++i) { - Gtk::Menu* bank_menu; - if (banks.size() > 1) - bank_menu = manage(new Gtk::Menu()); - else - bank_menu = &_program_menu; - map<int, string>::const_iterator j; - for (j = i->second.begin(); j != i->second.end(); ++j) { - oss.str(""); - oss << std::setw(3) << std::setfill('0') - << j->first << ' ' << j->second; - sigc::slot<void> slt = bind( - bind(sigc::mem_fun(*this, &DSSIController::send_program_change), - j->first), i->first); - bank_menu->items().push_back( - Gtk::Menu_Helpers::MenuElem(oss.str(), slt)); - } - if (banks.size() > 1) { - oss.str(""); - oss << "Bank " << i->first; - _program_menu.items().push_back( - Gtk::Menu_Helpers::MenuElem(oss.str(), *bank_menu)); - } - } - - // Disable the program menu if there are no programs - if (banks.size() == 0) - _program_menu_item->set_sensitive(false); - else - _program_menu_item->set_sensitive(true); - - _banks_dirty = false; -#endif -} - - -void -DSSIController::send_program_change(int bank, int program) -{ - //App::instance().engine()->set_program(node_model()->path(), bank, program); -} - - -/** Attempt to show the DSSI GUI for this plugin. - * - * Returns whether or not GUI was successfully loaded/shown. - */ -bool -DSSIController::attempt_to_show_gui() -{ - cerr << "FIXME: DSSI GUI" << endl; -#if 0 - // Shamelessley "inspired by" jack-dssi-host - // Copyright 2004 Chris Cannam, Steve Harris and Sean Bolton. - - const bool verbose = false; - - string engine_url = App::instance().engine()->engine_url(); - // Hack off last character if it's a / - if (engine_url[engine_url.length()-1] == '/') - engine_url = engine_url.substr(0, engine_url.length()-1); - - const char* dllName = node_model()->plugin()->lib_name().c_str(); - const char* label = node_model()->plugin()->plug_label().c_str(); - const char* myName = "ingenuity"; - const string& oscUrl = engine_url + "/dssi" + node_model()->path(); - - struct dirent* entry = NULL; - char* dllBase = strdup(dllName); - char* subpath = NULL; - DIR* subdir = NULL; - char* filename = NULL; - struct stat buf; - int fuzzy = 0; - - char* env_dssi_path = getenv("DSSI_PATH"); - string dssi_path; - if (!env_dssi_path) { - cerr << "DSSI_PATH is empty. Assuming /usr/lib/dssi:/usr/local/lib/dssi." << endl; - dssi_path = "/usr/lib/dssi:/usr/local/lib/dssi"; - } else { - dssi_path = env_dssi_path; - } - - if (strlen(dllBase) > 3 && !strcasecmp(dllBase + strlen(dllBase) - 3, ".so")) { - dllBase[strlen(dllBase) - 3] = '\0'; - } - - - // This is pretty nasty, it loops through the path, even if the dllBase is absolute - while (dssi_path != "") { - string directory = dssi_path.substr(0, dssi_path.find(':')); - if (dssi_path.find(':') != string::npos) - dssi_path = dssi_path.substr(dssi_path.find(':')+1); - else - dssi_path = ""; - - if (*dllBase == '/') { - subpath = strdup(dllBase); - } else { - subpath = (char*)malloc(strlen(directory.c_str()) + strlen(dllBase) + 2); - sprintf(subpath, "%s/%s", directory.c_str(), dllBase); - } - - for (fuzzy = 0; fuzzy <= 1; ++fuzzy) { - - if (!(subdir = opendir(subpath))) { - if (verbose) { - fprintf(stderr, "%s: can't open plugin GUI directory \"%s\"\n", myName, subpath); - } - break; - } - - while ((entry = readdir(subdir))) { - - if (entry->d_name[0] == '.') - continue; - if (!strchr(entry->d_name, '_')) - continue; - - if (fuzzy) { - if (verbose) { - fprintf(stderr, "checking %s against %s\n", entry->d_name, dllBase); - } - if (strncmp(entry->d_name, dllBase, strlen(dllBase))) - continue; - } else { - if (verbose) { - fprintf(stderr, "checking %s against %s\n", entry->d_name, label); - } - if (strncmp(entry->d_name, label, strlen(label))) - continue; - } - - filename = (char*)malloc(strlen(subpath) + strlen(entry->d_name) + 2); - sprintf(filename, "%s/%s", subpath, entry->d_name); - - if (stat(filename, &buf)) { - perror("stat failed"); - free(filename); - continue; - } - - if ((S_ISREG(buf.st_mode) || S_ISLNK(buf.st_mode)) && - (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) { - - if (verbose) { - fprintf(stderr, "%s: trying to execute GUI at \"%s\"\n", - myName, filename); - } - - if (fork() == 0) { - execlp(filename, filename, oscUrl.c_str(), dllName, label, - node_model()->name().c_str(), 0); - perror("exec failed"); - exit(1); - } - - free(filename); - free(subpath); - free(dllBase); - return true; - } - - free(filename); - } - } - } - - cerr << "Unable to launch DSSI GUI for " << node_model()->path() << endl; - - free(subpath); - free(dllBase); -#endif - return false; -} - - -void -DSSIController::show_menu(GdkEventButton* event) -{ -#if 0 - if (_banks_dirty) - update_program_menu(); - - NodeController::show_menu(event); -#endif -} - - -} // namespace GUI -} // namespace Ingen - diff --git a/src/libs/gui/DSSIController.hpp b/src/libs/gui/DSSIController.hpp deleted file mode 100644 index 7d6e0c97..00000000 --- a/src/libs/gui/DSSIController.hpp +++ /dev/null @@ -1,77 +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 DSSICONTROLLER_H -#define DSSICONTROLLER_H - -#include <string> -#include <gtkmm.h> -#include <raul/Path.hpp> -#include "client/NodeModel.hpp" - -using std::string; -using namespace Ingen::Client; - -namespace Ingen { namespace Client { - class MetadataModel; - class NodeModel; - class PortModel; -} } - -namespace Ingen { -namespace GUI { - -class NodeControlWindow; - - -/* Controller for a DSSI node. - * - * FIXME: legacy cruft. move this code to the appropriate places and nuke - * this class. - * - * \ingroup GUI - */ -class DSSIController -{ -public: - DSSIController(SharedPtr<NodeModel> model); - - virtual ~DSSIController() {} - - void show_gui(); - bool attempt_to_show_gui(); - void program_add(int bank, int program, const string& name); - void program_remove(int bank, int program); - - void send_program_change(int bank, int program); - - void show_menu(GdkEventButton* event); - -private: - void update_program_menu(); - - Gtk::Menu _program_menu; - Glib::RefPtr<Gtk::MenuItem> _program_menu_item; - - bool _banks_dirty; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // DSSICONTROLLER_H diff --git a/src/libs/gui/DSSIModule.cpp b/src/libs/gui/DSSIModule.cpp deleted file mode 100644 index 84058100..00000000 --- a/src/libs/gui/DSSIModule.cpp +++ /dev/null @@ -1,43 +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 "DSSIModule.hpp" -#include "DSSIController.hpp" - -namespace Ingen { -namespace GUI { - - -DSSIModule::DSSIModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> node) -: NodeModule(canvas, node) -{ -} - - -void -DSSIModule::on_double_click(GdkEventButton* ev) -{ - /* - DSSIController* dc = dynamic_cast<DSSIController*>(_node); - if (!dc || ! dc->attempt_to_show_gui()) - show_control_window(); - */ -} - - -} // namespace GUI -} // namespace Ingen diff --git a/src/libs/gui/DSSIModule.hpp b/src/libs/gui/DSSIModule.hpp deleted file mode 100644 index 76824bdc..00000000 --- a/src/libs/gui/DSSIModule.hpp +++ /dev/null @@ -1,46 +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 DSSIMODULE_H -#define DSSIMODULE_H - -#include "NodeModule.hpp" - -namespace Ingen { -namespace GUI { - -class DSSIController; - -/* Module for a DSSI node. - * - * \ingroup GUI - */ -class DSSIModule : public NodeModule -{ -public: - DSSIModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> node); - virtual ~DSSIModule() {} - - void on_double_click(GdkEventButton* ev); -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // DSSIMODULE_H - diff --git a/src/libs/gui/LoadPluginWindow.cpp b/src/libs/gui/LoadPluginWindow.cpp index 9aaed171..6d698f94 100644 --- a/src/libs/gui/LoadPluginWindow.cpp +++ b/src/libs/gui/LoadPluginWindow.cpp @@ -224,8 +224,6 @@ LoadPluginWindow::set_plugins(const Raul::Table<string, SharedPtr<PluginModel> > row[_plugins_columns._col_type] = "Internal"; else if (!strcmp(plugin->type_uri(), "ingen:LV2")) row[_plugins_columns._col_type] = "LV2"; - else if (!strcmp(plugin->type_uri(), "ingen:DSSI")) - row[_plugins_columns._col_type] = "DSSI"; else if (!strcmp(plugin->type_uri(), "ingen:LADSPA")) row[_plugins_columns._col_type] = "LADSPA"; else diff --git a/src/libs/gui/Makefile.am b/src/libs/gui/Makefile.am index a1e070cd..d0d07fd8 100644 --- a/src/libs/gui/Makefile.am +++ b/src/libs/gui/Makefile.am @@ -46,10 +46,6 @@ libingen_gui_la_SOURCES = \ ControlGroups.hpp \ ControlPanel.cpp \ ControlPanel.hpp \ - DSSIController.cpp \ - DSSIController.hpp \ - DSSIModule.cpp \ - DSSIModule.hpp \ GladeFactory.cpp \ GladeFactory.hpp \ LoadPatchWindow.cpp \ diff --git a/src/libs/gui/NodeModule.hpp b/src/libs/gui/NodeModule.hpp index cf4bff9e..32e9220d 100644 --- a/src/libs/gui/NodeModule.hpp +++ b/src/libs/gui/NodeModule.hpp @@ -42,8 +42,7 @@ class Port; /** A module in a patch. * - * This base class is extended for various types of modules - SubpatchModule, - * DSSIModule, etc. + * This base class is extended for various types of modules. * * \ingroup GUI */ diff --git a/src/libs/gui/UploadPatchWindow.hpp b/src/libs/gui/UploadPatchWindow.hpp index c3de55fa..af064bdb 100644 --- a/src/libs/gui/UploadPatchWindow.hpp +++ b/src/libs/gui/UploadPatchWindow.hpp @@ -28,7 +28,6 @@ #include "client/PatchModel.hpp" #include "client/PluginModel.hpp" using Ingen::Client::PatchModel; -using Ingen::Client::MetadataMap; namespace Ingen { namespace GUI { |