diff options
27 files changed, 27 insertions, 891 deletions
diff --git a/src/libs/client/DeprecatedLoader.cpp b/src/libs/client/DeprecatedLoader.cpp index 621420c4..f6c07ecd 100644 --- a/src/libs/client/DeprecatedLoader.cpp +++ b/src/libs/client/DeprecatedLoader.cpp @@ -44,58 +44,6 @@ using namespace std; namespace Ingen { namespace Client { -#if 0 -/** Searches for the filename passed in the path, returning the full - * path of the file, or the empty string if not found. - * - * This function tries to be as friendly a black box as possible - if the path - * passed is an absolute path and the file is found there, it will return - * that path, etc. - * - * additional_path is a list (colon delimeted as usual) of additional - * directories to look in. ie the directory the parent patch resides in would - * be a good idea to pass as additional_path, in the case of a subpatch. - */ -string -DeprecatedLoader::find_file(const string& filename, const string& additional_path) -{ - string search_path = additional_path + ":" + _patch_search_path; - - // Try to open the raw filename first - std::ifstream is(filename.c_str(), std::ios::in); - if (is.good()) { - is.close(); - return filename; - } - - string directory; - string full_patch_path = ""; - - while (search_path != "") { - directory = search_path.substr(0, search_path.find(':')); - if (search_path.find(':') != string::npos) - search_path = search_path.substr(search_path.find(':')+1); - else - search_path = ""; - - full_patch_path = directory +"/"+ filename; - - std::ifstream is; - is.open(full_patch_path.c_str(), std::ios::in); - - if (is.good()) { - is.close(); - return full_patch_path; - } else { - cerr << "[DeprecatedLoader] Could not find patch file " << full_patch_path << endl; - } - } - - return ""; -} - -#endif - string DeprecatedLoader::nameify_if_invalid(const string& name) { diff --git a/src/libs/client/OSCClientReceiver.cpp b/src/libs/client/OSCClientReceiver.cpp index 9c68f2dd..c369db0e 100644 --- a/src/libs/client/OSCClientReceiver.cpp +++ b/src/libs/client/OSCClientReceiver.cpp @@ -173,9 +173,7 @@ OSCClientReceiver::setup_callbacks() int OSCClientReceiver::_error_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) { - cerr << "ERROR: " << argv[0]->s << endl; - // FIXME - //error((char*)argv[0]); + error((char*)argv[0]); return 0; } @@ -264,16 +262,6 @@ OSCClientReceiver::_new_node_cb(const char* path, const char* types, lo_arg** ar new_node(uri, node_path, polyphonic, num_ports); - /*_receiving_node_model = new NodeModel(node_path); - _receiving_node_model->polyphonic((poly == 1)); - _receiving_node_num_ports = num_ports; - - PluginModel* pi = new PluginModel(type, uri); - _receiving_node_model->plugin(pi); - - _receiving_node = true; - _num_received_ports = 0; - */ return 0; } @@ -286,54 +274,9 @@ OSCClientReceiver::_new_port_cb(const char* path, const char* types, lo_arg** ar const char* port_path = &argv[0]->s; const char* type = &argv[1]->s; bool is_output = (argv[2]->i == 1); - /*const char* direction = &argv[2]->s; - const char* hint = &argv[3]->s; - float default_val = argv[4]->f; - float min_val = argv[5]->f; - float max_val = argv[6]->f;*/ new_port(port_path, type, is_output); -#if 0 - PortModel::Type ptype = PortModel::CONTROL; - if (!strcmp(type, "AUDIO")) ptype = PortModel::AUDIO; - else if (!strcmp(type, "CONTROL")) ptype = PortModel::CONTROL; - else if (!strcmp(type, "MIDI")) ptype = PortModel::MIDI; - else cerr << "[OSCClientReceiver] WARNING: Unknown port type received (" << type << ")" << endl; - -#if 0 - PortModel::Direction pdir = PortModel::INPUT; - if (!strcmp(direction, "INPUT")) pdir = PortModel::INPUT; - else if (!strcmp(direction, "OUTPUT")) pdir = PortModel::OUTPUT; - else cerr << "[OSCClientReceiver] WARNING: Unknown port direction received (" << direction << ")" << endl; -#endif - PortModel::Direction pdir = is_output ? PortModel::OUTPUT : PortModel::INPUT; - -/* - PortModel::Hint phint = PortModel::NONE; - if (!strcmp(hint, "LOGARITHMIC")) phint = PortModel::LOGARITHMIC; - else if (!strcmp(hint, "INTEGER")) phint = PortModel::INTEGER; - else if (!strcmp(hint, "TOGGLE")) phint = PortModel::TOGGLE; - PortModel* port_model = new PortModel(port_path, ptype, pdir, phint, default_val, min_val, max_val); -*/ - PortModel* port_model = new PortModel(port_path, ptype, pdir); - if (_receiving_node) { - assert(_receiving_node_model); - _receiving_node_model->add_port(port_model); - ++m_num_received_ports; - - // If transmission is done, send new node to client - if (_num_received_ports == _receiving_node_num_ports) { - new_node_model(_receiving_node_model); - _receiving_node = false; - _receiving_node_model = NULL; - _num_received_ports = 0; - } - } else { - new_port_model(port_model); - } - -#endif return 0; } 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(); diff --git a/src/libs/gui/App.cpp b/src/libs/gui/App.cpp index c2d835f3..b36c5c07 100644 --- a/src/libs/gui/App.cpp +++ b/src/libs/gui/App.cpp @@ -35,7 +35,6 @@ #include "LoadPluginWindow.hpp" #include "PatchWindow.hpp" #include "MessagesWindow.hpp" -#include "ConfigWindow.hpp" #include "GladeFactory.hpp" #include "PatchTreeWindow.hpp" #include "Configuration.hpp" @@ -75,7 +74,6 @@ App::App(Ingen::Shared::World* world) glade_xml->get_widget_derived("connect_win", _connect_window); glade_xml->get_widget_derived("messages_win", _messages_window); glade_xml->get_widget_derived("patch_tree_win", _patch_tree_window); - glade_xml->get_widget_derived("config_win", _config_window); glade_xml->get_widget("about_win", _about_dialog); Raul::RDF::World& rdf_world = *world->rdf_world; @@ -87,8 +85,6 @@ App::App(Ingen::Shared::World* world) rdf_world.add_prefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#"); rdf_world.add_prefix("doap", "http://usefulinc.com/ns/doap#"); - _config_window->configuration(_configuration); - #ifdef HAVE_SLV2 PluginModel::set_slv2_world(world->slv2_world); #endif diff --git a/src/libs/gui/App.hpp b/src/libs/gui/App.hpp index ea549c09..a300d04e 100644 --- a/src/libs/gui/App.hpp +++ b/src/libs/gui/App.hpp @@ -54,7 +54,6 @@ namespace Ingen { namespace GUI { class MessagesWindow; -class ConfigWindow; class PatchCanvas; class PatchTreeView; class PatchTreeWindow; @@ -85,9 +84,8 @@ public: void quit(); - ConnectWindow* connect_window() const { return _connect_window; } - Gtk::AboutDialog* about_dialog() const { return _about_dialog; } - ConfigWindow* configuration_dialog() const { return _config_window; } + ConnectWindow* connect_window() const { return _connect_window; } + Gtk::AboutDialog* about_dialog() const { return _about_dialog; } MessagesWindow* messages_dialog() const { return _messages_window; } PatchTreeWindow* patch_tree() const { return _patch_tree_window; } Configuration* configuration() const { return _configuration; } @@ -122,7 +120,6 @@ protected: ConnectWindow* _connect_window; MessagesWindow* _messages_window; PatchTreeWindow* _patch_tree_window; - ConfigWindow* _config_window; Gtk::AboutDialog* _about_dialog; WindowFactory* _window_factory; diff --git a/src/libs/gui/ConfigWindow.cpp b/src/libs/gui/ConfigWindow.cpp deleted file mode 100644 index 3fb44626..00000000 --- a/src/libs/gui/ConfigWindow.cpp +++ /dev/null @@ -1,88 +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 <iostream> -#include <cassert> -#include <algorithm> -#include <cctype> -#include "client/NodeModel.hpp" -#include "ConfigWindow.hpp" - -using namespace std; - -namespace Ingen { -namespace GUI { - - -ConfigWindow::ConfigWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) -: Gtk::Window(cobject), - _configuration(NULL) -{ - xml->get_widget("config_path_entry", _path_entry); - xml->get_widget("config_save_button", _save_button); - xml->get_widget("config_cancel_button", _cancel_button); - xml->get_widget("config_ok_button", _ok_button); - - _save_button->signal_clicked().connect( sigc::mem_fun(this, &ConfigWindow::save_clicked)); - _cancel_button->signal_clicked().connect(sigc::mem_fun(this, &ConfigWindow::cancel_clicked)); - _ok_button->signal_clicked().connect( sigc::mem_fun(this, &ConfigWindow::ok_clicked)); -} - - -/** Sets the state manager for this window and initializes everything. - * - * This function MUST be called before using the window in any way! - */ -void -ConfigWindow::configuration(Configuration* sm) -{ - _configuration = sm; - _path_entry->set_text(sm->patch_path()); -} - - - -///// Event Handlers ////// - - -void -ConfigWindow::save_clicked() -{ - _configuration->patch_path(_path_entry->get_text()); - _configuration->apply_settings(); - _configuration->save_settings(); -} - - -void -ConfigWindow::cancel_clicked() -{ - hide(); -} - - -void -ConfigWindow::ok_clicked() -{ - _configuration->patch_path(_path_entry->get_text()); - _configuration->apply_settings(); - hide(); -} - - -} // namespace GUI -} // namespace Ingen diff --git a/src/libs/gui/ConfigWindow.hpp b/src/libs/gui/ConfigWindow.hpp deleted file mode 100644 index dce40218..00000000 --- a/src/libs/gui/ConfigWindow.hpp +++ /dev/null @@ -1,65 +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 CONFIGWINDOW_H -#define CONFIGWINDOW_H - -#include <list> -#include <libglademm/xml.h> -#include <libglademm.h> -#include <gtkmm.h> -#include "client/PluginModel.hpp" -#include "Configuration.hpp" - -using std::list; -using Ingen::Client::PluginModel; - -namespace Ingen { -namespace GUI { - - -/** 'Configuration' window. - * - * Loaded by glade as a derived object. - * - * \ingroup GUI - */ -class ConfigWindow : public Gtk::Window -{ -public: - ConfigWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml); - - void configuration(Configuration* sm); - -private: - void save_clicked(); - void cancel_clicked(); - void ok_clicked(); - - Configuration* _configuration; - - Gtk::Entry* _path_entry; - Gtk::Button* _save_button; - Gtk::Button* _cancel_button; - Gtk::Button* _ok_button; -}; - - -} // namespace GUI -} // namespace Ingen - -#endif // CONFIGWINDOW_H diff --git a/src/libs/gui/Configuration.cpp b/src/libs/gui/Configuration.cpp index afeba77e..ffef8137 100644 --- a/src/libs/gui/Configuration.cpp +++ b/src/libs/gui/Configuration.cpp @@ -38,9 +38,8 @@ using namespace Ingen::Client; Configuration::Configuration() - : _patch_path("/usr/share/ingen/patches:/usr/local/share/ingen/patches") // Agave FTW - , _audio_port_color( 0x0D597FFF) + : _audio_port_color( 0x0D597FFF) , _control_port_color(0x2F7F0DFF) , _midi_port_color( 0x7F240DFF) , _osc_port_color( 0x5D0D7FFF) @@ -58,49 +57,8 @@ Configuration::~Configuration() */ void Configuration::load_settings(string filename) -{ -#if 0 - if (filename == "") - filename = string(getenv("HOME")).append("/.omgtkrc"); - - std::ifstream is; - is.open(filename.c_str(), std::ios::in); - - if ( ! is.good()) { - cout << "[Configuration] Unable to open settings file " << filename << endl; - return; - } else { - cout << "[Configuration] Loading settings from " << filename << endl; - } - - string s; - - is >> s; - if (s != "file_version") { - cerr << "[Configuration] Corrupt settings file, load aborted." << endl; - is.close(); - return; - } - - is >> s; - if (s != "1") { - cerr << "[Configuration] Unknown settings file version number, load aborted." << endl; - is.close(); - return; - } - - is >> s; - if (s != "patch_path") { - cerr << "[Configuration] Corrupt settings file, load aborted." << endl; - is.close(); - return; - } - - is >> s; - _patch_path = s; - - is.close(); -#endif +{ + /* ... */ } @@ -110,25 +68,7 @@ Configuration::load_settings(string filename) void Configuration::save_settings(string filename) { -#if 0 - if (filename == "") - filename = string(getenv("HOME")).append("/.omgtkrc"); - - std::ofstream os; - os.open(filename.c_str(), std::ios::out); - - if ( ! os.good()) { - cout << "[Configuration] Unable to write to setting file " << filename << endl; - return; - } else { - cout << "[Configuration] Saving settings to " << filename << endl; - } - - os << "file_version 1" << endl; - os << "patch_path " << _patch_path << endl; - - os.close(); -#endif + /* ... */ } @@ -138,7 +78,7 @@ Configuration::save_settings(string filename) void Configuration::apply_settings() { - //App::instance().loader()->set_patch_path(_patch_path); + /* ... */ } @@ -163,34 +103,6 @@ Configuration::get_port_color(const PortModel* pi) return 0xFF0000B0; } -/* -Coord -Configuration::get_window_location(const string& id) -{ - return _window_locations[id]; -} - - -void -Configuration::set_window_location(const string& id, Coord loc) -{ - _window_locations[id] = loc; -} - - -Coord -Configuration::get_window_size(const string& id) -{ - return _window_sizes[id]; -} - - -void -Configuration::set_window_size(const string& id, Coord size) -{ - _window_sizes[id] = size; -}*/ - } // namespace GUI } // namespace Ingen diff --git a/src/libs/gui/Configuration.hpp b/src/libs/gui/Configuration.hpp index 9f7cbb08..ab96cc80 100644 --- a/src/libs/gui/Configuration.hpp +++ b/src/libs/gui/Configuration.hpp @@ -50,18 +50,12 @@ public: void apply_settings(); - string patch_path() { return _patch_path; } - void patch_path(const string& path) { _patch_path = path; } - const string& patch_folder() { return _patch_folder; } void set_patch_folder(const string& f) { _patch_folder = f; } uint32_t get_port_color(const PortModel* pi); private: - /** Search path for patch files. Colon delimited, as usual. */ - string _patch_path; - /** Most recent patch folder shown in open dialog */ string _patch_folder; diff --git a/src/libs/gui/DSSIController.cpp b/src/libs/gui/DSSIController.cpp index b5537f82..9bb037ba 100644 --- a/src/libs/gui/DSSIController.cpp +++ b/src/libs/gui/DSSIController.cpp @@ -229,11 +229,11 @@ DSSIController::attempt_to_show_gui() } if ((S_ISREG(buf.st_mode) || S_ISLNK(buf.st_mode)) && - (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) { + (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) { if (verbose) { fprintf(stderr, "%s: trying to execute GUI at \"%s\"\n", - myName, filename); + myName, filename); } if (fork() == 0) { @@ -267,8 +267,9 @@ void DSSIController::show_menu(GdkEventButton* event) { #if 0 - if (_banks_dirty) - update_program_menu(); + if (_banks_dirty) + update_program_menu(); + NodeController::show_menu(event); #endif } diff --git a/src/libs/gui/Makefile.am b/src/libs/gui/Makefile.am index f3b2e3ae..944df91f 100644 --- a/src/libs/gui/Makefile.am +++ b/src/libs/gui/Makefile.am @@ -38,8 +38,6 @@ libingen_gui_la_SOURCES = \ BreadCrumb.hpp \ BreadCrumbBox.cpp \ BreadCrumbBox.hpp \ - ConfigWindow.cpp \ - ConfigWindow.hpp \ Configuration.cpp \ Configuration.hpp \ ConnectWindow.cpp \ diff --git a/src/libs/gui/NodeMenu.cpp b/src/libs/gui/NodeMenu.cpp index 4b00a13b..a4f91e95 100644 --- a/src/libs/gui/NodeMenu.cpp +++ b/src/libs/gui/NodeMenu.cpp @@ -93,91 +93,6 @@ NodeMenu::NodeMenu(SharedPtr<NodeModel> node) //model->destroyed_sig.connect(sigc::mem_fun(this, &NodeMenu::destroy)); } -#if 0 -NodeMenu::~NodeMenu() -{ - cerr << "~NodeMenu()\n"; -} - -void -NodeMenu::destroy() -{ - cerr << "FIXME: NODE DESTROYED\n"; - //SharedPtr<ObjectModel> model = _model; - //m_model.reset(); -} -#endif - -void -NodeMenu::set_path(const Path& new_path) -{ - cerr << "FIXME: rename\n"; - /* - remove_from_store(); - - // Rename ports - for (list<PortModel*>::const_iterator i = _node->ports().begin(); - i != _node->ports().end(); ++i) { - ObjectController* const pc = (*i)->controller(); - assert(pc != NULL); - pc->set_path(_model->path().base() + pc->model()->name()); - } - - // Handle bridge port, if this node represents one - if (_bridge_port != NULL) - _bridge_port->set_path(new_path); - - if (_module != NULL) - _module->canvas()->rename_module(_node->path().name(), new_path.name()); - - ObjectController::set_path(new_path); - - add_to_store(); - */ -} - -#if 0 -void -NodeMenu::destroy() -{ - PatchController* pc = ((PatchController*)_model->parent()->controller()); - assert(pc != NULL); - - //remove_from_store(); - //pc->remove_node(_model->path().name()); - cerr << "FIXME: remove node\n"; - - if (_bridge_port != NULL) - _bridge_port->destroy(); - _bridge_port = NULL; - - //if (_module != NULL) - // delete _module; -} -#endif - -#if 0 -void -NodeMenu::add_port(SharedPtr<PortModel> pm) -{ - assert(pm->parent().get() == _node.get()); - assert(pm->parent() == _node); - assert(_node->get_port(pm->path().name()) == pm); - - //cout << "[NodeMenu] Adding port " << pm->path() << endl; - - /* - if (_module != NULL) { - // (formerly PortController) - pc->create_port(_module); - _module->resize(); - - // Enable "Controls" menu item on module - if (has_control_inputs()) - enable_controls_menuitem(); - }*/ -} -#endif void NodeMenu::on_menu_destroy() @@ -206,7 +121,7 @@ NodeMenu::polyphonic_changed(bool polyphonic) void NodeMenu::on_menu_clone() { - cerr << "FIXME: clone broken\n"; + cerr << "[NodeMenu] FIXME: clone broken\n"; /* assert(_node); //assert(_parent != NULL); @@ -278,9 +193,6 @@ void NodeMenu::disable_controls_menuitem() { _controls_menuitem->property_sensitive() = false; - - //if (_control_window != NULL) - // _control_window->hide(); } diff --git a/src/libs/gui/NodeMenu.hpp b/src/libs/gui/NodeMenu.hpp index e6f63d73..dd31c4ee 100644 --- a/src/libs/gui/NodeMenu.hpp +++ b/src/libs/gui/NodeMenu.hpp @@ -44,8 +44,6 @@ class NodeMenu : public Gtk::Menu public: NodeMenu(SharedPtr<NodeModel> node); - void set_path(const Path& new_path); - virtual void program_add(int bank, int program, const string& name) {} virtual void program_remove(int bank, int program) {} @@ -56,8 +54,6 @@ protected: virtual void enable_controls_menuitem(); virtual void disable_controls_menuitem(); - //virtual void add_port(SharedPtr<PortModel> pm); - void on_menu_destroy(); void on_menu_polyphonic(); void on_menu_clone(); diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp index 0992ba81..dc1504ef 100644 --- a/src/libs/gui/PatchCanvas.cpp +++ b/src/libs/gui/PatchCanvas.cpp @@ -346,7 +346,7 @@ PatchCanvas::connect(boost::shared_ptr<FlowCanvas::Connectable> src_port, // Midi binding/learn shortcut if (src->model()->is_midi() && dst->model()->is_control()) { - cerr << "FIXME: MIDI binding" << endl; + cerr << "[PatchCanvas] FIXME: MIDI binding shortcut" << endl; #if 0 SharedPtr<PluginModel> pm(new PluginModel(PluginModel::Internal, "", "midi_control_in", "")); SharedPtr<NodeModel> nm(new NodeModel(pm, _patch->path().base() diff --git a/src/libs/gui/PatchWindow.cpp b/src/libs/gui/PatchWindow.cpp index c3e9149f..76e94b44 100644 --- a/src/libs/gui/PatchWindow.cpp +++ b/src/libs/gui/PatchWindow.cpp @@ -30,7 +30,7 @@ #include "LoadSubpatchWindow.hpp" #include "NodeControlWindow.hpp" #include "PatchPropertiesWindow.hpp" -#include "ConfigWindow.hpp" +#include "Configuration.hpp" #include "MessagesWindow.hpp" #include "PatchTreeWindow.hpp" #include "BreadCrumbBox.hpp" @@ -68,7 +68,6 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad xml->get_widget("patch_paste_menuitem", _menu_paste); xml->get_widget("patch_delete_menuitem", _menu_delete); xml->get_widget("patch_close_menuitem", _menu_close); - xml->get_widget("patch_configuration_menuitem", _menu_configuration); xml->get_widget("patch_quit_menuitem", _menu_quit); xml->get_widget("patch_view_control_window_menuitem", _menu_view_control_window); xml->get_widget("patch_view_engine_window_menuitem", _menu_view_engine_window); @@ -103,8 +102,6 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad sigc::mem_fun(this, &PatchWindow::event_delete)); _menu_quit->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_quit)); - _menu_configuration->signal_activate().connect( - sigc::mem_fun(App::instance().configuration_dialog(), &ConfigWindow::show)); _menu_fullscreen->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_fullscreen_toggled)); _menu_arrange->signal_activate().connect( diff --git a/src/libs/gui/PatchWindow.hpp b/src/libs/gui/PatchWindow.hpp index 08048bd3..5120ba5a 100644 --- a/src/libs/gui/PatchWindow.hpp +++ b/src/libs/gui/PatchWindow.hpp @@ -119,7 +119,6 @@ private: Gtk::MenuItem* _menu_copy; Gtk::MenuItem* _menu_paste; Gtk::MenuItem* _menu_delete; - Gtk::MenuItem* _menu_configuration; Gtk::MenuItem* _menu_close; Gtk::MenuItem* _menu_quit; Gtk::MenuItem* _menu_fullscreen; diff --git a/src/libs/gui/ingen_gui.glade b/src/libs/gui/ingen_gui.glade index e5229e0b..849f5f8a 100644 --- a/src/libs/gui/ingen_gui.glade +++ b/src/libs/gui/ingen_gui.glade @@ -102,27 +102,6 @@ </widget> </child> <child> - <widget class="GtkSeparatorMenuItem" id="separator10"> - <property name="visible">True</property> - </widget> - </child> - <child> - <widget class="GtkImageMenuItem" id="patch_configuration_menuitem"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">Configure OmGtk</property> - <property name="label" translatable="yes">Confi_guration...</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_patch_configuration_menuitem_activate"/> - <child internal-child="image"> - <widget class="GtkImage" id="image2127"> - <property name="visible">True</property> - <property name="stock">gtk-preferences</property> - <property name="icon_size">1</property> - </widget> - </child> - </widget> - </child> - <child> <widget class="GtkSeparatorMenuItem" id="separator11"> <property name="visible">True</property> </widget> @@ -1391,7 +1370,7 @@ <widget class="GtkSpinButton" id="patch_view_poly_spin"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="adjustment">1 1 100 1 10 10</property> + <property name="adjustment">1 1 512 1 10 10</property> <property name="climb_rate">1</property> <property name="numeric">True</property> </widget> |