diff options
author | David Robillard <d@drobilla.net> | 2007-09-20 01:25:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-09-20 01:25:40 +0000 |
commit | 99524eb321120773c39ca357396603eb32cffd2c (patch) | |
tree | aca911f6109756b865f8315e27a13e57f6c9b3b4 /src/libs/engine | |
parent | 0a9c38574cafd3e77234d220a18241025098bbb3 (diff) | |
download | ingen-99524eb321120773c39ca357396603eb32cffd2c.tar.gz ingen-99524eb321120773c39ca357396603eb32cffd2c.tar.bz2 ingen-99524eb321120773c39ca357396603eb32cffd2c.zip |
Strip a bunch of old useless code.
git-svn-id: http://svn.drobilla.net/lad/ingen@735 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine')
-rw-r--r-- | src/libs/engine/ClientBroadcaster.cpp | 57 | ||||
-rw-r--r-- | src/libs/engine/ClientBroadcaster.hpp | 7 | ||||
-rw-r--r-- | src/libs/engine/Driver.hpp | 26 | ||||
-rw-r--r-- | src/libs/engine/LADSPANode.cpp | 75 | ||||
-rw-r--r-- | src/libs/engine/LV2Node.cpp | 76 | ||||
-rw-r--r-- | src/libs/engine/OSCClientSender.cpp | 91 | ||||
-rw-r--r-- | src/libs/engine/ObjectStore.cpp | 10 | ||||
-rw-r--r-- | src/libs/engine/Plugin.hpp | 11 | ||||
-rw-r--r-- | src/libs/engine/PostProcessor.cpp | 16 | ||||
-rw-r--r-- | src/libs/engine/events/DestroyEvent.cpp | 33 | ||||
-rw-r--r-- | src/libs/engine/events/DestroyEvent.hpp | 1 |
11 files changed, 10 insertions, 393 deletions
diff --git a/src/libs/engine/ClientBroadcaster.cpp b/src/libs/engine/ClientBroadcaster.cpp index 6193b586..94452e73 100644 --- a/src/libs/engine/ClientBroadcaster.cpp +++ b/src/libs/engine/ClientBroadcaster.cpp @@ -102,51 +102,6 @@ ClientBroadcaster::send_error(const string& msg) void ClientBroadcaster::send_plugins_to(ClientInterface* client, const list<Plugin*>& plugin_list) { -#if 0 - // FIXME: This probably isn't actually thread safe - const list<Plugin*> plugs = plugin_list; // make a copy - - const Plugin* plugin; - - // FIXME FIXME FIXME - OSCClientSender* osc_client = dynamic_cast<OSCClientSender*>(client); - assert(osc_client); - - lo_timetag tt; - lo_timetag_now(&tt); - lo_bundle b = lo_bundle_new(tt); - lo_message m = lo_message_new(); - list<lo_message> msgs; - - lo_message_add_int32(m, plugs.size()); - lo_bundle_add_message(b, "/om/num_plugins", m); - msgs.push_back(m); - - for (list<Plugin*>::const_iterator j = plugs.begin(); j != plugs.end(); ++j) { - plugin = (*j); - m = lo_message_new(); - - lo_message_add_string(m, plugin->type_string()); - lo_message_add_string(m, plugin->uri().c_str()); - lo_message_add_string(m, plugin->name().c_str()); - lo_bundle_add_message(b, "/om/plugin", m); - msgs.push_back(m); - if (lo_bundle_length(b) > 1024) { - lo_send_bundle(osc_client->address(), b); - lo_bundle_free(b); - b = lo_bundle_new(tt); - } - } - - if (lo_bundle_length(b) > 0) { - lo_send_bundle(osc_client->address(), b); - lo_bundle_free(b); - } else { - lo_bundle_free(b); - } - for (list<lo_bundle>::const_iterator i = msgs.begin(); i != msgs.end(); ++i) - lo_message_free(*i); -#endif client->transfer_begin(); for (list<Plugin*>::const_iterator i = plugin_list.begin(); i != plugin_list.end(); ++i) { @@ -310,16 +265,4 @@ ClientBroadcaster::send_rename(const string& old_path, const string& new_path) } -/** Sends all GraphObjects known to the engine. - */ -void -ClientBroadcaster::send_all_objects() -{ - cerr << "FIXME: send_all" << endl; - - //for (Clients::const_iterator i = _clients.begin(); i != _clients.end(); ++i) - // (*i).second->send_all_objects(); -} - - } // namespace Ingen diff --git a/src/libs/engine/ClientBroadcaster.hpp b/src/libs/engine/ClientBroadcaster.hpp index 42bd817b..7977cc6f 100644 --- a/src/libs/engine/ClientBroadcaster.hpp +++ b/src/libs/engine/ClientBroadcaster.hpp @@ -58,17 +58,11 @@ public: ClientInterface* client(const string& uri); - // Notification band: - //void send_client_registration(const string& url, int client_id); // Error that isn't the direct result of a request void send_error(const string& msg); - - - //void send_node_creation_messages(const Node* const node); - void send_plugins(const list<Plugin*>& plugin_list); void send_patch(const Patch* const p, bool recursive); void send_node(const Node* const node, bool recursive); @@ -79,7 +73,6 @@ public: void send_connection(const Connection* const connection); void send_disconnection(const string& src_port_path, const string& dst_port_path); void send_rename(const string& old_path, const string& new_path); - void send_all_objects(); void send_patch_enable(const string& patch_path); void send_patch_disable(const string& patch_path); void send_patch_polyphony(const string& patch_path, uint32_t poly); diff --git a/src/libs/engine/Driver.hpp b/src/libs/engine/Driver.hpp index 786b7775..012b4ab0 100644 --- a/src/libs/engine/Driver.hpp +++ b/src/libs/engine/Driver.hpp @@ -89,32 +89,6 @@ protected: }; -#if 0 -/** Dummy audio driver. - * - * Not abstract, all functions are dummies. One of these will be allocated and - * "used" if no working AUDIO driver is loaded. (Doing it this way as opposed to - * just making Driver have dummy functions makes sure any existing Driver - * derived class actually implements the required functions). - * - * \ingroup engine - */ -class DummyDriver : public Driver -{ -public: - ~DummyDriver() {} - - void activate() {} - void deactivate() {} - - void enable() {} - void disable() {} - - DriverPort* create_port(TypedPort<Sample>* patch_port) { return NULL; } -}; -#endif - - } // namespace Ingen #endif // DRIVER_H diff --git a/src/libs/engine/LADSPANode.cpp b/src/libs/engine/LADSPANode.cpp index 67ae0b62..3e3f863e 100644 --- a/src/libs/engine/LADSPANode.cpp +++ b/src/libs/engine/LADSPANode.cpp @@ -212,81 +212,6 @@ LADSPANode::set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf) audio_buffer->data()); } -#if 0 -// Based on code stolen from jack-rack -void -LADSPANode::get_port_vals(ulong port_index, PortInfo* info) -{ - LADSPA_Data upper = 0.0f; - LADSPA_Data lower = 0.0f; - LADSPA_Data normal = 0.0f; - LADSPA_PortRangeHintDescriptor hint_descriptor = _descriptor->PortRangeHints[port_index].HintDescriptor; - - /* set upper and lower, possibly adjusted to the sample rate */ - if (LADSPA_IS_HINT_SAMPLE_RATE(hint_descriptor)) { - upper = _descriptor->PortRangeHints[port_index].UpperBound * _srate; - lower = _descriptor->PortRangeHints[port_index].LowerBound * _srate; - } else { - upper = _descriptor->PortRangeHints[port_index].UpperBound; - lower = _descriptor->PortRangeHints[port_index].LowerBound; - } - - if (LADSPA_IS_HINT_LOGARITHMIC(hint_descriptor)) { - /* FLT_EPSILON is defined as the different between 1.0 and the minimum - * float greater than 1.0. So, if lower is < FLT_EPSILON, it will be 1.0 - * and the logarithmic control will have a base of 1 and thus not change - */ - if (lower < FLT_EPSILON) lower = FLT_EPSILON; - } - - - if (LADSPA_IS_HINT_HAS_DEFAULT(hint_descriptor)) { - - if (LADSPA_IS_HINT_DEFAULT_MINIMUM(hint_descriptor)) { - normal = lower; - } else if (LADSPA_IS_HINT_DEFAULT_LOW(hint_descriptor)) { - if (LADSPA_IS_HINT_LOGARITHMIC(hint_descriptor)) { - normal = exp(log(lower) * 0.75 + log(upper) * 0.25); - } else { - normal = lower * 0.75 + upper * 0.25; - } - } else if (LADSPA_IS_HINT_DEFAULT_MIDDLE(hint_descriptor)) { - if (LADSPA_IS_HINT_LOGARITHMIC(hint_descriptor)) { - normal = exp(log(lower) * 0.5 + log(upper) * 0.5); - } else { - normal = lower * 0.5 + upper * 0.5; - } - } else if (LADSPA_IS_HINT_DEFAULT_HIGH(hint_descriptor)) { - if (LADSPA_IS_HINT_LOGARITHMIC(hint_descriptor)) { - normal = exp(log(lower) * 0.25 + log(upper) * 0.75); - } else { - normal = lower * 0.25 + upper * 0.75; - } - } else if (LADSPA_IS_HINT_DEFAULT_MAXIMUM(hint_descriptor)) { - normal = upper; - } else if (LADSPA_IS_HINT_DEFAULT_0(hint_descriptor)) { - normal = 0.0; - } else if (LADSPA_IS_HINT_DEFAULT_1(hint_descriptor)) { - normal = 1.0; - } else if (LADSPA_IS_HINT_DEFAULT_100(hint_descriptor)) { - normal = 100.0; - } else if (LADSPA_IS_HINT_DEFAULT_440(hint_descriptor)) { - normal = 440.0; - } - } else { // No default hint - if (LADSPA_IS_HINT_BOUNDED_BELOW(hint_descriptor)) { - normal = lower; - } else if (LADSPA_IS_HINT_BOUNDED_ABOVE(hint_descriptor)) { - normal = upper; - } - } - - info->min_val(lower); - info->default_val(normal); - info->max_val(upper); -} -#endif - void LADSPANode::get_port_limits(unsigned long port_index, Sample& normal, Sample& lower, Sample& upper) diff --git a/src/libs/engine/LV2Node.cpp b/src/libs/engine/LV2Node.cpp index 8de8c04a..c8c13f38 100644 --- a/src/libs/engine/LV2Node.cpp +++ b/src/libs/engine/LV2Node.cpp @@ -256,81 +256,5 @@ LV2Node::set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf) } -#if 0 -// Based on code stolen from jack-rack -void -LV2Node::get_port_vals(ulong port_index, PortInfo* info) -{ - LV2_Data upper = 0.0f; - LV2_Data lower = 0.0f; - LV2_Data normal = 0.0f; - LV2_PortRangeHintDescriptor hint_descriptor = _descriptor->PortRangeHints[port_index].HintDescriptor; - - /* set upper and lower, possibly adjusted to the sample rate */ - if (LV2_IS_HINT_SAMPLE_RATE(hint_descriptor)) { - upper = _descriptor->PortRangeHints[port_index].UpperBound * _srate; - lower = _descriptor->PortRangeHints[port_index].LowerBound * _srate; - } else { - upper = _descriptor->PortRangeHints[port_index].UpperBound; - lower = _descriptor->PortRangeHints[port_index].LowerBound; - } - - if (LV2_IS_HINT_LOGARITHMIC(hint_descriptor)) { - /* FLT_EPSILON is defined as the different between 1.0 and the minimum - * float greater than 1.0. So, if lower is < FLT_EPSILON, it will be 1.0 - * and the logarithmic control will have a base of 1 and thus not change - */ - if (lower < FLT_EPSILON) lower = FLT_EPSILON; - } - - - if (LV2_IS_HINT_HAS_DEFAULT(hint_descriptor)) { - - if (LV2_IS_HINT_DEFAULT_MINIMUM(hint_descriptor)) { - normal = lower; - } else if (LV2_IS_HINT_DEFAULT_LOW(hint_descriptor)) { - if (LV2_IS_HINT_LOGARITHMIC(hint_descriptor)) { - normal = exp(log(lower) * 0.75 + log(upper) * 0.25); - } else { - normal = lower * 0.75 + upper * 0.25; - } - } else if (LV2_IS_HINT_DEFAULT_MIDDLE(hint_descriptor)) { - if (LV2_IS_HINT_LOGARITHMIC(hint_descriptor)) { - normal = exp(log(lower) * 0.5 + log(upper) * 0.5); - } else { - normal = lower * 0.5 + upper * 0.5; - } - } else if (LV2_IS_HINT_DEFAULT_HIGH(hint_descriptor)) { - if (LV2_IS_HINT_LOGARITHMIC(hint_descriptor)) { - normal = exp(log(lower) * 0.25 + log(upper) * 0.75); - } else { - normal = lower * 0.25 + upper * 0.75; - } - } else if (LV2_IS_HINT_DEFAULT_MAXIMUM(hint_descriptor)) { - normal = upper; - } else if (LV2_IS_HINT_DEFAULT_0(hint_descriptor)) { - normal = 0.0; - } else if (LV2_IS_HINT_DEFAULT_1(hint_descriptor)) { - normal = 1.0; - } else if (LV2_IS_HINT_DEFAULT_100(hint_descriptor)) { - normal = 100.0; - } else if (LV2_IS_HINT_DEFAULT_440(hint_descriptor)) { - normal = 440.0; - } - } else { // No default hint - if (LV2_IS_HINT_BOUNDED_BELOW(hint_descriptor)) { - normal = lower; - } else if (LV2_IS_HINT_BOUNDED_ABOVE(hint_descriptor)) { - normal = upper; - } - } - - info->min_val(lower); - info->default_val(normal); - info->max_val(upper); -} -#endif - - } // namespace Ingen diff --git a/src/libs/engine/OSCClientSender.cpp b/src/libs/engine/OSCClientSender.cpp index a2034cda..35b17f36 100644 --- a/src/libs/engine/OSCClientSender.cpp +++ b/src/libs/engine/OSCClientSender.cpp @@ -252,105 +252,18 @@ OSCClientSender::plugins() */ void OSCClientSender::new_node(const std::string& plugin_uri, const std::string& node_path, - bool is_polyphonic, - uint32_t num_ports) + bool is_polyphonic, + uint32_t num_ports) { if (!_enabled) return; - //cerr << "Sending node " << node_path << endl; - if (is_polyphonic) lo_send(_address, "/ingen/new_node", "ssTi", plugin_uri.c_str(), node_path.c_str(), num_ports); else lo_send(_address, "/ingen/new_node", "ssFi", plugin_uri.c_str(), node_path.c_str(), num_ports); -#if 0 - /* - lo_timetag tt; - lo_timetag_now(&tt); - lo_bundle b = lo_bundle_new(tt); - lo_message m = lo_message_new(); - list<lo_message> msgs; - - lo_message_add_string(m, plugin_type.c_str()); - lo_message_add_string(m, plugin_uri.c_str()); - lo_message_add_string(m, node_path.c_str()); - lo_message_add_int32(m, is_polyphonic ? 1 : 0); - lo_message_add_int32(m, num_ports); - - lo_bundle_add_message(b, "/ingen/new_node", m); - msgs.push_back(m); -*/ - - - /* - const Raul::Array<Port*>& ports = node->ports(); - Port* port; - PortInfo* info; - for (size_t j=0; j < ports.size(); ++j) { - port = ports.at(j); - info = port->port_info(); - - assert(port != NULL); - assert(info != NULL); - - m = lo_message_new(); - lo_message_add_string(m, port->path().c_str()); - lo_message_add_string(m, info->type_const std::string&().c_str()); - lo_message_add_string(m, info->direction_const std::string&().c_str()); - lo_message_add_string(m, info->hint_const std::string&().c_str()); - lo_message_add_float(m, info->default_val()); - lo_message_add_float(m, info->min_val()); - lo_message_add_float(m, info->max_val()); - lo_bundle_add_message(b, "/ingen/new_port", m); - msgs.push_back(m); - - // If the bundle is getting very large, send it and start - // a new one - if (lo_bundle_length(b) > 1024) { - lo_send_bundle(_address, b); - lo_bundle_free(b); - b = lo_bundle_new(tt); - } - } -*/ - /*m = lo_message_new(); - //lo_bundle_add_message(b, "/ingen/new_node_end", m); - //msgs.push_back(m); - - lo_send_bundle(_address, b); - lo_bundle_free(b); - - for (list<lo_bundle>::const_iterator i = msgs.begin(); i != msgs.end(); ++i) - lo_message_free(*i); - - usleep(100); -*/ - /* - const map<const std::string&, const std::string&>& data = node->metadata(); - // Send node metadata - for (map<const std::string&, const std::string&>::const_iterator i = data.begin(); i != data.end(); ++i) - metadata_update(node->path(), (*i).first, (*i).second); - - - // Send port metadata - for (size_t j=0; j < ports.size(); ++j) { - port = ports.at(j); - const map<const std::string&, const std::string&>& data = port->metadata(); - for (map<const std::string&, const std::string&>::const_iterator i = data.begin(); i != data.end(); ++i) - metadata_update(port->path(), (*i).first, (*i).second); - } - - // Send control values - for (size_t i=0; i < node->ports().size(); ++i) { - TypedPort<Sample>* port = (TypedPort<Sample>*)node->ports().at(i); - if (port->port_info()->is_input() && port->port_info()->is_control()) - control_change(port->path(), port->buffer(0)->value_at(0)); - } - */ -#endif } diff --git a/src/libs/engine/ObjectStore.cpp b/src/libs/engine/ObjectStore.cpp index fc501d28..4dbe9f0e 100644 --- a/src/libs/engine/ObjectStore.cpp +++ b/src/libs/engine/ObjectStore.cpp @@ -107,16 +107,6 @@ ObjectStore::add(const Table<Path,GraphObject*>& table) } } -#if 0 -/** Add an object to the store. Not realtime safe. - */ -void -ObjectStore::add(TreeNode<GraphObject*>* tn) -{ - cerr << "[ObjectStore] Adding " << tn->key() << endl; - _objects.insert(tn); -} -#endif /** Remove an object from the store. * diff --git a/src/libs/engine/Plugin.hpp b/src/libs/engine/Plugin.hpp index aa51d725..46a2fd0f 100644 --- a/src/libs/engine/Plugin.hpp +++ b/src/libs/engine/Plugin.hpp @@ -60,17 +60,6 @@ public: #endif {} -#if 0 - // FIXME: remove - Plugin() : _type(Internal), _lib_path("/Ingen"), - _id(0), _library(NULL) - { -#ifdef HAVE_SLV2 - _slv2_plugin = NULL; -#endif - } -#endif - Plugin(const Plugin* const copy) { // Copying only allowed for Internal plugins. Bit of a hack, but // allows the PluginInfo to be defined in the Node class which keeps diff --git a/src/libs/engine/PostProcessor.cpp b/src/libs/engine/PostProcessor.cpp index 109635df..ccf3b0a5 100644 --- a/src/libs/engine/PostProcessor.cpp +++ b/src/libs/engine/PostProcessor.cpp @@ -28,24 +28,11 @@ using std::cerr; using std::cout; using std::endl; namespace Ingen { -PostProcessor::PostProcessor(/*Raul::Maid& maid, */size_t queue_size) - //: _maid(maid) +PostProcessor::PostProcessor(size_t queue_size) : _events(queue_size) { - //set_name("PostProcessor"); } -#if 0 -/** Post-Process every pending event. - * - * The PostProcessor should be whipped by the audio thread once every cycle - */ -void -PostProcessor::_whipped() -{ - //process(); -} -#endif void PostProcessor::process() @@ -59,4 +46,5 @@ PostProcessor::process() } } + } // namespace Ingen diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp index 38a8fe3e..2c4fd7da 100644 --- a/src/libs/engine/events/DestroyEvent.cpp +++ b/src/libs/engine/events/DestroyEvent.cpp @@ -54,24 +54,6 @@ DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, Frame assert(_source); } -#if 0 -DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, Node* node, bool block) -: QueuedEvent(engine, responder, block, source), - _path(node->path()), - _store_iterator(engine.object_store()->objects().end()) - _object(node), - _node(node), - _port(NULL), - _driver_port(NULL), - _patch_node_listnode(NULL), - _patch_port_listnode(NULL), - _ports_array(NULL), - _compiled_patch(NULL), - _disconnect_node_event(NULL), - _disconnect_port_event(NULL) -{ -} -#endif DestroyEvent::~DestroyEvent() { @@ -83,17 +65,14 @@ DestroyEvent::~DestroyEvent() void DestroyEvent::pre_process() { - //if (_object == NULL) { - _store_iterator = _engine.object_store()->find(_path); - //_object = _engine.object_store()->find_object(_path); + _store_iterator = _engine.object_store()->find(_path); - if (_store_iterator != _engine.object_store()->objects().end()) { - _node = dynamic_cast<Node*>(_store_iterator->second); + if (_store_iterator != _engine.object_store()->objects().end()) { + _node = dynamic_cast<Node*>(_store_iterator->second); - if (!_node) - _port = dynamic_cast<Port*>(_store_iterator->second); - } - //} + if (!_node) + _port = dynamic_cast<Port*>(_store_iterator->second); + } if (_store_iterator != _engine.object_store()->objects().end()) { _table = _engine.object_store()->remove(_store_iterator); diff --git a/src/libs/engine/events/DestroyEvent.hpp b/src/libs/engine/events/DestroyEvent.hpp index c401ff31..ed4328f6 100644 --- a/src/libs/engine/events/DestroyEvent.hpp +++ b/src/libs/engine/events/DestroyEvent.hpp @@ -52,7 +52,6 @@ class DestroyEvent : public QueuedEvent { public: DestroyEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime timestamp, QueuedEventSource* source, const string& path, bool block = true); - //DestroyEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime timestamp, QueuedEventSource* source, Node* node, bool block = true); ~DestroyEvent(); void pre_process(); |