diff options
Diffstat (limited to 'src/libs/engine')
21 files changed, 12 insertions, 1251 deletions
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 \ |