diff options
author | David Robillard <d@drobilla.net> | 2009-05-13 16:04:14 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-13 16:04:14 +0000 |
commit | aa473d19780f2670bb828835ee7ce970571016cf (patch) | |
tree | 0483fcb2cc350b3cc2f660f22449f803ae12f93d | |
parent | 44ddb73018b96a6979b4339f4ba234e5c97741f8 (diff) | |
download | ingen-aa473d19780f2670bb828835ee7ce970571016cf.tar.gz ingen-aa473d19780f2670bb828835ee7ce970571016cf.tar.bz2 ingen-aa473d19780f2670bb828835ee7ce970571016cf.zip |
Strip trailing whitespace.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1999 a436a847-0d15-0410-975c-d299462d15a1
299 files changed, 2691 insertions, 2691 deletions
diff --git a/src/bindings/Client.hpp b/src/bindings/Client.hpp index b510e54e..439f583c 100644 --- a/src/bindings/Client.hpp +++ b/src/bindings/Client.hpp @@ -9,13 +9,13 @@ public: virtual void subscribe(Ingen::Shared::EngineInterface* engine) { engine->register_client(this); } - + virtual void response_ok(int32_t id) {} - + virtual void response_error(int32_t id, const std::string& msg) {} - + virtual void enable() {} - + /** Signifies the client does not wish to receive any messages until * enable is called. Useful for performance and avoiding feedback. */ @@ -27,7 +27,7 @@ public: */ virtual void bundle_begin() {} virtual void bundle_end() {} - + /** Transfers are 'weak' bundles. These are used to break a large group * of similar/related messages into larger chunks (solely for communication * efficiency). A bunch of messages in a transfer will arrive as 1 or more @@ -35,54 +35,54 @@ public: */ virtual void transfer_begin() {} virtual void transfer_end() {} - + virtual void error(const std::string& msg) {} - + virtual void new_plugin(const std::string& uri, const std::string& type_uri, const std::string& symbol) {} - + virtual void new_patch(const std::string& path, uint32_t poly) {} - + virtual void new_node(const std::string& path, const std::string& plugin_uri) {} - + virtual void new_port(const std::string& path, const std::string& type, uint32_t index, bool is_output) {} - + virtual void clear_patch(const std::string& path) {} - + virtual void rename(const std::string& old_path, const std::string& new_path) {} - + virtual void connect(const std::string& src_port_path, const std::string& dst_port_path) {} - + virtual void disconnect(const std::string& src_port_path, const std::string& dst_port_path) {} - + virtual void set_variable(const std::string& subject_path, const std::string& predicate, const Raul::Atom& value) {} - + virtual void set_port_value(const std::string& port_path, const std::string& type_uri, uint32_t data_size, const void* data) {} - + virtual void set_voice_value(const std::string& port_path, const std::string& type_uri, uint32_t voice, uint32_t data_size, const void* data) {} - + virtual void program_add(const std::string& node_path, uint32_t bank, uint32_t program, const std::string& program_name) {} - + virtual void program_remove(const std::string& node_path, uint32_t bank, uint32_t program) {} diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 21ace7de..0db40a8d 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -1,15 +1,15 @@ /* 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 @@ -86,10 +86,10 @@ ClientStore::add_object(SharedPtr<ObjectModel> object) object->set_parent(parent); parent->add_child(object); assert(parent && (object->parent() == parent)); - + (*this)[object->path()] = object; signal_new_object.emit(object); - + #if 0 resolve_variable_orphans(parent); resolve_orphans(parent); @@ -198,7 +198,7 @@ void ClientStore::add_plugin(SharedPtr<PluginModel> pm) { // FIXME: dupes? merge, like with objects? - + (*_plugins)[pm->uri()] = pm; signal_new_plugin(pm); //cerr << "Plugin: " << pm->uri() << ", # plugins: " << _plugins->size() << endl; @@ -221,7 +221,7 @@ ClientStore::rename(const Path& old_path_str, const Path& new_path_str) { Path old_path(old_path_str); Path new_path(new_path_str); - + iterator parent = find(old_path); if (parent == end()) { cerr << "[Store] Failed to find object " << old_path << " to rename." << endl; @@ -229,16 +229,16 @@ ClientStore::rename(const Path& old_path_str, const Path& new_path_str) } iterator descendants_end = find_descendants_end(parent); - + SharedPtr< Table<Path, SharedPtr<Shared::GraphObject> > > removed = yank(parent, descendants_end); - + assert(removed->size() > 0); for (Table<Path, SharedPtr<Shared::GraphObject> >::iterator i = removed->begin(); i != removed->end(); ++i) { const Path& child_old_path = i->first; assert(Path::descendant_comparator(old_path, child_old_path)); - + Path child_new_path; if (child_old_path == old_path) child_new_path = new_path; @@ -281,7 +281,7 @@ ClientStore::new_object(const Shared::GraphObject* object) new_patch(patch->path(), patch->internal_polyphony()); return true; } - + const Node* node = dynamic_cast<const Node*>(object); if (node) { new_node(node->path(), node->plugin()->uri()); @@ -340,7 +340,7 @@ ClientStore::clear_patch(const Path& path) if (i != end()) { assert((*i).second->path() == path); SharedPtr<PatchModel> patch = PtrCast<PatchModel>(i->second); - + iterator first_descendant = i; ++first_descendant; iterator descendants_end = find_descendants_end(i); @@ -380,7 +380,7 @@ ClientStore::set_variable(const URI& subject_path, const URI& predicate, const A } } - + void ClientStore::set_property(const URI& subject_path, const URI& predicate, const Atom& value) { @@ -416,7 +416,7 @@ ClientStore::set_voice_value(const Path& port_path, uint32_t voice, const Atom& cerr << "ERROR: poly control change for nonexistant port " << port_path << endl; } - + void ClientStore::activity(const Path& path) { @@ -435,13 +435,13 @@ ClientStore::connection_patch(const Path& src_port_path, const Path& dst_port_pa if (src_port_path.parent() == dst_port_path.parent()) patch = PtrCast<PatchModel>(this->object(src_port_path.parent())); - + if (!patch && src_port_path.parent() == dst_port_path.parent().parent()) patch = PtrCast<PatchModel>(this->object(src_port_path.parent())); if (!patch && src_port_path.parent().parent() == dst_port_path.parent()) patch = PtrCast<PatchModel>(this->object(dst_port_path.parent())); - + if (!patch) patch = PtrCast<PatchModel>(this->object(src_port_path.parent().parent())); @@ -458,8 +458,8 @@ ClientStore::attempt_connection(const Path& src_port_path, const Path& dst_port_ { SharedPtr<PortModel> src_port = PtrCast<PortModel>(object(src_port_path)); SharedPtr<PortModel> dst_port = PtrCast<PortModel>(object(dst_port_path)); - - if (src_port && dst_port) { + + if (src_port && dst_port) { assert(src_port->parent()); assert(dst_port->parent()); @@ -467,7 +467,7 @@ ClientStore::attempt_connection(const Path& src_port_path, const Path& dst_port_ assert(patch); SharedPtr<ConnectionModel> cm(new ConnectionModel(src_port, dst_port)); - + src_port->connected_to(dst_port); dst_port->connected_to(src_port); @@ -480,7 +480,7 @@ ClientStore::attempt_connection(const Path& src_port_path, const Path& dst_port_ return false; } - + void ClientStore::connect(const Path& src_port_path, const Path& dst_port_path) { @@ -493,7 +493,7 @@ ClientStore::disconnect(const Path& src_port_path, const Path& dst_port_path) { // Find the ports and create a ConnectionModel just to get at the parent path // finding logic in ConnectionModel. So I'm lazy. - + SharedPtr<PortModel> src_port = PtrCast<PortModel>(object(src_port_path)); SharedPtr<PortModel> dst_port = PtrCast<PortModel>(object(dst_port_path)); @@ -501,14 +501,14 @@ ClientStore::disconnect(const Path& src_port_path, const Path& dst_port_path) src_port->disconnected_from(dst_port); else cerr << "WARNING: Disconnection from nonexistant src port " << src_port_path << endl; - + if (dst_port) dst_port->disconnected_from(dst_port); else cerr << "WARNING: Disconnection from nonexistant dst port " << dst_port_path << endl; SharedPtr<PatchModel> patch = connection_patch(src_port_path, dst_port_path); - + if (patch) patch->remove_connection(src_port_path, dst_port_path); else diff --git a/src/client/ClientStore.hpp b/src/client/ClientStore.hpp index b8451fd2..48f6dad1 100644 --- a/src/client/ClientStore.hpp +++ b/src/client/ClientStore.hpp @@ -1,15 +1,15 @@ /* 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 @@ -65,7 +65,7 @@ public: SharedPtr<const Plugins> plugins() const { return _plugins; } SharedPtr<Plugins> plugins() { return _plugins; } void set_plugins(SharedPtr<Plugins> p) { _plugins = p; } - + // CommonInterface void new_plugin(const Raul::URI& uri, const Raul::URI& type_uri, const Raul::Symbol& symbol); bool new_object(const Shared::GraphObject* object); @@ -80,9 +80,9 @@ public: void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); void destroy(const Raul::Path& path); - - sigc::signal<void, SharedPtr<ObjectModel> > signal_new_object; - sigc::signal<void, SharedPtr<PluginModel> > signal_new_plugin; + + sigc::signal<void, SharedPtr<ObjectModel> > signal_new_object; + sigc::signal<void, SharedPtr<PluginModel> > signal_new_plugin; private: @@ -90,7 +90,7 @@ private: void add_object(SharedPtr<ObjectModel> object); SharedPtr<ObjectModel> remove_object(const Raul::Path& path); - + void add_plugin(SharedPtr<PluginModel> plugin); SharedPtr<PatchModel> connection_patch(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); @@ -102,9 +102,9 @@ private: void object_renamed(const Raul::Path& old_path, const Raul::Path& new_path); void clear_patch(const Raul::Path& path); void activity(const Raul::Path& path); - + bool attempt_connection(const Raul::Path& src_port_path, const Raul::Path& dst_port_path, bool add_orphan=false); - + bool _handle_orphans; SharedPtr<Shared::EngineInterface> _engine; diff --git a/src/client/ConnectionModel.hpp b/src/client/ConnectionModel.hpp index d0f98ec7..7f3223c9 100644 --- a/src/client/ConnectionModel.hpp +++ b/src/client/ConnectionModel.hpp @@ -1,15 +1,15 @@ /* 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 @@ -50,7 +50,7 @@ public: const Raul::Path src_port_path() const { return _src_port->path(); } const Raul::Path dst_port_path() const { return _dst_port->path(); } - + private: friend class ClientStore; @@ -64,7 +64,7 @@ private: assert(_dst_port->parent()); assert(_src_port->path() != _dst_port->path()); } - + const SharedPtr<PortModel> _src_port; const SharedPtr<PortModel> _dst_port; }; diff --git a/src/client/DeprecatedLoader.cpp b/src/client/DeprecatedLoader.cpp index c0591609..845c2ce7 100644 --- a/src/client/DeprecatedLoader.cpp +++ b/src/client/DeprecatedLoader.cpp @@ -1,15 +1,15 @@ /* 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 @@ -42,7 +42,7 @@ namespace Ingen { using namespace Shared; namespace Client { - + /** A single port's control setting (in a preset). * * \ingroup IngenClient @@ -56,7 +56,7 @@ public: { assert(_port_path.find("//") == string::npos); } - + const Raul::Path& port_path() const { return _port_path; } void port_path(const string& p) { _port_path = p; } float value() const { return _value; } @@ -118,7 +118,7 @@ string DeprecatedLoader::translate_load_path(const string& path) { std::map<string,string>::iterator t = _load_path_translations.find(path); - + if (t != _load_path_translations.end()) { assert(Path::is_valid((*t).second)); return (*t).second; @@ -161,12 +161,12 @@ DeprecatedLoader::add_variable(GraphObject::Properties& data, string old_key, st // Hack to make module-x and module-y set as floats char* c_val = strdup(value.c_str()); char* endptr = NULL; - + // FIXME: locale kludges char* locale = strdup(setlocale(LC_NUMERIC, NULL)); - + float fval = strtof(c_val, &endptr); - + setlocale(LC_NUMERIC, locale); free(locale); @@ -174,7 +174,7 @@ DeprecatedLoader::add_variable(GraphObject::Properties& data, string old_key, st data[key] = Atom(fval); else data[key] = Atom(Atom::STRING, value); - + free(c_val); } } @@ -220,14 +220,14 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, path = *parent_path; if (name) path = path.base() + *name; - + size_t poly = 0; - + /* Use parameter overridden polyphony, if given */ GraphObject::Properties::iterator poly_param = initial_data.find("ingen:polyphony"); if (poly_param != initial_data.end() && poly_param->second.type() == Atom::INT) poly = poly_param->second.get_int32(); - + if (initial_data.find("filename") == initial_data.end()) initial_data["filename"] = Atom(filename.c_str()); // FIXME: URL? @@ -258,7 +258,7 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, // Load Patch attributes while (cur != NULL) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - + if ((!xmlStrcmp(cur->name, (const xmlChar*)"name"))) { if (!merge && parent_path && !name && key) { if (parent_path) @@ -280,13 +280,13 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, if (key) add_variable(initial_data, (const char*)cur->name, (const char*)key); } - + xmlFree(key); key = NULL; // Avoid a (possible?) double free cur = cur->next; } - + if (poly == 0) poly = 1; @@ -302,7 +302,7 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, while (cur != NULL) { if ((!xmlStrcmp(cur->name, (const xmlChar*)"node"))) load_node(path, doc, cur); - + cur = cur->next; } @@ -314,7 +314,7 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, } cur = cur->next; } - + // Load connections cur = xmlDocGetRootElement(doc)->xmlChildrenNode; while (cur != NULL) { @@ -323,7 +323,7 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, } cur = cur->next; } - + // Load presets (control values) cur = xmlDocGetRootElement(doc)->xmlChildrenNode; while (cur != NULL) { @@ -343,7 +343,7 @@ DeprecatedLoader::load_patch(const Glib::ustring& filename, } cur = cur->next; } - + xmlFreeDoc(doc); xmlCleanupParser(); @@ -367,12 +367,12 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr { xmlChar* key; xmlNodePtr cur = node->xmlChildrenNode; - + string path = ""; bool polyphonic = false; string plugin_uri; - + string plugin_type; // deprecated string library_name; // deprecated string plugin_label; // deprecated @@ -381,7 +381,7 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr while (cur != NULL) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - + if ((!xmlStrcmp(cur->name, (const xmlChar*)"name"))) { path = parent.base() + nameify_if_invalid((char*)key); } else if ((!xmlStrcmp(cur->name, (const xmlChar*)"polyphonic"))) { @@ -397,14 +397,14 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr } else if ((!xmlStrcmp(cur->name, (const xmlChar*)"port"))) { #if 0 xmlNodePtr child = cur->xmlChildrenNode; - + string port_name; float user_min = 0.0; float user_max = 0.0; - + while (child != NULL) { key = xmlNodeListGetString(doc, child->xmlChildrenNode, 1); - + if ((!xmlStrcmp(child->name, (const xmlChar*)"name"))) { port_name = nameify_if_invalid((char*)key); } else if ((!xmlStrcmp(child->name, (const xmlChar*)"user-min"))) { @@ -412,10 +412,10 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr } else if ((!xmlStrcmp(child->name, (const xmlChar*)"user-max"))) { user_max = atof((char*)key); } - + xmlFree(key); key = NULL; // Avoid a (possible?) double free - + child = child->next; } @@ -439,7 +439,7 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr cur = cur->next; } - + if (path == "") { cerr << "[DeprecatedLoader] Malformed patch file (node tag has empty children)" << endl; cerr << "[DeprecatedLoader] Node ignored." << endl; @@ -478,7 +478,7 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr if (is_port) { const string old_path = path; const string new_path = (Path::is_valid(old_path) ? old_path : Path::pathify(old_path)); - + if (!Path::is_valid(old_path)) cerr << "WARNING: Translating invalid port path \"" << old_path << "\" => \"" << new_path << "\"" << endl; @@ -513,7 +513,7 @@ DeprecatedLoader::load_node(const Path& parent, xmlDocPtr doc, const xmlNodePtr _engine->new_node(path, plugin_uri); _engine->set_variable(path, "ingen:polyphonic", bool(polyphonic)); - + for (GraphObject::Properties::const_iterator i = initial_data.begin(); i != initial_data.end(); ++i) _engine->set_variable(path, i->first, i->second); @@ -538,16 +538,16 @@ DeprecatedLoader::load_subpatch(const string& base_filename, const Path& parent, { xmlChar *key; xmlNodePtr cur = subpatch->xmlChildrenNode; - + string name = ""; string filename = ""; size_t poly = 0; - + GraphObject::Properties initial_data; while (cur != NULL) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - + if ((!xmlStrcmp(cur->name, (const xmlChar*)"name"))) { name = (const char*)key; } else if ((!xmlStrcmp(cur->name, (const xmlChar*)"polyphony"))) { @@ -568,7 +568,7 @@ DeprecatedLoader::load_subpatch(const string& base_filename, const Path& parent, // load_patch sets the passed variable last, so values stored in the parent // will override values stored in the child patch file load_patch(filename, false, parent, Symbol(nameify_if_invalid(name)), initial_data, false); - + return false; } @@ -580,12 +580,12 @@ DeprecatedLoader::load_connection(const Path& parent, xmlDocPtr doc, const xmlNo { xmlChar *key; xmlNodePtr cur = node->xmlChildrenNode; - + string source_node, source_port, dest_node, dest_port; - + while (cur != NULL) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - + if ((!xmlStrcmp(cur->name, (const xmlChar*)"source-node"))) { source_node = (char*)key; } else if ((!xmlStrcmp(cur->name, (const xmlChar*)"source-port"))) { @@ -595,7 +595,7 @@ DeprecatedLoader::load_connection(const Path& parent, xmlDocPtr doc, const xmlNo } else if ((!xmlStrcmp(cur->name, (const xmlChar*)"destination-port"))) { dest_port = (char*)key; } - + xmlFree(key); key = NULL; // Avoid a (possible?) double free @@ -613,11 +613,11 @@ DeprecatedLoader::load_connection(const Path& parent, xmlDocPtr doc, const xmlNo source_port = nameify_if_invalid(source_port); dest_node = nameify_if_invalid(dest_node); dest_port = nameify_if_invalid(dest_port); - + _engine->connect( translate_load_path(parent.base() + source_node +"/"+ source_port), translate_load_path(parent.base() + dest_node +"/"+ dest_port)); - + return true; } @@ -631,7 +631,7 @@ DeprecatedLoader::load_preset(const Path& parent, xmlDocPtr doc, const xmlNodePt xmlChar* key; SharedPtr<PresetModel> pm(new PresetModel(parent.base())); - + while (cur != NULL) { key = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); @@ -640,13 +640,13 @@ DeprecatedLoader::load_preset(const Path& parent, xmlDocPtr doc, const xmlNodePt pm->name((char*)key); } else if ((!xmlStrcmp(cur->name, (const xmlChar*)"control"))) { xmlNodePtr child = cur->xmlChildrenNode; - + string node_name = "", port_name = ""; float val = 0.0; - + while (child != NULL) { key = xmlNodeListGetString(doc, child->xmlChildrenNode, 1); - + if ((!xmlStrcmp(child->name, (const xmlChar*)"node-name"))) { node_name = (char*)key; } else if ((!xmlStrcmp(child->name, (const xmlChar*)"port-name"))) { @@ -654,10 +654,10 @@ DeprecatedLoader::load_preset(const Path& parent, xmlDocPtr doc, const xmlNodePt } else if ((!xmlStrcmp(child->name, (const xmlChar*)"value"))) { val = atof((char*)key); } - + xmlFree(key); key = NULL; // Avoid a (possible?) double free - + child = child->next; } @@ -665,7 +665,7 @@ DeprecatedLoader::load_preset(const Path& parent, xmlDocPtr doc, const xmlNodePt if (node_name != "") node_name = nameify_if_invalid(node_name); port_name = nameify_if_invalid(port_name); - + if (port_name == "") { string msg = "Unable to parse control in patch file ( node = "; msg.append(node_name).append(", port = ").append(port_name).append(")"); diff --git a/src/client/DeprecatedLoader.hpp b/src/client/DeprecatedLoader.hpp index c229017c..253bc12d 100644 --- a/src/client/DeprecatedLoader.hpp +++ b/src/client/DeprecatedLoader.hpp @@ -1,15 +1,15 @@ /* 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 @@ -40,7 +40,7 @@ class NodeModel; class ConnectionModel; class PresetModel; // defined in DeprecatedLoader.cpp - + /** Loads deprecated (XML) patch files (from the Om days). * * \ingroup IngenClient @@ -75,7 +75,7 @@ private: bool load_node(const Raul::Path& parent, xmlDocPtr doc, const xmlNodePtr cur); bool load_connection(const Raul::Path& parent, xmlDocPtr doc, const xmlNodePtr cur); bool load_subpatch(const std::string& base_filename, const Raul::Path& parent, xmlDocPtr doc, const xmlNodePtr cur); - + SharedPtr<PresetModel> load_preset(const Raul::Path& parent, xmlDocPtr doc, const xmlNodePtr cur); }; diff --git a/src/client/HTTPClientReceiver.cpp b/src/client/HTTPClientReceiver.cpp index cad55107..9e954236 100644 --- a/src/client/HTTPClientReceiver.cpp +++ b/src/client/HTTPClientReceiver.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -68,12 +68,12 @@ HTTPClientReceiver::Listener::Listener(HTTPClientReceiver* receiver, const std:: cout << "HTTP listen URI: " << uri << " port: " << port << endl; struct sockaddr_in servaddr; - + // Create listen address memset(&servaddr, 0, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_port = htons(port); - + // Create listen socket if ((_sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { cerr << "Error creating listening socket: %s" << strerror(errno) << endl; @@ -138,7 +138,7 @@ HTTPClientReceiver::message_callback(SoupSession* session, SoupMessage* msg, voi const string path = soup_message_get_uri(msg)->path; if (path == Path::root_uri) { me->_target->response_ok(0); - + } else if (path == "/plugins") { if (msg->response_body->data == NULL) { cout << "ERROR: Empty response" << endl; @@ -194,19 +194,19 @@ HTTPClientReceiver::start(bool dump) _parser = SharedPtr<Parser>(new_parser()); } } - + _session = soup_session_sync_new(); SoupMessage* msg; - + msg = soup_message_new("GET", _url.c_str()); soup_session_queue_message(_session, msg, message_callback, this); - + msg = soup_message_new("GET", (_url + "/plugins").c_str()); soup_session_queue_message(_session, msg, message_callback, this); - + msg = soup_message_new("GET", (_url + "/patch").c_str()); soup_session_queue_message(_session, msg, message_callback, this); - + msg = soup_message_new("GET", (_url + "/stream").c_str()); soup_session_queue_message(_session, msg, message_callback, this); } diff --git a/src/client/HTTPClientReceiver.hpp b/src/client/HTTPClientReceiver.hpp index c0f979f4..afe99dc2 100644 --- a/src/client/HTTPClientReceiver.hpp +++ b/src/client/HTTPClientReceiver.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -45,7 +45,7 @@ public: void start(bool dump); void stop(); - + private: static void message_callback(SoupSession* session, SoupMessage* msg, void* ptr); @@ -61,7 +61,7 @@ private: int _sock; HTTPClientReceiver* _receiver; }; - + friend class Listener; SharedPtr<Listener> _listener; diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp index a586df72..0bedb56f 100644 --- a/src/client/HTTPEngineSender.cpp +++ b/src/client/HTTPEngineSender.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -82,19 +82,19 @@ HTTPEngineSender::load_plugins() void -HTTPEngineSender::activate() +HTTPEngineSender::activate() { } void -HTTPEngineSender::deactivate() +HTTPEngineSender::deactivate() { } void -HTTPEngineSender::quit() +HTTPEngineSender::quit() { } diff --git a/src/client/HTTPEngineSender.hpp b/src/client/HTTPEngineSender.hpp index 55d1646a..8b4d1a4f 100644 --- a/src/client/HTTPEngineSender.hpp +++ b/src/client/HTTPEngineSender.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -39,9 +39,9 @@ class HTTPEngineSender : public Shared::EngineInterface { public: HTTPEngineSender(const Raul::URI& engine_url); ~HTTPEngineSender(); - + Raul::URI uri() const { return _engine_url; } - + inline int32_t next_id() { int32_t ret = (_id == -1) ? -1 : _id++; return ret; } @@ -52,13 +52,13 @@ public: /* *** EngineInterface implementation below here *** */ - + void enable() { _enabled = true; } void disable() { _enabled = false; } - + void bundle_begin() { transfer_begin(); } void bundle_end() { transfer_end(); } - + void transfer_begin() {} void transfer_end() {} @@ -71,59 +71,59 @@ public: void activate(); void deactivate(); void quit(); - + // Object commands - + virtual bool new_object(const Shared::GraphObject* object); virtual void new_patch(const Raul::Path& path, uint32_t poly); - + virtual void new_node(const Raul::Path& path, const Raul::URI& plugin_uri); - + virtual void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output); - + virtual void clear_patch(const Raul::Path& path); - + virtual void destroy(const Raul::Path& path); - + virtual void rename(const Raul::Path& old_path, const Raul::Path& new_path); - + virtual void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void disconnect_all(const Raul::Path& parent_patch_path, const Raul::Path& path); - + virtual void set_variable(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_port_value(const Raul::Path& port_path, const Raul::Atom& value); - + virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value); - + virtual void set_program(const Raul::Path& node_path, uint32_t bank, uint32_t program); virtual void midi_learn(const Raul::Path& node_path); - + // Requests // void ping(); diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index 97743098..da35fbe7 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -1,15 +1,15 @@ /* 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 @@ -109,7 +109,7 @@ void NodeModel::add_child(SharedPtr<ObjectModel> c) { assert(c->parent().get() == this); - + //ObjectModel::add_child(c); SharedPtr<PortModel> pm = PtrCast<PortModel>(c); @@ -123,7 +123,7 @@ NodeModel::remove_child(SharedPtr<ObjectModel> c) { assert(c->path().is_child_of(_path)); assert(c->parent().get() == this); - + //bool ret = ObjectModel::remove_child(c); SharedPtr<PortModel> pm = PtrCast<PortModel>(c); @@ -143,7 +143,7 @@ NodeModel::add_port(SharedPtr<PortModel> pm) assert(pm->parent().get() == this); Ports::iterator existing = find(_ports.begin(), _ports.end(), pm); - + // Store should have handled this by merging the two assert(existing == _ports.end()); @@ -161,7 +161,7 @@ NodeModel::get_port(const string& port_name) const return (*i); return SharedPtr<PortModel>(); } - + Shared::Port* NodeModel::port(uint32_t index) const @@ -175,7 +175,7 @@ void NodeModel::port_value_range(SharedPtr<PortModel> port, float& min, float& max) const { assert(port->parent().get() == this); - + #ifdef HAVE_SLV2 // Plugin value first if (_plugin && _plugin->type() == PluginModel::LV2) { @@ -187,7 +187,7 @@ NodeModel::port_value_range(SharedPtr<PortModel> port, float& min, float& max) c _num_values = slv2_plugin_get_num_ports(_plugin->slv2_plugin()); _min_values = new float[_num_values]; _max_values = new float[_num_values]; - slv2_plugin_get_port_ranges_float(_plugin->slv2_plugin(), + slv2_plugin_get_port_ranges_float(_plugin->slv2_plugin(), _min_values, _max_values, 0); } @@ -210,7 +210,7 @@ NodeModel::port_value_range(SharedPtr<PortModel> port, float& min, float& max) c max = min + 1.0; } - + void NodeModel::set(SharedPtr<ObjectModel> model) { diff --git a/src/client/NodeModel.hpp b/src/client/NodeModel.hpp index cc9811fd..5d220a61 100644 --- a/src/client/NodeModel.hpp +++ b/src/client/NodeModel.hpp @@ -1,15 +1,15 @@ /* 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 @@ -37,7 +37,7 @@ namespace Client { class PluginModel; class ClientStore; - + /** Node model class, used by the client to store engine's state. * * \ingroup IngenClient @@ -47,27 +47,27 @@ class NodeModel : public ObjectModel, virtual public Ingen::Shared::Node public: NodeModel(const NodeModel& copy); virtual ~NodeModel(); - + typedef std::vector< SharedPtr<PortModel> > Ports; SharedPtr<PortModel> get_port(const std::string& port_name) const; - + Shared::Port* port(uint32_t index) const; - + const Raul::URI& plugin_uri() const { return _plugin_uri; } const Shared::Plugin* plugin() const { return _plugin.get(); } uint32_t num_ports() const { return _ports.size(); } const Ports& ports() const { return _ports; } - + void port_value_range(SharedPtr<PortModel> port, float& min, float& max) const; - + // Signals - sigc::signal<void, SharedPtr<PortModel> > signal_new_port; - sigc::signal<void, SharedPtr<PortModel> > signal_removed_port; - + sigc::signal<void, SharedPtr<PortModel> > signal_new_port; + sigc::signal<void, SharedPtr<PortModel> > signal_removed_port; + protected: friend class ClientStore; - + NodeModel(const Raul::URI& plugin_uri, const Raul::Path& path); NodeModel(SharedPtr<PluginModel> plugin, const Raul::Path& path); @@ -82,7 +82,7 @@ protected: void set(SharedPtr<ObjectModel> model); virtual void clear(); - + Ports _ports; ///< Vector of ports (not a Table to preserve order) Raul::URI _plugin_uri; ///< Plugin URI (if PluginModel is unknown) SharedPtr<PluginModel> _plugin; ///< The plugin this node is an instance of diff --git a/src/client/OSCClientReceiver.cpp b/src/client/OSCClientReceiver.cpp index 445c92cc..66488df2 100644 --- a/src/client/OSCClientReceiver.cpp +++ b/src/client/OSCClientReceiver.cpp @@ -1,15 +1,15 @@ /* 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 @@ -59,7 +59,7 @@ OSCClientReceiver::start(bool dump_osc) } // Find a free port - if (!_st) { + if (!_st) { _st = lo_server_thread_new(NULL, lo_error_cb); _listen_port = lo_server_thread_get_port(_st); } @@ -99,13 +99,13 @@ int OSCClientReceiver::generic_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* user_data) { printf("[OSCMsg] %s (%s)\t", path, types); - + for (int i=0; i < argc; ++i) { lo_arg_pp(lo_type(types[i]), argv[i]); printf("\t"); } printf("\n"); - + /*for (int i=0; i < argc; ++i) { printf(" '%c' ", types[i]); lo_arg_pp(lo_type(types[i]), argv[i]); @@ -169,7 +169,7 @@ OSCClientReceiver::_error_cb(const char* path, const char* types, lo_arg** argv, _target->error((char*)argv[0]); return 0; } - + int OSCClientReceiver::_new_patch_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) @@ -208,7 +208,7 @@ OSCClientReceiver::_connection_cb(const char* path, const char* types, lo_arg** { const char* const src_port_path = &argv[0]->s; const char* const dst_port_path = &argv[1]->s; - + _target->connect(src_port_path, dst_port_path); return 0; @@ -252,8 +252,8 @@ OSCClientReceiver::_new_port_cb(const char* path, const char* types, lo_arg** ar const bool is_output = (argv[3]->i == 1); _target->new_port(port_path, type, index, is_output); - - return 0; + + return 0; } @@ -272,7 +272,7 @@ OSCClientReceiver::_set_variable_cb(const char* path, const char* types, lo_arg* _target->set_variable(obj_path, key, value); - return 0; + return 0; } @@ -291,7 +291,7 @@ OSCClientReceiver::_set_property_cb(const char* path, const char* types, lo_arg* _target->set_property(obj_path, key, value); - return 0; + return 0; } @@ -303,10 +303,10 @@ OSCClientReceiver::_set_port_value_cb(const char* path, const char* types, lo_ar _target->set_port_value(port_path, value); - return 0; + return 0; } - + int OSCClientReceiver::_set_voice_value_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) { @@ -316,7 +316,7 @@ OSCClientReceiver::_set_voice_value_cb(const char* path, const char* types, lo_a _target->set_voice_value(port_path, voice, value); - return 0; + return 0; } @@ -327,7 +327,7 @@ OSCClientReceiver::_activity_cb(const char* path, const char* types, lo_arg** ar _target->activity(port_path); - return 0; + return 0; } @@ -359,7 +359,7 @@ OSCClientReceiver::_plugin_cb(const char* path, const char* types, lo_arg** argv assert(argc == 3 && !strcmp(types, "sss")); _target->new_plugin(&argv[0]->s, &argv[1]->s, &argv[2]->s); // uri, type, symbol - return 0; + return 0; } @@ -373,7 +373,7 @@ OSCClientReceiver::_program_add_cb(const char* path, const char* types, lo_arg** _target->program_add(node_path, bank, program, name); - return 0; + return 0; } @@ -386,7 +386,7 @@ OSCClientReceiver::_program_remove_cb(const char* path, const char* types, lo_ar _target->program_remove(node_path, bank, program); - return 0; + return 0; } diff --git a/src/client/OSCClientReceiver.hpp b/src/client/OSCClientReceiver.hpp index c0ea2f43..af6b08af 100644 --- a/src/client/OSCClientReceiver.hpp +++ b/src/client/OSCClientReceiver.hpp @@ -1,15 +1,15 @@ /* 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 @@ -61,18 +61,18 @@ public: void start(bool dump_osc); void stop(); - + int listen_port() { return _listen_port; } std::string listen_url() { return lo_server_thread_get_url(_st); } - + private: void setup_callbacks(); - + static void lo_error_cb(int num, const char* msg, const char* path); static int generic_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* user_data); static int unknown_cb(const char* path, const char* types, lo_arg** argv, int argc, void* data, void* osc_receiver); - + SharedPtr<Shared::ClientInterface> _target; int _listen_port; diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp index 2286108c..87a66daa 100644 --- a/src/client/OSCEngineSender.cpp +++ b/src/client/OSCEngineSender.cpp @@ -1,15 +1,15 @@ /* 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 @@ -108,27 +108,27 @@ OSCEngineSender::load_plugins() void -OSCEngineSender::activate() +OSCEngineSender::activate() { send("/ingen/activate", "i", next_id(), LO_ARGS_END); } void -OSCEngineSender::deactivate() +OSCEngineSender::deactivate() { send("/ingen/deactivate", "i", next_id(), LO_ARGS_END); } void -OSCEngineSender::quit() +OSCEngineSender::quit() { send("/ingen/quit", "i", next_id(), LO_ARGS_END); } - + // Object commands @@ -142,7 +142,7 @@ OSCEngineSender::new_object(const Shared::GraphObject* object) new_patch(patch->path(), patch->internal_polyphony()); return true; } - + const Node* node = dynamic_cast<const Node*>(object); if (node) { new_node(node->path(), node->plugin()->uri()); @@ -231,7 +231,7 @@ OSCEngineSender::clear_patch(const Path& patch_path) LO_ARGS_END); } - + void OSCEngineSender::connect(const Path& src_port_path, const Path& dst_port_path) @@ -334,7 +334,7 @@ OSCEngineSender::set_variable(const URI& obj_path, send_message("/ingen/set_variable", m); } - + void OSCEngineSender::set_property(const URI& obj_path, const URI& predicate, @@ -389,7 +389,7 @@ OSCEngineSender::request_variable(const URI& object_path, const URI& key) LO_ARGS_END); } - + void OSCEngineSender::request_property(const URI& object_path, const URI& key) { diff --git a/src/client/OSCEngineSender.hpp b/src/client/OSCEngineSender.hpp index 13609df3..bd93e4eb 100644 --- a/src/client/OSCEngineSender.hpp +++ b/src/client/OSCEngineSender.hpp @@ -1,15 +1,15 @@ /* 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 @@ -39,13 +39,13 @@ class OSCEngineSender : public Shared::EngineInterface, public Shared::OSCSender public: OSCEngineSender(const Raul::URI& engine_url); ~OSCEngineSender(); - + static OSCEngineSender* create(const Raul::URI& engine_url) { return new OSCEngineSender(engine_url); } - + Raul::URI uri() const { return _engine_url; } - + inline int32_t next_id() { int32_t ret = (_id == -1) ? -1 : _id++; return ret; } @@ -56,10 +56,10 @@ public: /* *** EngineInterface implementation below here *** */ - + void enable() { _enabled = true; } void disable() { _enabled = false; } - + void bundle_begin() { OSCSender::bundle_begin(); } void bundle_end() { OSCSender::bundle_end(); } void transfer_begin() { OSCSender::transfer_begin(); } @@ -74,60 +74,60 @@ public: void activate(); void deactivate(); void quit(); - + // Object commands - + virtual bool new_object(const Shared::GraphObject* object); virtual void new_patch(const Raul::Path& path, uint32_t poly); - + virtual void new_node(const Raul::Path& path, const Raul::URI& plugin_uri); - + virtual void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output); - + virtual void clear_patch(const Raul::Path& path); - + virtual void destroy(const Raul::Path& path); - + virtual void rename(const Raul::Path& old_path, const Raul::Path& new_path); - + virtual void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void disconnect_all(const Raul::Path& parent_patch_path, const Raul::Path& path); - + virtual void set_variable(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_port_value(const Raul::Path& port_path, const Raul::Atom& value); - + virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value); - + virtual void set_program(const Raul::Path& node_path, uint32_t bank, uint32_t program); virtual void midi_learn(const Raul::Path& node_path); - + // Requests // void ping(); void request_plugin(const Raul::URI& uri); diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 68326a3d..cd61c78d 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -1,15 +1,15 @@ /* 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 @@ -37,7 +37,7 @@ ObjectModel::ObjectModel(const Path& path) ObjectModel::~ObjectModel() { } - + /** Get a variable for this object. * @@ -92,7 +92,7 @@ ObjectModel::set(SharedPtr<ObjectModel> o) assert(_path == o->path()); if (o->_parent) _parent = o->_parent; - + for (Properties::const_iterator v = o->properties().begin(); v != o->properties().end(); ++v) { const Raul::Atom& mine = get_property(v->first); if (mine.is_valid()) diff --git a/src/client/ObjectModel.hpp b/src/client/ObjectModel.hpp index 230a030e..14c5180b 100644 --- a/src/client/ObjectModel.hpp +++ b/src/client/ObjectModel.hpp @@ -1,15 +1,15 @@ /* 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 @@ -56,12 +56,12 @@ public: const Raul::Atom& get_variable(const Raul::URI& key) const; Raul::Atom& get_variable(Raul::URI& key); - + virtual void set_property(const Raul::URI& key, const Raul::Atom& value) { ResourceImpl::set_property(key, value); signal_property.emit(key, value); } - + virtual void set_variable(const Raul::URI& key, const Raul::Atom& value) { _variables[key] = value; signal_variable.emit(key, value); } @@ -71,22 +71,22 @@ public: const Raul::Symbol symbol() const { return _path.name(); } SharedPtr<ObjectModel> parent() const { return _parent; } bool polyphonic() const; - + GraphObject* graph_parent() const { return _parent.get(); } // Signals - sigc::signal<void, SharedPtr<ObjectModel> > signal_new_child; - sigc::signal<void, SharedPtr<ObjectModel> > signal_removed_child; - sigc::signal<void, const Raul::URI&, const Raul::Atom&> signal_variable; - sigc::signal<void, const Raul::URI&, const Raul::Atom&> signal_property; - sigc::signal<void> signal_destroyed; - sigc::signal<void> signal_renamed; + sigc::signal<void, SharedPtr<ObjectModel> > signal_new_child; + sigc::signal<void, SharedPtr<ObjectModel> > signal_removed_child; + sigc::signal<void, const Raul::URI&, const Raul::Atom&> signal_variable; + sigc::signal<void, const Raul::URI&, const Raul::Atom&> signal_property; + sigc::signal<void> signal_destroyed; + sigc::signal<void> signal_renamed; protected: friend class ClientStore; - + ObjectModel(const Raul::Path& path); - + virtual void set_path(const Raul::Path& p) { _path = p; signal_renamed.emit(); } virtual void set_parent(SharedPtr<ObjectModel> p) { assert(p); _parent = p; } virtual void add_child(SharedPtr<ObjectModel> c) {} @@ -96,7 +96,7 @@ protected: Raul::Path _path; SharedPtr<ObjectModel> _parent; - + Properties _variables; }; diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp index 1f322259..19509c6c 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/PatchModel.cpp @@ -1,15 +1,15 @@ /* 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 @@ -39,7 +39,7 @@ PatchModel::add_child(SharedPtr<ObjectModel> c) add_port(pm); return; } - + SharedPtr<NodeModel> nm = PtrCast<NodeModel>(c); if (nm) signal_new_node.emit(nm); @@ -55,7 +55,7 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o) SharedPtr<PortModel> pm = PtrCast<PortModel>(o); if (pm) remove_port(pm); - + // Remove any connections which referred to this object, // since they can't possibly exist anymore for (Connections::iterator j = _connections->begin(); j != _connections->end() ; ) { @@ -78,9 +78,9 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o) } SharedPtr<NodeModel> nm = PtrCast<NodeModel>(o); - if (nm) + if (nm) signal_removed_node.emit(nm); - + return true; } @@ -129,7 +129,7 @@ PatchModel::add_connection(SharedPtr<ConnectionModel> cm) || cm->src_port()->parent()->parent().get() == this); assert(cm->dst_port()->parent().get() == this || cm->dst_port()->parent()->parent().get() == this); - + SharedPtr<ConnectionModel> existing = get_connection(cm->src_port_path(), cm->dst_port_path()); if (existing) { diff --git a/src/client/PatchModel.hpp b/src/client/PatchModel.hpp index b07924cc..2816cf4e 100644 --- a/src/client/PatchModel.hpp +++ b/src/client/PatchModel.hpp @@ -1,15 +1,15 @@ /* 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 @@ -42,10 +42,10 @@ public: /* WARNING: Copy constructor creates a shallow copy WRT connections */ const Connections& connections() const { return *_connections.get(); } - + SharedPtr<ConnectionModel> get_connection(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) const; - + uint32_t poly() const { return _poly; } uint32_t internal_polyphony() const { return _poly; } bool enabled() const; @@ -59,13 +59,13 @@ public: _editable = e; signal_editable.emit(e); } } - + virtual void set_variable(const Raul::URI& key, const Raul::Atom& value); // Signals - sigc::signal<void, SharedPtr<NodeModel> > signal_new_node; - sigc::signal<void, SharedPtr<NodeModel> > signal_removed_node; - sigc::signal<void, SharedPtr<ConnectionModel> > signal_new_connection; + sigc::signal<void, SharedPtr<NodeModel> > signal_new_node; + sigc::signal<void, SharedPtr<NodeModel> > signal_removed_node; + sigc::signal<void, SharedPtr<ConnectionModel> > signal_new_connection; sigc::signal<void, SharedPtr<ConnectionModel> > signal_removed_connection; sigc::signal<void, bool> signal_editable; @@ -79,14 +79,14 @@ private: , _editable(true) { } - + void clear(); void add_child(SharedPtr<ObjectModel> c); bool remove_child(SharedPtr<ObjectModel> c); - + void add_connection(SharedPtr<ConnectionModel> cm); void remove_connection(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + SharedPtr<Connections> _connections; uint32_t _poly; bool _editable; diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index 6f6aa715..69ee2002 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -1,15 +1,15 @@ /* 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 @@ -35,7 +35,7 @@ SLV2Plugins PluginModel::_slv2_plugins = NULL; #endif Redland::World* PluginModel::_rdf_world = NULL; - + PluginModel::PluginModel(const URI& uri, const URI& type_uri) : ResourceImpl(uri) @@ -52,7 +52,7 @@ PluginModel::PluginModel(const URI& uri, const URI& type_uri) if (_type == Internal) set_property("doap:name", Raul::Atom(uri.substr(uri.find_last_of("#") + 1).c_str())); } - + string PluginModel::default_node_symbol() const @@ -137,7 +137,7 @@ PluginModel::icon_path() const Glib::Mutex::Lock lock(_rdf_world->mutex()); _icon_path = get_lv2_icon_path(_slv2_plugin); } - + return _icon_path; } @@ -151,14 +151,14 @@ PluginModel::get_lv2_icon_path(SLV2Plugin plugin) "http://ll-plugins.nongnu.org/lv2/namespace#svgIcon"); SLV2Values paths = slv2_plugin_get_value(plugin, svg_icon_pred); - + if (slv2_values_size(paths) > 0) { SLV2Value value = slv2_values_get_at(paths, 0); if (slv2_value_is_uri(value)) result = slv2_uri_to_path(slv2_value_as_string(value)); slv2_values_free(paths); } - + slv2_value_free(svg_icon_pred); return result; } diff --git a/src/client/PluginModel.hpp b/src/client/PluginModel.hpp index b2f4cd0e..cf0b1eed 100644 --- a/src/client/PluginModel.hpp +++ b/src/client/PluginModel.hpp @@ -1,15 +1,15 @@ /* 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 @@ -47,9 +47,9 @@ class PluginModel : public Ingen::Shared::Plugin { public: PluginModel(const Raul::URI& uri, const Raul::URI& type_uri); - + Type type() const { return _type; } - + const std::string symbol() const { return string_property("lv2:symbol"); } const std::string name() const { return string_property("doap:name"); } @@ -68,7 +68,7 @@ public: static void set_slv2_world(SLV2World world) { Glib::Mutex::Lock lock(_rdf_world->mutex()); - _slv2_world = world; + _slv2_world = world; _slv2_plugins = slv2_world_get_all_plugins(_slv2_world); } @@ -89,7 +89,7 @@ public: private: const Type _type; - + const std::string string_property(const std::string& name) const; #ifdef HAVE_SLV2 diff --git a/src/client/PluginUI.cpp b/src/client/PluginUI.cpp index 63bef6b2..249d3c2e 100644 --- a/src/client/PluginUI.cpp +++ b/src/client/PluginUI.cpp @@ -1,15 +1,15 @@ /* 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 @@ -53,7 +53,7 @@ lv2_ui_write(LV2UI_Controller controller, PluginUI* ui = (PluginUI*)controller; SharedPtr<PortModel> port = ui->node()->ports()[port_index]; - + const LV2Features::Feature* f = ui->world()->lv2_features->feature(LV2_URI_MAP_URI); LV2URIMap* map = (LV2URIMap*)f->controller; assert(map); @@ -63,7 +63,7 @@ lv2_ui_write(LV2UI_Controller controller, assert(buffer_size == 4); if (*(float*)buffer == port->value().get_float()) return; // do nothing (handle stupid plugin UIs that feed back) - + ui->world()->engine->set_port_value(port->path(), Atom(*(float*)buffer)); // FIXME: slow, need to cache ID @@ -80,7 +80,7 @@ lv2_ui_write(LV2UI_Controller controller, ui->world()->engine->set_port_value(port->path(), Atom("lv2midi:MidiEvent", ev->size, data)); } else { - cerr << "WARNING: Unable to send event type " << ev->type << + cerr << "WARNING: Unable to send event type " << ev->type << " over OSC, ignoring event" << endl; } @@ -93,7 +93,7 @@ lv2_ui_write(LV2UI_Controller controller, } } - + PluginUI::PluginUI(Ingen::Shared::World* world, SharedPtr<NodeModel> node) : _world(world) diff --git a/src/client/PluginUI.hpp b/src/client/PluginUI.hpp index 81aa23a4..f3461f22 100644 --- a/src/client/PluginUI.hpp +++ b/src/client/PluginUI.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index d62aa236..e5c4b96f 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -1,15 +1,15 @@ /* 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 @@ -27,7 +27,7 @@ PortModel::has_hint(const std::string& qname) const const Raul::Atom& hint = get_variable(qname); return (hint.is_valid() && hint.get_bool() > 0); } - + void PortModel::set(SharedPtr<ObjectModel> model) { diff --git a/src/client/PortModel.hpp b/src/client/PortModel.hpp index 90b11ae0..cfdd9d01 100644 --- a/src/client/PortModel.hpp +++ b/src/client/PortModel.hpp @@ -1,15 +1,15 @@ /* 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 @@ -40,14 +40,14 @@ class PortModel : public ObjectModel, public Ingen::Shared::Port { public: enum Direction { INPUT, OUTPUT }; - - inline uint32_t index() const { return _index; } + + inline uint32_t index() const { return _index; } inline Shared::DataType type() const { return _type; } inline const Raul::Atom& value() const { return _current_val; } inline bool connected() const { return (_connections > 0); } inline bool is_input() const { return (_direction == INPUT); } inline bool is_output() const { return (_direction == OUTPUT); } - + bool has_hint(const std::string& qname) const; bool is_logarithmic() const { return has_hint("ingen:logarithmic"); } @@ -55,19 +55,19 @@ public: bool is_toggle() const { return has_hint("lv2:toggled"); } inline bool operator==(const PortModel& pm) const { return (_path == pm._path); } - + inline void value(const Raul::Atom& val) { if (val != _current_val) { _current_val = val; signal_value_changed.emit(val); } } - + inline void value(uint32_t voice, const Raul::Atom& val) { // FIXME: implement properly signal_voice_changed.emit(voice, val); } - + // Signals sigc::signal<void, const Raul::Atom&> signal_value_changed; ///< Value ports sigc::signal<void, uint32_t, const Raul::Atom&> signal_voice_changed; ///< Polyphonic value ports @@ -77,7 +77,7 @@ public: private: friend class ClientStore; - + PortModel(const Raul::Path& path, uint32_t index, Shared::DataType type, Direction dir) : ObjectModel(path) , _index(index) @@ -89,15 +89,15 @@ private: if (_type == Shared::DataType::UNKNOWN) std::cerr << "[PortModel] Warning: Unknown port type" << std::endl; } - + void add_child(SharedPtr<ObjectModel> c) { throw; } bool remove_child(SharedPtr<ObjectModel> c) { throw; } - + void connected_to(SharedPtr<PortModel> p) { ++_connections; signal_connection.emit(p); } void disconnected_from(SharedPtr<PortModel> p) { --_connections; signal_disconnection.emit(p); } - + void set(SharedPtr<ObjectModel> model); - + uint32_t _index; Shared::DataType _type; Direction _direction; diff --git a/src/client/SigClientInterface.hpp b/src/client/SigClientInterface.hpp index ee20797a..5ea3436a 100644 --- a/src/client/SigClientInterface.hpp +++ b/src/client/SigClientInterface.hpp @@ -1,15 +1,15 @@ /* 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 @@ -40,51 +40,51 @@ class SigClientInterface : public Ingen::Shared::ClientInterface, public sigc::t { public: SigClientInterface() : _enabled(true) {} - + bool enabled() const { return _enabled; } Raul::URI uri() const { return "ingen:internal"; } // Signal parameters match up directly with ClientInterface calls sigc::signal<bool, const Shared::GraphObject*> signal_new_object; - + sigc::signal<void, int32_t> signal_response_ok; sigc::signal<void, int32_t, std::string> signal_response_error; - sigc::signal<void> signal_bundle_begin; - sigc::signal<void> signal_bundle_end; - sigc::signal<void, std::string> signal_error; - sigc::signal<void, Raul::URI, Raul::URI, Raul::Symbol> signal_new_plugin; - sigc::signal<void, Raul::Path, uint32_t> signal_new_patch; - sigc::signal<void, Raul::Path, Raul::URI> signal_new_node; - sigc::signal<void, Raul::Path, Raul::URI, uint32_t, bool> signal_new_port; - sigc::signal<void, Raul::Path> signal_clear_patch; - sigc::signal<void, Raul::Path, Raul::Path> signal_object_renamed; - sigc::signal<void, Raul::Path> signal_object_destroyed; - sigc::signal<void, Raul::Path, Raul::Path> signal_connection; - sigc::signal<void, Raul::Path, Raul::Path> signal_disconnection; - sigc::signal<void, Raul::URI, Raul::URI, Raul::Atom> signal_variable_change; - sigc::signal<void, Raul::URI, Raul::URI, Raul::Atom> signal_property_change; - sigc::signal<void, Raul::Path, Raul::Atom> signal_port_value; - sigc::signal<void, Raul::Path, uint32_t, Raul::Atom> signal_voice_value; - sigc::signal<void, Raul::Path> signal_activity; - sigc::signal<void, Raul::Path, uint32_t, uint32_t, std::string> signal_program_add; - sigc::signal<void, Raul::Path, uint32_t, uint32_t> signal_program_remove; - + sigc::signal<void> signal_bundle_begin; + sigc::signal<void> signal_bundle_end; + sigc::signal<void, std::string> signal_error; + sigc::signal<void, Raul::URI, Raul::URI, Raul::Symbol> signal_new_plugin; + sigc::signal<void, Raul::Path, uint32_t> signal_new_patch; + sigc::signal<void, Raul::Path, Raul::URI> signal_new_node; + sigc::signal<void, Raul::Path, Raul::URI, uint32_t, bool> signal_new_port; + sigc::signal<void, Raul::Path> signal_clear_patch; + sigc::signal<void, Raul::Path, Raul::Path> signal_object_renamed; + sigc::signal<void, Raul::Path> signal_object_destroyed; + sigc::signal<void, Raul::Path, Raul::Path> signal_connection; + sigc::signal<void, Raul::Path, Raul::Path> signal_disconnection; + sigc::signal<void, Raul::URI, Raul::URI, Raul::Atom> signal_variable_change; + sigc::signal<void, Raul::URI, Raul::URI, Raul::Atom> signal_property_change; + sigc::signal<void, Raul::Path, Raul::Atom> signal_port_value; + sigc::signal<void, Raul::Path, uint32_t, Raul::Atom> signal_voice_value; + sigc::signal<void, Raul::Path> signal_activity; + sigc::signal<void, Raul::Path, uint32_t, uint32_t, std::string> signal_program_add; + sigc::signal<void, Raul::Path, uint32_t, uint32_t> signal_program_remove; + /** Fire pending signals. Only does anything on derived classes (that may queue) */ virtual bool emit_signals() { return false; } protected: - + bool _enabled; // ClientInterface hooks that fire the above signals - + void enable() { _enabled = true; } void disable() { _enabled = false ; } void bundle_begin() { if (_enabled) signal_bundle_begin.emit(); } - + void bundle_end() { if (_enabled) signal_bundle_end.emit(); } @@ -96,58 +96,58 @@ protected: void response_error(int32_t id, const std::string& msg) { if (_enabled) signal_response_error.emit(id, msg); } - + void error(const std::string& msg) { if (_enabled) signal_error.emit(msg); } - + void new_plugin(const Raul::URI& uri, const Raul::URI& type_uri, const Raul::Symbol& symbol) { if (_enabled) signal_new_plugin.emit(uri, type_uri, symbol); } - + bool new_object(const Shared::GraphObject* object) { if (_enabled) signal_new_object.emit(object); return false; } void new_patch(const Raul::Path& path, uint32_t poly) { if (_enabled) signal_new_patch.emit(path, poly); } - + void new_node(const Raul::Path& path, const Raul::URI& plugin_uri) { if (_enabled) signal_new_node.emit(path, plugin_uri); } - + void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output) { if (_enabled) signal_new_port.emit(path, type, index, is_output); } - + void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) { if (_enabled) signal_connection.emit(src_port_path, dst_port_path); } void destroy(const Raul::Path& path) { if (_enabled) signal_object_destroyed.emit(path); } - + void clear_patch(const Raul::Path& path) { if (_enabled) signal_clear_patch.emit(path); } void rename(const Raul::Path& old_path, const Raul::Path& new_path) { if (_enabled) signal_object_renamed.emit(old_path, new_path); } - + void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) { if (_enabled) signal_disconnection.emit(src_port_path, dst_port_path); } - + void set_variable(const Raul::URI& path, const Raul::URI& key, const Raul::Atom& value) { if (_enabled) signal_variable_change.emit(path, key, value); } - + void set_property(const Raul::URI& path, const Raul::URI& key, const Raul::Atom& value) { if (_enabled) signal_property_change.emit(path, key, value); } void set_port_value(const Raul::Path& port_path, const Raul::Atom& value) { if (_enabled) signal_port_value.emit(port_path, value); } - + void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value) { if (_enabled) signal_voice_value.emit(port_path, voice, value); } - + void activity(const Raul::Path& port_path) { if (_enabled) signal_activity.emit(port_path); } void program_add(const Raul::Path& path, uint32_t bank, uint32_t program, const std::string& name) { if (_enabled) signal_program_add.emit(path, bank, program, name); } - + void program_remove(const Raul::Path& path, uint32_t bank, uint32_t program) { if (_enabled) signal_program_remove.emit(path, bank, program); } }; diff --git a/src/client/ThreadedSigClientInterface.cpp b/src/client/ThreadedSigClientInterface.cpp index bc7707f3..980b8057 100644 --- a/src/client/ThreadedSigClientInterface.cpp +++ b/src/client/ThreadedSigClientInterface.cpp @@ -1,15 +1,15 @@ /* 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 @@ -98,7 +98,7 @@ ThreadedSigClientInterface::new_object(const Shared::GraphObject* object) new_port(port->path(), port->type().uri(), port->index(), !port->is_input()); return true; } - + return false; } diff --git a/src/client/ThreadedSigClientInterface.hpp b/src/client/ThreadedSigClientInterface.hpp index 0862bdee..a2aca427 100644 --- a/src/client/ThreadedSigClientInterface.hpp +++ b/src/client/ThreadedSigClientInterface.hpp @@ -1,15 +1,15 @@ /* 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 @@ -79,66 +79,66 @@ public: void bundle_end() { push_sig(bundle_end_slot); } - + void transfer_begin() {} void transfer_end() {} void response_ok(int32_t id) { push_sig(sigc::bind(response_ok_slot, id)); } - + void response_error(int32_t id, const std::string& msg) { push_sig(sigc::bind(response_error_slot, id, msg)); } void error(const std::string& msg) { push_sig(sigc::bind(error_slot, msg)); } - + void new_plugin(const Raul::URI& uri, const Raul::URI& type_uri, const Raul::Symbol& symbol) { push_sig(sigc::bind(new_plugin_slot, uri, type_uri, symbol)); } - + bool new_object(const Shared::GraphObject* object); - + void new_patch(const Raul::Path& path, uint32_t poly) { push_sig(sigc::bind(new_patch_slot, path, poly)); } - + void new_node(const Raul::Path& path, const Raul::URI& plugin_uri) { push_sig(sigc::bind(new_node_slot, path, plugin_uri)); } - + void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output) { push_sig(sigc::bind(new_port_slot, path, type, index, is_output)); } - + void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) { push_sig(sigc::bind(connection_slot, src_port_path, dst_port_path)); } void destroy(const Raul::Path& path) { push_sig(sigc::bind(object_destroyed_slot, path)); } - + void clear_patch(const Raul::Path& path) { push_sig(sigc::bind(clear_patch_slot, path)); } void rename(const Raul::Path& old_path, const Raul::Path& new_path) { push_sig(sigc::bind(object_renamed_slot, old_path, new_path)); } - + void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) { push_sig(sigc::bind(disconnection_slot, src_port_path, dst_port_path)); } - + void set_variable(const Raul::URI& path, const Raul::URI& key, const Raul::Atom& value) { push_sig(sigc::bind(variable_change_slot, path, key, value)); } - + void set_property(const Raul::URI& path, const Raul::URI& key, const Raul::Atom& value) { push_sig(sigc::bind(property_change_slot, path, key, value)); } void set_port_value(const Raul::Path& port_path, const Raul::Atom& value) { push_sig(sigc::bind(port_value_slot, port_path, value)); } - + void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value) { push_sig(sigc::bind(voice_value_slot, port_path, voice, value)); } - + void activity(const Raul::Path& port_path) { push_sig(sigc::bind(activity_slot, port_path)); } void program_add(const Raul::Path& path, uint32_t bank, uint32_t program, const std::string& name) { push_sig(sigc::bind(program_add_slot, path, bank, program, name)); } - + void program_remove(const Raul::Path& path, uint32_t bank, uint32_t program) { push_sig(sigc::bind(program_remove_slot, path, bank, program)); } @@ -147,34 +147,34 @@ public: private: void push_sig(Closure ev); - + Glib::Mutex _mutex; Glib::Cond _cond; Raul::SRSWQueue<Closure> _sigs; bool _attached; - sigc::slot<void> bundle_begin_slot; - sigc::slot<void> bundle_end_slot; - sigc::slot<void, int32_t> response_ok_slot; - sigc::slot<void, int32_t, std::string> response_error_slot; - sigc::slot<void, std::string> error_slot; - sigc::slot<void, Raul::URI, Raul::URI, Raul::Symbol> new_plugin_slot; - sigc::slot<void, Raul::Path, uint32_t> new_patch_slot; - sigc::slot<void, Raul::Path, Raul::URI> new_node_slot; + sigc::slot<void> bundle_begin_slot; + sigc::slot<void> bundle_end_slot; + sigc::slot<void, int32_t> response_ok_slot; + sigc::slot<void, int32_t, std::string> response_error_slot; + sigc::slot<void, std::string> error_slot; + sigc::slot<void, Raul::URI, Raul::URI, Raul::Symbol> new_plugin_slot; + sigc::slot<void, Raul::Path, uint32_t> new_patch_slot; + sigc::slot<void, Raul::Path, Raul::URI> new_node_slot; sigc::slot<void, Raul::Path, Raul::URI, uint32_t, bool> new_port_slot; sigc::slot<void, Raul::Path, Raul::Path> connection_slot; - sigc::slot<void, Raul::Path> clear_patch_slot; - sigc::slot<void, Raul::Path> object_destroyed_slot; - sigc::slot<void, Raul::Path, Raul::Path> object_renamed_slot; - sigc::slot<void, Raul::Path, Raul::Path> disconnection_slot; - sigc::slot<void, Raul::URI, Raul::URI, Raul::Atom> variable_change_slot; - sigc::slot<void, Raul::URI, Raul::URI, Raul::Atom> property_change_slot; - sigc::slot<void, Raul::Path, Raul::Atom> port_value_slot; - sigc::slot<void, Raul::Path, uint32_t, Raul::Atom> voice_value_slot; - sigc::slot<void, Raul::Path> activity_slot; - sigc::slot<void, Raul::Path, uint32_t, uint32_t, std::string> program_add_slot; - sigc::slot<void, Raul::Path, uint32_t, uint32_t> program_remove_slot; + sigc::slot<void, Raul::Path> clear_patch_slot; + sigc::slot<void, Raul::Path> object_destroyed_slot; + sigc::slot<void, Raul::Path, Raul::Path> object_renamed_slot; + sigc::slot<void, Raul::Path, Raul::Path> disconnection_slot; + sigc::slot<void, Raul::URI, Raul::URI, Raul::Atom> variable_change_slot; + sigc::slot<void, Raul::URI, Raul::URI, Raul::Atom> property_change_slot; + sigc::slot<void, Raul::Path, Raul::Atom> port_value_slot; + sigc::slot<void, Raul::Path, uint32_t, Raul::Atom> voice_value_slot; + sigc::slot<void, Raul::Path> activity_slot; + sigc::slot<void, Raul::Path, uint32_t, uint32_t, std::string> program_add_slot; + sigc::slot<void, Raul::Path, uint32_t, uint32_t> program_remove_slot; }; diff --git a/src/client/client.cpp b/src/client/client.cpp index 72d329ef..2635101d 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -1,15 +1,15 @@ /* 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 HAVEOUT 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 @@ -30,7 +30,7 @@ using namespace std; namespace Ingen { namespace Client { - + SharedPtr<Ingen::Shared::EngineInterface> new_remote_interface(const std::string& url) diff --git a/src/client/client.hpp b/src/client/client.hpp index c33b0abd..e933cd91 100644 --- a/src/client/client.hpp +++ b/src/client/client.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/common/interface/ClientInterface.hpp b/src/common/interface/ClientInterface.hpp index a154e2ca..eef7150e 100644 --- a/src/common/interface/ClientInterface.hpp +++ b/src/common/interface/ClientInterface.hpp @@ -1,15 +1,15 @@ /* 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 @@ -51,20 +51,20 @@ public: */ virtual void transfer_begin() = 0; virtual void transfer_end() = 0; - + virtual void error(const std::string& msg) = 0; - + virtual void new_plugin(const Raul::URI& uri, const Raul::URI& type_uri, const Raul::Symbol& symbol) = 0; - + virtual void activity(const Raul::Path& path) = 0; - + virtual void program_add(const Raul::Path& node_path, uint32_t bank, uint32_t program, const std::string& program_name) = 0; - + virtual void program_remove(const Raul::Path& node_path, uint32_t bank, uint32_t program) = 0; diff --git a/src/common/interface/CommonInterface.hpp b/src/common/interface/CommonInterface.hpp index d00c7baa..fbacfba1 100644 --- a/src/common/interface/CommonInterface.hpp +++ b/src/common/interface/CommonInterface.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -38,52 +38,52 @@ class CommonInterface { public: virtual ~CommonInterface() {} - + /** Begin an atomic bundle */ virtual void bundle_begin() = 0; /** End (and send) an atomic bundle */ virtual void bundle_end() = 0; - + virtual bool new_object(const GraphObject* object) = 0; virtual void new_patch(const Raul::Path& path, uint32_t poly) = 0; - + virtual void new_node(const Raul::Path& path, const Raul::URI& plugin_uri) = 0; - + virtual void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output) = 0; - + virtual void rename(const Raul::Path& old_path, const Raul::Path& new_path) = 0; - + virtual void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) = 0; - + virtual void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path) = 0; - + virtual void set_variable(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value) = 0; - + virtual void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value) = 0; - + virtual void set_port_value(const Raul::Path& port_path, const Raul::Atom& value) = 0; - + virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value) = 0; - + virtual void destroy(const Raul::Path& path) = 0; - + virtual void clear_patch(const Raul::Path& patch_path) = 0; }; diff --git a/src/common/interface/Connection.hpp b/src/common/interface/Connection.hpp index 92c3ab9a..535d5764 100644 --- a/src/common/interface/Connection.hpp +++ b/src/common/interface/Connection.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/common/interface/DataType.hpp b/src/common/interface/DataType.hpp index 80d3e5e9..ecc90aac 100644 --- a/src/common/interface/DataType.hpp +++ b/src/common/interface/DataType.hpp @@ -1,15 +1,15 @@ /* 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 @@ -34,14 +34,14 @@ namespace Shared { */ class DataType { public: - + enum Symbol { UNKNOWN = 0, AUDIO = 1, CONTROL = 2, EVENT = 3 }; - + DataType(const Raul::URI& uri) : _symbol(UNKNOWN) { @@ -70,7 +70,7 @@ public: inline bool is_event() { return _symbol == EVENT; } private: - + static inline const char* type_uri(unsigned symbol_num) { switch (symbol_num) { case 1: return "lv2:AudioPort"; diff --git a/src/common/interface/EngineInterface.hpp b/src/common/interface/EngineInterface.hpp index 64284f05..3237929a 100644 --- a/src/common/interface/EngineInterface.hpp +++ b/src/common/interface/EngineInterface.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2007 Dave Robillard <http://drobilla.net> - * + * * Ingen is free software = 0; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation = 0; 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 = 0; 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 = 0; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -38,48 +38,48 @@ public: virtual ~EngineInterface() {} virtual Raul::URI uri() const = 0; - + // Responses virtual void set_next_response_id(int32_t id) = 0; virtual void disable_responses() = 0; - + // Client registration virtual void register_client(ClientInterface* client) = 0; virtual void unregister_client(const Raul::URI& uri) = 0; - + // Engine commands virtual void load_plugins() = 0; virtual void activate() = 0; virtual void deactivate() = 0; virtual void quit() = 0; - + // Object commands - + virtual void disconnect_all(const Raul::Path& parent_patch_path, const Raul::Path& path) = 0; - + virtual void set_program(const Raul::Path& node_path, uint32_t bank, uint32_t program) = 0; - + virtual void midi_learn(const Raul::Path& node_path) = 0; - + // Requests - + virtual void ping() = 0; - + virtual void request_plugin(const Raul::URI& uri) = 0; virtual void request_object(const Raul::Path& path) = 0; virtual void request_variable(const Raul::URI& path, const Raul::URI& key) = 0; - + virtual void request_property(const Raul::URI& path, const Raul::URI& key) = 0; virtual void request_plugins() = 0; - + virtual void request_all_objects() = 0; }; diff --git a/src/common/interface/EventType.hpp b/src/common/interface/EventType.hpp index 6d662b7e..2b29d630 100644 --- a/src/common/interface/EventType.hpp +++ b/src/common/interface/EventType.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -26,13 +26,13 @@ namespace Shared { */ class EventType { public: - + enum Symbol { UNKNOWN = 0, MIDI = 1, OSC = 2 }; - + EventType(const std::string& uri) : _symbol(UNKNOWN) { @@ -58,7 +58,7 @@ public: inline bool is_osc() { return _symbol == OSC; } private: - + static inline const char* type_uri(unsigned symbol_num) { switch (symbol_num) { case 1: return "ingen:MidiEvent"; diff --git a/src/common/interface/GraphObject.hpp b/src/common/interface/GraphObject.hpp index d4483b91..b84776b8 100644 --- a/src/common/interface/GraphObject.hpp +++ b/src/common/interface/GraphObject.hpp @@ -1,15 +1,15 @@ /* 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 @@ -44,7 +44,7 @@ class GraphObject : public Raul::Deletable { public: typedef Raul::PathTable< SharedPtr<GraphObject> >::const_iterator const_iterator; - + virtual void set_path(const Raul::Path& path) = 0; virtual const Raul::Path path() const = 0; @@ -52,7 +52,7 @@ public: virtual const Properties& variables() const = 0; virtual Properties& variables() = 0; virtual bool polyphonic() const = 0; - + // FIXME: return WeakPtr, and stupid name virtual GraphObject* graph_parent() const = 0; }; diff --git a/src/common/interface/Node.hpp b/src/common/interface/Node.hpp index 26133b11..c91942a6 100644 --- a/src/common/interface/Node.hpp +++ b/src/common/interface/Node.hpp @@ -1,15 +1,15 @@ /* 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 @@ -28,12 +28,12 @@ class Plugin; /** A Node (or "module") in a Patch (which is also a Node). - * + * * A Node is a unit with input/output ports, a process() method, and some other * things. * * Purely virtual (except for the destructor). - * + * * \ingroup interface */ class Node : public virtual GraphObject diff --git a/src/common/interface/Patch.hpp b/src/common/interface/Patch.hpp index 9e609c7c..d66384f4 100644 --- a/src/common/interface/Patch.hpp +++ b/src/common/interface/Patch.hpp @@ -1,15 +1,15 @@ /* 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 @@ -38,7 +38,7 @@ public: typedef Raul::List< SharedPtr<Connection> > Connections; virtual const Connections& connections() const = 0; - + virtual bool enabled() const = 0; virtual uint32_t internal_polyphony() const = 0; }; diff --git a/src/common/interface/Plugin.hpp b/src/common/interface/Plugin.hpp index 30b453f3..2637a5f8 100644 --- a/src/common/interface/Plugin.hpp +++ b/src/common/interface/Plugin.hpp @@ -1,15 +1,15 @@ /* 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 @@ -32,7 +32,7 @@ public: enum Type { LV2, LADSPA, Internal, Patch }; virtual Type type() const = 0; - + inline const char* type_uri() const { switch (type()) { case LV2: return "lv2:Plugin"; @@ -42,7 +42,7 @@ public: default: return ""; } } - + static inline Type type_from_uri(const std::string& uri) { if (uri == "lv2:Plugin") return LV2; diff --git a/src/common/interface/Port.hpp b/src/common/interface/Port.hpp index 09a886f1..6482c1e7 100644 --- a/src/common/interface/Port.hpp +++ b/src/common/interface/Port.hpp @@ -1,15 +1,15 @@ /* 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 @@ -30,7 +30,7 @@ namespace Shared { /** A Port on a Node. * * Purely virtual (except for the destructor). - * + * * \ingroup interface */ class Port : public virtual GraphObject diff --git a/src/common/interface/Resource.hpp b/src/common/interface/Resource.hpp index d22f0a59..8f239c74 100644 --- a/src/common/interface/Resource.hpp +++ b/src/common/interface/Resource.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 diff --git a/src/engine/AudioBuffer.cpp b/src/engine/AudioBuffer.cpp index c621c18c..c151a98e 100644 --- a/src/engine/AudioBuffer.cpp +++ b/src/engine/AudioBuffer.cpp @@ -1,15 +1,15 @@ /* 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 @@ -68,13 +68,13 @@ AudioBuffer::resize(size_t size) _size = size; Sample* const old_data = _data; - + const bool using_local_data = (_data == _local_data); deallocate(); alloc_local_data(_size * sizeof(Sample)); assert(_local_data); - + if (using_local_data) _data = _local_data; else @@ -161,7 +161,7 @@ AudioBuffer::set_block(Sample val, size_t start_offset, size_t end_offset) { assert(end_offset >= start_offset); assert(end_offset < _size); - + Sample* const buf = data(); assert(buf); @@ -179,7 +179,7 @@ AudioBuffer::scale(Sample val, size_t start_sample, size_t end_sample) { assert(end_sample >= start_sample); assert(end_sample < _size); - + Sample* const buf = data(); assert(buf); @@ -199,10 +199,10 @@ AudioBuffer::copy(const Buffer* src, size_t start_sample, size_t end_sample) assert(end_sample >= start_sample); assert(src); assert(src->type() == DataType::CONTROL || DataType::AUDIO); - + Sample* const buf = data(); assert(buf); - + const Sample* const src_buf = ((AudioBuffer*)src)->data(); assert(src_buf); @@ -226,14 +226,14 @@ AudioBuffer::accumulate(const AudioBuffer* const src, size_t start_sample, size_ Sample* const buf = data(); assert(buf); - + const Sample* const src_buf = src->data(); assert(src_buf); const size_t to_copy = std::min(end_sample, _size - 1); for (size_t i = start_sample; i <= to_copy; ++i) buf[i] += src_buf[i]; - + } @@ -249,7 +249,7 @@ AudioBuffer::join(Buffer* buf) return false; assert(abuf->size() >= _size); - + _joined_buf = abuf; _filled_size = abuf->filled_size(); @@ -258,7 +258,7 @@ AudioBuffer::join(Buffer* buf) return true; } - + void AudioBuffer::unjoin() { diff --git a/src/engine/AudioBuffer.hpp b/src/engine/AudioBuffer.hpp index de5487c0..09683151 100644 --- a/src/engine/AudioBuffer.hpp +++ b/src/engine/AudioBuffer.hpp @@ -1,15 +1,15 @@ /* 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 @@ -26,7 +26,7 @@ namespace Ingen { - + class AudioBuffer : public Buffer { public: @@ -38,27 +38,27 @@ public: void scale(Sample val, size_t start_sample, size_t end_sample); void copy(const Buffer* src, size_t start_sample, size_t end_sample); void accumulate(const AudioBuffer* src, size_t start_sample, size_t end_sample); - + bool join(Buffer* buf); void unjoin(); - + /** For driver use only!! */ void set_data(Sample* data); - + inline const void* raw_data() const { return _data; } inline void* raw_data() { return _data; } - + inline Sample* data() const { return _data; } - + inline Sample& value_at(size_t offset) const { assert(offset < _size); return data()[offset]; } - + void prepare_read(FrameTime start, SampleCount nframes); void prepare_write(FrameTime start, SampleCount nframes) {} - + void rewind() const {} void resize(size_t size); - + void filled_size(size_t size) { _filled_size = size; } size_t filled_size() const { return _filled_size; } size_t size() const { return _size; } diff --git a/src/engine/AudioDriver.hpp b/src/engine/AudioDriver.hpp index 265bb3ec..a753a39a 100644 --- a/src/engine/AudioDriver.hpp +++ b/src/engine/AudioDriver.hpp @@ -1,15 +1,15 @@ /* 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 @@ -41,14 +41,14 @@ class AudioDriver : public Driver { public: AudioDriver() : Driver(Shared::DataType::AUDIO) {} - + virtual void set_root_patch(PatchImpl* patch) = 0; virtual PatchImpl* root_patch() = 0; - + virtual void add_port(DriverPort* port) = 0; - + virtual Raul::List<DriverPort*>::Node* remove_port(const Raul::Path& path) = 0; - + virtual SampleCount buffer_size() const = 0; virtual SampleCount sample_rate() const = 0; virtual SampleCount frame_time() const = 0; diff --git a/src/engine/Buffer.cpp b/src/engine/Buffer.cpp index 49ce1136..90edb506 100644 --- a/src/engine/Buffer.cpp +++ b/src/engine/Buffer.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/Buffer.hpp b/src/engine/Buffer.hpp index 254cf009..987a6191 100644 --- a/src/engine/Buffer.hpp +++ b/src/engine/Buffer.hpp @@ -1,15 +1,15 @@ /* 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 @@ -27,7 +27,7 @@ namespace Ingen { - + class Buffer : public boost::noncopyable, public Raul::Deletable { public: @@ -38,12 +38,12 @@ public: {} virtual ~Buffer() {} - + static Buffer* create(Shared::DataType type, size_t size); /** Clear contents and reset state */ virtual void clear() = 0; - + virtual void* raw_data() = 0; virtual const void* raw_data() const = 0; @@ -52,13 +52,13 @@ public: virtual void prepare_read(FrameTime start, SampleCount nframes) = 0; virtual void prepare_write(FrameTime start, SampleCount nframes) = 0; - + bool is_joined() const { return (_joined_buf != NULL); } Buffer* joined_buffer() const { return _joined_buf; } - + virtual bool join(Buffer* buf) = 0; virtual void unjoin() = 0; - + virtual void copy(const Buffer* src, size_t start_sample, size_t end_sample) = 0; virtual void resize(size_t size) { _size = size; } diff --git a/src/engine/ClientBroadcaster.cpp b/src/engine/ClientBroadcaster.cpp index 638dbbb1..725e4b3c 100644 --- a/src/engine/ClientBroadcaster.cpp +++ b/src/engine/ClientBroadcaster.cpp @@ -1,15 +1,15 @@ /* 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 @@ -32,7 +32,7 @@ using Ingen::Shared::ClientInterface; namespace Ingen { - + /** Register a client to receive messages over the notification band. */ void @@ -57,7 +57,7 @@ bool ClientBroadcaster::unregister_client(const URI& uri) { size_t erased = _clients.erase(uri); - + if (erased > 0) cout << "Unregistered client: " << uri << endl; else @@ -85,7 +85,7 @@ ClientBroadcaster::client(const URI& uri) } } - + void ClientBroadcaster::bundle_begin() { @@ -93,7 +93,7 @@ ClientBroadcaster::bundle_begin() (*i).second->bundle_begin(); } - + void ClientBroadcaster::bundle_end() { diff --git a/src/engine/ClientBroadcaster.hpp b/src/engine/ClientBroadcaster.hpp index a053e23b..821f4970 100644 --- a/src/engine/ClientBroadcaster.hpp +++ b/src/engine/ClientBroadcaster.hpp @@ -1,15 +1,15 @@ /* 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 @@ -51,17 +51,17 @@ class ClientBroadcaster public: void register_client(const Raul::URI& uri, Shared::ClientInterface* client); bool unregister_client(const Raul::URI& uri); - + Shared::ClientInterface* client(const Raul::URI& uri); - + //void send_client_registration(const string& url, int client_id); - + void bundle_begin(); void bundle_end(); // Error that isn't the direct result of a request void send_error(const std::string& msg); - + void send_plugins(const NodeFactory::Plugins& plugin_list); void send_object(const GraphObjectImpl* p, bool recursive); void send_destroyed(const Raul::Path& path); @@ -75,7 +75,7 @@ public: void send_activity(const Raul::Path& path); void send_program_add(const Raul::Path& node_path, int bank, int program, const std::string& name); void send_program_remove(const Raul::Path& node_path, int bank, int program); - + void send_plugins_to(Shared::ClientInterface*, const NodeFactory::Plugins& plugin_list); private: diff --git a/src/engine/CompiledPatch.hpp b/src/engine/CompiledPatch.hpp index 4c62f494..4af7148c 100644 --- a/src/engine/CompiledPatch.hpp +++ b/src/engine/CompiledPatch.hpp @@ -1,15 +1,15 @@ /* 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 @@ -35,7 +35,7 @@ struct CompiledNode { { // Copy to a vector for maximum iteration speed and cache optimization // (Need to take a copy anyway) - + _dependants.reserve(d->size()); for (Raul::List<NodeImpl*>::iterator i = d->begin(); i != d->end(); ++i) _dependants.push_back(*i); diff --git a/src/engine/ConnectionImpl.cpp b/src/engine/ConnectionImpl.cpp index 3ec1a3f8..90253502 100644 --- a/src/engine/ConnectionImpl.cpp +++ b/src/engine/ConnectionImpl.cpp @@ -1,15 +1,15 @@ /* 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 @@ -29,7 +29,7 @@ using namespace Shared; /** Constructor for a connection from a node's output port. * - * This handles both polyphonic and monophonic nodes, transparently to the + * This handles both polyphonic and monophonic nodes, transparently to the * user (InputPort). */ ConnectionImpl::ConnectionImpl(PortImpl* src_port, PortImpl* dst_port) @@ -64,7 +64,7 @@ ConnectionImpl::~ConnectionImpl() { delete _local_buffer; } - + void ConnectionImpl::set_mode() @@ -90,7 +90,7 @@ ConnectionImpl::set_buffer_size(size_t size) _local_buffer = Buffer::create(_dst_port->type(), _dst_port->buffer(0)->size()); } - + _buffer_size = size; } @@ -137,7 +137,7 @@ ConnectionImpl::apply_poly(Raul::Maid& maid, uint32_t poly) { _src_port->apply_poly(maid, poly); set_mode(); - + /*cerr << "CONNECTION APPLY: " << src_port()->path() << " * " << src_port()->poly() << " -> " << dst_port()->path() << " * " << dst_port()->poly() << "\t\tmust mix: " << must_mix() << ", extend: " << must_extend() @@ -167,7 +167,7 @@ ConnectionImpl::process(ProcessContext& context) /*std::cerr << src_port()->path() << " * " << src_port()->poly() << " -> " << dst_port()->path() << " * " << dst_port()->poly() << "\t\tmode: " << (int)_mode << std::endl;*/ - + if (_mode == COPY) { assert(src_port()->poly() == dst_port()->poly()); const size_t copy_size = std::min(src_port()->buffer_size(), dst_port()->buffer_size()); @@ -178,7 +178,7 @@ ConnectionImpl::process(ProcessContext& context) const AudioBuffer* const src_buffer = (AudioBuffer*)src_port()->buffer(0); AudioBuffer* mix_buf = (AudioBuffer*)_local_buffer; - + assert(mix_buf); const size_t copy_size = std::min(src_buffer->size(), mix_buf->size()); @@ -189,13 +189,13 @@ ConnectionImpl::process(ProcessContext& context) // Write last value of src buffer to remainder of dst buffer, if necessary if (copy_size < mix_buf->size()) mix_buf->set_block(src_buffer->value_at(copy_size-1), copy_size, mix_buf->size()-1); - + // Accumulate the source's voices into local buffer starting at the second // voice (buffer is already set to first voice above) for (uint32_t j=1; j < src_port()->poly(); ++j) { mix_buf->accumulate((AudioBuffer*)src_port()->buffer(j), 0, copy_size-1); } - + // Find the summed value and write it to the remainder of dst buffer if (copy_size < mix_buf->size()) { float src_value = src_buffer->value_at(copy_size-1); @@ -208,7 +208,7 @@ ConnectionImpl::process(ProcessContext& context) // Scale the buffer down. if (src_port()->poly() > 1) mix_buf->scale(1.0f/(float)src_port()->poly(), 0, mix_buf->size()-1); - + } else if (_mode == EXTEND) { assert(type() == DataType::AUDIO || type() == DataType::CONTROL); assert(src_port()->poly() == 1 || src_port()->poly() == dst_port()->poly()); @@ -216,7 +216,7 @@ ConnectionImpl::process(ProcessContext& context) const uint32_t poly = dst_port()->poly(); const uint32_t copy_size = std::min(src_port()->buffer(0)->size(), dst_port()->buffer(0)->size()); - + for (uint32_t i = 0; i < poly; ++i) { uint32_t src_voice = std::min(i, src_port()->poly() - 1); AudioBuffer* src_buf = (AudioBuffer*)src_port()->buffer(src_voice); @@ -224,7 +224,7 @@ ConnectionImpl::process(ProcessContext& context) // Copy src to start of dst dst_buf->copy(src_buf, 0, copy_size-1); - + // Write last value of src buffer to remainder of dst buffer, if necessary if (copy_size < dst_buf->size()) dst_buf->set_block(src_buf->value_at(copy_size - 1), copy_size, dst_buf->size() - 1); diff --git a/src/engine/ConnectionImpl.hpp b/src/engine/ConnectionImpl.hpp index 48bc72df..e41d393e 100644 --- a/src/engine/ConnectionImpl.hpp +++ b/src/engine/ConnectionImpl.hpp @@ -1,15 +1,15 @@ /* 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 @@ -46,17 +46,17 @@ class ConnectionImpl : public Raul::Deletable, public Shared::Connection public: ConnectionImpl(PortImpl* src_port, PortImpl* dst_port); virtual ~ConnectionImpl(); - + PortImpl* src_port() const { return _src_port; } PortImpl* dst_port() const { return _dst_port; } - + const Raul::Path src_port_path() const { return _src_port->path(); } const Raul::Path dst_port_path() const { return _dst_port->path(); } /** Used by some (recursive) events to prevent double disconnections */ bool pending_disconnection() { return _pending_disconnection; } void pending_disconnection(bool b) { _pending_disconnection = b; } - + void process(ProcessContext& context); /** Get the buffer for a particular voice. @@ -67,7 +67,7 @@ public: inline Buffer* buffer(uint32_t voice) const; inline size_t buffer_size() const { return _buffer_size; } - + void set_buffer_size(size_t size); void prepare_poly(uint32_t poly); void apply_poly(Raul::Maid& maid, uint32_t poly); @@ -80,7 +80,7 @@ public: protected: enum { DIRECT, MIX, COPY, EXTEND } _mode; void set_mode(); - + bool must_copy() const; bool must_mix() const; bool must_extend() const; diff --git a/src/engine/Context.hpp b/src/engine/Context.hpp index 2e000fb1..c747b751 100644 --- a/src/engine/Context.hpp +++ b/src/engine/Context.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/Driver.hpp b/src/engine/Driver.hpp index 5493fdb8..3e8b3289 100644 --- a/src/engine/Driver.hpp +++ b/src/engine/Driver.hpp @@ -1,15 +1,15 @@ /* 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 @@ -33,7 +33,7 @@ class DuplexPort; /** Representation of a "system" (eg outside Ingen) port. * - * This is the class through which the rest of the engine manages everything + * This is the class through which the rest of the engine manages everything * related to driver ports. Derived classes are expected to have a pointer to * their driver (to be able to perform the operation necessary). * @@ -48,7 +48,7 @@ public: virtual void create() = 0; virtual void destroy() = 0; - + bool is_input() const { return _patch_port->is_input(); } DuplexPort* patch_port() const { return _patch_port; } @@ -79,17 +79,17 @@ public: virtual void activate() = 0; virtual void deactivate() = 0; - + virtual bool is_activated() const = 0; - + /** Create a port ready to be inserted with add_input (non realtime). * * May return NULL if the Driver can not drive the port for some reason. */ virtual DriverPort* create_port(DuplexPort* patch_port) = 0; - + virtual DriverPort* driver_port(const Raul::Path& path) = 0; - + virtual void add_port(DriverPort* port) = 0; virtual Raul::List<DriverPort*>::Node* remove_port(const Raul::Path& path) = 0; diff --git a/src/engine/DuplexPort.cpp b/src/engine/DuplexPort.cpp index 5912174b..e103b8c3 100644 --- a/src/engine/DuplexPort.cpp +++ b/src/engine/DuplexPort.cpp @@ -1,15 +1,15 @@ /* 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 @@ -56,15 +56,15 @@ void DuplexPort::pre_process(ProcessContext& context) { // <BrainHurt> - + /*cerr << endl << "{ duplex pre" << endl; cerr << path() << " duplex pre: fixed buffers: " << fixed_buffers() << endl; cerr << path() << " duplex pre: buffer: " << buffer(0) << endl; cerr << path() << " duplex pre: is_output: " << _is_output << " { " << endl;*/ - + for (Connections::iterator c = _connections.begin(); c != _connections.end(); ++c) (*c)->process(context); - + if (_is_output) { for (uint32_t i=0; i < _poly; ++i) @@ -80,14 +80,14 @@ DuplexPort::pre_process(ProcessContext& context) broadcast(context); } - - /*if (type() == DataType::EVENT) + + /*if (type() == DataType::EVENT) for (uint32_t i=0; i < _poly; ++i) cerr << path() << " (" << buffer(i) << ") # events: " << ((EventBuffer*)buffer(i))->event_count() << ", joined: " << _buffers->at(i)->is_joined() << ", is_output: " << _is_output << endl;*/ - + //cerr << "} duplex pre " << path() << endl; // </BrainHurt> @@ -98,13 +98,13 @@ void DuplexPort::post_process(ProcessContext& context) { // <BrainHurt> - + /*cerr << endl << "{ duplex post" << endl; cerr << path() << " duplex post: fixed buffers: " << fixed_buffers() << endl; cerr << path() << " duplex post: buffer: " << buffer(0) << endl; cerr << path() << " duplex post: is_output: " << _is_output << " { " << endl; - - if (type() == DataType::EVENT) + + if (type() == DataType::EVENT) for (uint32_t i=0; i < _poly; ++i) cerr << path() << " (" << buffer(i) << ") # events: " << ((EventBuffer*)buffer(i))->event_count() @@ -114,9 +114,9 @@ DuplexPort::post_process(ProcessContext& context) InputPort::pre_process(context); // Mix down inputs broadcast(context); } - + //cerr << "} duplex post " << path() << endl; - + // </BrainHurt> } diff --git a/src/engine/DuplexPort.hpp b/src/engine/DuplexPort.hpp index f76843a4..1bc2f560 100644 --- a/src/engine/DuplexPort.hpp +++ b/src/engine/DuplexPort.hpp @@ -1,15 +1,15 @@ /* 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 @@ -24,7 +24,7 @@ #include "OutputPort.hpp" namespace Ingen { - + class NodeImpl; @@ -52,7 +52,7 @@ public: void pre_process(ProcessContext& context); void post_process(ProcessContext& context); - + bool is_input() const { return !_is_output; } bool is_output() const { return _is_output; } diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index 9bbc74f3..15ba5ed7 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -1,15 +1,15 @@ /* 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 @@ -27,7 +27,7 @@ #include "module/World.hpp" #include "AudioDriver.hpp" #include "ClientBroadcaster.hpp" -#include "Engine.hpp" +#include "Engine.hpp" #include "EngineStore.hpp" #include "Event.hpp" #include "MessageContext.hpp" @@ -88,10 +88,10 @@ Engine::~Engine() //delete _lash_driver; delete _maid; - + munlockall(); } - + SharedPtr<EngineStore> Engine::engine_store() const @@ -139,7 +139,7 @@ Engine::main() main_iteration(); } cout << "[Main] Done main loop." << endl; - + deactivate(); return 0; @@ -155,7 +155,7 @@ Engine::main_iteration() { _post_processor->process(); _maid->cleanup(); - + return !_quit_flag; } @@ -184,7 +184,7 @@ Engine::activate(size_t parallelism) if (!_midi_driver) _midi_driver = new DummyMidiDriver(); - + for (EventSources::iterator i = _event_sources.begin(); i != _event_sources.end(); ++i) (*i)->activate_source(); @@ -206,13 +206,13 @@ Engine::activate(size_t parallelism) _process_slaves.reserve(parallelism); for (size_t i=0; i < parallelism - 1; ++i) _process_slaves.push_back(new ProcessSlave(*this, _audio_driver->is_realtime())); - + root_patch->enable(); - + //_post_processor->start(); _activated = true; - + return true; } @@ -222,7 +222,7 @@ Engine::deactivate() { if (!_activated) return; - + for (EventSources::iterator i = _event_sources.begin(); i != _event_sources.end(); ++i) (*i)->deactivate_source(); @@ -230,18 +230,18 @@ Engine::deactivate() i != _engine_store->objects().end(); ++i) if ((*i)->as_node() != NULL && (*i)->as_node()->parent() == NULL) (*i)->as_node()->deactivate();*/ - + if (_midi_driver) _midi_driver->deactivate(); _audio_driver->deactivate(); _audio_driver->root_patch()->deactivate(); - + /*for (size_t i=0; i < _process_slaves.size(); ++i) { delete _process_slaves[i]; }*/ - + //_process_slaves.clear(); // Finalize any lingering events (unlikely) @@ -249,10 +249,10 @@ Engine::deactivate() //_audio_driver.reset(); //_event_sources.clear(); - + _activated = false; } - + void Engine::process_events(ProcessContext& context) diff --git a/src/engine/Engine.hpp b/src/engine/Engine.hpp index 5d17d304..e465179f 100644 --- a/src/engine/Engine.hpp +++ b/src/engine/Engine.hpp @@ -1,15 +1,15 @@ /* 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 @@ -63,12 +63,12 @@ class Engine : boost::noncopyable { public: Engine(Ingen::Shared::World* world); - + virtual ~Engine(); virtual int main(); virtual bool main_iteration(); - + /** Set the quit flag that should kill all threads and exit cleanly. * Note that it will take some time. */ virtual void quit() { _quit_flag = true; } @@ -105,7 +105,7 @@ public: typedef std::vector<ProcessSlave*> ProcessSlaves; inline const ProcessSlaves& process_slaves() const { return _process_slaves; } inline ProcessSlaves& process_slaves() { return _process_slaves; } - + private: typedef std::set< SharedPtr<EventSource> > EventSources; EventSources _event_sources; @@ -120,7 +120,7 @@ private: ClientBroadcaster* _broadcaster; NodeFactory* _node_factory; MessageContext* _message_context; - + bool _quit_flag; bool _activated; }; diff --git a/src/engine/EngineStore.cpp b/src/engine/EngineStore.cpp index 420c6b49..30181571 100644 --- a/src/engine/EngineStore.cpp +++ b/src/engine/EngineStore.cpp @@ -1,15 +1,15 @@ /* 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 @@ -35,7 +35,7 @@ namespace Ingen { /** Find the Patch at the given path. */ PatchImpl* -EngineStore::find_patch(const Path& path) +EngineStore::find_patch(const Path& path) { GraphObjectImpl* const object = find_object(path); return dynamic_cast<PatchImpl*>(object); @@ -45,7 +45,7 @@ EngineStore::find_patch(const Path& path) /** Find the Node at the given path. */ NodeImpl* -EngineStore::find_node(const Path& path) +EngineStore::find_node(const Path& path) { GraphObjectImpl* const object = find_object(path); return dynamic_cast<NodeImpl*>(object); @@ -55,7 +55,7 @@ EngineStore::find_node(const Path& path) /** Find the Port at the given path. */ PortImpl* -EngineStore::find_port(const Path& path) +EngineStore::find_port(const Path& path) { GraphObjectImpl* const object = find_object(path); return dynamic_cast<PortImpl*>(object); @@ -91,7 +91,7 @@ EngineStore::add(const Objects& table) //cerr << "[EngineStore] Adding " << o[0].second->path() << endl; cram(table); - + /*cerr << "[EngineStore] Adding Table:" << endl; for (const_iterator i = table.begin(); i != table.end(); ++i) { cerr << i->first << " = " << i->second->path() << endl; @@ -120,7 +120,7 @@ SharedPtr<EngineStore::Objects> EngineStore::remove(iterator object) { assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS); - + if (object != end()) { iterator descendants_end = find_descendants_end(object); //cout << "[EngineStore] Removing " << object->first << " {" << endl; @@ -129,7 +129,7 @@ EngineStore::remove(iterator object) cout << "\t" << i->first << endl; } cout << "}" << endl;*/ - + return removed; } else { @@ -138,7 +138,7 @@ EngineStore::remove(iterator object) } } - + /** Remove all children of an object from the store. * * Returned is a vector containing all descendants of the object removed diff --git a/src/engine/EngineStore.hpp b/src/engine/EngineStore.hpp index a6782501..8b464319 100644 --- a/src/engine/EngineStore.hpp +++ b/src/engine/EngineStore.hpp @@ -1,15 +1,15 @@ /* 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 @@ -48,10 +48,10 @@ public: NodeImpl* find_node(const Raul::Path& path); PortImpl* find_port(const Raul::Path& path); GraphObjectImpl* find_object(const Raul::Path& path); - + void add(Shared::GraphObject* o); void add(const Objects& family); - + SharedPtr<Objects> remove(const Raul::Path& path); SharedPtr<Objects> remove(Objects::iterator i); SharedPtr<Objects> remove_children(const Raul::Path& path); diff --git a/src/engine/Event.cpp b/src/engine/Event.cpp index 4455a846..d8fea5da 100644 --- a/src/engine/Event.cpp +++ b/src/engine/Event.cpp @@ -1,15 +1,15 @@ /* 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 @@ -35,7 +35,7 @@ Event::execute(ProcessContext& context) _executed = true; } - + void Event::post_process() diff --git a/src/engine/Event.hpp b/src/engine/Event.hpp index ee2658b5..24f5d1fe 100644 --- a/src/engine/Event.hpp +++ b/src/engine/Event.hpp @@ -1,15 +1,15 @@ /* 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 @@ -24,7 +24,7 @@ #include "raul/Path.hpp" #include "types.hpp" -namespace Ingen { +namespace Ingen { class Engine; class Responder; @@ -49,13 +49,13 @@ public: /** Execute this event in the audio thread (MUST be realtime safe). */ virtual void execute(ProcessContext& context); - + /** Perform any actions after execution (ie send replies to commands) * (no realtime requirements). */ virtual void post_process(); - + inline SampleCount time() const { return _time; } - + protected: Event(Engine& engine, SharedPtr<Responder> responder, FrameTime time) : _engine(engine) @@ -63,7 +63,7 @@ protected: , _time(time) , _executed(false) {} - + Engine& _engine; SharedPtr<Responder> _responder; FrameTime _time; diff --git a/src/engine/EventBuffer.cpp b/src/engine/EventBuffer.cpp index c96a7d8c..19217faa 100644 --- a/src/engine/EventBuffer.cpp +++ b/src/engine/EventBuffer.cpp @@ -1,15 +1,15 @@ /* 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 @@ -66,7 +66,7 @@ EventBuffer::join(Buffer* buf) return true; } - + void EventBuffer::unjoin() { @@ -89,7 +89,7 @@ EventBuffer::prepare_write(FrameTime start, SampleCount nframes) { reset(nframes); } - + /** FIXME: parameters ignored */ void EventBuffer::copy(const Buffer* src_buf, size_t start_sample, size_t end_sample) @@ -98,7 +98,7 @@ EventBuffer::copy(const Buffer* src_buf, size_t start_sample, size_t end_sample) assert(src); assert(_buf->capacity() >= src->_buf->capacity()); assert(src->_buf != _buf); - + //clear(); src->rewind(); @@ -131,14 +131,14 @@ EventBuffer::merge(const EventBuffer& a, const EventBuffer& b) uint16_t a_type; uint16_t a_size; uint8_t* a_data; - + uint32_t b_frames; uint32_t b_subframes; uint16_t b_type; uint16_t b_size; uint8_t* b_data; #endif - + cout << "FIXME: merge" << endl; #if 0 a.get_event(&a_frames, &a_subframes, &a_type, &a_size, &a_data); diff --git a/src/engine/EventBuffer.hpp b/src/engine/EventBuffer.hpp index 9ff91cc7..3a674d9a 100644 --- a/src/engine/EventBuffer.hpp +++ b/src/engine/EventBuffer.hpp @@ -1,15 +1,15 @@ /* 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 @@ -30,20 +30,20 @@ namespace Ingen { class EventBuffer : public Buffer { public: EventBuffer(size_t capacity); - + void prepare_read(FrameTime start, SampleCount nframes); void prepare_write(FrameTime start, SampleCount nframes); bool join(Buffer* buf); void unjoin(); - + void* raw_data() { return _buf; } const void* raw_data() const { return _buf; } void copy(const Buffer* src, size_t start_sample, size_t end_sample); - + bool merge(const EventBuffer& a, const EventBuffer& b); - + bool increment() const { return _buf->increment(); } bool is_valid() const { return _buf->is_valid(); } @@ -53,14 +53,14 @@ public: inline uint32_t event_count() const { return _buf->event_count(); } inline void rewind() const { _buf->rewind(); } - + inline void clear() { reset(_this_nframes); } - + inline void reset(SampleCount nframes) { _this_nframes = nframes; _buf->reset(); } - + inline bool get_event(uint32_t* frames, uint32_t* subframes, uint16_t* type, diff --git a/src/engine/EventSink.cpp b/src/engine/EventSink.cpp index 5e7305e4..2a4bc730 100644 --- a/src/engine/EventSink.cpp +++ b/src/engine/EventSink.cpp @@ -1,15 +1,15 @@ /* 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 @@ -22,7 +22,7 @@ using namespace std; namespace Ingen { - + /** \a size is not size_t because an event will never be even remotely close * to UINT32_MAX in size, so uint32_t saves wasted space on 64-bit. @@ -35,7 +35,7 @@ EventSink::write(uint32_t size, const Event* ev) _events.write(sizeof(uint32_t), (uint8_t*)&size); _events.write(size, (uint8_t*)ev); - + return true; } @@ -54,7 +54,7 @@ EventSink::read(uint32_t event_buffer_size, uint8_t* event_buffer) assert(read_size <= event_buffer_size); - if (read_size > 0) + if (read_size > 0) return _events.full_read(read_size, event_buffer); else return false; diff --git a/src/engine/EventSink.hpp b/src/engine/EventSink.hpp index 95795969..649c6cdd 100644 --- a/src/engine/EventSink.hpp +++ b/src/engine/EventSink.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/EventSource.hpp b/src/engine/EventSource.hpp index 1e36c2da..b10462b1 100644 --- a/src/engine/EventSource.hpp +++ b/src/engine/EventSource.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/GraphObjectImpl.cpp b/src/engine/GraphObjectImpl.cpp index b5d04106..26aaf159 100644 --- a/src/engine/GraphObjectImpl.cpp +++ b/src/engine/GraphObjectImpl.cpp @@ -1,15 +1,15 @@ /* 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 @@ -33,7 +33,7 @@ GraphObjectImpl::set_variable(const Raul::URI& key, const Atom& value) _variables[key] = value; } - + const Atom& GraphObjectImpl::get_variable(const Raul::URI& key) { @@ -48,7 +48,7 @@ GraphObjectImpl::parent_patch() const { return dynamic_cast<PatchImpl*>((NodeImpl*)_parent); } - + SharedPtr<GraphObject> GraphObjectImpl::find_child(const string& name) const diff --git a/src/engine/GraphObjectImpl.hpp b/src/engine/GraphObjectImpl.hpp index d5156088..c6cc349a 100644 --- a/src/engine/GraphObjectImpl.hpp +++ b/src/engine/GraphObjectImpl.hpp @@ -1,15 +1,15 @@ /* 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 @@ -48,17 +48,17 @@ class GraphObjectImpl : virtual public Ingen::Shared::GraphObject { public: virtual ~GraphObjectImpl() {} - + bool polyphonic() const { return _polyphonic; } virtual bool set_polyphonic(Raul::Maid& maid, bool p) { _polyphonic = p; return true; } - + GraphObject* graph_parent() const { return _parent; } - + const Raul::URI uri() const { return path(); } inline GraphObjectImpl* parent() const { return _parent; } const Raul::Symbol symbol() const { return _name; } - + virtual void process(ProcessContext& context) = 0; /** Rename */ @@ -67,16 +67,16 @@ public: _name = new_path.name(); assert(_name.find("/") == std::string::npos); } - + const Raul::Atom& get_variable(const Raul::URI& key); void set_variable(const Raul::URI& key, const Raul::Atom& value); - + const Properties& variables() const { return _variables; } Properties& variables() { return _variables; } /** The Patch this object is a child of. */ virtual PatchImpl* parent_patch() const; - + /** Raul::Path is dynamically generated from parent to ease renaming */ const Raul::Path path() const { if (_parent == NULL) @@ -86,7 +86,7 @@ public: else return Raul::Path(_parent->path().child(_name)); } - + SharedPtr<GraphObject> find_child(const std::string& name) const; protected: @@ -99,7 +99,7 @@ protected: assert(parent == NULL || _name.length() > 0); assert(_name.find("/") == std::string::npos); } - + GraphObjectImpl* _parent; std::string _name; bool _polyphonic; diff --git a/src/engine/HTTPClientSender.cpp b/src/engine/HTTPClientSender.cpp index 2d02ab92..2c6801f7 100644 --- a/src/engine/HTTPClientSender.cpp +++ b/src/engine/HTTPClientSender.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -85,7 +85,7 @@ void HTTPClientSender::connect(const Raul::Path& src_path, const Raul::Path& dst_path) { string msg = string( - "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" + "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" "@prefix ingen: <http://drobilla.net/ns/ingen#> .\n" "@prefix lv2var: <http://lv2plug.in/ns/ext/instance-var#> .\n\n<").append( "<> ingen:connection [\n" @@ -107,7 +107,7 @@ HTTPClientSender::set_variable(const Raul::URI& path, const Raul::URI& key, cons { Redland::Node node = AtomRDF::atom_to_node(*_engine.world()->rdf_world, value); string msg = string( - "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" + "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" "@prefix ingenuity: <http://drobilla.net/ns/ingenuity#> .\n" "@prefix lv2var: <http://lv2plug.in/ns/ext/instance-var#> .\n\n<").append( path.str()).append("> lv2var:variable [\n" @@ -122,7 +122,7 @@ HTTPClientSender::set_property(const Raul::URI& path, const Raul::URI& key, cons { Redland::Node node = AtomRDF::atom_to_node(*_engine.world()->rdf_world, value); string msg = string( - "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" + "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" "@prefix ingen: <http://drobilla.net/ns/ingen#> .\n" "@prefix ingenuity: <http://drobilla.net/ns/ingenuity#> .\n" "@prefix lv2var: <http://lv2plug.in/ns/ext/instance-var#> .\n\n<").append( @@ -205,7 +205,7 @@ void HTTPClientSender::rename(const Raul::Path& old_path, const Raul::Path& new_path) { string msg = string( - "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" + "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n" "@prefix ingen: <http://drobilla.net/ns/ingen#> .\n\n<").append( old_path.str()).append("> rdf:subject <").append(new_path.str()).append("> .\n"); send_chunk(msg); @@ -215,7 +215,7 @@ HTTPClientSender::rename(const Raul::Path& old_path, const Raul::Path& new_path) void HTTPClientSender::program_add(const Raul::Path& node_path, uint32_t bank, uint32_t program, const std::string& name) { - /*send("/ingen/program_add", "siis", + /*send("/ingen/program_add", "siis", node_path.c_str(), bank, program, name.c_str(), LO_ARGS_END);*/ } @@ -223,7 +223,7 @@ HTTPClientSender::program_add(const Raul::Path& node_path, uint32_t bank, uint32 void HTTPClientSender::program_remove(const Raul::Path& node_path, uint32_t bank, uint32_t program) { - /*send("/ingen/program_remove", "sii", + /*send("/ingen/program_remove", "sii", node_path.c_str(), bank, program, LO_ARGS_END);*/ } diff --git a/src/engine/HTTPClientSender.hpp b/src/engine/HTTPClientSender.hpp index e04e70f7..db007f1c 100644 --- a/src/engine/HTTPClientSender.hpp +++ b/src/engine/HTTPClientSender.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -53,14 +53,14 @@ public: void enable() { _enabled = true; } void disable() { _enabled = false; } - + void bundle_begin() { HTTPSender::bundle_begin(); } void bundle_end() { HTTPSender::bundle_end(); } void transfer_begin() { HTTPSender::transfer_begin(); } void transfer_end() { HTTPSender::transfer_end(); } Raul::URI uri() const { return "http://example.org/"; } - + void subscribe(Shared::EngineInterface* engine) { } /* *** ClientInterface Implementation Below *** */ @@ -71,59 +71,59 @@ public: void response_error(int32_t id, const std::string& msg); void error(const std::string& msg); - + virtual bool new_object(const Shared::GraphObject* object); virtual void new_plugin(const Raul::URI& uri, const Raul::URI& type_uri, const Raul::Symbol& symbol); - + virtual void new_patch(const Raul::Path& path, uint32_t poly); - + virtual void new_node(const Raul::Path& path, const Raul::URI& plugin_uri); - + virtual void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output); - + virtual void clear_patch(const Raul::Path& path); - + virtual void destroy(const Raul::Path& path); - + virtual void rename(const Raul::Path& old_path, const Raul::Path& new_path); - + virtual void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void set_variable(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_port_value(const Raul::Path& port_path, const Raul::Atom& value); - + virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value); - + virtual void activity(const Raul::Path& path); - + virtual void program_add(const Raul::Path& node_path, uint32_t bank, uint32_t program, const std::string& program_name); - + virtual void program_remove(const Raul::Path& node_path, uint32_t bank, uint32_t program); diff --git a/src/engine/HTTPEngineReceiver.cpp b/src/engine/HTTPEngineReceiver.cpp index 46e5e0af..de5d1bed 100644 --- a/src/engine/HTTPEngineReceiver.cpp +++ b/src/engine/HTTPEngineReceiver.cpp @@ -1,15 +1,15 @@ /* 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 @@ -54,7 +54,7 @@ HTTPEngineReceiver::HTTPEngineReceiver(Engine& engine, uint16_t port) cout << "Started HTTP server on port " << soup_server_get_port(_server) << endl; Thread::set_name("HTTP Receiver"); - + if (!engine.world()->serialisation_module) engine.world()->serialisation_module = Ingen::Shared::load_module("ingen_serialisation"); @@ -62,7 +62,7 @@ HTTPEngineReceiver::HTTPEngineReceiver(Engine& engine, uint16_t port) if (!engine.world()->serialiser) engine.world()->serialiser = SharedPtr<Serialiser>( Ingen::Serialisation::new_serialiser(engine.world(), engine.engine_store())); - + if (!engine.world()->parser) engine.world()->parser = SharedPtr<Parser>( Ingen::Serialisation::new_parser()); @@ -122,16 +122,16 @@ HTTPEngineReceiver::message_callback(SoupServer* server, SoupMessage* msg, const if (path[path.length()-1] == '/') { path = path.substr(0, path.length()-1); } - + SharedPtr<Serialiser> serialiser = me->_engine.world()->serialiser; const string base_uri = ""; const char* mime_type = "text/plain"; - + if (!strcmp(msg->method, SOUP_METHOD_PUT)) { cout << "PUT " << path << ":\n" << msg->request_body->data << endl; } - + if (path == Path::root_uri || path == "") { const string r = string("@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n") .append("\n<> rdfs:seeAlso <plugins> ;") @@ -145,7 +145,7 @@ HTTPEngineReceiver::message_callback(SoupServer* server, SoupMessage* msg, const // FIXME: kludge me->load_plugins(); me->_receive_thread->whip(); - + serialiser->start_to_string("/", base_uri); for (NodeFactory::Plugins::const_iterator p = me->_engine.node_factory()->plugins().begin(); p != me->_engine.node_factory()->plugins().end(); ++p) @@ -156,7 +156,7 @@ HTTPEngineReceiver::message_callback(SoupServer* server, SoupMessage* msg, const return; } else if (path.substr(0, 6) == "/patch") { path = '/' + path.substr(6); - + } else if (path.substr(0, 7) == "/stream") { HTTPClientSender* client = new HTTPClientSender(me->_engine); me->register_client(client); @@ -168,7 +168,7 @@ HTTPEngineReceiver::message_callback(SoupServer* server, SoupMessage* msg, const soup_message_set_status(msg, SOUP_STATUS_OK); soup_message_set_response(msg, mime_type, SOUP_MEMORY_COPY, buf, strlen(buf)); return; - + } else { soup_message_set_status(msg, SOUP_STATUS_NOT_FOUND); soup_message_set_response(msg, "text/plain", SOUP_MEMORY_STATIC, @@ -186,7 +186,7 @@ HTTPEngineReceiver::message_callback(SoupServer* server, SoupMessage* msg, const if (msg->method == SOUP_METHOD_GET) { Glib::RWLock::ReaderLock lock(store->lock()); - + // Find object Store::const_iterator start = store->find(path); if (start == store->end()) { @@ -196,7 +196,7 @@ HTTPEngineReceiver::message_callback(SoupServer* server, SoupMessage* msg, const err.c_str(), err.length()); return; } - + // Get serialiser SharedPtr<Serialiser> serialiser = me->_engine.world()->serialiser; if (!serialiser) { @@ -217,24 +217,24 @@ HTTPEngineReceiver::message_callback(SoupServer* server, SoupMessage* msg, const soup_message_set_status(msg, SOUP_STATUS_OK); soup_message_set_response(msg, mime_type, SOUP_MEMORY_COPY, response.c_str(), response.length()); - + } else if (msg->method == SOUP_METHOD_PUT) { Glib::RWLock::WriterLock lock(store->lock()); - + // Be sure object doesn't exist Store::const_iterator start = store->find(path); if (start != store->end()) { soup_message_set_status(msg, SOUP_STATUS_CONFLICT); return; } - + // Get parser SharedPtr<Parser> parser = me->_engine.world()->parser; if (!parser) { soup_message_set_status(msg, SOUP_STATUS_INTERNAL_SERVER_ERROR); return; } - + //cout << "POST: " << msg->request_body->data << endl; // Load object diff --git a/src/engine/HTTPEngineReceiver.hpp b/src/engine/HTTPEngineReceiver.hpp index 88f71aaf..ea6f3d5c 100644 --- a/src/engine/HTTPEngineReceiver.hpp +++ b/src/engine/HTTPEngineReceiver.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 diff --git a/src/engine/InputPort.cpp b/src/engine/InputPort.cpp index 9ff348a7..275fcd8b 100644 --- a/src/engine/InputPort.cpp +++ b/src/engine/InputPort.cpp @@ -1,15 +1,15 @@ /* 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 @@ -43,7 +43,7 @@ InputPort::InputPort(NodeImpl* parent, : PortImpl(parent, name, index, poly, type, value, buffer_size) { } - + bool InputPort::can_direct() const @@ -60,10 +60,10 @@ InputPort::set_buffer_size(size_t size) for (Connections::iterator c = _connections.begin(); c != _connections.end(); ++c) ((ConnectionImpl*)c->get())->set_buffer_size(size); - + } - + bool InputPort::prepare_poly(uint32_t poly) { @@ -81,19 +81,19 @@ InputPort::apply_poly(Raul::Maid& maid, uint32_t poly) { if (!_polyphonic || !_parent->polyphonic()) return true; - + for (Connections::iterator c = _connections.begin(); c != _connections.end(); ++c) ((ConnectionImpl*)c->get())->apply_poly(maid, poly); PortImpl::apply_poly(maid, poly); assert(this->poly() == poly); - + if (can_direct()) { ConnectionImpl* c = _connections.begin()->get(); for (uint32_t i=_poly; i < poly; ++i) _buffers->at(i)->join(c->buffer(i)); } - + for (uint32_t i=0; i < _poly; ++i) PortImpl::parent_node()->set_port_buffer(i, _index, buffer(i)); @@ -112,7 +112,7 @@ InputPort::add_connection(Connections::Node* const c) _connections.push_back(c); bool modify_buffers = !_fixed_buffers; - + if (modify_buffers) { if (can_direct()) { // Use buffer directly to avoid copying @@ -141,7 +141,7 @@ InputPort::Connections::Node* InputPort::remove_connection(const OutputPort* src_port) { bool modify_buffers = !_fixed_buffers; - + bool found = false; Connections::Node* connection = NULL; for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) { @@ -167,12 +167,12 @@ InputPort::remove_connection(const OutputPort* src_port) for (uint32_t i=0; i < _poly; ++i) { _buffers->at(i)->join(_connections.front()->buffer(i)); } - } + } } if (modify_buffers) PortImpl::connect_buffers(); - + // Turn off broadcasting if we're not connected any more (FIXME: not quite right..) if (_type == DataType::CONTROL && _connections.size() == 0) _broadcast = false; @@ -193,7 +193,7 @@ InputPort::pre_process(ProcessContext& context) return; bool do_mixdown = true; - + if (_connections.size() == 0) { for (uint32_t i=0; i < _poly; ++i) buffer(i)->prepare_read(context.start(), context.nframes()); @@ -220,12 +220,12 @@ InputPort::pre_process(ProcessContext& context) for (uint32_t i=0; i < _poly; ++i) buffer(i)->prepare_read(context.start(), context.nframes()); - + /*cerr << path() << " poly = " << _poly << ", mixdown: " << do_mixdown << ", fixed buffers: " << _fixed_buffers << ", joined: " << _buffers->at(0)->is_joined() << " to " << _buffers->at(0)->joined_buffer() << endl;*/ - - /*if (type() == DataType::EVENT) + + /*if (type() == DataType::EVENT) for (uint32_t i=0; i < _poly; ++i) if (((EventBuffer*)buffer(i))->event_count() > 0) cerr << path() << " (" << buffer(i) << ") # events: " @@ -256,11 +256,11 @@ InputPort::pre_process(ProcessContext& context) } } else { assert(_poly == 1); - + // FIXME if (_connections.size() > 1) cerr << "WARNING: MIDI mixing not implemented, only first connection used." << endl; - + // Copy first connection _buffers->at(0)->copy(_connections.front()->buffer(0), 0, _buffer_size-1); } @@ -278,7 +278,7 @@ InputPort::post_process(ProcessContext& context) buffer(i)->prepare_write(context.start(), context.nframes()); _set_by_user = false; - + /*if (_broadcast && (_type == DataType::CONTROL)) { const Sample value = ((AudioBuffer*)(*_buffers)[0])->value_at(0); diff --git a/src/engine/InputPort.hpp b/src/engine/InputPort.hpp index 65912881..8ef4c2bf 100644 --- a/src/engine/InputPort.hpp +++ b/src/engine/InputPort.hpp @@ -1,15 +1,15 @@ /* 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 @@ -55,27 +55,27 @@ public: size_t buffer_size); virtual ~InputPort() {} - + typedef Raul::List< SharedPtr<ConnectionImpl> > Connections; - + void add_connection(Connections::Node* c); Connections::Node* remove_connection(const OutputPort* src_port); const Connections& connections() { return _connections; } - + bool prepare_poly(uint32_t poly); bool apply_poly(Raul::Maid& maid, uint32_t poly); void pre_process(ProcessContext& context); void post_process(ProcessContext& context); - + bool is_connected() const { return (_connections.size() > 0); } - + bool is_input() const { return true; } bool is_output() const { return false; } virtual void set_buffer_size(size_t size); - + protected: bool can_direct() const; diff --git a/src/engine/InternalController.cpp b/src/engine/InternalController.cpp index fad17225..d9c3b3b1 100644 --- a/src/engine/InternalController.cpp +++ b/src/engine/InternalController.cpp @@ -1,15 +1,15 @@ /* 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 @@ -36,7 +36,7 @@ namespace Ingen { using namespace Shared; static InternalPlugin controller_plugin(NS_INTERNALS "Controller", "controller"); - + ControllerNode::ControllerNode(const string& path, bool polyphonic, PatchImpl* parent, @@ -49,7 +49,7 @@ ControllerNode::ControllerNode(const string& path, _midi_in_port = new InputPort(this, "input", 0, 1, DataType::EVENT, Raul::Atom(), _buffer_size); _ports->at(0) = _midi_in_port; - + _param_port = new InputPort(this, "controller", 1, 1, DataType::CONTROL, 0.0f, 1); _param_port->set_property("lv2:minimum", 0.0f); _param_port->set_property("lv2:maximum", 127.0f); @@ -59,13 +59,13 @@ ControllerNode::ControllerNode(const string& path, _log_port = new InputPort(this, "logarithmic", 2, 1, DataType::CONTROL, 0.0f, 1); _log_port->set_property("lv2:toggled", true); _ports->at(2) = _log_port; - + _min_port = new InputPort(this, "minimum", 3, 1, DataType::CONTROL, 0.0f, 1); _ports->at(3) = _min_port; - + _max_port = new InputPort(this, "maximum", 4, 1, DataType::CONTROL, 1.0f, 1); _ports->at(4) = _max_port; - + _audio_port = new OutputPort(this, "ar_output", 5, 1, DataType::AUDIO, 0.0f, _buffer_size); _ports->at(5) = _audio_port; } @@ -75,7 +75,7 @@ void ControllerNode::process(ProcessContext& context) { NodeBase::pre_process(context); - + uint32_t frames = 0; uint32_t subframes = 0; uint16_t type = 0; @@ -84,17 +84,17 @@ ControllerNode::process(ProcessContext& context) EventBuffer* const midi_in = (EventBuffer*)_midi_in_port->buffer(0); //assert(midi_in->this_nframes() == context.nframes()); - + midi_in->rewind(); while (midi_in->get_event(&frames, &subframes, &type, &size, &buf)) { // FIXME: type if (size >= 3 && (buf[0] & 0xF0) == MIDI_CMD_CONTROL) control(context, buf[1], buf[2], frames + context.start()); - + midi_in->increment(); } - + NodeBase::post_process(context); } @@ -105,9 +105,9 @@ ControllerNode::control(ProcessContext& context, uint8_t control_num, uint8_t va assert(time - context.start() < _buffer_size); Sample scaled_value; - + const Sample nval = (val / 127.0f); // normalized [0, 1] - + if (_learning) { _param_port->set_value(control_num); ((AudioBuffer*)_param_port->buffer(0))->set_value( diff --git a/src/engine/InternalController.hpp b/src/engine/InternalController.hpp index d33515b4..97d21451 100644 --- a/src/engine/InternalController.hpp +++ b/src/engine/InternalController.hpp @@ -1,15 +1,15 @@ /* 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 @@ -22,7 +22,7 @@ #include "NodeBase.hpp" namespace Ingen { - + class InputPort; class OutputPort; @@ -31,16 +31,16 @@ class OutputPort; * * Creating one of these nodes is how a user makes "MIDI Bindings". Note that * this node will always be monophonic, the poly parameter is ignored. - * + * * \ingroup engine */ class ControllerNode : public NodeBase { public: ControllerNode(const std::string& path, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size); - + void process(ProcessContext& context); - + void control(ProcessContext& context, uint8_t control_num, uint8_t val, FrameTime time); void learn() { _learning = true; } diff --git a/src/engine/InternalNote.cpp b/src/engine/InternalNote.cpp index 3120ca96..de350a8a 100644 --- a/src/engine/InternalNote.cpp +++ b/src/engine/InternalNote.cpp @@ -1,15 +1,15 @@ /* 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 @@ -46,22 +46,22 @@ NoteNode::NoteNode(const string& path, bool polyphonic, PatchImpl* parent, Sampl , _sustain(false) { _ports = new Raul::Array<PortImpl*>(5); - + _midi_in_port = new InputPort(this, "input", 0, 1, DataType::EVENT, Raul::Atom(), _buffer_size); _ports->at(0) = _midi_in_port; _freq_port = new OutputPort(this, "frequency", 1, _polyphony, DataType::AUDIO, 440.0f, _buffer_size); _ports->at(1) = _freq_port; - + _vel_port = new OutputPort(this, "velocity", 2, _polyphony, DataType::AUDIO, 0.0f, _buffer_size); _vel_port->set_property("lv2:minimum", 0.0f); _vel_port->set_property("lv2:maximum", 1.0f); _ports->at(2) = _vel_port; - + _gate_port = new OutputPort(this, "gate", 3, _polyphony, DataType::AUDIO, 0.0f, _buffer_size); _gate_port->set_property("lv2:toggled", true); _ports->at(3) = _gate_port; - + _trig_port = new OutputPort(this, "trigger", 4, _polyphony, DataType::AUDIO, 0.0f, _buffer_size); _trig_port->set_property("lv2:toggled", true); _ports->at(4) = _trig_port; @@ -118,7 +118,7 @@ NoteNode::process(ProcessContext& context) { EventBuffer* const midi_in = (EventBuffer*)_midi_in_port->buffer(0); NodeBase::pre_process(context); - + uint32_t frames = 0; uint32_t subframes = 0; uint16_t type = 0; @@ -136,7 +136,7 @@ NoteNode::process(ProcessContext& context) for (uint16_t i = 0; i < size; ++i) cout << (int)((char)buf[i]) << " "; cout << endl;*/ - + const FrameTime time = context.start() + (FrameTime)frames; if (size >= 3) { @@ -181,7 +181,7 @@ NoteNode::process(ProcessContext& context) if (midi_in->increment() == midi_in->this_nframes()) break; } - + NodeBase::post_process(context); } @@ -196,7 +196,7 @@ NoteNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, F Key* key = &_keys[note_num]; Voice* voice = NULL; uint32_t voice_num = 0; - + if (key->state != Key::OFF) { //cerr << "[NoteNode] Double midi note received" << endl; return; @@ -223,13 +223,13 @@ NoteNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, F oldest_time = voice->time; } } - } + } assert(voice != NULL); assert(voice == &(*_voices)[voice_num]); /*cerr << "[NoteNode] Note " << (int)note_num << " on @ " << time << ". Voice " << voice_num << " / " << _polyphony << endl;*/ - + // Update stolen key, if applicable if (voice->state == Voice::Voice::ACTIVE) { assert(_keys[voice->note].state == Key::ON_ASSIGNED); @@ -237,7 +237,7 @@ NoteNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, F _keys[voice->note].state = Key::Key::ON_UNASSIGNED; //cerr << "[NoteNode] Stole voice " << voice_num << endl; } - + // Store key information for later reallocation on note off key->state = Key::Key::ON_ASSIGNED; key->voice = voice_num; @@ -247,14 +247,14 @@ NoteNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, F voice->state = Voice::Voice::ACTIVE; voice->note = note_num; voice->time = time; - + assert(_keys[voice->note].state == Key::Key::ON_ASSIGNED); assert(_keys[voice->note].voice == voice_num); - + ((AudioBuffer*)_freq_port->buffer(voice_num))->set_value(note_to_freq(note_num), context.start(), time); ((AudioBuffer*)_vel_port->buffer(voice_num))->set_value(velocity/127.0, context.start(), time); ((AudioBuffer*)_gate_port->buffer(voice_num))->set_value(1.0f, context.start(), time); - + // trigger (one sample) ((AudioBuffer*)_trig_port->buffer(voice_num))->set_value(1.0f, context.start(), time); ((AudioBuffer*)_trig_port->buffer(voice_num))->set_value(0.0f, context.start(), time + 1); @@ -273,7 +273,7 @@ NoteNode::note_off(ProcessContext& context, uint8_t note_num, FrameTime time) assert(time - context.start() < _buffer_size); Key* key = &_keys[note_num]; - + //cerr << "[NoteNode] Note " << (int)note_num << " off @ " << time << endl; if (key->state == Key::ON_ASSIGNED) { @@ -299,7 +299,7 @@ NoteNode::note_off(ProcessContext& context, uint8_t note_num, FrameTime time) key->state = Key::OFF; } - + void NoteNode::free_voice(ProcessContext& context, uint32_t voice, FrameTime time) { @@ -322,7 +322,7 @@ NoteNode::free_voice(ProcessContext& context, uint32_t voice, FrameTime time) if (replace_key != NULL) { // Found a key to assign to freed voice assert(&_keys[replace_key_num] == replace_key); assert(replace_key->state == Key::ON_UNASSIGNED); - + // Change the freq but leave the gate high and don't retrigger ((AudioBuffer*)_freq_port->buffer(voice))->set_value(note_to_freq(replace_key_num), context.start(), time); @@ -349,7 +349,7 @@ NoteNode::all_notes_off(ProcessContext& context, FrameTime time) //cerr << "All notes off @ " << offset << endl; // FIXME: set all keys to Key::OFF? - + for (uint32_t i = 0; i < _polyphony; ++i) { ((AudioBuffer*)_gate_port->buffer(i))->set_value(0.0f, context.start(), time); (*_voices)[i].state = Voice::FREE; @@ -381,7 +381,7 @@ NoteNode::sustain_off(ProcessContext& context, FrameTime time) assert(time - context.start() < _buffer_size); _sustain = false; - + for (uint32_t i=0; i < _polyphony; ++i) if ((*_voices)[i].state == Voice::HOLDING) free_voice(context, i, time); diff --git a/src/engine/InternalNote.hpp b/src/engine/InternalNote.hpp index 9e441a65..3066bc1c 100644 --- a/src/engine/InternalNote.hpp +++ b/src/engine/InternalNote.hpp @@ -1,15 +1,15 @@ /* 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 @@ -39,12 +39,12 @@ class NoteNode : public NodeBase public: NoteNode(const std::string& path, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size); ~NoteNode(); - + bool prepare_poly(uint32_t poly); bool apply_poly(Raul::Maid& maid, uint32_t poly); void process(ProcessContext& context); - + void note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, FrameTime time); void note_off(ProcessContext& context, uint8_t note_num, FrameTime time); void all_notes_off(ProcessContext& context, FrameTime time); @@ -74,7 +74,7 @@ private: Raul::Array<Voice>* _prepared_voices; Key _keys[128]; bool _sustain; ///< Whether or not hold pedal is depressed - + InputPort* _midi_in_port; OutputPort* _freq_port; OutputPort* _vel_port; diff --git a/src/engine/InternalPlugin.cpp b/src/engine/InternalPlugin.cpp index e78519e8..7b094ab7 100644 --- a/src/engine/InternalPlugin.cpp +++ b/src/engine/InternalPlugin.cpp @@ -1,15 +1,15 @@ /* 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 @@ -36,7 +36,7 @@ InternalPlugin::instantiate(const string& name, Engine& engine) { assert(_type == Internal); - + SampleCount srate = engine.audio_driver()->sample_rate(); SampleCount buffer_size = engine.audio_driver()->buffer_size(); diff --git a/src/engine/InternalPlugin.hpp b/src/engine/InternalPlugin.hpp index a58c827b..0689b176 100644 --- a/src/engine/InternalPlugin.hpp +++ b/src/engine/InternalPlugin.hpp @@ -1,15 +1,15 @@ /* 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 @@ -50,12 +50,12 @@ public: : PluginImpl(Plugin::Internal, uri) , _symbol(symbol) {} - + NodeImpl* instantiate(const std::string& name, bool polyphonic, Ingen::PatchImpl* parent, Engine& engine); - + const std::string symbol() const { return _symbol; } private: diff --git a/src/engine/InternalTransport.cpp b/src/engine/InternalTransport.cpp index 35eaa53a..5478682b 100644 --- a/src/engine/InternalTransport.cpp +++ b/src/engine/InternalTransport.cpp @@ -1,15 +1,15 @@ /* 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 @@ -44,15 +44,15 @@ TransportNode::TransportNode(const string& path, bool polyphonic, PatchImpl* par OutputPort<Sample>* bpb_port = new OutputPort<Sample>(this, "Beats per Bar", 1, 1, // new PortInfo("Beats per Bar", CONTROL, OUTPUT, 0, 0, 1), 1); _ports.at(1) = bpb_port; - + OutputPort<Sample>* bar_port = new OutputPort<Sample>(this, "Bar", 3, 1, // new PortInfo("Bar", CONTROL, OUTPUT, 0, 0, 1), buffer_size); _ports.at(2) = bar_port; - + OutputPort<Sample>* beat_port = new OutputPort<Sample>(this, "Beat", 3, 1, // new PortInfo("Beat", CONTROL, OUTPUT, 0, 0, 1), buffer_size); _ports.at(3) = beat_port; - + OutputPort<Sample>* frame_port = new OutputPort<Sample>(this, "Frame", 3, 1, // new PortInfo("Frame", CONTROL, OUTPUT, 0, 0, 1), buffer_size); _ports.at(4) = frame_port; @@ -60,7 +60,7 @@ TransportNode::TransportNode(const string& path, bool polyphonic, PatchImpl* par OutputPort<Sample>* hour_port = new OutputPort<Sample>(this, "Hour", 3, 1, // new PortInfo("Hour", CONTROL, OUTPUT, 0, 0, 1), buffer_size); _ports.at(5) = hour_port; - + OutputPort<Sample>* minute_port = new OutputPort<Sample>(this, "Minute", 3, 1, // new PortInfo("Minute", CONTROL, OUTPUT, 0, 0, 1), buffer_size); _ports.at(6) = minute_port; @@ -68,7 +68,7 @@ TransportNode::TransportNode(const string& path, bool polyphonic, PatchImpl* par OutputPort<Sample>* second_port = new OutputPort<Sample>(this, "Second", 3, 1, // new PortInfo("Second", CONTROL, OUTPUT, 0, 0, 1), buffer_size); _ports.at(7) = second_port; - + OutputPort<Sample>* trg_port = new OutputPort<Sample>(this, "Beat Tick", 2, 1, // new PortInfo("Beat Tick", AUDIO, OUTPUT, 0, 0, 1), buffer_size); _ports.at(8) = trg_port; @@ -92,10 +92,10 @@ TransportNode::process(ProcessContext& context) double bpm = position->beats_per_minute; float bpb = position->beats_per_bar; float spb = 60.0 / bpm; - + //cerr << "bpm = " << bpm << endl; - //cerr << "spb = " << spb << endl; - + //cerr << "spb = " << spb << endl; + if (position->valid & JackPositionBBT) { cerr << "bar: " << position->bar << endl; cerr << "beat: " << position->beat << endl; @@ -121,14 +121,14 @@ TransportNode::process(ProcessContext& context) cerr << "No timecode." << endl; } - + ((OutputPort<Sample>*)_ports.at(0))->buffer(0)->set(spb, 0, 0); ((OutputPort<Sample>*)_ports.at(1))->buffer(0)->set(bpb, 0, 0); - + // fill the trigger buffers with zeros ((OutputPort<Sample>*)_ports.at(2))->buffer(0)->set(0.0f, 0, nframes - 1); ((OutputPort<Sample>*)_ports.at(3))->buffer(0)->set(0.0f, 0, nframes - 1); - + // if the transport is rolling, add triggers at the right frame positions if ((position->valid & JackTransportBBT) && (state == JackTransportRolling)) { double frames_per_beat = position->frame_rate * spb; @@ -147,7 +147,7 @@ TransportNode::process(ProcessContext& context) } } #endif - + NodeBase::post_process(context); } diff --git a/src/engine/InternalTransport.hpp b/src/engine/InternalTransport.hpp index af0ed207..19706253 100644 --- a/src/engine/InternalTransport.hpp +++ b/src/engine/InternalTransport.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/InternalTrigger.cpp b/src/engine/InternalTrigger.cpp index c6bf6d62..bd1f41f2 100644 --- a/src/engine/InternalTrigger.cpp +++ b/src/engine/InternalTrigger.cpp @@ -1,15 +1,15 @@ /* 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 @@ -42,13 +42,13 @@ TriggerNode::TriggerNode(const string& path, bool polyphonic, PatchImpl* parent, _midi_in_port = new InputPort(this, "input", 0, 1, DataType::EVENT, Raul::Atom(), _buffer_size); _ports->at(0) = _midi_in_port; - + _note_port = new InputPort(this, "note", 1, 1, DataType::CONTROL, 60.0f, 1); _note_port->set_property("lv2:minimum", 0.0f); _note_port->set_property("lv2:maximum", 127.0f); _note_port->set_property("lv2:integer", true); _ports->at(1) = _note_port; - + _gate_port = new OutputPort(this, "gate", 2, 1, DataType::AUDIO, 0.0f, _buffer_size); _gate_port->set_property("lv2:toggled", true); _ports->at(2) = _gate_port; @@ -56,7 +56,7 @@ TriggerNode::TriggerNode(const string& path, bool polyphonic, PatchImpl* parent, _trig_port = new OutputPort(this, "trigger", 3, 1, DataType::AUDIO, 0.0f, _buffer_size); _trig_port->set_property("lv2:toggled", true); _ports->at(3) = _trig_port; - + _vel_port = new OutputPort(this, "velocity", 4, 1, DataType::AUDIO, 0.0f, _buffer_size); _vel_port->set_property("lv2:minimum", 0.0f); _vel_port->set_property("lv2:maximum", 1.0f); @@ -68,7 +68,7 @@ void TriggerNode::process(ProcessContext& context) { NodeBase::pre_process(context); - + uint32_t frames = 0; uint32_t subframes = 0; uint16_t type = 0; @@ -77,7 +77,7 @@ TriggerNode::process(ProcessContext& context) EventBuffer* const midi_in = (EventBuffer*)_midi_in_port->buffer(0); //assert(midi_in->this_nframes() == context.nframes()); - + midi_in->rewind(); while (midi_in->get_event(&frames, &subframes, &type, &size, &buf)) { @@ -102,10 +102,10 @@ TriggerNode::process(ProcessContext& context) break; } } - + midi_in->increment(); } - + NodeBase::post_process(context); } @@ -115,7 +115,7 @@ TriggerNode::note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity { assert(time >= context.start() && time <= context.end()); assert(time - context.start() < _buffer_size); - + if (_learning) { _note_port->set_value(note_num); ((AudioBuffer*)_note_port->buffer(0))->set_value( diff --git a/src/engine/InternalTrigger.hpp b/src/engine/InternalTrigger.hpp index 8f287d0f..46712c03 100644 --- a/src/engine/InternalTrigger.hpp +++ b/src/engine/InternalTrigger.hpp @@ -1,15 +1,15 @@ /* 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 @@ -43,10 +43,10 @@ public: TriggerNode(const std::string& path, bool polyphonic, PatchImpl* parent, SampleRate srate, size_t buffer_size); void process(ProcessContext& context); - + void note_on(ProcessContext& context, uint8_t note_num, uint8_t velocity, FrameTime time); void note_off(ProcessContext& context, uint8_t note_num, FrameTime time); - + void learn() { _learning = true; } private: diff --git a/src/engine/JackAudioDriver.cpp b/src/engine/JackAudioDriver.cpp index 127dd1a9..9f3f55e2 100644 --- a/src/engine/JackAudioDriver.cpp +++ b/src/engine/JackAudioDriver.cpp @@ -1,15 +1,15 @@ /* 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 @@ -42,7 +42,7 @@ using namespace Raul; namespace Ingen { - + //// JackAudioPort //// JackAudioPort::JackAudioPort(JackAudioDriver* driver, DuplexPort* patch_port) @@ -58,7 +58,7 @@ JackAudioPort::JackAudioPort(JackAudioDriver* driver, DuplexPort* patch_port) patch_port->buffer(0)->clear(); patch_port->fixed_buffers(true); -} +} JackAudioPort::~JackAudioPort() @@ -108,7 +108,7 @@ JackAudioPort::prepare_buffer(jack_nframes_t nframes) assert(patch_buf->data() == jack_buf); } - + //// JackAudioDriver //// JackAudioDriver::JackAudioDriver(Engine& engine) @@ -130,7 +130,7 @@ JackAudioDriver::JackAudioDriver(Engine& engine) JackAudioDriver::~JackAudioDriver() { deactivate(); - + if (_local_client) jack_client_close(_client); } @@ -151,12 +151,12 @@ JackAudioDriver::attach(const std::string& server_name, cerr << "[JackAudioDriver] Connected to JACK server '" << server_name << "'" << endl; } - + // Either server name not specified, or supplied server name does not exist // Connect to default server if (!_client) { _client = jack_client_open(client_name.c_str(), JackNullOption, NULL); - + if (_client) cerr << "[JackAudioDriver] Connected to default JACK server." << endl; } @@ -174,13 +174,13 @@ JackAudioDriver::attach(const std::string& server_name, _buffer_size = jack_get_buffer_size(_client); _sample_rate = jack_get_sample_rate(_client); - + jack_on_shutdown(_client, shutdown_cb, this); jack_set_thread_init_callback(_client, thread_init_cb, this); jack_set_sample_rate_callback(_client, sample_rate_cb, this); jack_set_buffer_size_callback(_client, buffer_size_cb, this); - + for (Raul::List<JackAudioPort*>::iterator i = _ports.begin(); i != _ports.end(); ++i) (*i)->create(); @@ -190,7 +190,7 @@ JackAudioDriver::attach(const std::string& server_name, void JackAudioDriver::activate() -{ +{ if (_is_activated) { cerr << "[JackAudioDriver] Jack driver already activated." << endl; return; @@ -242,7 +242,7 @@ JackAudioDriver::deactivate() * * Realtime safe, this is to be called at the beginning of a process cycle to * insert (and actually begin using) a new port. - * + * * See create_port() and remove_port(). */ void @@ -270,7 +270,7 @@ JackAudioDriver::remove_port(const Path& path) for (Raul::List<JackAudioPort*>::iterator i = _ports.begin(); i != _ports.end(); ++i) if ((*i)->patch_port()->path() == path) return (Raul::List<DriverPort*>::Node*)(_ports.erase(i)); - + cerr << "[JackAudioDriver::remove_port] WARNING: Unable to find port " << path << endl; return NULL; } @@ -323,7 +323,7 @@ JackAudioDriver::driver_port(const Path& path) * \callgraph */ int -JackAudioDriver::_process_cb(jack_nframes_t nframes) +JackAudioDriver::_process_cb(jack_nframes_t nframes) { if (nframes == 0 || ! _is_activated) { if (_flag == 1) @@ -332,7 +332,7 @@ JackAudioDriver::_process_cb(jack_nframes_t nframes) } // FIXME: all of this time stuff is screwy - + // FIXME: support nframes != buffer_size, even though that never damn well happens assert(nframes == _buffer_size); @@ -355,11 +355,11 @@ JackAudioDriver::_process_cb(jack_nframes_t nframes) i != _engine.process_slaves().end(); ++i) { (*i)->context().set_time_slice(nframes, start_of_current_cycle, end_of_current_cycle); } - + // Process events that came in during the last cycle // (Aiming for jitter-free 1 block event latency, ideally) _engine.process_events(_process_context); - + // Set buffers of patch ports to Jack port buffers (zero-copy processing) for (Raul::List<JackAudioPort*>::iterator i = _ports.begin(); i != _ports.end(); ++i) { assert(*i); @@ -368,11 +368,11 @@ JackAudioDriver::_process_cb(jack_nframes_t nframes) if (_engine.midi_driver()) _engine.midi_driver()->pre_process(_process_context); - + // Run root patch if (_root_patch) _root_patch->process(_process_context); - + if (_engine.midi_driver()) _engine.midi_driver()->post_process(_process_context); @@ -382,8 +382,8 @@ JackAudioDriver::_process_cb(jack_nframes_t nframes) } -void -JackAudioDriver::_thread_init_cb() +void +JackAudioDriver::_thread_init_cb() { // Initialize thread specific data _jack_thread = Thread::create_for_this_thread("Jack"); @@ -392,8 +392,8 @@ JackAudioDriver::_thread_init_cb() assert(ThreadManager::current_thread_id() == THREAD_PROCESS); } -void -JackAudioDriver::_shutdown_cb() +void +JackAudioDriver::_shutdown_cb() { cout << "[JackAudioDriver] Jack shutdown. Exiting." << endl; _engine.quit(); @@ -402,7 +402,7 @@ JackAudioDriver::_shutdown_cb() int -JackAudioDriver::_sample_rate_cb(jack_nframes_t nframes) +JackAudioDriver::_sample_rate_cb(jack_nframes_t nframes) { if (_is_activated) { cerr << "[JackAudioDriver] On-the-fly sample rate changing not supported (yet). Aborting." << endl; @@ -415,7 +415,7 @@ JackAudioDriver::_sample_rate_cb(jack_nframes_t nframes) int -JackAudioDriver::_buffer_size_cb(jack_nframes_t nframes) +JackAudioDriver::_buffer_size_cb(jack_nframes_t nframes) { if (_root_patch) { _root_patch->set_buffer_size(nframes); diff --git a/src/engine/JackAudioDriver.hpp b/src/engine/JackAudioDriver.hpp index aa952197..50648fd3 100644 --- a/src/engine/JackAudioDriver.hpp +++ b/src/engine/JackAudioDriver.hpp @@ -1,15 +1,15 @@ /* 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 @@ -49,12 +49,12 @@ class JackAudioPort : public DriverPort, public Raul::List<JackAudioPort*>::Node public: JackAudioPort(JackAudioDriver* driver, DuplexPort* patch_port); ~JackAudioPort(); - + void create(); void destroy(); - + void set_name(const std::string& name) { jack_port_set_name(_jack_port, name.c_str()); }; - + void prepare_buffer(jack_nframes_t nframes); jack_port_t* jack_port() const { return _jack_port; } @@ -77,7 +77,7 @@ private: */ class JackAudioDriver : public AudioDriver { -public: +public: JackAudioDriver(Engine& engine); ~JackAudioDriver(); @@ -92,29 +92,29 @@ public: DriverPort* port(const Raul::Path& path); DriverPort* create_port(DuplexPort* patch_port); - + void add_port(DriverPort* port); DriverPort* driver_port(const Raul::Path& path); - + Raul::List<DriverPort*>::Node* remove_port(const Raul::Path& path); - + PatchImpl* root_patch() { return _root_patch; } void set_root_patch(PatchImpl* patch) { _root_patch = patch; } - + ProcessContext& context() { return _process_context; } - + /** Transport state for this frame. * Intended to only be called from the audio thread. */ inline const jack_position_t* position() { return &_position; } inline jack_transport_state_t transport_state() { return _transport_state; } - + bool is_realtime() const { return jack_is_realtime(_client); } - + jack_client_t* jack_client() const { return _client; } SampleCount buffer_size() const { return _buffer_size; } SampleCount sample_rate() const { return _sample_rate; } bool is_activated() const { return _is_activated; } - + inline SampleCount frame_time() const { return _client ? jack_frame_time(_client) : 0; } class PortRegistrationFailedException : public std::exception {}; @@ -148,7 +148,7 @@ private: bool _local_client; ///< Whether _client should be closed on destruction jack_position_t _position; jack_transport_state_t _transport_state; - + Raul::List<JackAudioPort*> _ports; ProcessContext _process_context; @@ -187,7 +187,7 @@ inline int JackAudioDriver::sample_rate_cb(jack_nframes_t nframes, void* jack_dr assert(jack_driver); return ((JackAudioDriver*)jack_driver)->_sample_rate_cb(nframes); } - + } // namespace Ingen diff --git a/src/engine/JackMidiDriver.cpp b/src/engine/JackMidiDriver.cpp index c0b55a6b..5f01a6f4 100644 --- a/src/engine/JackMidiDriver.cpp +++ b/src/engine/JackMidiDriver.cpp @@ -1,15 +1,15 @@ /* 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 @@ -38,7 +38,7 @@ using namespace Raul; namespace Ingen { - + //// JackMidiPort //// JackMidiPort::JackMidiPort(JackMidiDriver* driver, DuplexPort* patch_port) @@ -68,7 +68,7 @@ JackMidiPort::create() _patch_port->path().c_str(), JACK_DEFAULT_MIDI_TYPE, (_patch_port->is_input()) ? JackPortIsInput : JackPortIsOutput, 0); - + if (_jack_port == NULL) { cerr << "[JackMidiPort] ERROR: Failed to register port " << _patch_port->path() << endl; throw JackAudioDriver::PortRegistrationFailedException(); @@ -96,7 +96,7 @@ JackMidiPort::pre_process(ProcessContext& context) { if ( ! is_input() ) return; - + assert(_patch_port->poly() == 1); EventBuffer* patch_buf = dynamic_cast<EventBuffer*>(_patch_port->buffer(0)); @@ -106,7 +106,7 @@ JackMidiPort::pre_process(ProcessContext& context) const jack_nframes_t event_count = jack_midi_get_event_count(jack_buffer); patch_buf->prepare_write(context.start(), context.nframes()); - + // Copy events from Jack port buffer into patch port buffer for (jack_nframes_t i=0; i < event_count; ++i) { jack_midi_event_t ev; @@ -135,13 +135,13 @@ JackMidiPort::post_process(ProcessContext& context) EventBuffer* patch_buf = dynamic_cast<EventBuffer*>(_patch_port->buffer(0)); void* jack_buf = jack_port_get_buffer(_jack_port, context.nframes()); - + assert(_patch_port->poly() == 1); assert(patch_buf); patch_buf->prepare_read(context.start(), context.nframes()); jack_midi_clear_buffer(jack_buf); - + uint32_t frames = 0; uint32_t subframes = 0; uint16_t type = 0; @@ -198,7 +198,7 @@ JackMidiDriver::attach(AudioDriver& driver) /** Launch and start the MIDI thread. */ void -JackMidiDriver::activate() +JackMidiDriver::activate() { _is_activated = true; } @@ -207,7 +207,7 @@ JackMidiDriver::activate() /** Terminate the MIDI thread. */ void -JackMidiDriver::deactivate() +JackMidiDriver::deactivate() { for (Raul::List<JackMidiPort*>::iterator i = _ports.begin(); i != _ports.end(); ++i) (*i)->destroy(); @@ -241,7 +241,7 @@ JackMidiDriver::post_process(ProcessContext& context) * * Realtime safe, this is to be called at the beginning of a process cycle to * insert (and actually begin using) a new port. - * + * * See new_port() and remove_port(). */ void @@ -269,12 +269,12 @@ JackMidiDriver::remove_port(const Path& path) for (Raul::List<JackMidiPort*>::iterator i = _ports.begin(); i != _ports.end(); ++i) if ((*i)->patch_port()->path() == path) return (Raul::List<DriverPort*>::Node*)_ports.erase(i); - + cerr << "[JackMidiDriver::remove_port] WARNING: Unable to find port " << path << endl; return NULL; } - + DriverPort* JackMidiDriver::driver_port(const Path& path) { diff --git a/src/engine/JackMidiDriver.hpp b/src/engine/JackMidiDriver.hpp index d0e81396..9d20c215 100644 --- a/src/engine/JackMidiDriver.hpp +++ b/src/engine/JackMidiDriver.hpp @@ -1,15 +1,15 @@ /* 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 @@ -46,7 +46,7 @@ public: void pre_process(ProcessContext& context); void post_process(ProcessContext& context); - + void set_name(const std::string& name) { jack_port_set_name(_jack_port, name.c_str()); }; private: @@ -74,19 +74,19 @@ public: void deactivate(); void enable() { _is_enabled = true; } void disable() { _is_enabled = false; } - + bool is_activated() const { return _is_activated; } bool is_enabled() const { return _is_enabled; } - + void pre_process(ProcessContext& context); void post_process(ProcessContext& context); JackMidiPort* create_port(DuplexPort* patch_port) { return new JackMidiPort(this, patch_port); } - + void add_port(DriverPort* port); DriverPort* driver_port(const Raul::Path& path); - + Raul::List<DriverPort*>::Node* remove_port(const Raul::Path& path); jack_client_t* jack_client() { return _client; } @@ -96,12 +96,12 @@ private: uint32_t _midi_event_type; Raul::List<JackMidiPort*> _ports; - + friend class JackMidiPort; - + void add_output(Raul::List<JackMidiPort*>::Node* port); Raul::List<JackMidiPort*>::Node* remove_output(JackMidiPort* port); - + // MIDI thread static void* process_midi_in(void* me); diff --git a/src/engine/LADSPANode.cpp b/src/engine/LADSPANode.cpp index f8fc9e8d..5a3f0619 100644 --- a/src/engine/LADSPANode.cpp +++ b/src/engine/LADSPANode.cpp @@ -1,15 +1,15 @@ /* 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 @@ -70,7 +70,7 @@ LADSPANode::prepare_poly(uint32_t poly) || (_prepared_instances && poly <= _prepared_instances->size()) ) { return true; } - + _prepared_instances = new Raul::Array<LADSPA_Handle>(poly, *_instances); for (uint32_t i = _polyphony; i < _prepared_instances->size(); ++i) { _prepared_instances->at(i) = _descriptor->instantiate(_descriptor, _srate); @@ -78,7 +78,7 @@ LADSPANode::prepare_poly(uint32_t poly) cerr << "Failed to instantiate plugin!" << endl; return false; } - + // Initialize the values of new ports for (unsigned long j=0; j < num_ports(); ++j) { PortImpl* const port = _ports->at(j); @@ -95,7 +95,7 @@ LADSPANode::prepare_poly(uint32_t poly) if (_activated && _descriptor->activate) _descriptor->activate(_prepared_instances->at(i)); } - + return true; } @@ -112,14 +112,14 @@ LADSPANode::apply_poly(Raul::Maid& maid, uint32_t poly) _instances = _prepared_instances; _prepared_instances = NULL; } - + assert(poly <= _instances->size()); _polyphony = poly; - + return NodeBase::apply_poly(maid, poly); } - + static string nameify_if_invalid(const string& name) { @@ -137,7 +137,7 @@ nameify_if_invalid(const string& name) * * Implemented as a seperate function (rather than in the constructor) to * allow graceful error-catching of broken plugins. - * + * * Returns whether or not plugin was successfully instantiated. If return * value is false, this object may not be used. */ @@ -146,11 +146,11 @@ LADSPANode::instantiate() { if (!_ports) _ports = new Raul::Array<PortImpl*>(_descriptor->PortCount); - + _instances = new Raul::Array<LADSPA_Handle>(_polyphony, NULL); - + size_t port_buffer_size = 0; - + for (uint32_t i=0; i < _polyphony; ++i) { (*_instances)[i] = _descriptor->instantiate(_descriptor, _srate); if ((*_instances)[i] == NULL) { @@ -158,7 +158,7 @@ LADSPANode::instantiate() return false; } } - + PortImpl* port = NULL; std::map<std::string, uint32_t> names; @@ -189,7 +189,7 @@ LADSPANode::instantiate() port_name = name; names.insert(make_pair(port_name, j)); - + Path port_path(path().child(port_name)); DataType type = DataType::AUDIO; @@ -203,10 +203,10 @@ LADSPANode::instantiate() } assert (LADSPA_IS_PORT_INPUT(_descriptor->PortDescriptors[j]) || LADSPA_IS_PORT_OUTPUT(_descriptor->PortDescriptors[j])); - + boost::optional<Sample> default_val, min, max; get_port_limits(j, default_val, min, max); - + const float value = default_val ? default_val.get() : 0.0f; if (LADSPA_IS_PORT_INPUT(_descriptor->PortDescriptors[j])) { @@ -226,13 +226,13 @@ LADSPANode::instantiate() << ": Port default < minimum. Minimum adjusted." << endl; min = default_val; } - + if (default_val && default_val.get() > max.get()) { cerr << "WARNING: Broken LADSPA " << _descriptor->UniqueID << ": Maximum adjusted." << endl; max = default_val; } - + // Set initial/default value if (port->buffer_size() == 1) { for (uint32_t i=0; i < _polyphony; ++i) @@ -280,7 +280,7 @@ void LADSPANode::deactivate() { NodeBase::deactivate(); - + for (uint32_t i=0; i < _polyphony; ++i) if (_descriptor->deactivate != NULL) _descriptor->deactivate((*_instances)[i]); @@ -291,10 +291,10 @@ void LADSPANode::process(ProcessContext& context) { NodeBase::pre_process(context); - - for (uint32_t i=0; i < _polyphony; ++i) + + for (uint32_t i=0; i < _polyphony; ++i) _descriptor->run((*_instances)[i], context.nframes()); - + NodeBase::post_process(context); } @@ -303,7 +303,7 @@ void LADSPANode::set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf) { assert(voice < _polyphony); - + AudioBuffer* audio_buffer = dynamic_cast<AudioBuffer*>(buf); assert(audio_buffer); diff --git a/src/engine/LADSPANode.hpp b/src/engine/LADSPANode.hpp index 1ca84208..fe671390 100644 --- a/src/engine/LADSPANode.hpp +++ b/src/engine/LADSPANode.hpp @@ -1,15 +1,15 @@ /* 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 @@ -46,15 +46,15 @@ public: ~LADSPANode(); bool instantiate(); - + bool prepare_poly(uint32_t poly); bool apply_poly(Raul::Maid& maid, uint32_t poly); void activate(); void deactivate(); - + void process(ProcessContext& context); - + void set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf); protected: @@ -62,7 +62,7 @@ protected: boost::optional<Sample>& default_value, boost::optional<Sample>& lower_bound, boost::optional<Sample>& upper_bound); - + const LADSPA_Descriptor* _descriptor; Raul::Array<LADSPA_Handle>* _instances; Raul::Array<LADSPA_Handle>* _prepared_instances; diff --git a/src/engine/LADSPAPlugin.cpp b/src/engine/LADSPAPlugin.cpp index bc1f02fd..de9a81fb 100644 --- a/src/engine/LADSPAPlugin.cpp +++ b/src/engine/LADSPAPlugin.cpp @@ -1,15 +1,15 @@ /* 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 @@ -45,23 +45,23 @@ LADSPAPlugin::instantiate(const string& name, Engine& engine) { assert(_id != 0); - + SampleCount srate = engine.audio_driver()->sample_rate(); SampleCount buffer_size = engine.audio_driver()->buffer_size(); - + union { void* dp; LADSPA_Descriptor_Function fp; } df; df.dp = NULL; df.fp = NULL; - + LADSPANode* n = NULL; load(); // FIXME: unload at some point assert(_module); assert(*_module); - + if (!_module->get_symbol("ladspa_descriptor", df.dp)) { cerr << "Looks like this isn't a LADSPA plugin." << endl; return NULL; @@ -74,7 +74,7 @@ LADSPAPlugin::instantiate(const string& name, break; } } - + if (descriptor != NULL) { n = new LADSPANode(this, name, polyphonic, parent, descriptor, srate, buffer_size); diff --git a/src/engine/LADSPAPlugin.hpp b/src/engine/LADSPAPlugin.hpp index 1b4897a0..aea5aa12 100644 --- a/src/engine/LADSPAPlugin.hpp +++ b/src/engine/LADSPAPlugin.hpp @@ -1,15 +1,15 @@ /* 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 @@ -48,12 +48,12 @@ public: , _label(label) , _name(Raul::Atom::STRING, name) {} - + NodeImpl* instantiate(const std::string& name, bool polyphonic, Ingen::PatchImpl* parent, Engine& engine); - + const std::string& label() const { return _label; } unsigned long id() const { return _id; } const std::string symbol() const { return Raul::Path::nameify(_label); } @@ -62,9 +62,9 @@ public: const std::string library_name() const { return _library_path.substr(_library_path.find_last_of("/")+1); } - + const Raul::Atom& get_property(const Raul::URI& uri) const; - + private: const unsigned long _id; const std::string _label; diff --git a/src/engine/LV2EventBuffer.cpp b/src/engine/LV2EventBuffer.cpp index bec92c0e..5e462c2a 100644 --- a/src/engine/LV2EventBuffer.cpp +++ b/src/engine/LV2EventBuffer.cpp @@ -1,15 +1,15 @@ /* 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 @@ -95,14 +95,14 @@ LV2EventBuffer::is_valid() const /** Read an event from the current position in the buffer - * + * * \return true if read was successful, or false if end of buffer reached */ bool LV2EventBuffer::get_event(uint32_t* frames, - uint32_t* subframes, - uint16_t* type, - uint16_t* size, + uint32_t* subframes, + uint16_t* type, + uint16_t* size, uint8_t** data) const { if (lv2_event_is_valid(&_iter)) { @@ -183,7 +183,7 @@ LV2EventBuffer::append(const LV2_Event_Buffer* buf) _latest_frames = ev->frames; _latest_subframes = ev->subframes; } - + return ret; } diff --git a/src/engine/LV2EventBuffer.hpp b/src/engine/LV2EventBuffer.hpp index 30edc96c..2d559889 100644 --- a/src/engine/LV2EventBuffer.hpp +++ b/src/engine/LV2EventBuffer.hpp @@ -1,15 +1,15 @@ /* 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 @@ -31,9 +31,9 @@ public: inline LV2_Event_Buffer* data() { return _data; } inline const LV2_Event_Buffer* data() const { return _data; } - + inline void rewind() const { lv2_event_begin(&_iter, _data); } - + inline void reset() { _latest_frames = 0; _latest_subframes = 0; @@ -41,7 +41,7 @@ public: _data->size = 0; rewind(); } - + inline size_t event_count() const { return _data->event_count; } inline uint32_t capacity() const { return _data->capacity; } inline uint32_t size() const { return _data->size; } diff --git a/src/engine/LV2Info.cpp b/src/engine/LV2Info.cpp index fbef2f78..aa27d393 100644 --- a/src/engine/LV2Info.cpp +++ b/src/engine/LV2Info.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -25,7 +25,7 @@ using namespace std; namespace Ingen { - + LV2Info::LV2Info(Ingen::Shared::World* world) : input_class(slv2_value_new_uri(world->slv2_world, SLV2_PORT_CLASS_INPUT)) , output_class(slv2_value_new_uri(world->slv2_world, SLV2_PORT_CLASS_OUTPUT)) @@ -58,7 +58,7 @@ LV2Info::~LV2Info() } -uint32_t +uint32_t LV2Info::event_ref(LV2_Event_Callback_Data callback_data, LV2_Event* event) { diff --git a/src/engine/LV2Info.hpp b/src/engine/LV2Info.hpp index 96620ffd..a63664e4 100644 --- a/src/engine/LV2Info.hpp +++ b/src/engine/LV2Info.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -31,9 +31,9 @@ #include "shared/LV2URIMap.hpp" #include "lv2ext/lv2_uri_map.h" #include "lv2ext/lv2_event.h" - + namespace Ingen { - + /** Stuff that may need to be passed to an LV2 plugin (i.e. LV2 features). */ @@ -47,7 +47,7 @@ public: SLV2Value control_class; SLV2Value audio_class; SLV2Value event_class; - + Ingen::Shared::World& world() { return *_world; } SLV2World lv2_world() { return _world->slv2_world; } diff --git a/src/engine/LV2Node.cpp b/src/engine/LV2Node.cpp index e8029642..9c4bd065 100644 --- a/src/engine/LV2Node.cpp +++ b/src/engine/LV2Node.cpp @@ -1,15 +1,15 @@ /* 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 @@ -71,7 +71,7 @@ bool LV2Node::prepare_poly(uint32_t poly) { NodeBase::prepare_poly(poly); - + if ( (!_polyphonic) || (_prepared_instances && poly <= _prepared_instances->size()) ) { return true; @@ -105,7 +105,7 @@ LV2Node::prepare_poly(uint32_t poly) if (_activated) slv2_instance_activate(_prepared_instances->at(i)); } - + return true; } @@ -125,7 +125,7 @@ LV2Node::apply_poly(Raul::Maid& maid, uint32_t poly) assert(poly <= _instances->size()); _polyphony = poly; - + return NodeBase::apply_poly(maid, poly); } @@ -134,7 +134,7 @@ LV2Node::apply_poly(Raul::Maid& maid, uint32_t poly) * * Implemented as a seperate function (rather than in the constructor) to * allow graceful error-catching of broken plugins. - * + * * Returns whether or not plugin was successfully instantiated. If return * value is false, this object may not be used. */ @@ -149,43 +149,43 @@ LV2Node::instantiate() _ports = new Raul::Array<PortImpl*>(num_ports, NULL); _instances = new Raul::Array<SLV2Instance>(_polyphony, NULL); - + uint32_t port_buffer_size = 0; SLV2Value ctx_ext_uri = slv2_value_new_uri(info->lv2_world(), LV2_CONTEXT_MESSAGE); - + for (uint32_t i=0; i < _polyphony; ++i) { (*_instances)[i] = slv2_plugin_instantiate(plug, _srate, info->lv2_features()); if ((*_instances)[i] == NULL) { cerr << "Failed to instantiate plugin!" << endl; return false; } - + if (!slv2_plugin_has_feature(plug, ctx_ext_uri)) continue; const void* ctx_ext = slv2_instance_get_extension_data( (*_instances)[i], LV2_CONTEXT_MESSAGE); - + if (i == 0 && ctx_ext) { cerr << "HAS CONTEXT EXTENSION" << endl; assert(!_message_funcs); _message_funcs = (LV2MessageContext*)ctx_ext; } } - + slv2_value_free(ctx_ext_uri); - + string port_name; Path port_path; - + PortImpl* port = NULL; - + float* def_values = new float[num_ports]; slv2_plugin_get_port_ranges_float(plug, 0, 0, def_values); - + SLV2Value pred = slv2_value_new_uri(info->lv2_world(), "http://lv2plug.in/ns/dev/contexts#context"); - + for (uint32_t j=0; j < num_ports; ++j) { SLV2Port id = slv2_plugin_get_port_by_index(plug, j); @@ -194,7 +194,7 @@ LV2Node::instantiate() assert(port_name.find("/") == string::npos); port_path = path().child(port_name); - + DataType data_type = DataType::UNKNOWN; if (slv2_port_is_a(plug, id, info->control_class)) { data_type = DataType::CONTROL; @@ -221,7 +221,7 @@ LV2Node::instantiate() _instances = NULL; return false; } - + // FIXME: need nice type preserving SLV2Value -> Raul::Atom conversion const float def = isnan(def_values[j]) ? 0.0f : def_values[j]; const Raul::Atom defatm = def; @@ -233,7 +233,7 @@ LV2Node::instantiate() if (direction == INPUT && data_type == DataType::CONTROL) ((AudioBuffer*)port->buffer(0))->set_value(def, 0, 0); - + SLV2Values contexts = slv2_port_get_value(plug, id, pred); for (uint32_t i = 0; i < slv2_values_size(contexts); ++i) { SLV2Value c = slv2_values_get_at(contexts, i); @@ -254,9 +254,9 @@ LV2Node::instantiate() _ports->at(j) = port; } - + delete[] def_values; - + return true; } @@ -287,7 +287,7 @@ void LV2Node::deactivate() { NodeBase::deactivate(); - + for (uint32_t i=0; i < _polyphony; ++i) slv2_instance_deactivate((*_instances)[i]); } @@ -309,9 +309,9 @@ LV2Node::process(ProcessContext& context) { NodeBase::pre_process(context); - for (uint32_t i=0; i < _polyphony; ++i) + for (uint32_t i=0; i < _polyphony; ++i) slv2_instance_run((*_instances)[i], context.nframes()); - + NodeBase::post_process(context); } @@ -320,7 +320,7 @@ void LV2Node::set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf) { assert(voice < _polyphony); - + slv2_instance_connect_port((*_instances)[voice], port_num, buf->raw_data()); if ((*_ports).at(port_num)->context() == Context::MESSAGE) { assert(_message_funcs); diff --git a/src/engine/LV2Node.hpp b/src/engine/LV2Node.hpp index 595ed8e9..454f653f 100644 --- a/src/engine/LV2Node.hpp +++ b/src/engine/LV2Node.hpp @@ -1,15 +1,15 @@ /* 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 @@ -20,7 +20,7 @@ #include <string> #include "slv2/slv2.h" -#include "lv2_contexts.h" +#include "lv2_contexts.h" #include "types.hpp" #include "NodeBase.hpp" @@ -42,21 +42,21 @@ public: PatchImpl* parent, SampleRate srate, size_t buffer_size); - + ~LV2Node(); bool instantiate(); - + bool prepare_poly(uint32_t poly); bool apply_poly(Raul::Maid& maid, uint32_t poly); void activate(); void deactivate(); - + void message_process(MessageContext& context, uint32_t* ins, uint32_t* outs); - + void process(ProcessContext& context); - + void set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf); protected: diff --git a/src/engine/LV2Plugin.cpp b/src/engine/LV2Plugin.cpp index fa5eb415..7cc7b19f 100644 --- a/src/engine/LV2Plugin.cpp +++ b/src/engine/LV2Plugin.cpp @@ -1,15 +1,15 @@ /* 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 @@ -29,7 +29,7 @@ using namespace Raul; namespace Ingen { - + const string LV2Plugin::symbol() const { @@ -46,7 +46,7 @@ LV2Plugin::symbol() const else working = working.substr(0, last_slash); } - + return "lv2_symbol"; } @@ -59,9 +59,9 @@ LV2Plugin::instantiate(const string& name, { SampleCount srate = engine.audio_driver()->sample_rate(); SampleCount buffer_size = engine.audio_driver()->buffer_size(); - + load(); // FIXME: unload at some point - + Glib::Mutex::Lock lock(engine.world()->rdf_world->mutex()); LV2Node* n = new LV2Node(this, name, polyphonic, parent, srate, buffer_size); @@ -69,10 +69,10 @@ LV2Plugin::instantiate(const string& name, delete n; n = NULL; } - + return n; } - + void LV2Plugin::slv2_plugin(SLV2Plugin p) diff --git a/src/engine/LV2Plugin.hpp b/src/engine/LV2Plugin.hpp index a05853a8..8a515d2e 100644 --- a/src/engine/LV2Plugin.hpp +++ b/src/engine/LV2Plugin.hpp @@ -1,15 +1,15 @@ /* 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 @@ -51,16 +51,16 @@ public: , _slv2_plugin(NULL) , _lv2_info(lv2_info) {} - + NodeImpl* instantiate(const std::string& name, bool polyphonic, Ingen::PatchImpl* parent, Engine& engine); - + const std::string symbol() const; SharedPtr<LV2Info> lv2_info() const { return _lv2_info; } - + const std::string& library_path() const; SLV2Plugin slv2_plugin() const { return _slv2_plugin; } diff --git a/src/engine/MessageContext.cpp b/src/engine/MessageContext.cpp index 778804b3..1f6be6bd 100644 --- a/src/engine/MessageContext.cpp +++ b/src/engine/MessageContext.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 diff --git a/src/engine/MessageContext.hpp b/src/engine/MessageContext.hpp index 31531521..8a01304a 100644 --- a/src/engine/MessageContext.hpp +++ b/src/engine/MessageContext.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2007-2008 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 diff --git a/src/engine/MidiDriver.hpp b/src/engine/MidiDriver.hpp index 31ef686d..ee10d06c 100644 --- a/src/engine/MidiDriver.hpp +++ b/src/engine/MidiDriver.hpp @@ -1,15 +1,15 @@ /* 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 @@ -45,7 +45,7 @@ public: * Realtime safe, run in audio thread before executing the graph for a cycle. */ virtual void pre_process(ProcessContext& context) = 0; - + /** Prepare output for the specified (just completed) cycle. * * Realtime safe, run in audio thread after executing the graph for a cycle. @@ -70,28 +70,28 @@ public: DummyMidiDriver() { std::cout << "[DummyMidiDriver] Started Dummy MIDI driver." << std::endl; } - + ~DummyMidiDriver() {} void activate() {} void deactivate() {} - + bool is_activated() const { return false; } bool is_enabled() const { return false; } - + void enable() {} void disable() {} - + DriverPort* create_port(DuplexPort* patch_port) { return NULL; } - + DriverPort* driver_port(const Raul::Path& path) { return NULL; } - + DriverPort* new_port(DuplexPort* patch_port) { return NULL; } - + void add_port(DriverPort* port) {} - + Raul::List<DriverPort*>::Node* remove_port(const Raul::Path& path) { return NULL; } - + void pre_process(ProcessContext& context) {} void post_process(ProcessContext& context) {} }; diff --git a/src/engine/NodeBase.cpp b/src/engine/NodeBase.cpp index 2fd93162..34dbcca5 100644 --- a/src/engine/NodeBase.cpp +++ b/src/engine/NodeBase.cpp @@ -1,15 +1,15 @@ /* 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 @@ -64,7 +64,7 @@ NodeBase::~NodeBase() delete _dependants; } - + Shared::Port* NodeBase::port(uint32_t index) const { @@ -126,11 +126,11 @@ NodeBase::apply_poly(Raul::Maid& maid, uint32_t poly) _ports->at(i)->apply_poly(maid, poly); assert(_ports->at(i)->poly() == poly); } - + for (uint32_t i=0; i < num_ports(); ++i) for (uint32_t j=0; j < _polyphony; ++j) set_port_buffer(j, i, _ports->at(i)->prepared_buffer(j)); - + return true; } @@ -141,12 +141,12 @@ NodeBase::set_buffer_size(size_t size) assert(ThreadManager::current_thread_id() == THREAD_PROCESS); _buffer_size = size; - + if (_ports) for (size_t i=0; i < _ports->size(); ++i) _ports->at(i)->set_buffer_size(size); } - + void NodeBase::reset_input_ready() diff --git a/src/engine/NodeBase.hpp b/src/engine/NodeBase.hpp index 7c0293f9..d1fbe147 100644 --- a/src/engine/NodeBase.hpp +++ b/src/engine/NodeBase.hpp @@ -1,15 +1,15 @@ /* 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 @@ -58,10 +58,10 @@ public: virtual void activate(); virtual void deactivate(); bool activated() { return _activated; } - + virtual bool prepare_poly(uint32_t poly); virtual bool apply_poly(Raul::Maid& maid, uint32_t poly); - + virtual void reset_input_ready(); virtual bool process_lock(); virtual void process_unlock(); @@ -69,54 +69,54 @@ public: virtual unsigned n_inputs_ready() const { return _n_inputs_ready.get(); } virtual void learn() {} - + virtual void message_process(MessageContext& context, uint32_t* ins, uint32_t* outs) {} virtual void pre_process(ProcessContext& context); virtual void process(ProcessContext& context) = 0; virtual void post_process(ProcessContext& context); - + virtual void set_port_buffer(uint32_t voice, uint32_t port_num, Buffer* buf) {} - + virtual void set_buffer_size(size_t size); - + SampleRate sample_rate() const { return _srate; } size_t buffer_size() const { return _buffer_size; } uint32_t num_ports() const { return _ports ? _ports->size() : 0; } uint32_t polyphony() const { return _polyphony; } bool traversed() const { return _traversed; } void traversed(bool b) { _traversed = b; } - + virtual Shared::Port* port(uint32_t index) const; virtual PortImpl* port_impl(uint32_t index) const { return (*_ports)[index]; } - + /* These are NOT to be used in the audio thread! * The providers and dependants in CompiledNode are for that */ Raul::List<NodeImpl*>* providers() { return _providers; } void providers(Raul::List<NodeImpl*>* l) { _providers = l; } - + Raul::List<NodeImpl*>* dependants() { return _dependants; } void dependants(Raul::List<NodeImpl*>* l) { _dependants = l; } - + virtual const Shared::Plugin* plugin() const; virtual PluginImpl* plugin_impl() const { return _plugin; } virtual void plugin(PluginImpl* pi) { _plugin = pi; } - + /** A node's parent is always a patch, so static cast should be safe */ inline PatchImpl* parent_patch() const { return (PatchImpl*)_parent; } - + protected: virtual void signal_input_ready(); - + PluginImpl* _plugin; uint32_t _polyphony; SampleRate _srate; size_t _buffer_size; bool _activated; - + bool _traversed; ///< Flag for process order algorithm Raul::Semaphore _input_ready; ///< Parallelism: input ready signal Raul::AtomicInt _process_lock; ///< Parallelism: Waiting on inputs 'lock' diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp index fa9ec94e..67380606 100644 --- a/src/engine/NodeFactory.cpp +++ b/src/engine/NodeFactory.cpp @@ -1,15 +1,15 @@ /* 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 @@ -104,7 +104,7 @@ void NodeFactory::load_plugins() { assert(ThreadManager::current_thread_id() == THREAD_PRE_PROCESS); - + _world->rdf_world->mutex().lock(); // Only load if we havn't already, so every client connecting doesn't cause @@ -114,7 +114,7 @@ NodeFactory::load_plugins() _plugins.clear(); // FIXME: assert empty? load_internal_plugins(); - + #ifdef HAVE_SLV2 load_lv2_plugins(); #endif @@ -122,12 +122,12 @@ NodeFactory::load_plugins() #ifdef HAVE_LADSPA_H load_ladspa_plugins(); #endif - + _has_loaded = true; } - + _world->rdf_world->mutex().unlock(); - + //cerr << "[NodeFactory] # Plugins: " << _plugins.size() << endl; } @@ -136,7 +136,7 @@ void NodeFactory::load_internal_plugins() { // This is a touch gross... - + PatchImpl* parent = new PatchImpl(*_world->local_engine, "dummy", 1, NULL, 1, 1, 1); NodeImpl* n = NULL; @@ -152,7 +152,7 @@ NodeFactory::load_internal_plugins() n = new TransportNode("foo", 1, parent, 1, 1); _plugins.insert(make_pair(n->plugin_impl()->uri(), n->plugin_impl())); delete n; - + delete parent; } @@ -176,7 +176,7 @@ NodeFactory::load_lv2_plugins() #ifndef NDEBUG assert(_plugins.find(uri) == _plugins.end()); #endif - + LV2Plugin* const plugin = new LV2Plugin(_lv2_info, uri); plugin->slv2_plugin(lv2_plug); @@ -211,7 +211,7 @@ NodeFactory::load_ladspa_plugins() ladspa_path = ladspa_path.substr(ladspa_path.find(':')+1); else ladspa_path = ""; - + DIR* pdir = opendir(dir.c_str()); if (pdir == NULL) { //cerr << "[NodeFactory] Unreadable directory in LADSPA_PATH: " << dir.c_str() << endl; @@ -228,22 +228,22 @@ NodeFactory::load_ladspa_plugins() df.fp = NULL; LADSPA_Descriptor* descriptor = NULL; - + if (!strcmp(pfile->d_name, ".") || !strcmp(pfile->d_name, "..")) continue; - + const string lib_path = dir +"/"+ pfile->d_name; - + // Ignore stupid libtool files. Kludge alert. if (lib_path.substr(lib_path.length()-3) == ".la") { //cerr << "WARNING: Skipping stupid libtool file " << pfile->d_name << endl; continue; } - + Glib::Module* plugin_library = new Glib::Module(lib_path, Glib::MODULE_BIND_LOCAL); if (!plugin_library || !(*plugin_library)) continue; - + bool found = plugin_library->get_symbol("ladspa_descriptor", df.dp); if (!found || !df.dp) { cerr << "WARNING: Non-LADSPA library found in LADSPA path: " << @@ -257,9 +257,9 @@ NodeFactory::load_ladspa_plugins() char id_str[11]; snprintf(id_str, 11, "%lu", descriptor->UniqueID); const string uri = string("ladspa:").append(id_str); - + const Plugins::const_iterator i = _plugins.find(uri); - + if (i == _plugins.end()) { LADSPAPlugin* plugin = new LADSPAPlugin(lib_path, uri, descriptor->UniqueID, diff --git a/src/engine/NodeFactory.hpp b/src/engine/NodeFactory.hpp index 05fdf37a..b7c8a042 100644 --- a/src/engine/NodeFactory.hpp +++ b/src/engine/NodeFactory.hpp @@ -1,15 +1,15 @@ /* 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 @@ -39,7 +39,7 @@ class LV2Info; /** Loads plugins and creates Nodes from them. * - * NodeFactory's responsibility is to get enough information to allow the + * NodeFactory's responsibility is to get enough information to allow the * loading of a plugin possible (ie finding/opening shared libraries etc) * * The constructor of various Node types (ie LADSPANode) are responsible @@ -54,10 +54,10 @@ public: ~NodeFactory(); void load_plugins(); - + typedef std::map<Raul::URI, PluginImpl*> Plugins; const Plugins& plugins() const { return _plugins; } - + PluginImpl* plugin(const Raul::URI& uri); /** DEPRECATED */ @@ -75,7 +75,7 @@ private: #endif void load_internal_plugins(); - + Plugins _plugins; Ingen::Shared::World* _world; bool _has_loaded; diff --git a/src/engine/NodeImpl.hpp b/src/engine/NodeImpl.hpp index 2a751f6b..ebc42655 100644 --- a/src/engine/NodeImpl.hpp +++ b/src/engine/NodeImpl.hpp @@ -1,15 +1,15 @@ /* 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 @@ -36,10 +36,10 @@ class MessageContext; /** A Node (or "module") in a Patch (which is also a Node). - * + * * A Node is a unit with input/output ports, a process() method, and some other * things. - * + * * This is a pure abstract base class for any Node, it contains no * implementation details/data whatsoever. This is the interface you need to * implement to add a new Node type. @@ -69,7 +69,7 @@ public: * \return true on success. */ virtual bool prepare_poly(uint32_t poly) = 0; - + /** Apply a new (external) polyphony value. * * Audio thread. @@ -82,13 +82,13 @@ public: /** Parallelism: Reset flags for start of a new cycle. */ virtual void reset_input_ready() = 0; - + /** Parallelism: Claim this node (to wait on its input). * Only one thread will ever take this lock on a particular Node. * \return true if lock was aquired, false otherwise */ virtual bool process_lock() = 0; - + /** Parallelism: Unclaim this node (let someone else wait on its input). * Only a thread which successfully called process_lock may call this. */ @@ -98,7 +98,7 @@ public: * Only a thread which successfully called process_lock may call this. */ virtual void wait_for_input(size_t num_providers) = 0; - + /** Parallelism: Signal that input is ready. Realtime safe. * Calling this will wake up the thread which blocked on wait_for_input * if there is one, and otherwise cause it to return true the next call. @@ -109,7 +109,7 @@ public: /** Parallelism: Return the number of providers that have signalled. */ virtual unsigned n_inputs_ready() const = 0; - + /** Run the node for one instant in the message thread. */ virtual void message_process(MessageContext& context, uint32_t* ins, uint32_t* outs) = 0; @@ -127,23 +127,23 @@ public: virtual Shared::Port* port(uint32_t index) const = 0; virtual PortImpl* port_impl(uint32_t index) const = 0; - + /** Used by the process order finding algorithm (ie during connections) */ virtual bool traversed() const = 0; virtual void traversed(bool b) = 0; - + /** Nodes that are connected to this Node's inputs. * (This Node depends on them) */ virtual Raul::List<NodeImpl*>* providers() = 0; virtual void providers(Raul::List<NodeImpl*>* l) = 0; - + /** Nodes are are connected to this Node's outputs. * (They depend on this Node) */ virtual Raul::List<NodeImpl*>* dependants() = 0; virtual void dependants(Raul::List<NodeImpl*>* l) = 0; - + /** The Patch this Node belongs to. */ virtual PatchImpl* parent_patch() const = 0; @@ -151,7 +151,7 @@ public: * Not the best name - not all nodes come from plugins (ie Patch) */ virtual PluginImpl* plugin_impl() const = 0; - + /** Information about the Plugin this Node is an instance of. * Not the best name - not all nodes come from plugins (ie Patch) */ diff --git a/src/engine/OSCClientSender.cpp b/src/engine/OSCClientSender.cpp index 9809c0dd..7473e4cd 100644 --- a/src/engine/OSCClientSender.cpp +++ b/src/engine/OSCClientSender.cpp @@ -1,15 +1,15 @@ /* 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 @@ -80,7 +80,7 @@ OSCClientSender::response_ok(int32_t id) << lo_address_errstr(_address) << ")" << endl; } } - + /** \page client_osc_namespace * <p> \b /ingen/response - Respond to a user command @@ -318,7 +318,7 @@ OSCClientSender::new_object(const Shared::GraphObject* object) new_patch(patch->path(), patch->internal_polyphony()); return true; } - + const Node* node = dynamic_cast<const Node*>(object); if (node) { new_node(node->path(), node->plugin()->uri()); @@ -365,7 +365,7 @@ OSCClientSender::rename(const Path& old_path, const Path& new_path) void OSCClientSender::program_add(const Path& node_path, uint32_t bank, uint32_t program, const std::string& name) { - send("/ingen/program_add", "siis", + send("/ingen/program_add", "siis", node_path.c_str(), bank, program, name.c_str(), LO_ARGS_END); } @@ -373,7 +373,7 @@ OSCClientSender::program_add(const Path& node_path, uint32_t bank, uint32_t prog void OSCClientSender::program_remove(const Path& node_path, uint32_t bank, uint32_t program) { - send("/ingen/program_remove", "sii", + send("/ingen/program_remove", "sii", node_path.c_str(), bank, program, LO_ARGS_END); } diff --git a/src/engine/OSCClientSender.hpp b/src/engine/OSCClientSender.hpp index 3b677e6d..69c6d48c 100644 --- a/src/engine/OSCClientSender.hpp +++ b/src/engine/OSCClientSender.hpp @@ -1,15 +1,15 @@ /* 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 @@ -47,19 +47,19 @@ public: virtual ~OSCClientSender() { lo_address_free(_address); } - + bool enabled() const { return _enabled; } void enable() { _enabled = true; } void disable() { _enabled = false; } - + void bundle_begin() { OSCSender::bundle_begin(); } void bundle_end() { OSCSender::bundle_end(); } void transfer_begin() { OSCSender::transfer_begin(); } void transfer_end() { OSCSender::transfer_end(); } - + Raul::URI uri() const { return lo_address_get_url(_address); } - + void subscribe(Shared::EngineInterface* engine) { } /* *** ClientInterface Implementation Below *** */ @@ -70,59 +70,59 @@ public: void response_error(int32_t id, const std::string& msg); void error(const std::string& msg); - + virtual bool new_object(const Shared::GraphObject* object); virtual void new_plugin(const Raul::URI& uri, const Raul::URI& type_uri, const Raul::Symbol& symbol); - + virtual void new_patch(const Raul::Path& path, uint32_t poly); - + virtual void new_node(const Raul::Path& path, const Raul::URI& plugin_uri); - + virtual void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output); - + virtual void clear_patch(const Raul::Path& path); - + virtual void destroy(const Raul::Path& path); - + virtual void rename(const Raul::Path& old_path, const Raul::Path& new_path); - + virtual void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void set_variable(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_port_value(const Raul::Path& port_path, const Raul::Atom& value); - + virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value); - + virtual void activity(const Raul::Path& path); - + virtual void program_add(const Raul::Path& node_path, uint32_t bank, uint32_t program, const std::string& program_name); - + virtual void program_remove(const Raul::Path& node_path, uint32_t bank, uint32_t program); diff --git a/src/engine/OSCDriver.hpp b/src/engine/OSCDriver.hpp index fe295df5..7c57d6cf 100644 --- a/src/engine/OSCDriver.hpp +++ b/src/engine/OSCDriver.hpp @@ -1,15 +1,15 @@ /* 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 @@ -55,24 +55,24 @@ public: DummyOSCDriver() { std::cout << "[DummyOSCDriver] Started Dummy OSC driver." << std::endl; } - + ~DummyOSCDriver() {} void activate() {} void deactivate() {} - + bool is_activated() const { return false; } bool is_enabled() const { return false; } - + void enable() {} void disable() {} - + DriverPort* create_port(DuplexPort* patch_port) { return NULL; } - + void add_port(DriverPort* port) {} - + Raul::List<DriverPort*>::Node* remove_port(const Raul::Path& path) { return NULL; } - + void prepare_block(const SampleCount block_start, const SampleCount block_end) {} }; diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp index d5707720..fd9b6c1f 100644 --- a/src/engine/OSCEngineReceiver.cpp +++ b/src/engine/OSCEngineReceiver.cpp @@ -1,15 +1,15 @@ /* 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 @@ -61,7 +61,7 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t #ifdef ENABLE_AVAHI lo_server_avahi_init(_server, "ingen"); #endif - + if (_server == NULL) { cerr << "[OSC] Could not start OSC server. Aborting." << endl; exit(EXIT_FAILURE); @@ -77,7 +77,7 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t // Set response address for this message. // It's important this is first and returns nonzero. lo_server_add_method(_server, NULL, NULL, set_response_address_cb, this); - + // Commands lo_server_add_method(_server, "/ingen/ping", "i", ping_cb, this); lo_server_add_method(_server, "/ingen/ping_queued", "i", ping_slow_cb, this); @@ -180,12 +180,12 @@ OSCEngineReceiver::ReceiveThread::_run() // Enqueue every other message that is here "now" // (would this provide truly atomic bundles?) - while (lo_server_recv_noblock(_receiver._server, 0) > 0) + while (lo_server_recv_noblock(_receiver._server, 0) > 0) if (_receiver.unprepared_events()) _receiver.whip(); // No more unprepared events - } + } } @@ -214,7 +214,7 @@ OSCEngineReceiver::set_response_address_cb(const char* path, const char* types, const lo_address addr = lo_message_get_source(msg); char* const url = lo_address_get_url(addr); - + const SharedPtr<Responder> r = me->_responder; /* Different address than last time, have to do a lookup */ @@ -225,7 +225,7 @@ OSCEngineReceiver::set_response_address_cb(const char* path, const char* types, else me->_responder = SharedPtr<Responder>(new Responder()); } - + if (id != -1) { me->set_next_response_id(id); } else { @@ -322,7 +322,7 @@ OSCEngineReceiver::_unregister_client_cb(const char* path, const char* types, lo char* url = lo_address_get_url(addr); unregister_client(url); free(url); - + return 0; } @@ -394,7 +394,7 @@ OSCEngineReceiver::_rename_cb(const char* path, const char* types, lo_arg** argv { const char* old_path = &argv[1]->s; const char* new_path = &argv[2]->s; - + rename(old_path, new_path); return 0; } @@ -409,7 +409,7 @@ int OSCEngineReceiver::_clear_patch_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) { const char* patch_path = &argv[1]->s; - + clear_patch(patch_path); return 0; } @@ -429,7 +429,7 @@ OSCEngineReceiver::_new_port_cb(const char* path, const char* types, lo_arg** ar const char* port_path = &argv[1]->s; const char* data_type = &argv[2]->s; const int32_t direction = argv[3]->i; - + new_port(port_path, data_type, 0, (direction == 1)); return 0; } @@ -445,7 +445,7 @@ OSCEngineReceiver::_new_node_by_uri_cb(const char* path, const char* types, lo_a { const char* node_path = &argv[1]->s; const char* plug_uri = &argv[2]->s; - + new_node(node_path, plug_uri); return 0; } @@ -460,7 +460,7 @@ int OSCEngineReceiver::_destroy_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) { const char* node_path = &argv[1]->s; - + destroy(node_path); return 0; } @@ -528,7 +528,7 @@ OSCEngineReceiver::_set_port_value_cb(const char* path, const char* types, lo_ar { if (argc < 3 || argc > 5 || strncmp(types, "is", 2)) return 1; - + const char* port_path = &argv[1]->s; using Raul::Atom; @@ -627,7 +627,7 @@ OSCEngineReceiver::_all_notes_off_cb(const char* path, const char* types, lo_arg * <p> \b /ingen/midi_learn - Initiate MIDI learn for a given (MIDI Control) Node * \arg \b response-id (integer) * \arg \b node-path (string) - Patch of the Node that should learn the next MIDI event. - * + * * \li This of course will only do anything for MIDI control nodes. The node will learn the next MIDI * event that arrives at it's MIDI input port - no behind the scenes voodoo happens here. It is planned * that a plugin specification supporting arbitrary OSC commands for plugins will exist one day, and this @@ -637,7 +637,7 @@ int OSCEngineReceiver::_midi_learn_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) { const char* patch_path = &argv[1]->s; - + midi_learn(patch_path); return 0; } @@ -658,9 +658,9 @@ OSCEngineReceiver::_variable_set_cb(const char* path, const char* types, lo_arg* const char* object_path = &argv[1]->s; const char* key = &argv[2]->s; - + Raul::Atom value = Raul::AtomLiblo::lo_arg_to_atom(types[3], argv[3]); - + set_variable(object_path, key, value); return 0; } @@ -681,9 +681,9 @@ OSCEngineReceiver::_property_set_cb(const char* path, const char* types, lo_arg* const char* object_path = &argv[1]->s; const char* key = &argv[2]->s; - + Raul::Atom value = Raul::AtomLiblo::lo_arg_to_atom(types[3], argv[3]); - + set_property(object_path, key, value); return 0; } @@ -774,7 +774,7 @@ int OSCEngineReceiver::generic_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg, void* user_data) { printf("[OSCMsg] %s (%s)\t", path, types); - + for (int i=0; i < argc; ++i) { lo_arg_pp(lo_type(types[i]), argv[i]); printf("\t"); diff --git a/src/engine/OSCEngineReceiver.hpp b/src/engine/OSCEngineReceiver.hpp index 816d9542..3465d9cc 100644 --- a/src/engine/OSCEngineReceiver.hpp +++ b/src/engine/OSCEngineReceiver.hpp @@ -1,15 +1,15 @@ /* 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 @@ -76,7 +76,7 @@ private: ReceiveThread* _receive_thread; - static void error_cb(int num, const char* msg, const char* path); + static void error_cb(int num, const char* msg, const char* path); static int set_response_address_cb(LO_HANDLER_ARGS, void* myself); static int generic_cb(LO_HANDLER_ARGS, void* myself); static int unknown_cb(LO_HANDLER_ARGS, void* myself); diff --git a/src/engine/ObjectSender.cpp b/src/engine/ObjectSender.cpp index 0f8f10b6..b86df5a7 100644 --- a/src/engine/ObjectSender.cpp +++ b/src/engine/ObjectSender.cpp @@ -1,15 +1,15 @@ /* 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 @@ -43,7 +43,7 @@ ObjectSender::send_object(ClientInterface* client, const GraphObjectImpl* object send_patch(client, patch, recursive); return; } - + const NodeImpl* node = dynamic_cast<const NodeImpl*>(object); if (node) { send_node(client, node, recursive); @@ -66,12 +66,12 @@ ObjectSender::send_patch(ClientInterface* client, const PatchImpl* patch, bool r client->new_patch(patch->path(), patch->internal_polyphony()); client->set_variable(patch->path(), "ingen:polyphonic", bool(patch->polyphonic())); - + // Send variable const GraphObjectImpl::Properties& data = patch->variables(); for (GraphObjectImpl::Properties::const_iterator j = data.begin(); j != data.end(); ++j) client->set_variable(patch->path(), (*j).first, (*j).second); - + client->set_variable(patch->path(), "ingen:enabled", (bool)patch->enabled()); if (recursive) { @@ -79,7 +79,7 @@ ObjectSender::send_patch(ClientInterface* client, const PatchImpl* patch, bool r // Send nodes for (Raul::List<NodeImpl*>::const_iterator j = patch->nodes().begin(); j != patch->nodes().end(); ++j) { - const NodeImpl* const node = (*j); + const NodeImpl* const node = (*j); send_node(client, node, true, false); } @@ -94,7 +94,7 @@ ObjectSender::send_patch(ClientInterface* client, const PatchImpl* patch, bool r j != patch->connections().end(); ++j) client->connect((*j)->src_port_path(), (*j)->dst_port_path()); } - + if (bundle) client->transfer_end(); } @@ -115,29 +115,29 @@ ObjectSender::send_node(ClientInterface* client, const NodeImpl* node, bool recu cerr << "Node " << node->path() << " plugin has no URI! Not sending." << endl; return; } - + if (bundle) client->transfer_begin(); - + client->new_node(node->path(), node->plugin()->uri()); client->set_variable(node->path(), "ingen:polyphonic", bool(node->polyphonic())); - + // Send variables const GraphObjectImpl::Properties& data = node->variables(); for (GraphObjectImpl::Properties::const_iterator j = data.begin(); j != data.end(); ++j) client->set_variable(node->path(), (*j).first, (*j).second); - + // Send properties const GraphObjectImpl::Properties& prop = node->properties(); for (GraphObjectImpl::Properties::const_iterator j = prop.begin(); j != prop.end(); ++j) client->set_property(node->path(), (*j).first, (*j).second); - + if (recursive) { // Send ports for (size_t j=0; j < node->num_ports(); ++j) send_port(client, node->port_impl(j), false); } - + if (bundle) client->transfer_end(); } @@ -147,7 +147,7 @@ void ObjectSender::send_port(ClientInterface* client, const PortImpl* port, bool bundle) { assert(port); - + if (bundle) client->bundle_begin(); @@ -155,24 +155,24 @@ ObjectSender::send_port(ClientInterface* client, const PortImpl* port, bool bund PatchImpl* graph_parent = dynamic_cast<PatchImpl*>(port->parent_node()); if (graph_parent && graph_parent->internal_polyphony() > 1) client->set_variable(port->path(), "ingen:polyphonic", bool(port->polyphonic())); - + // Send variable const GraphObjectImpl::Properties& data = port->variables(); for (GraphObjectImpl::Properties::const_iterator j = data.begin(); j != data.end(); ++j) client->set_variable(port->path(), (*j).first, (*j).second); - + // Send properties const GraphObjectImpl::Properties& prop = port->properties(); for (GraphObjectImpl::Properties::const_iterator j = prop.begin(); j != prop.end(); ++j) client->set_property(port->path(), (*j).first, (*j).second); - + // Send control value if (port->type() == DataType::CONTROL) { const Sample value = dynamic_cast<const AudioBuffer*>(port->buffer(0))->value_at(0); //cerr << port->path() << " sending default value " << default_value << endl; client->set_port_value(port->path(), value); } - + if (bundle) client->bundle_end(); } diff --git a/src/engine/ObjectSender.hpp b/src/engine/ObjectSender.hpp index db10e8fc..d356dee3 100644 --- a/src/engine/ObjectSender.hpp +++ b/src/engine/ObjectSender.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/OutputPort.cpp b/src/engine/OutputPort.cpp index b0af3f6e..6cebf005 100644 --- a/src/engine/OutputPort.cpp +++ b/src/engine/OutputPort.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/OutputPort.hpp b/src/engine/OutputPort.hpp index 6e36d021..ea84c6e7 100644 --- a/src/engine/OutputPort.hpp +++ b/src/engine/OutputPort.hpp @@ -1,15 +1,15 @@ /* 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 @@ -49,7 +49,7 @@ public: void pre_process(ProcessContext& context); void post_process(ProcessContext& context); - + virtual ~OutputPort() {} bool is_input() const { return false; } diff --git a/src/engine/PatchImpl.cpp b/src/engine/PatchImpl.cpp index ac053f31..18259816 100644 --- a/src/engine/PatchImpl.cpp +++ b/src/engine/PatchImpl.cpp @@ -1,15 +1,15 @@ /* 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 @@ -36,7 +36,7 @@ namespace Ingen { using namespace Shared; -PatchImpl::PatchImpl(Engine& engine, const string& path, uint32_t poly, PatchImpl* parent, SampleRate srate, size_t buffer_size, uint32_t internal_poly) +PatchImpl::PatchImpl(Engine& engine, const string& path, uint32_t poly, PatchImpl* parent, SampleRate srate, size_t buffer_size, uint32_t internal_poly) : NodeBase(new PatchPlugin("http://example.org/FIXME", "patch", "Ingen Patch"), path, poly, parent, srate, buffer_size) , _engine(engine) @@ -51,7 +51,7 @@ PatchImpl::PatchImpl(Engine& engine, const string& path, uint32_t poly, PatchImp PatchImpl::~PatchImpl() { assert(!_activated); - + delete _compiled_patch; } @@ -63,7 +63,7 @@ PatchImpl::activate() for (List<NodeImpl*>::iterator i = _nodes.begin(); i != _nodes.end(); ++i) (*i)->activate(); - + assert(_activated); } @@ -72,9 +72,9 @@ void PatchImpl::deactivate() { if (_activated) { - + NodeBase::deactivate(); - + for (List<NodeImpl*>::iterator i = _nodes.begin(); i != _nodes.end(); ++i) { if ((*i)->activated()) (*i)->deactivate(); @@ -96,7 +96,7 @@ PatchImpl::disable() (*i)->clear_buffers(); } - + bool PatchImpl::prepare_internal_poly(uint32_t poly) { @@ -106,7 +106,7 @@ PatchImpl::prepare_internal_poly(uint32_t poly) for (List<NodeImpl*>::iterator i = _nodes.begin(); i != _nodes.end(); ++i) (*i)->prepare_poly(poly); - + for (Connections::iterator i = _connections.begin(); i != _connections.end(); ++i) ((ConnectionImpl*)i->get())->prepare_poly(poly); @@ -125,15 +125,15 @@ PatchImpl::apply_internal_poly(Raul::Maid& maid, uint32_t poly) for (List<NodeImpl*>::iterator i = _nodes.begin(); i != _nodes.end(); ++i) (*i)->apply_poly(maid, poly); - + _internal_poly = poly; - + return true; } /** Run the patch for the specified number of frames. - * + * * Calls all Nodes in (roughly, if parallel) the order _compiled_patch specifies. */ void @@ -141,9 +141,9 @@ PatchImpl::process(ProcessContext& context) { if (!_process) return; - + NodeBase::pre_process(context); - + /*if (_ports) for (size_t i=0; i < _ports->size(); ++i) if (_ports->at(i)->is_input() && _ports->at(i)->type() == DataType::MIDI) @@ -182,7 +182,7 @@ PatchImpl::process_parallel(ProcessContext& context) for (size_t i=0; i < n_slaves; ++i) _engine.process_slaves()[i]->whip(cp, i+1, context); } - + /* Process ourself until everything is done * This is analogous to ProcessSlave::_whipped(), but this is the master @@ -220,7 +220,7 @@ PatchImpl::process_parallel(ProcessContext& context) index = (index + 1) % cp->size(); } - + /* Tell slaves we're done in case we beat them, and pray they're * really done by the start of next cycle. * FIXME: This probably breaks (race) at extremely small nframes where @@ -230,7 +230,7 @@ PatchImpl::process_parallel(ProcessContext& context) _engine.process_slaves()[i]->finish(); } - + void PatchImpl::process_single(ProcessContext& context) { @@ -239,14 +239,14 @@ PatchImpl::process_single(ProcessContext& context) for (size_t i=0; i < cp->size(); ++i) (*cp)[i].node()->process(context); } - + void PatchImpl::set_buffer_size(size_t size) { NodeBase::set_buffer_size(size); assert(_buffer_size == size); - + CompiledPatch* const cp = _compiled_patch; for (size_t i=0; i < cp->size(); ++i) @@ -268,7 +268,7 @@ PatchImpl::add_node(List<NodeImpl*>::Node* ln) assert(ln->elem() != NULL); assert(ln->elem()->parent_patch() == this); //assert(ln->elem()->polyphony() == _internal_poly); - + _nodes.push_back(ln); } @@ -283,7 +283,7 @@ PatchImpl::remove_node(const string& symbol) for (List<NodeImpl*>::iterator i = _nodes.begin(); i != _nodes.end(); ++i) if ((*i)->symbol() == symbol) return _nodes.erase(i); - + return NULL; } @@ -311,7 +311,7 @@ PatchImpl::remove_connection(const PortImpl* src_port, const PortImpl* dst_port) return connection; } - + bool PatchImpl::has_connection(const PortImpl* src_port, const PortImpl* dst_port) const @@ -416,10 +416,10 @@ PatchImpl::build_ports_array() const Raul::Array<PortImpl*>* const result = new Raul::Array<PortImpl*>(_input_ports.size() + _output_ports.size()); size_t i = 0; - + for (List<PortImpl*>::const_iterator p = _input_ports.begin(); p != _input_ports.end(); ++p,++i) result->at(i) = *p; - + for (List<PortImpl*>::const_iterator p = _output_ports.begin(); p != _output_ports.end(); ++p,++i) result->at(i) = *p; @@ -445,24 +445,24 @@ PatchImpl::compile() const //cerr << "*********** Compiling " << path() << endl; CompiledPatch* const compiled_patch = new CompiledPatch();//_nodes.size()); - + for (Nodes::const_iterator i = _nodes.begin(); i != _nodes.end(); ++i) (*i)->traversed(false); - + for (Nodes::const_iterator i = _nodes.begin(); i != _nodes.end(); ++i) { NodeImpl* const node = (*i); // Either a sink or connected to our output ports: if ( ( ! node->traversed()) && node->dependants()->size() == 0) compile_recursive(node, compiled_patch); } - + // Traverse any nodes we didn't hit yet for (Nodes::const_iterator i = _nodes.begin(); i != _nodes.end(); ++i) { NodeImpl* const node = (*i); if ( ! node->traversed()) compile_recursive(node, compiled_patch); } - + /*cerr << "----------------------------------------\n"; for (size_t i=0; i < process_order->size(); ++i) { assert(process_order->at(i)); diff --git a/src/engine/PatchImpl.hpp b/src/engine/PatchImpl.hpp index 17600c4c..3f05e6df 100644 --- a/src/engine/PatchImpl.hpp +++ b/src/engine/PatchImpl.hpp @@ -1,15 +1,15 @@ /* 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 @@ -61,16 +61,16 @@ public: void deactivate(); void process(ProcessContext& context); - + void set_buffer_size(size_t size); - + /** Prepare for a new (internal) polyphony value. * * Preprocessor thread, poly is actually applied by apply_internal_poly. * \return true on success. */ bool prepare_internal_poly(uint32_t poly); - + /** Apply a new (internal) polyphony value. * * Audio thread. @@ -79,42 +79,42 @@ public: * \param maid Any objects no longer needed will be pushed to this */ bool apply_internal_poly(Raul::Maid& maid, uint32_t poly); - + // Patch specific stuff not inherited from Node - + typedef Raul::List<NodeImpl*> Nodes; - + void add_node(Nodes::Node* tn); Nodes::Node* remove_node(const std::string& name); Nodes& nodes() { return _nodes; } Connections& connections() { return _connections; } - + const Nodes& nodes() const { return _nodes; } const Connections& connections() const { return _connections; } - + uint32_t num_ports() const; - + PortImpl* create_port(const std::string& name, Shared::DataType type, size_t buffer_size, bool is_output); void add_input(Raul::List<PortImpl*>::Node* port) { _input_ports.push_back(port); } ///< Preprocesser thread void add_output(Raul::List<PortImpl*>::Node* port) { _output_ports.push_back(port); } ///< Preprocessor thread Raul::List<PortImpl*>::Node* remove_port(const std::string& name); void clear_ports(); - + void add_connection(Connections::Node* c) { _connections.push_back(c); } Connections::Node* remove_connection(const PortImpl* src_port, const PortImpl* dst_port); - + bool has_connection(const PortImpl* src_port, const PortImpl* dst_port) const; - + CompiledPatch* compiled_patch() { return _compiled_patch; } void compiled_patch(CompiledPatch* cp) { _compiled_patch = cp; } - + Raul::Array<PortImpl*>* external_ports() { return _ports; } void external_ports(Raul::Array<PortImpl*>* pa) { _ports = pa; } CompiledPatch* compile() const; Raul::Array<PortImpl*>* build_ports_array() const; - + /** Whether to run this patch's DSP bits in the audio thread */ bool enabled() const { return _process; } void enable() { _process = true; } @@ -148,7 +148,7 @@ PatchImpl::compile_recursive(NodeImpl* n, CompiledPatch* output) const n->traversed(true); assert(output != NULL); - + for (Raul::List<NodeImpl*>::iterator i = n->providers()->begin(); i != n->providers()->end(); ++i) if ( ! (*i)->traversed() ) compile_recursive((*i), output); diff --git a/src/engine/PatchPlugin.hpp b/src/engine/PatchPlugin.hpp index 068329d0..6ead1ec0 100644 --- a/src/engine/PatchPlugin.hpp +++ b/src/engine/PatchPlugin.hpp @@ -1,15 +1,15 @@ /* 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 @@ -40,7 +40,7 @@ public: const std::string& name) : PluginImpl(Plugin::Patch, uri) {} - + NodeImpl* instantiate(const std::string& name, bool polyphonic, Ingen::PatchImpl* parent, @@ -48,7 +48,7 @@ public: { return NULL; } - + const std::string symbol() const { return "patch"; } const std::string name() const { return "Ingen Patch"; } diff --git a/src/engine/PluginImpl.cpp b/src/engine/PluginImpl.cpp index 7370defc..f37de694 100644 --- a/src/engine/PluginImpl.cpp +++ b/src/engine/PluginImpl.cpp @@ -1,15 +1,15 @@ /* 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 @@ -38,7 +38,7 @@ PluginImpl::load() } } - + void PluginImpl::unload() { diff --git a/src/engine/PluginImpl.hpp b/src/engine/PluginImpl.hpp index 40f9c91f..4d56df01 100644 --- a/src/engine/PluginImpl.hpp +++ b/src/engine/PluginImpl.hpp @@ -1,15 +1,15 @@ /* 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 @@ -49,19 +49,19 @@ public: , _library_path(library_path) , _module(NULL) {} - + virtual NodeImpl* instantiate(const std::string& name, bool polyphonic, Ingen::PatchImpl* parent, Engine& engine) = 0; - + virtual const std::string symbol() const = 0; - + virtual const std::string& library_path() const { return _library_path; } - + void load(); void unload(); - + Plugin::Type type() const { return _type; } void type(Plugin::Type t) { _type = t; } Glib::Module* module() const { return _module; } diff --git a/src/engine/PortImpl.cpp b/src/engine/PortImpl.cpp index 9c819e23..d207928f 100644 --- a/src/engine/PortImpl.cpp +++ b/src/engine/PortImpl.cpp @@ -1,15 +1,15 @@ /* 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 @@ -64,7 +64,7 @@ PortImpl::PortImpl(NodeImpl* const node, _polyphonic = false; else _polyphonic = true; - + if (type == DataType::EVENT) _broadcast = true; // send activity blips @@ -81,7 +81,7 @@ PortImpl::~PortImpl() delete _buffers; } - + bool PortImpl::set_polyphonic(Raul::Maid& maid, bool p) { @@ -129,7 +129,7 @@ PortImpl::apply_poly(Raul::Maid& maid, uint32_t poly) return true; } - + void PortImpl::allocate_buffers() @@ -162,14 +162,14 @@ PortImpl::connect_buffers() PortImpl::parent_node()->set_port_buffer(i, _index, buffer(i)); } - + void PortImpl::clear_buffers() { for (uint32_t i=0; i < _poly; ++i) buffer(i)->clear(); } - + void PortImpl::broadcast_value(ProcessContext& context, bool force) diff --git a/src/engine/PortImpl.hpp b/src/engine/PortImpl.hpp index d3aad1c3..a39d9358 100644 --- a/src/engine/PortImpl.hpp +++ b/src/engine/PortImpl.hpp @@ -1,15 +1,15 @@ /* 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 @@ -53,15 +53,15 @@ public: /** A port's parent is always a node, so static cast should be safe */ NodeImpl* parent_node() const { return (NodeImpl*)_parent; } - + bool set_polyphonic(Raul::Maid& maid, bool p); - + /** Prepare for a new (external) polyphony value. * * Preprocessor thread, poly is actually applied by apply_poly. */ virtual bool prepare_poly(uint32_t poly); - + /** Apply a new polyphony value. * * Audio thread. @@ -69,7 +69,7 @@ public: * \a poly Must be < the most recent value passed to prepare_poly. */ virtual bool apply_poly(Raul::Maid& maid, uint32_t poly); - + const Raul::Atom& value() const { return _value; } void set_value(const Raul::Atom& v) { _value = v; } @@ -90,7 +90,7 @@ public: virtual void pre_process(ProcessContext& context) = 0; virtual void process(ProcessContext& context) {}; virtual void post_process(ProcessContext& context) = 0; - + /** Empty buffer contents completely (ie silence) */ virtual void clear_buffers(); @@ -105,10 +105,10 @@ public: } virtual void set_buffer_size(size_t size); - + void fixed_buffers(bool b) { _fixed_buffers = b; } bool fixed_buffers() { return _fixed_buffers; } - + void broadcast(bool b) { _broadcast = b; } bool broadcast() { return _broadcast; } @@ -127,7 +127,7 @@ protected: Shared::DataType type, const Raul::Atom& value, size_t buffer_size); - + virtual void allocate_buffers(); virtual void connect_buffers(); virtual void broadcast(ProcessContext& context); diff --git a/src/engine/PostProcessor.cpp b/src/engine/PostProcessor.cpp index 1595ac38..0d525424 100644 --- a/src/engine/PostProcessor.cpp +++ b/src/engine/PostProcessor.cpp @@ -1,15 +1,15 @@ /* 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 @@ -51,7 +51,7 @@ PostProcessor::process() * broadcast event which will segfault if executed afterwards. * If it's the other way around, broadcasts will be sent for * ports the client doesn't even know about yet... */ - + /* FIXME: process events from all threads if parallel */ /* Process audio thread generated events */ diff --git a/src/engine/PostProcessor.hpp b/src/engine/PostProcessor.hpp index bf4f557b..071b6ecf 100644 --- a/src/engine/PostProcessor.hpp +++ b/src/engine/PostProcessor.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/ProcessContext.hpp b/src/engine/ProcessContext.hpp index daf04463..158127d3 100644 --- a/src/engine/ProcessContext.hpp +++ b/src/engine/ProcessContext.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/ProcessSlave.cpp b/src/engine/ProcessSlave.cpp index 3b29d61b..fcbc047f 100644 --- a/src/engine/ProcessSlave.cpp +++ b/src/engine/ProcessSlave.cpp @@ -1,15 +1,15 @@ /* 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 @@ -43,15 +43,15 @@ ProcessSlave::_whipped() size_t num_finished = 0; // Number of consecutive finished nodes hit while (_state == STATE_RUNNING) { - + CompiledNode& n = (*cp)[_index]; - + if (n.node()->process_lock()) { n.node()->wait_for_input(n.n_providers()); n.node()->process(_process_context); - + /* Signal dependants their input is ready */ for (size_t i=0; i < n.dependants().size(); ++i) n.dependants()[i]->signal_input_ready(); @@ -60,13 +60,13 @@ ProcessSlave::_whipped() } else { ++num_finished; } - + _index = (_index + 1) % cp->size(); if (num_finished >= cp->size()) break; } - + _index = 0; _compiled_patch = NULL; _state = STATE_FINISHED; diff --git a/src/engine/ProcessSlave.hpp b/src/engine/ProcessSlave.hpp index 22c387c0..075fc411 100644 --- a/src/engine/ProcessSlave.hpp +++ b/src/engine/ProcessSlave.hpp @@ -1,15 +1,15 @@ /* 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 @@ -43,13 +43,13 @@ public: ss << "Process Slave "; ss << _id; set_name(ss.str()); - + start(); - + if (realtime) set_scheduling(SCHED_FIFO, 40); } - + ~ProcessSlave() { stop(); } @@ -72,7 +72,7 @@ public: inline uint32_t id() const { return _id; } inline const ProcessContext& context() const { return _process_context; } inline ProcessContext& context() { return _process_context; } - + private: void _whipped(); diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp index 1ac41f38..2a42569a 100644 --- a/src/engine/QueuedEngineInterface.cpp +++ b/src/engine/QueuedEngineInterface.cpp @@ -1,15 +1,15 @@ /* 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 @@ -117,19 +117,19 @@ QueuedEngineInterface::activate() void -QueuedEngineInterface::deactivate() +QueuedEngineInterface::deactivate() { push_queued(new DeactivateEvent(_engine, _responder, now())); } void -QueuedEngineInterface::quit() +QueuedEngineInterface::quit() { _responder->respond_ok(); _engine.quit(); } - + // Bundle commands @@ -146,7 +146,7 @@ QueuedEngineInterface::bundle_end() _in_bundle = false; } - + // Object commands bool @@ -203,7 +203,7 @@ QueuedEngineInterface::clear_patch(const Path& patch_path) push_queued(new ClearPatchEvent(_engine, _responder, now(), this, patch_path)); } - + void QueuedEngineInterface::connect(const Path& src_port_path, const Path& dst_port_path) @@ -270,7 +270,7 @@ QueuedEngineInterface::set_variable(const URI& path, push_queued(new SetMetadataEvent(_engine, _responder, now(), false, path, predicate, value)); } - + void QueuedEngineInterface::set_property(const URI& path, const URI& predicate, diff --git a/src/engine/QueuedEngineInterface.hpp b/src/engine/QueuedEngineInterface.hpp index b4577850..299f1269 100644 --- a/src/engine/QueuedEngineInterface.hpp +++ b/src/engine/QueuedEngineInterface.hpp @@ -1,15 +1,15 @@ /* 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 @@ -49,9 +49,9 @@ class QueuedEngineInterface : public QueuedEventSource, public Shared::EngineInt public: QueuedEngineInterface(Engine& engine, size_t queue_size); virtual ~QueuedEngineInterface() {} - + Raul::URI uri() const { return "ingen:internal"; } - + void set_next_response_id(int32_t id); // Client registration @@ -63,67 +63,67 @@ public: virtual void activate(); virtual void deactivate(); virtual void quit(); - + // Bundles virtual void bundle_begin(); virtual void bundle_end(); - + // CommonInterface object commands - + virtual bool new_object(const Shared::GraphObject* object); virtual void new_patch(const Raul::Path& path, uint32_t poly); - + virtual void new_node(const Raul::Path& path, const Raul::URI& plugin_uri); - + virtual void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output); - + virtual void rename(const Raul::Path& old_path, const Raul::Path& new_path); - + virtual void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void set_variable(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_port_value(const Raul::Path& port_path, const Raul::Atom& value); - + virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value); - + virtual void destroy(const Raul::Path& path); - + virtual void clear_patch(const Raul::Path& patch_path); - + // EngineInterface object commands - + virtual void disconnect_all(const Raul::Path& parent_patch_path, const Raul::Path& path); - + virtual void set_program(const Raul::Path& node_path, uint32_t bank, uint32_t program); virtual void midi_learn(const Raul::Path& node_path); - + // Requests // - + virtual void ping(); virtual void request_plugin(const Raul::URI& uri); virtual void request_object(const Raul::Path& path); @@ -133,7 +133,7 @@ public: virtual void request_all_objects(); protected: - + virtual void disable_responses(); SharedPtr<Responder> _responder; ///< NULL if responding disabled diff --git a/src/engine/QueuedEvent.cpp b/src/engine/QueuedEvent.cpp index 8ed6fa02..d102b8df 100644 --- a/src/engine/QueuedEvent.cpp +++ b/src/engine/QueuedEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -44,7 +44,7 @@ QueuedEvent::execute(ProcessContext& context) Event::execute(context); } - + } // namespace Ingen diff --git a/src/engine/QueuedEvent.hpp b/src/engine/QueuedEvent.hpp index e616d269..35eb1c82 100644 --- a/src/engine/QueuedEvent.hpp +++ b/src/engine/QueuedEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -52,11 +52,11 @@ public: bool is_blocking() { return _blocking; } bool is_prepared() { return _pre_processed; } - + protected: QueuedEvent(Engine& engine, SharedPtr<Responder> responder, - FrameTime time, + FrameTime time, bool blocking = false, QueuedEventSource* source = NULL) : Event(engine, responder, time) @@ -65,7 +65,7 @@ protected: if (blocking) assert(_source); } - + // NULL event base (for internal events only!) QueuedEvent(Engine& engine) : Event(engine, SharedPtr<Responder>(), 0) diff --git a/src/engine/QueuedEventSource.cpp b/src/engine/QueuedEventSource.cpp index af9b270e..bf7cbf53 100644 --- a/src/engine/QueuedEventSource.cpp +++ b/src/engine/QueuedEventSource.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -66,7 +66,7 @@ void QueuedEventSource::process(PostProcessor& dest, ProcessContext& context) { assert(ThreadManager::current_thread_id() == THREAD_PROCESS); - + if (_events.empty()) return; @@ -75,7 +75,7 @@ QueuedEventSource::process(PostProcessor& dest, ProcessContext& context) * choked by events coming in faster than they can be processed. * FIXME: test this and figure out a good value */ const size_t MAX_QUEUED_EVENTS = context.nframes() / 32; - + size_t num_events_processed = 0; QueuedEvent* ev = (QueuedEvent*)_events.front(); @@ -112,7 +112,7 @@ QueuedEventSource::_whipped() assert(ev); if (!ev) return; - + assert(!ev->is_prepared()); ev->pre_process(); assert(ev->is_prepared()); diff --git a/src/engine/QueuedEventSource.hpp b/src/engine/QueuedEventSource.hpp index 3054d910..cdcd1fa7 100644 --- a/src/engine/QueuedEventSource.hpp +++ b/src/engine/QueuedEventSource.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -52,7 +52,7 @@ public: void deactivate_source() { Slave::stop(); } void process(PostProcessor& dest, ProcessContext& context); - + /** Signal that the blocking event is finished. * When this is called preparing will resume. This MUST be called by * blocking events in their post_process() method. */ @@ -62,7 +62,7 @@ protected: void push_queued(QueuedEvent* const ev); inline bool unprepared_events() { return (_prepared_back.get() != NULL); } - + virtual void _whipped(); ///< Prepare 1 event private: diff --git a/src/engine/Responder.hpp b/src/engine/Responder.hpp index 1cff0d8c..a2e8c44f 100644 --- a/src/engine/Responder.hpp +++ b/src/engine/Responder.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/ThreadManager.hpp b/src/engine/ThreadManager.hpp index 199f80bb..96397a30 100644 --- a/src/engine/ThreadManager.hpp +++ b/src/engine/ThreadManager.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events.hpp b/src/engine/events.hpp index b8a344de..b9115875 100644 --- a/src/engine/events.hpp +++ b/src/engine/events.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/AllNotesOffEvent.cpp b/src/engine/events/AllNotesOffEvent.cpp index 0057c456..7a0dd71f 100644 --- a/src/engine/events/AllNotesOffEvent.cpp +++ b/src/engine/events/AllNotesOffEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -53,7 +53,7 @@ AllNotesOffEvent::execute(ProcessContext& context) if (!_patch) _patch = _engine.engine_store()->find_patch(_patch_path); - + //if (_patch != NULL) // for (Raul::List<MidiInNode*>::iterator j = _patch->midi_in_nodes().begin(); j != _patch->midi_in_nodes().end(); ++j) // (*j)->all_notes_off(offset); diff --git a/src/engine/events/AllNotesOffEvent.hpp b/src/engine/events/AllNotesOffEvent.hpp index 41f7e25b..a9b58c98 100644 --- a/src/engine/events/AllNotesOffEvent.hpp +++ b/src/engine/events/AllNotesOffEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -34,7 +34,7 @@ class AllNotesOffEvent : public Event public: AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, PatchImpl* patch); AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Raul::Path& patch_path); - + void execute(ProcessContext& context); void post_process(); diff --git a/src/engine/events/ClearPatchEvent.cpp b/src/engine/events/ClearPatchEvent.cpp index e68ee271..0fb6046b 100644 --- a/src/engine/events/ClearPatchEvent.cpp +++ b/src/engine/events/ClearPatchEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -53,7 +53,7 @@ void ClearPatchEvent::pre_process() { EngineStore::Objects::iterator patch_iterator = _engine.engine_store()->find(_patch_path); - + if (patch_iterator != _engine.engine_store()->end()) { _patch = PtrCast<PatchImpl>(patch_iterator->second); if (_patch) { @@ -65,7 +65,7 @@ ClearPatchEvent::pre_process() _ports_array = _patch->build_ports_array(); if (_patch->enabled()) _compiled_patch = _patch->compile(); - + // Remove driver ports if (_patch->parent() == NULL) { size_t port_count = 0; @@ -92,18 +92,18 @@ ClearPatchEvent::execute(ProcessContext& context) if (_patch && _removed_table) { _patch->disable(); - + if (_patch->compiled_patch() != NULL) { _engine.maid()->push(_patch->compiled_patch()); _patch->compiled_patch(NULL); } - + _patch->connections().clear(); _patch->compiled_patch(_compiled_patch); Raul::Array<PortImpl*>* old_ports = _patch->external_ports(); _patch->external_ports(_ports_array); _ports_array = old_ports; - + // Remove driver ports if (_patch->parent() == NULL) { for (EngineStore::Objects::iterator i = _removed_table->begin(); @@ -124,10 +124,10 @@ ClearPatchEvent::execute(ProcessContext& context) void ClearPatchEvent::post_process() -{ +{ if (_patch != NULL) { delete _ports_array; - + // Restore patch's run state if (_process) _patch->enable(); @@ -138,7 +138,7 @@ ClearPatchEvent::post_process() assert(_patch->nodes().size() == 0); assert(_patch->num_ports() == 0); assert(_patch->connections().size() == 0); - + // Reply _responder->respond_ok(); _engine.broadcaster()->send_clear_patch(_patch_path); @@ -158,7 +158,7 @@ ClearPatchEvent::post_process() } else { _responder->respond_error(string("Patch ") + _patch_path.str() + " not found"); } - + _source->unblock(); // FIXME: can be done earlier in execute? } diff --git a/src/engine/events/ClearPatchEvent.hpp b/src/engine/events/ClearPatchEvent.hpp index 42b06658..c5cba705 100644 --- a/src/engine/events/ClearPatchEvent.hpp +++ b/src/engine/events/ClearPatchEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -39,7 +39,7 @@ class ClearPatchEvent : public QueuedEvent { public: ClearPatchEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const Raul::Path& patch_path); - + void pre_process(); void execute(ProcessContext& context); void post_process(); @@ -50,10 +50,10 @@ private: bool _process; Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports for Patch CompiledPatch* _compiled_patch; ///< Patch's new process order - + typedef Raul::Array<Raul::List<DriverPort*>::Node*> DriverPorts; DriverPorts* _driver_ports; - + SharedPtr< Raul::Table<Raul::Path, SharedPtr<Shared::GraphObject> > > _removed_table; }; diff --git a/src/engine/events/ConnectionEvent.cpp b/src/engine/events/ConnectionEvent.cpp index 6a55f35b..ef5d5d00 100644 --- a/src/engine/events/ConnectionEvent.cpp +++ b/src/engine/events/ConnectionEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -64,10 +64,10 @@ ConnectionEvent::pre_process() QueuedEvent::pre_process(); return; } - + _src_port = _engine.engine_store()->find_port(_src_port_path); _dst_port = _engine.engine_store()->find_port(_dst_port_path); - + if (_src_port == NULL || _dst_port == NULL) { _error = PORT_NOT_FOUND; QueuedEvent::pre_process(); @@ -81,10 +81,10 @@ ConnectionEvent::pre_process() QueuedEvent::pre_process(); return; } - + _dst_input_port = dynamic_cast<InputPort*>(_dst_port); _src_output_port = dynamic_cast<OutputPort*>(_src_port); - + if (!_dst_input_port || !_src_output_port) { _error = DIRECTION_MISMATCH; QueuedEvent::pre_process(); @@ -102,18 +102,18 @@ ConnectionEvent::pre_process() _patch = dynamic_cast<PatchImpl*>(dst_node); else _patch = dynamic_cast<PatchImpl*>(src_node); - + // Connection from a patch input to a patch output (pass through) } else if (src_node == dst_node && dynamic_cast<PatchImpl*>(src_node)) { _patch = dynamic_cast<PatchImpl*>(src_node); - + // Normal connection between nodes with the same parent } else { _patch = src_node->parent_patch(); } assert(_patch); - + if (_patch->has_connection(_src_output_port, _dst_input_port)) { _error = ALREADY_CONNECTED; QueuedEvent::pre_process(); @@ -125,7 +125,7 @@ ConnectionEvent::pre_process() QueuedEvent::pre_process(); return; } - + if (_patch != src_node && src_node->parent() != _patch && dst_node->parent() != _patch) { _error = PARENTS_NOT_FOUND; QueuedEvent::pre_process(); @@ -135,14 +135,14 @@ ConnectionEvent::pre_process() _connection = SharedPtr<ConnectionImpl>(new ConnectionImpl(_src_port, _dst_port)); _patch_listnode = new PatchImpl::Connections::Node(_connection); _port_listnode = new InputPort::Connections::Node(_connection); - + // Need to be careful about patch port connections here and adding a node's // parent as a dependant/provider, or adding a patch as it's own provider... if (src_node != dst_node && src_node->parent() == dst_node->parent()) { dst_node->providers()->push_back(new Raul::List<NodeImpl*>::Node(src_node)); src_node->dependants()->push_back(new Raul::List<NodeImpl*>::Node(dst_node)); } - + _patch->add_connection(_patch_listnode); if (_patch->enabled()) diff --git a/src/engine/events/ConnectionEvent.hpp b/src/engine/events/ConnectionEvent.hpp index 53254e77..926c8ba8 100644 --- a/src/engine/events/ConnectionEvent.hpp +++ b/src/engine/events/ConnectionEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -30,7 +30,7 @@ namespace Raul { } namespace Ingen { - + class PatchImpl; class NodeImpl; class ConnectionImpl; @@ -55,8 +55,8 @@ public: void post_process(); private: - - enum ErrorType { + + enum ErrorType { NO_ERROR, PARENT_PATCH_DIFFERENT, PORT_NOT_FOUND, @@ -65,10 +65,10 @@ private: ALREADY_CONNECTED, PARENTS_NOT_FOUND }; - + Raul::Path _src_port_path; Raul::Path _dst_port_path; - + PatchImpl* _patch; PortImpl* _src_port; PortImpl* _dst_port; @@ -76,7 +76,7 @@ private: InputPort* _dst_input_port; CompiledPatch* _compiled_patch; ///< New process order for Patch - + SharedPtr<ConnectionImpl> _connection; PatchImpl::Connections::Node* _patch_listnode; InputPort::Connections::Node* _port_listnode; diff --git a/src/engine/events/CreateNodeEvent.cpp b/src/engine/events/CreateNodeEvent.cpp index e4663799..c38d24ad 100644 --- a/src/engine/events/CreateNodeEvent.cpp +++ b/src/engine/events/CreateNodeEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -78,18 +78,18 @@ CreateNodeEvent::pre_process() : _engine.node_factory()->plugin(_plugin_type, _plugin_lib, _plugin_label); if (_patch && plugin) { - + _node = plugin->instantiate(_path.name(), _polyphonic, _patch, _engine); - + if (_node != NULL) { _node->activate(); - + // This can be done here because the audio thread doesn't touch the // node tree - just the process order array _patch->add_node(new PatchImpl::Nodes::Node(_node)); //_node->add_to_store(_engine.engine_store()); _engine.engine_store()->add(_node); - + // FIXME: not really necessary to build process order since it's not connected, // just append to the list if (_patch->enabled()) diff --git a/src/engine/events/CreateNodeEvent.hpp b/src/engine/events/CreateNodeEvent.hpp index cba84cd0..e475ecb4 100644 --- a/src/engine/events/CreateNodeEvent.hpp +++ b/src/engine/events/CreateNodeEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -41,7 +41,7 @@ public: const Raul::Path& node_path, const Raul::URI& plugin_uri, bool poly); - + void pre_process(); void execute(ProcessContext& context); void post_process(); diff --git a/src/engine/events/CreatePatchEvent.cpp b/src/engine/events/CreatePatchEvent.cpp index 0b85dd89..5b83c3de 100644 --- a/src/engine/events/CreatePatchEvent.cpp +++ b/src/engine/events/CreatePatchEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -59,7 +59,7 @@ CreatePatchEvent::pre_process() QueuedEvent::pre_process(); return; } - + const Path& path = (const Path&)_path; _parent = _engine.engine_store()->find_patch(path.parent()); @@ -68,26 +68,26 @@ CreatePatchEvent::pre_process() QueuedEvent::pre_process(); return; } - + uint32_t poly = 1; if (_parent != NULL && _poly > 1 && _poly == static_cast<int>(_parent->internal_polyphony())) poly = _poly; - + _patch = new PatchImpl(_engine, path.name(), poly, _parent, _engine.audio_driver()->sample_rate(), _engine.audio_driver()->buffer_size(), _poly); - + if (_parent != NULL) { _parent->add_node(new PatchImpl::Nodes::Node(_patch)); if (_parent->enabled()) _compiled_patch = _parent->compile(); } - + _patch->activate(); - + // Insert into EngineStore //_patch->add_to_store(_engine.engine_store()); _engine.engine_store()->add(_patch); - + QueuedEvent::pre_process(); } diff --git a/src/engine/events/CreatePatchEvent.hpp b/src/engine/events/CreatePatchEvent.hpp index c2759341..9d21cc56 100644 --- a/src/engine/events/CreatePatchEvent.hpp +++ b/src/engine/events/CreatePatchEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -21,7 +21,7 @@ #include "QueuedEvent.hpp" namespace Ingen { - + class PatchImpl; class CompiledPatch; @@ -41,7 +41,7 @@ public: private: enum ErrorType { NO_ERROR, OBJECT_EXISTS, PARENT_NOT_FOUND, INVALID_POLY }; - + const Raul::Path _path; PatchImpl* _patch; PatchImpl* _parent; diff --git a/src/engine/events/CreatePortEvent.cpp b/src/engine/events/CreatePortEvent.cpp index 8e2230eb..b0f8273d 100644 --- a/src/engine/events/CreatePortEvent.cpp +++ b/src/engine/events/CreatePortEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -85,22 +85,22 @@ CreatePortEvent::pre_process() if (_patch != NULL) { assert(_patch->path() == _path.parent()); - + size_t buffer_size = 1; if (_type.str() != "ingen:Float") buffer_size = _engine.audio_driver()->buffer_size(); - + const uint32_t old_num_ports = _patch->num_ports(); _patch_port = _patch->create_port(_path.name(), _data_type, buffer_size, _is_output); - + if (_patch_port) { if (_is_output) _patch->add_output(new Raul::List<PortImpl*>::Node(_patch_port)); else _patch->add_input(new Raul::List<PortImpl*>::Node(_patch_port)); - + if (_patch->external_ports()) _ports_array = new Raul::Array<PortImpl*>(old_num_ports + 1, *_patch->external_ports()); else @@ -138,7 +138,7 @@ CreatePortEvent::execute(ProcessContext& context) _engine.maid()->push(_patch->external_ports()); _patch->external_ports(_ports_array); } - + if (_driver_port) { if (_type.str() == "lv2:AudioPort") { _engine.audio_driver()->add_port(_driver_port); @@ -146,7 +146,7 @@ CreatePortEvent::execute(ProcessContext& context) _engine.midi_driver()->add_port(_driver_port); } } - + if (_source) _source->unblock(); } diff --git a/src/engine/events/CreatePortEvent.hpp b/src/engine/events/CreatePortEvent.hpp index 1fe9b962..0c3e5cac 100644 --- a/src/engine/events/CreatePortEvent.hpp +++ b/src/engine/events/CreatePortEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -46,8 +46,8 @@ public: void post_process(); private: - - enum ErrorType { + + enum ErrorType { NO_ERROR, UNKNOWN_TYPE, CREATION_FAILED diff --git a/src/engine/events/DeactivateEvent.hpp b/src/engine/events/DeactivateEvent.hpp index eaa7e9cb..03d39721 100644 --- a/src/engine/events/DeactivateEvent.hpp +++ b/src/engine/events/DeactivateEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -34,7 +34,7 @@ public: DeactivateEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp) : QueuedEvent(engine, responder, timestamp) {} - + void post_process() { _responder->respond_ok(); _engine.deactivate(); diff --git a/src/engine/events/DestroyEvent.cpp b/src/engine/events/DestroyEvent.cpp index d5611f03..9832b715 100644 --- a/src/engine/events/DestroyEvent.cpp +++ b/src/engine/events/DestroyEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -70,7 +70,7 @@ DestroyEvent::pre_process() if (!_node) _port = PtrCast<PortImpl>(_store_iterator->second); } - + if (_store_iterator != _engine.engine_store()->end()) { _removed_table = _engine.engine_store()->remove(_store_iterator); } @@ -80,10 +80,10 @@ DestroyEvent::pre_process() _patch_node_listnode = _node->parent_patch()->remove_node(_path.name()); if (_patch_node_listnode) { assert(_patch_node_listnode->elem() == _node.get()); - + _disconnect_event = new DisconnectAllEvent(_engine, _node->parent_patch(), _node.get()); _disconnect_event->pre_process(); - + if (_node->parent_patch()->enabled()) { // FIXME: is this called multiple times? _compiled_patch = _node->parent_patch()->compile(); @@ -101,10 +101,10 @@ DestroyEvent::pre_process() _patch_port_listnode = _port->parent_patch()->remove_port(_path.name()); if (_patch_port_listnode) { assert(_patch_port_listnode->elem() == _port.get()); - + _disconnect_event = new DisconnectAllEvent(_engine, _port->parent_patch(), _port.get()); _disconnect_event->pre_process(); - + if (_port->parent_patch()->enabled()) { // FIXME: is this called multiple times? _compiled_patch = _port->parent_patch()->compile(); @@ -129,28 +129,28 @@ DestroyEvent::execute(ProcessContext& context) if (_disconnect_event) _disconnect_event->execute(context); - + if (_node->parent_patch()->compiled_patch()) _engine.maid()->push(_node->parent_patch()->compiled_patch()); _node->parent_patch()->compiled_patch(_compiled_patch); - + } else if (_patch_port_listnode) { assert(_port); if (_disconnect_event) _disconnect_event->execute(context); - + if (_port->parent_patch()->compiled_patch()) _engine.maid()->push(_port->parent_patch()->compiled_patch()); - + _port->parent_patch()->compiled_patch(_compiled_patch); - + if (_port->parent_patch()->external_ports()) _engine.maid()->push(_port->parent_patch()->external_ports()); - + _port->parent_patch()->external_ports(_ports_array); - + if ( ! _port->parent_patch()->parent()) { if (_port->type() == DataType::AUDIO) _driver_port = _engine.audio_driver()->remove_port(_port->path()); @@ -162,7 +162,7 @@ DestroyEvent::execute(ProcessContext& context) // _driver_port->elem()->unregister(); } } - + if (_source) _source->unblock(); } @@ -180,7 +180,7 @@ DestroyEvent::post_process() } } - if (_patch_node_listnode) { + if (_patch_node_listnode) { assert(_node); _node->deactivate(); _responder->respond_ok(); @@ -190,7 +190,7 @@ DestroyEvent::post_process() _engine.broadcaster()->send_destroyed(_path); _engine.broadcaster()->bundle_end(); _engine.maid()->push(_patch_node_listnode); - } else if (_patch_port_listnode) { + } else if (_patch_port_listnode) { assert(_port); _responder->respond_ok(); _engine.broadcaster()->bundle_begin(); diff --git a/src/engine/events/DestroyEvent.hpp b/src/engine/events/DestroyEvent.hpp index 791a74ae..940d46e7 100644 --- a/src/engine/events/DestroyEvent.hpp +++ b/src/engine/events/DestroyEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -62,7 +62,7 @@ private: Raul::Array<PortImpl*>* _ports_array; ///< New (external) ports for Patch CompiledPatch* _compiled_patch; ///< Patch's new process order DisconnectAllEvent* _disconnect_event; - + SharedPtr< Raul::Table<Raul::Path, SharedPtr<Shared::GraphObject> > > _removed_table; }; diff --git a/src/engine/events/DisablePortMonitoringEvent.cpp b/src/engine/events/DisablePortMonitoringEvent.cpp index 1c75f06c..6de1ffe9 100644 --- a/src/engine/events/DisablePortMonitoringEvent.cpp +++ b/src/engine/events/DisablePortMonitoringEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -57,7 +57,7 @@ DisablePortMonitoringEvent::execute(ProcessContext& context) if (_port != NULL && _port->type() == DataType::FLOAT) _value = ((AudioBuffer*)_port->buffer(0))->value_at(0/*_time - start*/); - else + else _port = NULL; // triggers error response #endif } diff --git a/src/engine/events/DisablePortMonitoringEvent.hpp b/src/engine/events/DisablePortMonitoringEvent.hpp index 2ac802f6..d6298332 100644 --- a/src/engine/events/DisablePortMonitoringEvent.hpp +++ b/src/engine/events/DisablePortMonitoringEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -22,7 +22,7 @@ #include "types.hpp" namespace Ingen { - + /** Disable sending of dynamic value change notifications for a port. * diff --git a/src/engine/events/DisconnectAllEvent.cpp b/src/engine/events/DisconnectAllEvent.cpp index 190ed878..a6c761be 100644 --- a/src/engine/events/DisconnectAllEvent.cpp +++ b/src/engine/events/DisconnectAllEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -80,21 +80,21 @@ DisconnectAllEvent::pre_process() { if (_lookup) { _parent = _engine.engine_store()->find_patch(_parent_path); - + if (_parent == NULL) { _error = PARENT_NOT_FOUND; QueuedEvent::pre_process(); return; } - + GraphObjectImpl* object = _engine.engine_store()->find_object(_path); - + if (object == NULL) { _error = OBJECT_NOT_FOUND; QueuedEvent::pre_process(); return; } - + if (object->parent_patch() != _parent && object->parent()->parent_patch() != _parent) { _error = INVALID_PARENT_PATH; QueuedEvent::pre_process(); @@ -134,8 +134,8 @@ DisconnectAllEvent::pre_process() } } } - - QueuedEvent::pre_process(); + + QueuedEvent::pre_process(); } diff --git a/src/engine/events/DisconnectAllEvent.hpp b/src/engine/events/DisconnectAllEvent.hpp index 5fff30d6..9dbe9d8a 100644 --- a/src/engine/events/DisconnectAllEvent.hpp +++ b/src/engine/events/DisconnectAllEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -49,7 +49,7 @@ public: void post_process(); private: - enum ErrorType { + enum ErrorType { NO_ERROR, INVALID_PARENT_PATH, PARENT_NOT_FOUND, @@ -62,7 +62,7 @@ private: NodeImpl* _node; PortImpl* _port; Raul::List<DisconnectionEvent*> _disconnection_events; - + bool _lookup; bool _disconnect_parent; diff --git a/src/engine/events/DisconnectionEvent.cpp b/src/engine/events/DisconnectionEvent.cpp index ec90480f..3bb0db89 100644 --- a/src/engine/events/DisconnectionEvent.cpp +++ b/src/engine/events/DisconnectionEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -86,7 +86,7 @@ DisconnectionEvent::pre_process() _src_port = _engine.engine_store()->find_port(_src_port_path); _dst_port = _engine.engine_store()->find_port(_dst_port_path); } - + if (_src_port == NULL || _dst_port == NULL) { _error = PORT_NOT_FOUND; QueuedEvent::pre_process(); @@ -109,18 +109,18 @@ DisconnectionEvent::pre_process() _patch = dynamic_cast<PatchImpl*>(dst_node); else _patch = dynamic_cast<PatchImpl*>(src_node); - + // Connection from a patch input to a patch output (pass through) } else if (src_node == dst_node && dynamic_cast<PatchImpl*>(src_node)) { _patch = dynamic_cast<PatchImpl*>(src_node); - + // Normal connection between nodes with the same parent } else { _patch = src_node->parent_patch(); } assert(_patch); - + if (!_patch->has_connection(_src_output_port, _dst_input_port)) { _error = NOT_CONNECTED; QueuedEvent::pre_process(); @@ -132,7 +132,7 @@ DisconnectionEvent::pre_process() QueuedEvent::pre_process(); return; } - + for (Raul::List<NodeImpl*>::iterator i = dst_node->providers()->begin(); i != dst_node->providers()->end(); ++i) if ((*i) == src_node) { delete dst_node->providers()->erase(i); @@ -144,12 +144,12 @@ DisconnectionEvent::pre_process() delete src_node->dependants()->erase(i); break; } - + _patch_connection = _patch->remove_connection(_src_port, _dst_port); - + if (_patch->enabled()) _compiled_patch = _patch->compile(); - + QueuedEvent::pre_process(); } @@ -162,7 +162,7 @@ DisconnectionEvent::execute(ProcessContext& context) if (_error == NO_ERROR) { InputPort::Connections::Node* const port_connection = _dst_input_port->remove_connection(_src_output_port); - + if (port_connection != NULL) { assert(_patch_connection); @@ -177,11 +177,11 @@ DisconnectionEvent::execute(ProcessContext& context) << " -> " << _patch_connection->elem()->dst_port_path() << endl; } assert(port_connection->elem() == _patch_connection->elem()); - + // Destroy list node, which will drop reference to connection itself _engine.maid()->push(port_connection); _engine.maid()->push(_patch_connection); - + if (_patch->compiled_patch() != NULL) _engine.maid()->push(_patch->compiled_patch()); _patch->compiled_patch(_compiled_patch); diff --git a/src/engine/events/DisconnectionEvent.hpp b/src/engine/events/DisconnectionEvent.hpp index afca463a..178e27fe 100644 --- a/src/engine/events/DisconnectionEvent.hpp +++ b/src/engine/events/DisconnectionEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -29,7 +29,7 @@ namespace Raul { } namespace Ingen { - + class NodeImpl; class ConnectionImpl; class MidiMessage; @@ -54,7 +54,7 @@ public: void post_process(); private: - + enum ErrorType { NO_ERROR, PARENT_PATCH_DIFFERENT, @@ -64,10 +64,10 @@ private: PARENTS_NOT_FOUND, CONNECTION_NOT_FOUND }; - + Raul::Path _src_port_path; Raul::Path _dst_port_path; - + PatchImpl* _patch; PortImpl* _src_port; PortImpl* _dst_port; @@ -75,10 +75,10 @@ private: InputPort* _dst_input_port; bool _lookup; - + PatchImpl::Connections::Node* _patch_connection; CompiledPatch* _compiled_patch; ///< New process order for Patch - + ErrorType _error; }; diff --git a/src/engine/events/LoadPluginsEvent.cpp b/src/engine/events/LoadPluginsEvent.cpp index 67fbed79..fd3b078b 100644 --- a/src/engine/events/LoadPluginsEvent.cpp +++ b/src/engine/events/LoadPluginsEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -35,7 +35,7 @@ void LoadPluginsEvent::pre_process() { _engine.node_factory()->load_plugins(); - + QueuedEvent::pre_process(); } @@ -44,7 +44,7 @@ LoadPluginsEvent::post_process() { if (_source) _source->unblock(); - + _responder->respond_ok(); } diff --git a/src/engine/events/LoadPluginsEvent.hpp b/src/engine/events/LoadPluginsEvent.hpp index 476cf3ad..b002a486 100644 --- a/src/engine/events/LoadPluginsEvent.hpp +++ b/src/engine/events/LoadPluginsEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -34,7 +34,7 @@ public: SharedPtr<Responder> responder, SampleCount timestamp, QueuedEventSource* source); - + void pre_process(); void post_process(); }; diff --git a/src/engine/events/MidiLearnEvent.cpp b/src/engine/events/MidiLearnEvent.cpp index 337acca3..dee10f61 100644 --- a/src/engine/events/MidiLearnEvent.cpp +++ b/src/engine/events/MidiLearnEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -42,16 +42,16 @@ void MidiLearnEvent::pre_process() { _node = _engine.engine_store()->find_node(_node_path); - + QueuedEvent::pre_process(); } void MidiLearnEvent::execute(ProcessContext& context) -{ +{ QueuedEvent::execute(context); - + if (_node != NULL) { if (_node->plugin_impl()->type() == Shared::Plugin::Internal) { ((NodeBase*)_node)->learn(); diff --git a/src/engine/events/MidiLearnEvent.hpp b/src/engine/events/MidiLearnEvent.hpp index 149b81b7..fd1c6171 100644 --- a/src/engine/events/MidiLearnEvent.hpp +++ b/src/engine/events/MidiLearnEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -36,13 +36,13 @@ class MidiLearnEvent : public QueuedEvent { public: MidiLearnEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const Raul::Path& node_path); - + void pre_process(); void execute(ProcessContext& context); void post_process(); private: - enum ErrorType { + enum ErrorType { NO_ERROR, INVALID_NODE_TYPE }; diff --git a/src/engine/events/NoteEvent.cpp b/src/engine/events/NoteEvent.cpp index 62fdff13..e323dd24 100644 --- a/src/engine/events/NoteEvent.cpp +++ b/src/engine/events/NoteEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -69,9 +69,9 @@ NoteEvent::execute(ProcessContext& context) // Lookup if neccessary if (!_node) _node = _engine.engine_store()->find_node(_node_path); - + // FIXME: barf - + if (_node != NULL && _node->plugin()->type() == Shared::Plugin::Internal) { if (_on) { if (_node->plugin_impl()->uri().str() == NS_INTERNALS "Note") diff --git a/src/engine/events/NoteEvent.hpp b/src/engine/events/NoteEvent.hpp index eac5b1f5..5944768b 100644 --- a/src/engine/events/NoteEvent.hpp +++ b/src/engine/events/NoteEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -48,7 +48,7 @@ public: bool on, uint8_t note_num, uint8_t velocity); - + void execute(ProcessContext& context); void post_process(); diff --git a/src/engine/events/PingQueuedEvent.hpp b/src/engine/events/PingQueuedEvent.hpp index 08897bfe..00e52099 100644 --- a/src/engine/events/PingQueuedEvent.hpp +++ b/src/engine/events/PingQueuedEvent.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/RegisterClientEvent.cpp b/src/engine/events/RegisterClientEvent.cpp index e78d0577..f8b72357 100644 --- a/src/engine/events/RegisterClientEvent.cpp +++ b/src/engine/events/RegisterClientEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -39,7 +39,7 @@ RegisterClientEvent::RegisterClientEvent(Engine& engine, void RegisterClientEvent::pre_process() -{ +{ _engine.broadcaster()->register_client(_uri, _client); QueuedEvent::pre_process(); diff --git a/src/engine/events/RegisterClientEvent.hpp b/src/engine/events/RegisterClientEvent.hpp index d75c92e6..c8cc66a3 100644 --- a/src/engine/events/RegisterClientEvent.hpp +++ b/src/engine/events/RegisterClientEvent.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/RenameEvent.cpp b/src/engine/events/RenameEvent.cpp index 3ff5d254..a8c18503 100644 --- a/src/engine/events/RenameEvent.cpp +++ b/src/engine/events/RenameEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -75,11 +75,11 @@ RenameEvent::pre_process() = _engine.engine_store()->remove(_store_iterator); assert(removed->size() > 0); - + for (Table<Path, SharedPtr<Shared::GraphObject> >::iterator i = removed->begin(); i != removed->end(); ++i) { const Path& child_old_path = i->first; assert(Path::descendant_comparator(_old_path, child_old_path)); - + Path child_new_path; if (child_old_path == _old_path) child_new_path = _new_path; @@ -100,7 +100,7 @@ void RenameEvent::execute(ProcessContext& context) { QueuedEvent::execute(context); - + SharedPtr<PortImpl> port = PtrCast<PortImpl>(_store_iterator->second); if (port && port->parent()->parent() == NULL) { DriverPort* driver_port = NULL; @@ -120,7 +120,7 @@ void RenameEvent::post_process() { string msg = "Unable to rename object - "; - + if (_error == NO_ERROR) { _responder->respond_ok(); _engine.broadcaster()->send_rename(_old_path, _new_path); diff --git a/src/engine/events/RenameEvent.hpp b/src/engine/events/RenameEvent.hpp index 23dd47b3..2d95706f 100644 --- a/src/engine/events/RenameEvent.hpp +++ b/src/engine/events/RenameEvent.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/RequestAllObjectsEvent.cpp b/src/engine/events/RequestAllObjectsEvent.cpp index a4dbc1f2..93d2eca4 100644 --- a/src/engine/events/RequestAllObjectsEvent.cpp +++ b/src/engine/events/RequestAllObjectsEvent.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/RequestAllObjectsEvent.hpp b/src/engine/events/RequestAllObjectsEvent.hpp index 9e4701a0..18eb3739 100644 --- a/src/engine/events/RequestAllObjectsEvent.hpp +++ b/src/engine/events/RequestAllObjectsEvent.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/RequestMetadataEvent.cpp b/src/engine/events/RequestMetadataEvent.cpp index 14cbcfb3..4470f16f 100644 --- a/src/engine/events/RequestMetadataEvent.cpp +++ b/src/engine/events/RequestMetadataEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -73,7 +73,7 @@ RequestMetadataEvent::pre_process() _value = _resource->get_property(_key); else _value = dynamic_cast<GraphObjectImpl*>(_resource)->get_variable(_key); - + QueuedEvent::pre_process(); } diff --git a/src/engine/events/RequestMetadataEvent.hpp b/src/engine/events/RequestMetadataEvent.hpp index df1b1acd..b60558d2 100644 --- a/src/engine/events/RequestMetadataEvent.hpp +++ b/src/engine/events/RequestMetadataEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -53,10 +53,10 @@ private: NONE, PORT_VALUE } _special_type; - + Raul::URI _uri; Raul::URI _key; - Raul::Atom _value; + Raul::Atom _value; Shared::ResourceImpl* _resource; bool _is_property; }; diff --git a/src/engine/events/RequestObjectEvent.cpp b/src/engine/events/RequestObjectEvent.cpp index 7cce6588..15d7a160 100644 --- a/src/engine/events/RequestObjectEvent.cpp +++ b/src/engine/events/RequestObjectEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -62,7 +62,7 @@ RequestObjectEvent::post_process() { if (!_object) { _responder->respond_error("Unable to find object requested."); - } else if (_responder->client()) { + } else if (_responder->client()) { ObjectSender::send_object(_responder->client(), _object, true); } else { _responder->respond_error("Unable to find client to send object."); diff --git a/src/engine/events/RequestObjectEvent.hpp b/src/engine/events/RequestObjectEvent.hpp index 79db5b19..1e754891 100644 --- a/src/engine/events/RequestObjectEvent.hpp +++ b/src/engine/events/RequestObjectEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -22,7 +22,7 @@ #include "types.hpp" namespace Ingen { - + class GraphObjectImpl; diff --git a/src/engine/events/RequestPluginEvent.cpp b/src/engine/events/RequestPluginEvent.cpp index 89371a8b..4dab7f53 100644 --- a/src/engine/events/RequestPluginEvent.cpp +++ b/src/engine/events/RequestPluginEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -61,7 +61,7 @@ RequestPluginEvent::post_process() { if (!_plugin) { _responder->respond_error("Unable to find plugin requested."); - + } else if (_responder->client()) { _responder->respond_ok(); diff --git a/src/engine/events/RequestPluginEvent.hpp b/src/engine/events/RequestPluginEvent.hpp index eece8610..0d811c2f 100644 --- a/src/engine/events/RequestPluginEvent.hpp +++ b/src/engine/events/RequestPluginEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -23,7 +23,7 @@ #include "types.hpp" namespace Ingen { - + class PluginImpl; diff --git a/src/engine/events/RequestPluginsEvent.cpp b/src/engine/events/RequestPluginsEvent.cpp index 8d7fc1ba..317fbe72 100644 --- a/src/engine/events/RequestPluginsEvent.cpp +++ b/src/engine/events/RequestPluginsEvent.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/RequestPluginsEvent.hpp b/src/engine/events/RequestPluginsEvent.hpp index f6b41d7a..3ed4bd0c 100644 --- a/src/engine/events/RequestPluginsEvent.hpp +++ b/src/engine/events/RequestPluginsEvent.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/SendPortActivityEvent.cpp b/src/engine/events/SendPortActivityEvent.cpp index 3a408d8d..d414c2a2 100644 --- a/src/engine/events/SendPortActivityEvent.cpp +++ b/src/engine/events/SendPortActivityEvent.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/SendPortActivityEvent.hpp b/src/engine/events/SendPortActivityEvent.hpp index 29c7f1a8..051c1f44 100644 --- a/src/engine/events/SendPortActivityEvent.hpp +++ b/src/engine/events/SendPortActivityEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -52,7 +52,7 @@ public: inline void operator=(const SendPortActivityEvent& ev) { _port = ev._port; } - + void post_process(); private: diff --git a/src/engine/events/SendPortValueEvent.cpp b/src/engine/events/SendPortValueEvent.cpp index d3fb0d36..0adbc919 100644 --- a/src/engine/events/SendPortValueEvent.cpp +++ b/src/engine/events/SendPortValueEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -30,7 +30,7 @@ void SendPortValueEvent::post_process() { // FIXME... - + if (_omni) { _engine.broadcaster()->send_port_value(_port->path(), _value); } else { diff --git a/src/engine/events/SendPortValueEvent.hpp b/src/engine/events/SendPortValueEvent.hpp index 8eaaee1a..dbd75337 100644 --- a/src/engine/events/SendPortValueEvent.hpp +++ b/src/engine/events/SendPortValueEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -60,7 +60,7 @@ public: _voice_num = ev._voice_num; _value = ev._value; } - + void post_process(); private: diff --git a/src/engine/events/SetMetadataEvent.cpp b/src/engine/events/SetMetadataEvent.cpp index ea4e9129..9eb77779 100644 --- a/src/engine/events/SetMetadataEvent.cpp +++ b/src/engine/events/SetMetadataEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -62,7 +62,7 @@ SetMetadataEvent::pre_process() _object = _engine.engine_store()->find_object(Path(_subject.str())); else _object = _engine.node_factory()->plugin(_subject); - + if (_object == NULL) { _error = NOT_FOUND; QueuedEvent::pre_process(); @@ -76,7 +76,7 @@ SetMetadataEvent::pre_process() _object->set_property(_key, _value); else dynamic_cast<GraphObjectImpl*>(_object)->set_variable(_key, _value); - + _patch = dynamic_cast<PatchImpl*>(_object); if (_key.str() == "ingen:broadcast") { @@ -143,7 +143,7 @@ SetMetadataEvent::execute(ProcessContext& context) break; default: _success = true; - } + } QueuedEvent::execute(context); } diff --git a/src/engine/events/SetMetadataEvent.hpp b/src/engine/events/SetMetadataEvent.hpp index 70292682..b57c2716 100644 --- a/src/engine/events/SetMetadataEvent.hpp +++ b/src/engine/events/SetMetadataEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -44,7 +44,7 @@ public: const Raul::URI& subject, const Raul::URI& key, const Raul::Atom& value); - + void pre_process(); void execute(ProcessContext& context); void post_process(); diff --git a/src/engine/events/SetPortValueEvent.cpp b/src/engine/events/SetPortValueEvent.cpp index 1c07af95..1626c973 100644 --- a/src/engine/events/SetPortValueEvent.cpp +++ b/src/engine/events/SetPortValueEvent.cpp @@ -1,15 +1,15 @@ /* 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 @@ -52,7 +52,7 @@ SetPortValueEvent::SetPortValueEvent(Engine& engine, , _omni(true) , _voice_num(0) , _port_path(port_path) - , _value(value) + , _value(value) , _port(NULL) , _error(NO_ERROR) { @@ -72,7 +72,7 @@ SetPortValueEvent::SetPortValueEvent(Engine& engine, , _omni(false) , _voice_num(voice_num) , _port_path(port_path) - , _value(value) + , _value(value) , _port(NULL) , _error(NO_ERROR) { @@ -100,7 +100,7 @@ SetPortValueEvent::pre_process() apply(0, 0); _engine.message_context()->run(_port->parent_node()); } - + QueuedEvent::pre_process(); } @@ -110,10 +110,10 @@ SetPortValueEvent::execute(ProcessContext& context) { Event::execute(context); assert(_time >= context.start() && _time <= context.end()); - + if (_port && _port->context() == Context::MESSAGE) return; - + apply(context.start(), context.nframes()); } @@ -151,19 +151,19 @@ SetPortValueEvent::apply(uint32_t start, uint32_t nframes) } return; } - + EventBuffer* const ebuf = dynamic_cast<EventBuffer*>(buf); const LV2Features::Feature* f = _engine.world()->lv2_features->feature(LV2_URI_MAP_URI); LV2URIMap* map = (LV2URIMap*)f->controller; - + // FIXME: eliminate lookups // FIXME: need a proper prefix system if (ebuf && _value.type() == Atom::BLOB) { const uint32_t frames = std::max( (uint32_t)(_time - start), ebuf->latest_frames()); - + // Size 0 event, pass it along to the plugin as a typed but empty event if (_value.data_size() == 0) { cout << "BANG!" << endl; diff --git a/src/engine/events/SetPortValueEvent.hpp b/src/engine/events/SetPortValueEvent.hpp index f1385e26..200a9964 100644 --- a/src/engine/events/SetPortValueEvent.hpp +++ b/src/engine/events/SetPortValueEvent.hpp @@ -1,15 +1,15 @@ /* 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 @@ -28,7 +28,7 @@ class PortImpl; /** An event to change the value of a port. - * + * * This event can either be queued or immediate, depending on the queued * parameter passed to the constructor. It must be passed to the appropriate * place (ie queued event passed to the event queue and non-queued event @@ -45,7 +45,7 @@ public: SampleCount timestamp, const Raul::Path& port_path, const Raul::Atom& value); - + SetPortValueEvent(Engine& engine, SharedPtr<Responder> responder, bool queued, @@ -68,9 +68,9 @@ private: ILLEGAL_VOICE, TYPE_MISMATCH }; - + void apply(uint32_t start, uint32_t nframes); - + bool _queued; bool _omni; uint32_t _voice_num; diff --git a/src/engine/events/UnregisterClientEvent.cpp b/src/engine/events/UnregisterClientEvent.cpp index 3a79adc1..d5591405 100644 --- a/src/engine/events/UnregisterClientEvent.cpp +++ b/src/engine/events/UnregisterClientEvent.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/events/UnregisterClientEvent.hpp b/src/engine/events/UnregisterClientEvent.hpp index f62940fa..96b72158 100644 --- a/src/engine/events/UnregisterClientEvent.hpp +++ b/src/engine/events/UnregisterClientEvent.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/ingen.lv2/ingen_lv2.cpp b/src/engine/ingen.lv2/ingen_lv2.cpp index 67b63fc5..d3693f6b 100644 --- a/src/engine/ingen.lv2/ingen_lv2.cpp +++ b/src/engine/ingen.lv2/ingen_lv2.cpp @@ -1,6 +1,6 @@ /* Ingen.LV2 - A thin wrapper which allows Ingen to run as an LV2 plugin. * Copyright (C) 2008 Dave Robillard <http://drobilla.net> - * + * * This library 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) @@ -52,24 +52,24 @@ struct IngenLV2Driver : public Ingen::AudioDriver { _root_patch->process(_context); _frame_time += nframes; } - + virtual void set_root_patch(PatchImpl* patch) {} virtual PatchImpl* root_patch() { return NULL; } - + virtual void add_port(DriverPort* port) {} virtual DriverPort* remove_port(const Raul::Path& path) { return NULL; } - + virtual DriverPort* create_port(DuplexPort* patch_port) { return NULL; } - + virtual DriverPort* driver_port(const Raul::Path& path) { return NULL; } - + virtual SampleCount buffer_size() const { return _buffer_size; } virtual SampleCount sample_rate() const { return _sample_rate; } virtual SampleCount frame_time() const { return _frame_time;} virtual bool is_realtime() const { return true; } virtual ProcessContext& context() { return _context; } - + private: ProcessContext _context; PatchImpl* _root_patch; @@ -123,11 +123,11 @@ ingen_instantiate(const LV2_Descriptor* descriptor, plugin->world = Ingen::Shared::get_world(); plugin->engine = SharedPtr<Engine>(new Engine(plugin->world)); plugin->world->local_engine = plugin->engine; - + // FIXME: fixed buffer size plugin->engine->set_driver(DataType::AUDIO, SharedPtr<Driver>(new IngenLV2Driver(*plugin->engine, rate, 4096))); - + return (LV2_Handle)plugin; } diff --git a/src/engine/ingen_engine.cpp b/src/engine/ingen_engine.cpp index f56392cf..c19f5954 100644 --- a/src/engine/ingen_engine.cpp +++ b/src/engine/ingen_engine.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/ingen_engine.hpp b/src/engine/ingen_engine.hpp index 93b426ac..6bb15a73 100644 --- a/src/engine/ingen_engine.hpp +++ b/src/engine/ingen_engine.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/tuning.hpp b/src/engine/tuning.hpp index 7ec55ae4..288cb484 100644 --- a/src/engine/tuning.hpp +++ b/src/engine/tuning.hpp @@ -1,15 +1,15 @@ /* 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 @@ -22,9 +22,9 @@ #include <time.h> namespace Ingen { - + // FIXME: put this in a Config class - + static const size_t event_queue_size = 1024; static const size_t pre_processor_queue_size = 1024; static const size_t post_processor_queue_size = 1024; diff --git a/src/engine/types.hpp b/src/engine/types.hpp index 52d423b9..7ff2b1c3 100644 --- a/src/engine/types.hpp +++ b/src/engine/types.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/engine/util.hpp b/src/engine/util.hpp index 7cca59d6..335da1d1 100644 --- a/src/engine/util.hpp +++ b/src/engine/util.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/gui/App.cpp b/src/gui/App.cpp index c7056a64..f15b3355 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -1,15 +1,15 @@ /* 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 @@ -79,7 +79,7 @@ App::App(Ingen::Shared::World* world) , _enable_signal(true) { Glib::RefPtr<Gnome::Glade::Xml> glade_xml = GladeFactory::new_glade_reference(); - + Glib::set_application_name("Ingen"); gtk_window_set_default_icon_name("ingen"); @@ -110,16 +110,16 @@ App::init(int argc, char** argv, Ingen::Shared::World* world) if (!_instance) _instance = new App(world); - + // Load configuration settings _instance->configuration()->load_settings(); _instance->configuration()->apply_settings(); - + // Set default window icon _instance->_about_dialog->property_program_name() = "Ingen"; _instance->_about_dialog->property_logo_icon_name() = "ingen"; gtk_window_set_default_icon_name("ingen"); - + // Set style for embedded node GUIs const string rc_style = "style \"ingen_embedded_node_gui_style\" {" @@ -135,9 +135,9 @@ App::init(int argc, char** argv, Ingen::Shared::World* world) " fg[INSENSITIVE] = \"#FFFFFF\"" "}\n" "widget \"*ingen_embedded_node_gui_container*\" style \"ingen_embedded_node_gui_style\"\n"; - + Gtk::RC::parse_string(rc_style); - + App::instance().connect_window()->start(world); // Run main iterations here until we're attached to the engine @@ -166,14 +166,14 @@ App::attach(SharedPtr<SigClientInterface> client, assert( ! _loader); _world->engine->register_client(client.get()); - + _client = client; _handle = handle; _store = SharedPtr<ClientStore>(new ClientStore(_world->engine, client)); _loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(_world->engine)); _patch_tree_window->init(*_store); - + _client->signal_response_error.connect(sigc::mem_fun(this, &App::error_response)); _client->signal_error.connect(sigc::mem_fun(this, &App::error_message)); } @@ -193,7 +193,7 @@ App::detach() _world->engine.reset(); } } - + const SharedPtr<Serialiser>& App::serialiser() @@ -223,7 +223,7 @@ void App::error_message(const string& str) { _messages_window->post(str); - + if (!_messages_window->is_visible()) _messages_window->present(); @@ -256,7 +256,7 @@ App::activity_port_destroyed(Port* port) ActivityPorts::iterator i = _activity_ports.find(port); if (i != _activity_ports.end()) _activity_ports.erase(i); - + return; } @@ -291,17 +291,17 @@ App::event_load_session() { Gtk::FileChooserDialog* dialog = new Gtk::FileChooserDialog(*_main_window, "Load Session", Gtk::FILE_CHOOSER_ACTION_OPEN); - + dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); + dialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); int result = dialog->run(); string filename = dialog->get_filename(); delete dialog; cout << result << endl; - + assert(result == Gtk::RESPONSE_OK || result == Gtk::RESPONSE_CANCEL || result == Gtk::RESPONSE_NONE); - + if (result == Gtk::RESPONSE_OK) //configuration->load_session(filename); _controller->load_session(filename); @@ -312,7 +312,7 @@ void App::event_save_session_as() { Gtk::FileChooserDialog dialog(*_main_window, "Save Session", Gtk::FILE_CHOOSER_ACTION_SAVE); - + /* Gtk::VBox* box = dialog.get_vbox(); Gtk::Label warning("Warning: Recursively saving will overwrite any subpatch files \ @@ -321,20 +321,20 @@ App::event_save_session_as() Gtk::CheckButton recursive_checkbutton("Recursively save all subpatches"); box->pack_start(recursive_checkbutton, false, false, 0); recursive_checkbutton.show(); - */ + */ dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); - + dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); + int result = dialog.run(); //bool recursive = recursive_checkbutton.get_active(); - + assert(result == Gtk::RESPONSE_OK || result == Gtk::RESPONSE_CANCEL || result == Gtk::RESPONSE_NONE); - - if (result == Gtk::RESPONSE_OK) { + + if (result == Gtk::RESPONSE_OK) { string filename = dialog.get_filename(); if (filename.length() < 11 || filename.substr(filename.length()-10) != ".omsession") filename += ".omsession"; - + bool confirm = false; std::fstream fin; fin.open(filename.c_str(), std::ios::in); @@ -351,7 +351,7 @@ App::event_save_session_as() confirm = true; } fin.close(); - + if (confirm) { _controller->save_session(filename); } @@ -365,7 +365,7 @@ App::register_callbacks() { Glib::signal_timeout().connect( sigc::mem_fun(App::instance(), &App::gtk_main_iteration), 25, G_PRIORITY_DEFAULT); - + Glib::signal_timeout().connect( sigc::mem_fun(App::instance(), &App::animate), 50, G_PRIORITY_DEFAULT); } @@ -384,7 +384,7 @@ App::gtk_main_iteration() _client->emit_signals(); _enable_signal = true; } - + return true; } @@ -410,7 +410,7 @@ App::icon_from_path(const string& path, int size) /* If weak references to Glib::Objects are needed somewhere else it will probably be a good idea to create a proper WeakPtr class instead of using raw pointers, but for a single use this will do. */ - + Glib::RefPtr<Gdk::Pixbuf> buf; if (path.length() == 0) return buf; @@ -444,9 +444,9 @@ App::icon_destroyed(void* data) Icons::iterator iter = instance()._icons.find(*p); if (iter != instance()._icons.end()) instance()._icons.erase(iter); - + delete p; // allocated in App::icon_from_path - + return NULL; } diff --git a/src/gui/App.hpp b/src/gui/App.hpp index a7b4236b..002ff9c2 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -1,15 +1,15 @@ /* 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 @@ -30,7 +30,7 @@ #include "raul/Deletable.hpp" #include "module/World.hpp" -namespace Ingen { +namespace Ingen { class Engine; namespace Shared { class EngineInterface; @@ -80,13 +80,13 @@ public: SharedPtr<Raul::Deletable> handle=SharedPtr<Raul::Deletable>()); void detach(); - + void register_callbacks(); bool gtk_main_iteration(); void show_about(); void quit(); - + void port_activity(Port* port); void activity_port_destroyed(Port* port); @@ -99,16 +99,16 @@ public: PatchTreeWindow* patch_tree() const { return _patch_tree_window; } Configuration* configuration() const { return _configuration; } WindowFactory* window_factory() const { return _window_factory; } - + Glib::RefPtr<Gdk::Pixbuf> icon_from_path(const std::string& path, int size); const SharedPtr<Shared::EngineInterface>& engine() const { return _world->engine; } const SharedPtr<Client::SigClientInterface>& client() const { return _client; } const SharedPtr<Client::ClientStore>& store() const { return _store; } const SharedPtr<ThreadedLoader>& loader() const { return _loader; } - + const SharedPtr<Serialisation::Serialiser>& serialiser(); - + static inline App& instance() { assert(_instance); return *_instance; } static void init(int argc, char** argv, Ingen::Shared::World* world); @@ -122,26 +122,26 @@ protected: template <typename A, typename B> struct LexicalCompare { bool operator()(const std::pair<A, B>& p1, const std::pair<A, B>& p2) { - return (p1.first < p2.first) || + return (p1.first < p2.first) || ((p1.first == p2.first) && (p1.second < p2.second)); } }; - + typedef std::map< std::pair<std::string, int>, Gdk::Pixbuf*, LexicalCompare<std::string, int> > Icons; Icons _icons; - + App(Ingen::Shared::World* world); - + bool animate(); void error_response(int32_t id, const std::string& str); - + static void* icon_destroyed(void* data); - + static Gtk::Main* _main; static App* _instance; - + SharedPtr<Client::SigClientInterface> _client; SharedPtr<Raul::Deletable> _handle; SharedPtr<Client::ClientStore> _store; @@ -155,7 +155,7 @@ protected: PatchTreeWindow* _patch_tree_window; Gtk::AboutDialog* _about_dialog; WindowFactory* _window_factory; - + Ingen::Shared::World* _world; typedef std::map<Port*, bool> ActivityPorts; diff --git a/src/gui/BreadCrumb.hpp b/src/gui/BreadCrumb.hpp index 846064d2..82cfff53 100644 --- a/src/gui/BreadCrumb.hpp +++ b/src/gui/BreadCrumb.hpp @@ -1,15 +1,15 @@ /* 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 @@ -57,7 +57,7 @@ public: const Raul::Path& path() const { return _path; } SharedPtr<PatchView> view() const { return _view; } - + void set_path(const Raul::Path& path) { remove(); diff --git a/src/gui/BreadCrumbBox.cpp b/src/gui/BreadCrumbBox.cpp index 6a131806..86b4cf88 100644 --- a/src/gui/BreadCrumbBox.cpp +++ b/src/gui/BreadCrumbBox.cpp @@ -1,15 +1,15 @@ /* 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 @@ -50,7 +50,7 @@ BreadCrumbBox::view(const Path& path) /** Sets up the crumbs to display @a path. * - * If @a path is already part of the shown path, it will be selected and the + * If @a path is already part of the shown path, it will be selected and the * children preserved. */ void @@ -61,7 +61,7 @@ BreadCrumbBox::build(Path path, SharedPtr<PatchView> view) // Moving to a path we already contain, just switch the active button if (_breadcrumbs.size() > 0 && (path.is_parent_of(_full_path) || path == _full_path)) { - + for (std::list<BreadCrumb*>::iterator i = _breadcrumbs.begin(); i != _breadcrumbs.end(); ++i) { if ((*i)->path() == path) { (*i)->set_active(true); @@ -75,7 +75,7 @@ BreadCrumbBox::build(Path path, SharedPtr<PatchView> view) (*i)->set_active(false); } } - + _active_path = path; _enable_signal = old_enable_signal; @@ -98,7 +98,7 @@ BreadCrumbBox::build(Path path, SharedPtr<PatchView> view) else suffix = suffix.substr(suffix.find("/")+1); } - + for (std::list<BreadCrumb*>::iterator i = _breadcrumbs.begin(); i != _breadcrumbs.end(); ++i) (*i)->set_active(false); _breadcrumbs.back()->set_active(true); @@ -140,7 +140,7 @@ BreadCrumbBox::build(Path path, SharedPtr<PatchView> view) suffix = suffix.substr(suffix.find("/")+1); } } - + _enable_signal = old_enable_signal; } @@ -154,7 +154,7 @@ BreadCrumbBox::create_crumb(const Path& path, { BreadCrumb* but = manage(new BreadCrumb(path, (view && path == view->patch()->path()) ? view : SharedPtr<PatchView>())); - + but->signal_toggled().connect(sigc::bind(sigc::mem_fun( this, &BreadCrumbBox::breadcrumb_clicked), but)); diff --git a/src/gui/BreadCrumbBox.hpp b/src/gui/BreadCrumbBox.hpp index 7c4764c1..67b82e92 100644 --- a/src/gui/BreadCrumbBox.hpp +++ b/src/gui/BreadCrumbBox.hpp @@ -1,15 +1,15 @@ /* 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 @@ -42,7 +42,7 @@ class BreadCrumbBox : public Gtk::HBox { public: BreadCrumbBox(); - + SharedPtr<PatchView> view(const Raul::Path& path); void build(Raul::Path path, SharedPtr<PatchView> view); @@ -54,7 +54,7 @@ private: SharedPtr<PatchView> view = SharedPtr<PatchView>()); void breadcrumb_clicked(BreadCrumb* crumb); - + void object_destroyed(const Raul::Path& path); void object_renamed(const Raul::Path& old_path, const Raul::Path& new_path); diff --git a/src/gui/Configuration.cpp b/src/gui/Configuration.cpp index 381d17fb..2d64e34e 100644 --- a/src/gui/Configuration.cpp +++ b/src/gui/Configuration.cpp @@ -1,15 +1,15 @@ /* 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 @@ -94,10 +94,10 @@ Configuration::get_port_color(const PortModel* p) } /*else if (p->type().is_osc()) { return _osc_port_color; }*/ - + cerr << "[Configuration] Unknown port type " << p->type().uri() << ", port will appear black." << endl; - + return 0x000000FF; } diff --git a/src/gui/Configuration.hpp b/src/gui/Configuration.hpp index 6ce66776..82cfbc8f 100644 --- a/src/gui/Configuration.hpp +++ b/src/gui/Configuration.hpp @@ -1,15 +1,15 @@ /* 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 @@ -32,7 +32,7 @@ namespace GUI { /** Singleton state manager for the entire app. * - * Stores settings like color preferences, search paths, etc. + * Stores settings like color preferences, search paths, etc. * (ie any user-defined preferences to be stoed in the rc file). * * \ingroup GUI @@ -50,9 +50,9 @@ public: 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); - + enum NameStyle { PATH, HUMAN, NONE }; NameStyle name_style() const { return _name_style; } @@ -61,9 +61,9 @@ public: private: /** Most recent patch folder shown in open dialog */ string _patch_folder; - + NameStyle _name_style; - + uint32_t _audio_port_color; uint32_t _control_port_color; uint32_t _event_port_color; @@ -75,4 +75,4 @@ private: #endif // CONFIG_H - + diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index f255ebdc..e20ac201 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -79,7 +79,7 @@ ConnectWindow::start(Ingen::Shared::World* world) if (_widgets_loaded) _internal_radio->set_active(true); } - + set_connected_to(world->engine); connect(true); @@ -90,7 +90,7 @@ void ConnectWindow::set_connected_to(SharedPtr<Shared::EngineInterface> engine) { App::instance().world()->engine = engine; - + if (!_widgets_loaded) return; @@ -132,7 +132,7 @@ ConnectWindow::set_connected_to(SharedPtr<Shared::EngineInterface> engine) void ConnectWindow::set_connecting_widget_states() { - if (!_widgets_loaded) + if (!_widgets_loaded) return; _connect_button->set_sensitive(false); @@ -161,7 +161,7 @@ ConnectWindow::connect(bool existing) _connect_stage = 0; set_connecting_widget_states(); - + Ingen::Shared::World* world = App::instance().world(); #ifdef HAVE_LIBLO @@ -175,10 +175,10 @@ ConnectWindow::connect(bool existing) } world->engine = SharedPtr<EngineInterface>(new OSCEngineSender(engine_url)); } - + SharedPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024)); SharedPtr<Raul::Deletable> client; - + const string& uri = world->engine->uri().str(); const string& scheme = uri.substr(0, uri.find(":")); if (scheme == "osc.udp" || scheme == "osc.tcp") @@ -187,7 +187,7 @@ ConnectWindow::connect(bool existing) else if (scheme == "http") client = SharedPtr<HTTPClientReceiver>(new HTTPClientReceiver(world, uri, tsci)); #endif - + App::instance().attach(tsci, client); App::instance().register_callbacks(); @@ -208,7 +208,7 @@ ConnectWindow::connect(bool existing) // FIXME: static args SharedPtr<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024)); SharedPtr<OSCClientReceiver> client(new OSCClientReceiver(16181, tsci)); - + App::instance().attach(tsci, client); App::instance().register_callbacks(); @@ -226,22 +226,22 @@ ConnectWindow::connect(bool existing) assert(_new_engine); world->local_engine = SharedPtr<Engine>(_new_engine(world)); } - + if ( ! world->engine) { SharedPtr<QueuedEngineInterface> interface( new QueuedEngineInterface(*world->local_engine, Ingen::event_queue_size)); world->engine = interface; world->local_engine->add_event_source(interface); } - + SharedPtr<SigClientInterface> client(new SigClientInterface()); - + Ingen::Driver* (*new_driver)( Ingen::Engine& engine, const std::string server_name, const std::string client_name, void* jack_client) = NULL; - + if (!world->local_engine->audio_driver()) { bool found = _engine_jack_module->get_symbol( "new_jack_audio_driver", (void*&)(new_driver)); @@ -252,10 +252,10 @@ ConnectWindow::connect(bool existing) } world->local_engine->activate(1); // FIXME: parallelism - + App::instance().attach(client); App::instance().register_callbacks(); - + Glib::signal_timeout().connect( sigc::mem_fun(this, &ConnectWindow::gtk_callback), 10); } @@ -336,10 +336,10 @@ ConnectWindow::load_widgets() _connect_button->signal_clicked().connect(sigc::bind( sigc::mem_fun(this, &ConnectWindow::connect), false)); _quit_button->signal_clicked().connect(sigc::mem_fun(this, &ConnectWindow::quit)); - + _progress_bar->set_pulse_step(0.01); _widgets_loaded = true; - + _engine_module = Ingen::Shared::load_module("ingen_engine"); if (!_engine_module) cerr << "Unable to load ingen_engine module, internal engine unavailable." << endl; @@ -348,7 +348,7 @@ ConnectWindow::load_widgets() cerr << "Unable to find module entry point, internal engine unavailable." << endl; _engine_module.reset(); } - + _engine_jack_module = Ingen::Shared::load_module("ingen_engine_jack"); server_toggled(); @@ -412,7 +412,7 @@ bool ConnectWindow::gtk_callback() { /* If I call this a "state machine" it's not ugly code any more */ - + // Timing stuff for repeated attach attempts timeval now; gettimeofday(&now, NULL); @@ -428,7 +428,7 @@ ConnectWindow::gtk_callback() set_connecting_widget_states(); } } - + /* Connecting to engine */ if (_connect_stage == 0) { @@ -439,11 +439,11 @@ ConnectWindow::gtk_callback() App::instance().client()->signal_response_ok.connect( sigc::mem_fun(this, &ConnectWindow::on_response)); - + _ping_id = abs(rand()) / 2 * 2; // avoid -1 App::instance().engine()->set_next_response_id(_ping_id); App::instance().engine()->ping(); - + if (_widgets_loaded) { _progress_label->set_text("Connecting to engine..."); _progress_bar->set_pulse_step(0.01); @@ -490,10 +490,10 @@ ConnectWindow::gtk_callback() _finished_connecting = true; return false; // deregister this callback } - + if (_widgets_loaded) _progress_bar->pulse(); - + if (_connect_stage == -1) { // we were cancelled if (_widgets_loaded) { _icon->set(Gtk::Stock::DISCONNECT, Gtk::ICON_SIZE_LARGE_TOOLBAR); diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp index a435e900..bc5b46f4 100644 --- a/src/gui/ConnectWindow.hpp +++ b/src/gui/ConnectWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -50,7 +50,7 @@ class ConnectWindow : public Gtk::Dialog { public: ConnectWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml); - + void set_connected_to(SharedPtr<Shared::EngineInterface> engine); void start(Ingen::Shared::World* world); void on_response(int32_t id) { _attached = true; } @@ -63,7 +63,7 @@ private: void server_toggled(); void launch_toggled(); void internal_toggled(); - + void disconnect(); void connect(bool existing); void activate(); diff --git a/src/gui/Connection.hpp b/src/gui/Connection.hpp index 5291a7c7..ad5e4153 100644 --- a/src/gui/Connection.hpp +++ b/src/gui/Connection.hpp @@ -1,15 +1,15 @@ /* 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 @@ -30,7 +30,7 @@ namespace GUI { /** A Connection in a Patch. - * + * * \ingroup GUI */ class Connection : public FlowCanvas::Connection @@ -48,7 +48,7 @@ public: virtual ~Connection() {} SharedPtr<ConnectionModel> model() const { return _connection_model; } - + private: SharedPtr<ConnectionModel> _connection_model; }; diff --git a/src/gui/ControlPanel.cpp b/src/gui/ControlPanel.cpp index ccfb54d2..634d35e0 100644 --- a/src/gui/ControlPanel.cpp +++ b/src/gui/ControlPanel.cpp @@ -1,15 +1,15 @@ /* 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 alongCont * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -30,7 +30,7 @@ using namespace Raul; namespace Ingen { namespace GUI { - + ControlPanel::ControlPanel(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) : Gtk::HBox(cobject) , _callback_enabled(true) @@ -40,7 +40,7 @@ ControlPanel::ControlPanel(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Gl xml->get_widget("control_panel_all_voices_radio", _all_voices_radio); xml->get_widget("control_panel_specific_voice_radio", _specific_voice_radio); xml->get_widget("control_panel_voice_spinbutton", _voice_spinbutton); - + _all_voices_radio->signal_toggled().connect( sigc::mem_fun(this, &ControlPanel::all_voices_selected)); @@ -63,7 +63,7 @@ ControlPanel::init(SharedPtr<NodeModel> node, uint32_t poly) { assert(node != NULL); assert(poly > 0); - + if (node->polyphonic()) { _voice_spinbutton->set_range(0, poly - 1); _voice_control_box->show(); @@ -74,7 +74,7 @@ ControlPanel::init(SharedPtr<NodeModel> node, uint32_t poly) for (NodeModel::Ports::const_iterator i = node->ports().begin(); i != node->ports().end(); ++i) { add_port(*i); } - + node->signal_property.connect( sigc::mem_fun(this, &ControlPanel::variable_changed)); @@ -84,7 +84,7 @@ ControlPanel::init(SharedPtr<NodeModel> node, uint32_t poly) } else { cerr << "[ControlPanel] No parent, polyphonic controls disabled" << endl; } - + _callback_enabled = true; } @@ -106,15 +106,15 @@ void ControlPanel::add_port(SharedPtr<PortModel> pm) { assert(pm); - + // Already have port, don't add another if (find_port(pm->path()) != NULL) return; - + // Add port if (pm->type().is_control() && pm->is_input()) { Control* control = NULL; - + if (pm->is_toggle()) { ToggleControl* tc; Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference("toggle_control"); @@ -126,12 +126,12 @@ ControlPanel::add_port(SharedPtr<PortModel> pm) xml->get_widget_derived("control_strip", sc); control = sc; } - + control->init(this, pm); - + if (_controls.size() > 0) _control_box->pack_start(*Gtk::manage(new Gtk::HSeparator()), false, false, 4); - + _controls.push_back(control); _control_box->pack_start(*control, false, false, 0); @@ -143,7 +143,7 @@ ControlPanel::add_port(SharedPtr<PortModel> pm) _control_box->size_request(controls_size); _ideal_size.first = controls_size.width; _ideal_size.second = controls_size.height; - + Gtk::Requisition voice_size; _voice_control_box->size_request(voice_size); _ideal_size.first += voice_size.width; @@ -270,6 +270,6 @@ ControlPanel::variable_changed(const Raul::URI& predicate, const Raul::Atom& val } } - + } // namespace GUI } // namespace Ingen diff --git a/src/gui/ControlPanel.hpp b/src/gui/ControlPanel.hpp index 4e2204ef..0895ad51 100644 --- a/src/gui/ControlPanel.hpp +++ b/src/gui/ControlPanel.hpp @@ -1,15 +1,15 @@ /* 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 @@ -51,7 +51,7 @@ class ControlPanel : public Gtk::HBox { public: ControlPanel(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml); virtual ~ControlPanel(); - + void init(SharedPtr<NodeModel> node, uint32_t poly); Control* find_port(const Raul::Path& path) const; @@ -61,22 +61,22 @@ public: void enable_port(const Raul::Path& path); void disable_port(const Raul::Path& path); - + size_t num_controls() const { return _controls.size(); } std::pair<int,int> ideal_size() const { return _ideal_size; } - + // Callback for Control void value_changed(SharedPtr<PortModel> port_path, float val); - + private: void all_voices_selected(); void specific_voice_selected(); - + void variable_changed(const Raul::URI& predicate, const Raul::Atom& value); void parent_property_changed(const Raul::URI& predicate, const Raul::Atom& value); bool _callback_enabled; - + std::pair<int,int> _ideal_size; std::vector<Control*> _controls; diff --git a/src/gui/Controls.cpp b/src/gui/Controls.cpp index f163befe..0314f799 100644 --- a/src/gui/Controls.cpp +++ b/src/gui/Controls.cpp @@ -1,15 +1,15 @@ /* 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 @@ -46,11 +46,11 @@ Control::Control(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& Glib::RefPtr<Gnome::Glade::Xml> menu_xml = GladeFactory::new_glade_reference("port_control_menu"); menu_xml->get_widget("port_control_menu", _menu); menu_xml->get_widget("port_control_menu_properties", _menu_properties); - + _menu_properties->signal_activate().connect( sigc::mem_fun(this, &SliderControl::menu_properties)); } - + Control::~Control() { @@ -72,7 +72,7 @@ Control::init(ControlPanel* panel, SharedPtr<PortModel> pm) _control_connection = pm->signal_value_changed.connect(sigc::mem_fun(this, &Control::set_value)); } - + void Control::menu_properties() { @@ -109,7 +109,7 @@ SliderControl::init(ControlPanel* panel, SharedPtr<PortModel> pm) assert(_slider); set_name(pm->path().name()); - + _slider->set_draw_value(false); signal_button_press_event().connect(sigc::mem_fun(*this, &SliderControl::clicked)); @@ -120,12 +120,12 @@ SliderControl::init(ControlPanel* panel, SharedPtr<PortModel> pm) _slider->signal_value_changed().connect( sigc::mem_fun(*this, &SliderControl::update_value_from_slider)); - + _value_spinner->signal_value_changed().connect( sigc::mem_fun(*this, &SliderControl::update_value_from_spinner)); float min = 0.0f, max = 1.0f; - + boost::shared_ptr<NodeModel> parent = PtrCast<NodeModel>(_port_model->parent()); if (parent) parent->port_value_range(_port_model, min, max); @@ -136,7 +136,7 @@ SliderControl::init(ControlPanel* panel, SharedPtr<PortModel> pm) } else { _slider->set_increments(0, 0); } - + pm->signal_variable.connect(sigc::mem_fun(this, &SliderControl::port_variable_change)); _slider->set_range(std::min(min, pm->value().get_float()), std::max(max, pm->value().get_float())); @@ -166,7 +166,7 @@ void SliderControl::set_value(const Atom& atom) { float val = atom.get_float(); - + if (_port_model->is_integer()) val = lrintf(val); @@ -186,17 +186,17 @@ SliderControl::set_value(const Atom& atom) _enable_signal = true; } - + void SliderControl::port_variable_change(const URI& key, const Atom& value) { _enable_signal = false; - + if (key.str() == "lv2:minimum" && value.type() == Atom::FLOAT) set_range(value.get_float(), _slider->get_adjustment()->get_upper()); else if (key.str() == "lv2:maximum" && value.type() == Atom::FLOAT) set_range(_slider->get_adjustment()->get_lower(), value.get_float()); - + _enable_signal = true; } @@ -206,7 +206,7 @@ SliderControl::set_range(float min, float max) { if (max <= min) max = min + 1.0; - + _slider->set_range(min, max); //_value_spinner->set_range(min, max); } @@ -249,20 +249,20 @@ SliderControl::update_value_from_slider() if (_enable_signal) { float value = _slider->get_value(); bool change = true; - + _enable_signal = false; - + if (_port_model->is_integer()) { value = lrintf(value); if (value == lrintf(_port_model->value().get_float())) change = false; } - + if (change) { _value_spinner->set_value(value); _control_panel->value_changed(_port_model, value); } - + _enable_signal = true; } } @@ -278,7 +278,7 @@ SliderControl::update_value_from_spinner() set_value(value); _control_panel->value_changed(_port_model, value); - + //m_port_model->value(value); _enable_signal = true; } @@ -299,7 +299,7 @@ SliderControl::slider_pressed(GdkEvent* ev) _enabled = true; //GtkClientInterface::instance()->clear_ignore_port(); } - + return false; } @@ -321,7 +321,7 @@ IntegerControl::IntegerControl(ControlPanel* panel, SharedPtr<PortModel> pm) _spinner.signal_value_changed().connect( sigc::mem_fun(*this, &IntegerControl::update_value)); _spinner.set_increments(1, 10); - + _alignment.add(_spinner); pack_start(_name_label); pack_start(_alignment); @@ -389,7 +389,7 @@ ToggleControl::ToggleControl(BaseObjectType* cobject, const Glib::RefPtr<Gnome:: xml->get_widget("toggle_control_check", _checkbutton); } - + void ToggleControl::init(ControlPanel* panel, SharedPtr<PortModel> pm) { @@ -435,7 +435,7 @@ ToggleControl::set_value(const Atom& val) default: cerr << "Unsupported value type for toggle control" << endl; } - + _enable_signal = false; _checkbutton->set_active(enable); _enable_signal = true; diff --git a/src/gui/Controls.hpp b/src/gui/Controls.hpp index d83a0bff..d85afffc 100644 --- a/src/gui/Controls.hpp +++ b/src/gui/Controls.hpp @@ -1,15 +1,15 @@ /* 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 @@ -42,25 +42,25 @@ class Control : public Gtk::VBox public: Control(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml); virtual ~Control(); - + virtual void init(ControlPanel* panel, SharedPtr<Client::PortModel> pm); - + virtual void enable() = 0; virtual void disable() = 0; - + inline const SharedPtr<Client::PortModel> port_model() const { return _port_model; } protected: virtual void set_value(const Raul::Atom& value) = 0; virtual void set_range(float min, float max) {} - + void menu_properties(); ControlPanel* _control_panel; SharedPtr<Client::PortModel> _port_model; sigc::connection _control_connection; bool _enable_signal; - + Gtk::Menu* _menu; Gtk::MenuItem* _menu_properties; }; @@ -78,7 +78,7 @@ public: void enable(); void disable(); - + void set_min(float val); void set_max(float val); @@ -86,18 +86,18 @@ private: void set_name(const std::string& name); void set_value(const Raul::Atom& value); void set_range(float min, float max); - + void port_variable_change(const Raul::URI& key, const Raul::Atom& value); void update_range(); void update_value_from_slider(); void update_value_from_spinner(); - + bool slider_pressed(GdkEvent* ev); bool clicked(GdkEventButton* ev); bool _enabled; - + Gtk::Label* _name_label; Gtk::SpinButton* _value_spinner; Gtk::HScale* _slider; @@ -107,23 +107,23 @@ private: #if 0 /** A spinbutton for integer controls. - * + * * \ingroup GUI */ class IntegerControl : public Control { public: IntegerControl(ControlPanel* panel, SharedPtr<PortModel> pm); - + void enable(); void disable(); - + private: void set_name(const string& name); void set_value(float val); void update_value(); - + bool _enable_signal; Gtk::Alignment _alignment; Gtk::Label _name_label; @@ -133,25 +133,25 @@ private: /** A radio button for toggle controls. - * + * * \ingroup GUI */ class ToggleControl : public Control { public: ToggleControl(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml); - + void init(ControlPanel* panel, SharedPtr<Client::PortModel> pm); - + void enable(); void disable(); - + private: void set_name(const std::string& name); void set_value(const Raul::Atom& value); void toggled(); - + Gtk::Label* _name_label; Gtk::CheckButton* _checkbutton; }; diff --git a/src/gui/GladeFactory.cpp b/src/gui/GladeFactory.cpp index 0cbb0470..aa445f30 100644 --- a/src/gui/GladeFactory.cpp +++ b/src/gui/GladeFactory.cpp @@ -1,15 +1,15 @@ /* 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 @@ -44,7 +44,7 @@ GladeFactory::find_glade_file() cerr << "Unable to find ingen_gui.glade in " << INGEN_DATA_DIR << endl; throw; } - + fs.close(); cerr << "[GladeFactory] Loading widgets from " << glade_filename.c_str() << endl; } diff --git a/src/gui/GladeFactory.hpp b/src/gui/GladeFactory.hpp index 6da2da5f..f0e15373 100644 --- a/src/gui/GladeFactory.hpp +++ b/src/gui/GladeFactory.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp index d693704f..17ea7640 100644 --- a/src/gui/LoadPatchWindow.cpp +++ b/src/gui/LoadPatchWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -46,7 +46,7 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gno xml->get_widget("load_patch_poly_spinbutton", _poly_spinbutton); xml->get_widget("load_patch_ok_button", _ok_button); xml->get_widget("load_patch_cancel_button", _cancel_button); - + _poly_from_current_radio->signal_toggled().connect( sigc::mem_fun(this, &LoadPatchWindow::poly_from_file_selected)); _poly_from_file_radio->signal_toggled().connect( @@ -57,7 +57,7 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gno sigc::mem_fun(this, &LoadPatchWindow::ok_clicked)); _cancel_button->signal_clicked().connect( sigc::mem_fun(this, &LoadPatchWindow::cancel_clicked)); - + _poly_from_current_radio->set_active(true); Gtk::FileFilter filt; @@ -132,10 +132,10 @@ LoadPatchWindow::ok_clicked() // If unset load_patch will load value optional<Path> parent; optional<Symbol> symbol; - + if (_poly_from_user_radio->get_active()) _initial_data.insert(make_pair("ingen:polyphony", _poly_spinbutton->get_value_as_int())); - + if (_replace) App::instance().engine()->clear_patch(_patch->path()); @@ -146,10 +146,10 @@ LoadPatchWindow::ok_clicked() _patch.reset(); hide(); - + App::instance().loader()->load_patch(true, get_uri(), Path("/"), parent, symbol, _initial_data); -} +} void diff --git a/src/gui/LoadPatchWindow.hpp b/src/gui/LoadPatchWindow.hpp index 2cd9ef9e..58c421ef 100644 --- a/src/gui/LoadPatchWindow.hpp +++ b/src/gui/LoadPatchWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -32,7 +32,7 @@ using Ingen::Client::PluginModel; using Ingen::Client::PatchModel; namespace GUI { - + /** 'Load Patch' window. * @@ -77,7 +77,7 @@ private: Gtk::Button* _ok_button; Gtk::Button* _cancel_button; }; - + } // namespace GUI } // namespace Ingen diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index 5b2c7925..7361d5a9 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -47,10 +47,10 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr<G xml->get_widget("load_plugin_add_button", _add_button); //xml->get_widget("load_plugin_close_button", _close_button); //xml->get_widget("load_plugin_ok_button", _add_button); - + xml->get_widget("load_plugin_filter_combo", _filter_combo); xml->get_widget("load_plugin_search_entry", _search_entry); - + // Set up the plugins list _plugins_liststore = Gtk::ListStore::create(_plugins_columns); _plugins_treeview->set_model(_plugins_liststore); @@ -58,7 +58,7 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr<G _plugins_treeview->append_column("Name", _plugins_columns._col_name); _plugins_treeview->append_column("Type", _plugins_columns._col_type); _plugins_treeview->append_column("URI", _plugins_columns._col_uri); - + // This could be nicer.. store the TreeViewColumns locally maybe? _plugins_treeview->get_column(1)->set_sort_column(_plugins_columns._col_name); _plugins_treeview->get_column(2)->set_sort_column(_plugins_columns._col_type); @@ -67,7 +67,7 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr<G //m_plugins_treeview->get_column(4)->set_sort_column(_plugins_columns._col_label); for (int i=0; i < 3; ++i) _plugins_treeview->get_column(i)->set_resizable(true); - + _plugins_liststore->set_default_sort_func( sigc::mem_fun(this, &LoadPluginWindow::plugin_compare)); @@ -139,7 +139,7 @@ LoadPluginWindow::name_changed() } else { //m_message_label->set_text(""); _add_button->property_sensitive() = true; - } + } } @@ -168,7 +168,7 @@ LoadPluginWindow::set_patch(SharedPtr<PatchModel> patch) * * This is done here instead of construction time as the list population is * really expensive and bogs down creation of a patch. This is especially - * important when many patch notifications are sent at one time from the + * important when many patch notifications are sent at one time from the * engine. */ void @@ -244,7 +244,7 @@ LoadPluginWindow::add_plugin(SharedPtr<PluginModel> plugin) Gtk::TreeModel::iterator iter = _plugins_liststore->append(); Gtk::TreeModel::Row row = *iter; _rows.insert(make_pair(plugin->uri(), iter)); - + row[_plugins_columns._col_name] = plugin->name(); if (!strcmp(plugin->type_uri(), "ingen:Internal")) row[_plugins_columns._col_type] = "Internal"; @@ -307,7 +307,7 @@ LoadPluginWindow::generate_module_name(int offset) string name = ""; Gtk::TreeModel::iterator iter = _selection->get_selected(); - + if (iter) { Gtk::TreeModel::Row row = *iter; SharedPtr<PluginModel> plugin = row.get_value(_plugins_columns._col_plugin_model); @@ -327,8 +327,8 @@ LoadPluginWindow::add_clicked() { Gtk::TreeModel::iterator iter = _selection->get_selected(); bool polyphonic = _polyphonic_checkbutton->get_active(); - - if (iter) { // If anything is selected + + if (iter) { // If anything is selected Gtk::TreeModel::Row row = *iter; SharedPtr<PluginModel> plugin = row.get_value(_plugins_columns._col_plugin_model); string name = _node_name_entry->get_text(); @@ -349,7 +349,7 @@ LoadPluginWindow::add_clicked() i != _initial_data.end(); ++i) App::instance().engine()->set_variable(path, i->first, i->second); _node_name_entry->set_text(generate_module_name(++_plugin_name_offset)); - + // Cascade Atom& x = _initial_data["ingenuity:canvas-x"]; x = Atom(x.get_float() + 20.0f); @@ -388,16 +388,16 @@ LoadPluginWindow::filter_changed() // Get selected criteria const Gtk::TreeModel::Row row = *(_filter_combo->get_active()); CriteriaColumns::Criteria criteria = row[_criteria_columns._col_criteria]; - + string field; - + Gtk::TreeModel::Row model_row; Gtk::TreeModel::iterator model_iter; size_t num_visible = 0; - + for (ClientStore::Plugins::const_iterator i = App::instance().store()->plugins()->begin(); i != App::instance().store()->plugins()->end(); ++i) { - + const SharedPtr<PluginModel> plugin = (*i).second; switch (criteria) { @@ -410,13 +410,13 @@ LoadPluginWindow::filter_changed() default: throw; } - + transform(field.begin(), field.end(), field.begin(), ::toupper); - + if (field.find(search) != string::npos) { model_iter = _plugins_liststore->append(); model_row = *model_iter; - + model_row[_plugins_columns._col_name] = plugin->name(); model_row[_plugins_columns._col_type] = plugin->type_uri(); model_row[_plugins_columns._col_uri] = plugin->uri().str(); diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp index 0ff24ed7..09169ec0 100644 --- a/src/gui/LoadPluginWindow.hpp +++ b/src/gui/LoadPluginWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -36,7 +36,7 @@ using Ingen::Client::PluginModel; using Ingen::Client::PatchModel; namespace GUI { - + // Gtkmm _really_ needs to add some helper to abstract away this stupid nonsense @@ -75,9 +75,9 @@ class CriteriaColumns : public Gtk::TreeModel::ColumnRecord { public: enum Criteria { NAME, TYPE, URI, }; - + CriteriaColumns() { add(_col_label); add(_col_criteria); } - + Gtk::TreeModelColumn<Glib::ustring> _col_label; Gtk::TreeModelColumn<Criteria> _col_criteria; }; @@ -104,7 +104,7 @@ public: protected: void on_show(); bool on_key_press_event(GdkEventKey* event); - + private: void add_clicked(); //void close_clicked(); @@ -112,7 +112,7 @@ private: void filter_changed(); void clear_clicked(); void name_changed(); - + void new_plugin(SharedPtr<PluginModel> plugin); void plugin_property_changed(const Raul::URI& plugin, @@ -132,17 +132,17 @@ private: typedef std::map<Raul::URI, Gtk::TreeModel::iterator> Rows; Rows _rows; - + Glib::RefPtr<Gtk::ListStore> _plugins_liststore; ModelColumns _plugins_columns; Glib::RefPtr<Gtk::ListStore> _criteria_liststore; CriteriaColumns _criteria_columns; - + Glib::RefPtr<Gtk::TreeSelection> _selection; - + int _plugin_name_offset; // see comments for generate_plugin_name - + bool _has_shown; bool _refresh_list; Gtk::TreeView* _plugins_treeview; diff --git a/src/gui/LoadRemotePatchWindow.cpp b/src/gui/LoadRemotePatchWindow.cpp index ecfe5240..fc2a1653 100644 --- a/src/gui/LoadRemotePatchWindow.cpp +++ b/src/gui/LoadRemotePatchWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -44,12 +44,12 @@ LoadRemotePatchWindow::LoadRemotePatchWindow(BaseObjectType* cobject, const Glib xml->get_widget("load_remote_patch_uri_entry", _uri_entry); xml->get_widget("load_remote_patch_cancel_button", _cancel_button); xml->get_widget("load_remote_patch_open_button", _open_button); - + _liststore = Gtk::ListStore::create(_columns); _treeview->set_model(_liststore); _treeview->append_column("Name", _columns._col_name); _treeview->append_column("URI", _columns._col_uri); - + _selection = _treeview->get_selection(); _selection->signal_changed().connect(sigc::mem_fun(this, &LoadRemotePatchWindow::patch_selected)); _treeview->signal_row_activated().connect(sigc::mem_fun(this, &LoadRemotePatchWindow::patch_activated)); @@ -67,7 +67,7 @@ LoadRemotePatchWindow::present(SharedPtr<PatchModel> patch, GraphObject::Propert set_patch(patch); _initial_data = data; - + Redland::Model model(*App::instance().world()->rdf_world, "http://rdf.drobilla.net/ingen_patches/index.ttl", "http://rdf.drobilla.net/ingen_patches/"); @@ -79,7 +79,7 @@ LoadRemotePatchWindow::present(SharedPtr<PatchModel> patch, GraphObject::Propert "}")); Redland::Query::Results results = query.run(*App::instance().world()->rdf_world, model); - + for (Redland::Query::Results::iterator i = results.begin(); i != results.end(); ++i) { Gtk::TreeModel::iterator iter = _liststore->append(); (*iter)[_columns._col_name] = (*i)["name"].to_string(); @@ -87,7 +87,7 @@ LoadRemotePatchWindow::present(SharedPtr<PatchModel> patch, GraphObject::Propert } _treeview->columns_autosize(); - + Gtk::Window::present(); } @@ -121,8 +121,8 @@ void LoadRemotePatchWindow::patch_selected() { Gtk::TreeModel::iterator selected_i = _selection->get_selected(); - - if (selected_i) { // If anything is selected + + if (selected_i) { // If anything is selected const Glib::ustring uri = selected_i->get_value(_columns._col_uri); _uri_entry->set_text(uri); } @@ -137,7 +137,7 @@ LoadRemotePatchWindow::open_clicked() // If unset load_patch will load values optional<Path> parent; optional<Symbol> symbol; - + if (_replace) App::instance().engine()->clear_patch(_patch->path()); @@ -146,9 +146,9 @@ LoadRemotePatchWindow::open_clicked() App::instance().loader()->load_patch(true, uri, Path("/"), parent, symbol, _initial_data); - + hide(); -} +} void diff --git a/src/gui/LoadRemotePatchWindow.hpp b/src/gui/LoadRemotePatchWindow.hpp index 211924d5..9af0d922 100644 --- a/src/gui/LoadRemotePatchWindow.hpp +++ b/src/gui/LoadRemotePatchWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -77,7 +77,7 @@ private: SharedPtr<PatchModel> _patch; bool _replace; - + Glib::RefPtr<Gtk::TreeSelection> _selection; Glib::RefPtr<Gtk::ListStore> _liststore; PatchColumns _columns; @@ -87,7 +87,7 @@ private: Gtk::Button* _open_button; Gtk::Button* _cancel_button; }; - + } // namespace GUI } // namespace Ingen diff --git a/src/gui/LoadSubpatchWindow.cpp b/src/gui/LoadSubpatchWindow.cpp index 302b5387..548039c5 100644 --- a/src/gui/LoadSubpatchWindow.cpp +++ b/src/gui/LoadSubpatchWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -66,7 +66,7 @@ LoadSubpatchWindow::LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefP set_filter(filt); property_select_multiple() = true; - + // Add global examples directory to "shortcut folders" (bookmarks) const string examples_dir = Shared::data_file_path("patches"); DIR* d = opendir(examples_dir.c_str()); @@ -146,11 +146,11 @@ void LoadSubpatchWindow::ok_clicked() { assert(_patch); - + // If unset load_patch will load values optional<Raul::Symbol> symbol; string name_str = ""; - + if (_name_from_user_radio->get_active()) { name_str = _name_entry->get_text(); symbol = Symbol::symbolify(name_str); @@ -176,7 +176,7 @@ LoadSubpatchWindow::ok_clicked() } hide(); -} +} void diff --git a/src/gui/LoadSubpatchWindow.hpp b/src/gui/LoadSubpatchWindow.hpp index 9e4fda0d..5a34363b 100644 --- a/src/gui/LoadSubpatchWindow.hpp +++ b/src/gui/LoadSubpatchWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -30,7 +30,7 @@ namespace Client { class PatchModel; } using Ingen::Client::PatchModel; namespace GUI { - + /** 'Add Subpatch' window. * @@ -44,7 +44,7 @@ public: LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml); void set_patch(SharedPtr<PatchModel> patch); - + void present(SharedPtr<PatchModel> patch, GraphObject::Properties data); protected: @@ -55,14 +55,14 @@ private: void enable_name_entry(); void disable_poly_spinner(); void enable_poly_spinner(); - + void ok_clicked(); void cancel_clicked(); GraphObject::Properties _initial_data; SharedPtr<PatchModel> _patch; - + Gtk::RadioButton* _name_from_file_radio; Gtk::RadioButton* _name_from_user_radio; Gtk::Entry* _name_entry; @@ -73,7 +73,7 @@ private: Gtk::Button* _ok_button; Gtk::Button* _cancel_button; }; - + } // namespace GUI } // namespace Ingen diff --git a/src/gui/MessagesWindow.cpp b/src/gui/MessagesWindow.cpp index 3da810f6..71967a0e 100644 --- a/src/gui/MessagesWindow.cpp +++ b/src/gui/MessagesWindow.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/gui/MessagesWindow.hpp b/src/gui/MessagesWindow.hpp index dea0fdd4..4099fee7 100644 --- a/src/gui/MessagesWindow.hpp +++ b/src/gui/MessagesWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -26,7 +26,7 @@ using std::string; namespace Ingen { namespace GUI { - + /** Messages Window. * diff --git a/src/gui/NewSubpatchWindow.cpp b/src/gui/NewSubpatchWindow.cpp index c6be5230..b5145afe 100644 --- a/src/gui/NewSubpatchWindow.cpp +++ b/src/gui/NewSubpatchWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -41,7 +41,7 @@ NewSubpatchWindow::NewSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr _name_entry->signal_changed().connect(sigc::mem_fun(this, &NewSubpatchWindow::name_changed)); _ok_button->signal_clicked().connect(sigc::mem_fun(this, &NewSubpatchWindow::ok_clicked)); _cancel_button->signal_clicked().connect(sigc::mem_fun(this, &NewSubpatchWindow::cancel_clicked)); - + _ok_button->property_sensitive() = false; } @@ -84,7 +84,7 @@ NewSubpatchWindow::name_changed() } else { _message_label->set_text(""); _ok_button->property_sensitive() = true; - } + } } @@ -99,9 +99,9 @@ NewSubpatchWindow::ok_clicked() App::instance().engine()->set_variable(path, i->first, i->second); App::instance().engine()->set_variable(path, "ingen:enabled", (bool)true); - + hide(); -} +} void diff --git a/src/gui/NewSubpatchWindow.hpp b/src/gui/NewSubpatchWindow.hpp index 186e0953..6a0882cc 100644 --- a/src/gui/NewSubpatchWindow.hpp +++ b/src/gui/NewSubpatchWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -30,7 +30,7 @@ namespace Client { class PatchModel; } using Ingen::Client::PatchModel; namespace GUI { - + /** 'New Subpatch' window. * @@ -54,14 +54,14 @@ private: GraphObject::Properties _initial_data; SharedPtr<PatchModel> _patch; - + Gtk::Entry* _name_entry; Gtk::Label* _message_label; Gtk::SpinButton* _poly_spinbutton; Gtk::Button* _ok_button; Gtk::Button* _cancel_button; }; - + } // namespace GUI } // namespace Ingen diff --git a/src/gui/NodeControlWindow.cpp b/src/gui/NodeControlWindow.cpp index 0384c934..505599b6 100644 --- a/src/gui/NodeControlWindow.cpp +++ b/src/gui/NodeControlWindow.cpp @@ -1,15 +1,15 @@ /* 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 alongCont * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -41,7 +41,7 @@ NodeControlWindow::NodeControlWindow(SharedPtr<NodeModel> node, uint32_t poly) , _y(0) { assert(_node != NULL); - + property_resizable() = true; set_border_width(5); @@ -49,15 +49,15 @@ NodeControlWindow::NodeControlWindow(SharedPtr<NodeModel> node, uint32_t poly) Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference("warehouse_win"); xml->get_widget_derived("control_panel_vbox", _control_panel); - + show_all_children(); - + _control_panel->reparent(*this); _control_panel->init(_node, poly); _control_panel->show(); resize(); - + _callback_enabled = true; } @@ -69,7 +69,7 @@ NodeControlWindow::NodeControlWindow(SharedPtr<NodeModel> node, ControlPanel* pa , _control_panel(panel) { assert(_node); - + property_resizable() = true; set_border_width(5); @@ -79,7 +79,7 @@ NodeControlWindow::NodeControlWindow(SharedPtr<NodeModel> node, ControlPanel* pa show_all_children(); resize(); - + _callback_enabled = true; } diff --git a/src/gui/NodeControlWindow.hpp b/src/gui/NodeControlWindow.hpp index 2e6c5837..0e3374eb 100644 --- a/src/gui/NodeControlWindow.hpp +++ b/src/gui/NodeControlWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -33,7 +33,7 @@ using Ingen::Client::NodeModel; namespace Ingen { namespace GUI { - + class ControlGroup; class ControlPanel; @@ -52,7 +52,7 @@ public: SharedPtr<NodeModel> node() { return _node; } ControlPanel* control_panel() const { return _control_panel; } - + void resize(); protected: @@ -63,7 +63,7 @@ private: SharedPtr<NodeModel> _node; ControlPanel* _control_panel; bool _callback_enabled; - + bool _position_stored; int _x; int _y; diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp index 5917b400..6a9734cb 100644 --- a/src/gui/NodeMenu.cpp +++ b/src/gui/NodeMenu.cpp @@ -1,15 +1,15 @@ /* 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 @@ -49,7 +49,7 @@ NodeMenu::NodeMenu(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml node_menu->remove(*_popup_gui_menuitem); node_menu->remove(*_embed_gui_menuitem); node_menu->remove(*_randomize_menuitem); - + insert(*_randomize_menuitem, 0); items().push_front(Gtk::Menu_Helpers::SeparatorElem()); insert(*_controls_menuitem, 0); @@ -63,7 +63,7 @@ void NodeMenu::init(SharedPtr<NodeModel> node) { ObjectMenu::init(node); - + _learn_menuitem->signal_activate().connect(sigc::mem_fun(this, &NodeMenu::on_menu_learn)); _controls_menuitem->signal_activate().connect(sigc::bind( @@ -84,7 +84,7 @@ NodeMenu::init(SharedPtr<NodeModel> node) _popup_gui_menuitem->hide(); _embed_gui_menuitem->hide(); } - + #ifdef HAVE_SLV2 if (plugin && plugin->type() == PluginModel::LV2) { SLV2Results presets = slv2_plugin_query_sparql(plugin->slv2_plugin(), @@ -160,7 +160,7 @@ NodeMenu::on_menu_learn() App::instance().engine()->midi_learn(_object->path()); } - + void NodeMenu::on_menu_disconnect() { @@ -202,7 +202,7 @@ NodeMenu::has_control_inputs() for (NodeModel::Ports::const_iterator i = nm->ports().begin(); i != nm->ports().end(); ++i) if ((*i)->is_input() && (*i)->type().is_control()) return true; - + return false; } diff --git a/src/gui/NodeMenu.hpp b/src/gui/NodeMenu.hpp index a15b2b91..de930449 100644 --- a/src/gui/NodeMenu.hpp +++ b/src/gui/NodeMenu.hpp @@ -1,15 +1,15 @@ /* 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 @@ -38,19 +38,19 @@ class NodeMenu : public ObjectMenu { public: NodeMenu(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml); - + virtual void program_add(int bank, int program, const std::string& name) {} virtual void program_remove(int bank, int program) {} void init(SharedPtr<NodeModel> node); bool has_control_inputs(); - + sigc::signal<void> signal_popup_gui; sigc::signal<void, bool> signal_embed_gui; - + protected: - + virtual void enable_controls_menuitem(); virtual void disable_controls_menuitem(); diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index efc2febd..9dd8b7a7 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -1,15 +1,15 @@ /* 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 @@ -60,7 +60,7 @@ NodeModule::NodeModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeMode NodeModule::~NodeModule() { NodeControlWindow* win = App::instance().window_factory()->control_window(_node); - + if (win) { // Should remove from window factory via signal delete win; @@ -76,7 +76,7 @@ NodeModule::create_menu() _menu->init(_node); _menu->signal_embed_gui.connect(sigc::mem_fun(this, &NodeModule::embed_gui)); _menu->signal_popup_gui.connect(sigc::hide_return(sigc::mem_fun(this, &NodeModule::popup_gui))); - + set_menu(_menu); } @@ -98,7 +98,7 @@ NodeModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> n for (NodeModel::Ports::const_iterator p = node->ports().begin(); p != node->ports().end(); ++p) { ret->add_port(*p, false); } - + ret->set_stacked_border(node->polyphonic()); if (human) @@ -119,7 +119,7 @@ NodeModule::show_human_names(bool b) } else { b = false; } - + if (!b) set_name(node()->symbol()); @@ -210,7 +210,7 @@ NodeModule::embed_gui(bool embed) if ((*p)->type().is_control() && (*p)->is_output()) App::instance().engine()->set_property((*p)->path(), "ingen:broadcast", false); } - + if (embed && _embed_item) { initialise_gui_values(); set_base_color(0x212222FF); @@ -234,7 +234,7 @@ void NodeModule::add_port(SharedPtr<PortModel> port, bool resize_to_fit) { uint32_t index = _ports.size(); // FIXME: kludge, engine needs to tell us this - + string name = port->path().name(); if (App::instance().configuration()->name_style() == Configuration::HUMAN && node()->plugin()) { string hn = ((PluginModel*)node()->plugin())->port_human_name(index); @@ -244,7 +244,7 @@ NodeModule::add_port(SharedPtr<PortModel> port, bool resize_to_fit) Module::add_port(boost::shared_ptr<Port>( new Port(PtrCast<NodeModule>(shared_from_this()), port, name))); - + port->signal_value_changed.connect(sigc::bind<0>( sigc::mem_fun(this, &NodeModule::value_changed), index)); @@ -252,7 +252,7 @@ NodeModule::add_port(SharedPtr<PortModel> port, bool resize_to_fit) resize(); } - + boost::shared_ptr<Port> NodeModule::port(boost::shared_ptr<PortModel> model) { @@ -296,7 +296,7 @@ NodeModule::popup_gui() if (_plugin_ui) { GtkWidget* c_widget = (GtkWidget*)slv2_ui_instance_get_widget(_plugin_ui->instance()); _gui_widget = Glib::wrap(c_widget); - + _gui_window = new Gtk::Window(); _gui_window->add(*_gui_widget); _gui_widget->show_all(); @@ -324,7 +324,7 @@ NodeModule::on_gui_window_close() _plugin_ui.reset(); _gui_widget = NULL; } - + void NodeModule::initialise_gui_values() @@ -343,7 +343,7 @@ NodeModule::show_control_window() { App::instance().window_factory()->present_controls(_node); } - + void NodeModule::on_double_click(GdkEventButton* ev) @@ -358,10 +358,10 @@ NodeModule::store_location() { const float x = static_cast<float>(property_x()); const float y = static_cast<float>(property_y()); - + const Atom& existing_x = _node->get_variable("ingenuity:canvas-x"); const Atom& existing_y = _node->get_variable("ingenuity:canvas-y"); - + if (existing_x.type() != Atom::FLOAT || existing_y.type() != Atom::FLOAT || existing_x.get_float() != x || existing_y.get_float() != y) { App::instance().engine()->set_variable(_node->path(), "ingenuity:canvas-x", Atom(x)); diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp index 47dfa374..6960a00e 100644 --- a/src/gui/NodeModule.hpp +++ b/src/gui/NodeModule.hpp @@ -1,14 +1,14 @@ /* This file is part of In* 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 @@ -34,7 +34,7 @@ using namespace Ingen::Client; namespace Ingen { namespace GUI { - + class PatchCanvas; class Port; class NodeMenu; @@ -42,7 +42,7 @@ class NodeMenu; /** A module in a patch. * - * This base class is extended for various types of modules. + * This base class is extended for various types of modules. * * \ingroup GUI */ @@ -55,9 +55,9 @@ public: bool human_names); virtual ~NodeModule(); - + boost::shared_ptr<Port> port(boost::shared_ptr<PortModel> model); - + void remove_port(SharedPtr<PortModel> port); virtual void store_location(); @@ -75,17 +75,17 @@ protected: bool popup_gui(); void on_gui_window_close(); void set_selected(bool b); - + void rename(); void set_variable(const Raul::URI& predicate, const Raul::Atom& value); - + void add_port(SharedPtr<PortModel> port, bool resize=true); void value_changed(uint32_t index, const Raul::Atom& value); void initialise_gui_values(); void create_menu(); - + SharedPtr<NodeModel> _node; NodeMenu* _menu; SharedPtr<PluginUI> _plugin_ui; diff --git a/src/gui/NodePropertiesWindow.cpp b/src/gui/NodePropertiesWindow.cpp index 3739cd5e..1b01ab8b 100644 --- a/src/gui/NodePropertiesWindow.cpp +++ b/src/gui/NodePropertiesWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -46,11 +46,11 @@ void NodePropertiesWindow::set_node(SharedPtr<NodeModel> node_model) { assert(node_model); - + _node_model = node_model; set_title(node_model->path().str() + " Properties"); - + _node_path_label->set_text(node_model->path().str()); _node_polyphonic_toggle->set_active(node_model->polyphonic()); diff --git a/src/gui/NodePropertiesWindow.hpp b/src/gui/NodePropertiesWindow.hpp index 0152ed5b..d626e225 100644 --- a/src/gui/NodePropertiesWindow.hpp +++ b/src/gui/NodePropertiesWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -43,7 +43,7 @@ public: void set_node(SharedPtr<NodeModel> node_model); private: - + SharedPtr<NodeModel> _node_model; Gtk::Label* _node_path_label; Gtk::CheckButton* _node_polyphonic_toggle; diff --git a/src/gui/ObjectMenu.cpp b/src/gui/ObjectMenu.cpp index 904ada74..5b61857c 100644 --- a/src/gui/ObjectMenu.cpp +++ b/src/gui/ObjectMenu.cpp @@ -1,15 +1,15 @@ /* 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 @@ -51,22 +51,22 @@ ObjectMenu::init(SharedPtr<ObjectModel> object) _object = object; App& app = App::instance(); - + _polyphonic_menuitem->signal_toggled().connect( sigc::mem_fun(this, &ObjectMenu::on_menu_polyphonic)); - + _polyphonic_menuitem->set_active(object->polyphonic()); - + _disconnect_menuitem->signal_activate().connect( sigc::mem_fun(this, &ObjectMenu::on_menu_disconnect)); _rename_menuitem->signal_activate().connect(sigc::bind( sigc::mem_fun(app.window_factory(), &WindowFactory::present_rename), object)); - + _destroy_menuitem->signal_activate().connect( sigc::mem_fun(this, &ObjectMenu::on_menu_destroy)); - + _properties_menuitem->signal_activate().connect( sigc::mem_fun(this, &ObjectMenu::on_menu_properties)); diff --git a/src/gui/ObjectMenu.hpp b/src/gui/ObjectMenu.hpp index 3c59580c..ff93f7c9 100644 --- a/src/gui/ObjectMenu.hpp +++ b/src/gui/ObjectMenu.hpp @@ -1,15 +1,15 @@ /* 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 @@ -40,7 +40,7 @@ class ObjectMenu : public Gtk::Menu { public: ObjectMenu(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml); - + void init(SharedPtr<ObjectModel> object); protected: diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 99ed8446..8d71ca6a 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -1,15 +1,15 @@ /* 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 @@ -72,7 +72,7 @@ PatchCanvas::PatchCanvas(SharedPtr<PatchModel> patch, int width, int height) { Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference(); xml->get_widget("canvas_menu", _menu); - + /*xml->get_widget("canvas_menu_add_number_control", _menu_add_number_control); xml->get_widget("canvas_menu_add_button_control", _menu_add_button_control);*/ xml->get_widget("canvas_menu_add_audio_input", _menu_add_audio_input); @@ -104,7 +104,7 @@ PatchCanvas::PatchCanvas(SharedPtr<PatchModel> patch, int width, int height) _menu_add_event_output->signal_activate().connect( sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port), "event_out", "Event Out", "lv2ev:EventPort", true)); - + // Add control menu items /*_menu_add_number_control->signal_activate().connect( sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_control), NUMBER)); @@ -118,9 +118,9 @@ PatchCanvas::PatchCanvas(SharedPtr<PatchModel> patch, int width, int height) _patch->signal_removed_port.connect(sigc::mem_fun(this, &PatchCanvas::remove_port)); _patch->signal_new_connection.connect(sigc::mem_fun(this, &PatchCanvas::connection)); _patch->signal_removed_connection.connect(sigc::mem_fun(this, &PatchCanvas::disconnection)); - + App::instance().store()->signal_new_plugin.connect(sigc::mem_fun(this, &PatchCanvas::add_plugin)); - + // Connect widget signals to do things _menu_load_plugin->signal_activate().connect(sigc::mem_fun(this, &PatchCanvas::menu_load_plugin)); _menu_load_patch->signal_activate().connect(sigc::mem_fun(this, &PatchCanvas::menu_load_patch)); @@ -133,7 +133,7 @@ PatchCanvas::show_menu(GdkEvent* event) { if (!_internal_menu) build_menus(); - + _menu->popup(event->button.button, event->button.time); } @@ -157,7 +157,7 @@ PatchCanvas::build_menus() #ifdef HAVE_SLV2 if (!_plugin_menu) build_plugin_menu(); - + // Build (or clear existing) uncategorized (classless, heh) plugins menu if (_classless_menu) { _classless_menu->items().clear(); @@ -169,7 +169,7 @@ PatchCanvas::build_menus() _classless_menu->hide(); } #endif - + // Add known plugins to menu heirarchy SharedPtr<const ClientStore::Plugins> plugins = App::instance().store()->plugins(); for (ClientStore::Plugins::const_iterator i = plugins->begin(); i != plugins->end(); ++i) { @@ -191,11 +191,11 @@ PatchCanvas::build_plugin_class_menu(Gtk::Menu* menu, const char* class_uri_str = slv2_value_as_string(class_uri); _class_menus.insert(make_pair(class_uri_str, menu)); - + LV2Children::const_iterator kids_begin = children.find(class_uri_str); if (kids_begin == children.end()) return 0; - + LV2Children::const_iterator kids_end = children.upper_bound(class_uri_str); // Add submenus @@ -252,7 +252,7 @@ PatchCanvas::build() { boost::shared_ptr<PatchCanvas> shared_this = boost::dynamic_pointer_cast<PatchCanvas>(shared_from_this()); - + // Create modules for nodes for (ObjectModel::const_iterator i = App::instance().store()->children_begin(_patch); i != App::instance().store()->children_end(_patch); ++i) { @@ -274,12 +274,12 @@ PatchCanvas::build() } } - + void PatchCanvas::arrange(bool ingen_doesnt_use_length_hints) { FlowCanvas::Canvas::arrange(false); - + for (list<boost::shared_ptr<Item> >::iterator i = _items.begin(); i != _items.end(); ++i) (*i)->store_location(); } @@ -293,7 +293,7 @@ PatchCanvas::show_human_names(bool b) boost::shared_ptr<NodeModule> mod = boost::dynamic_pointer_cast<NodeModule>(*m); if (mod) mod->show_human_names(b); - + boost::shared_ptr<PatchPortModule> pmod = boost::dynamic_pointer_cast<PatchPortModule>(*m); if (pmod) pmod->show_human_names(b); @@ -312,7 +312,7 @@ PatchCanvas::show_port_names(bool b) } } - + void PatchCanvas::add_plugin(SharedPtr<PluginModel> p) { @@ -367,7 +367,7 @@ PatchCanvas::add_node(SharedPtr<NodeModel> nm) if (plugm && plugm->icon_path() != "") module->set_icon(App::instance().icon_from_path(plugm->icon_path(), 100)); } - + add_item(module); module->show(); _views.insert(std::make_pair(nm, module)); @@ -411,12 +411,12 @@ PatchCanvas::remove_port(SharedPtr<PortModel> pm) cerr << "WARNING: Failed to remove port item: " << pm->path() << endl; i->second.reset(); _views.erase(i); - + } else { SharedPtr<NodeModule> module = PtrCast<NodeModule>(_views[pm->parent()]); module->remove_port(pm); } - + assert(_views.find(pm) == _views.end()); } @@ -425,7 +425,7 @@ SharedPtr<FlowCanvas::Port> PatchCanvas::get_port_view(SharedPtr<PortModel> port) { SharedPtr<FlowCanvas::Module> module = _views[port]; - + // Port on this patch if (module) { return (PtrCast<PatchPortModule>(module)) @@ -442,7 +442,7 @@ PatchCanvas::get_port_view(SharedPtr<PortModel> port) } } } - + return SharedPtr<FlowCanvas::Port>(); } @@ -451,7 +451,7 @@ void PatchCanvas::connection(SharedPtr<ConnectionModel> cm) { assert(cm); - + const SharedPtr<FlowCanvas::Port> src = get_port_view(cm->src_port()); const SharedPtr<FlowCanvas::Port> dst = get_port_view(cm->dst_port()); @@ -470,7 +470,7 @@ PatchCanvas::disconnection(SharedPtr<ConnectionModel> cm) { const SharedPtr<FlowCanvas::Port> src = get_port_view(cm->src_port()); const SharedPtr<FlowCanvas::Port> dst = get_port_view(cm->dst_port()); - + if (src && dst) remove_connection(src, dst); else @@ -488,7 +488,7 @@ PatchCanvas::connect(boost::shared_ptr<FlowCanvas::Connectable> src_port, const boost::shared_ptr<Ingen::GUI::Port> dst = boost::dynamic_pointer_cast<Ingen::GUI::Port>(dst_port); - + if (!src || !dst) return; @@ -507,9 +507,9 @@ PatchCanvas::connect(boost::shared_ptr<FlowCanvas::Connectable> src_port, App::instance().engine()->connect(src->model()->path(), nm->path() + "/MIDI_In"); App::instance().engine()->connect(nm->path() + "/Out_(CR)", dst->model()->path()); App::instance().engine()->midi_learn(nm->path()); - + // Set control node range to port's user range - + App::instance().engine()->set_port_value_queued(nm->path().base() + "Min", dst->model()->get_variable("user-min").get_float()); App::instance().engine()->set_port_value_queued(nm->path().base() + "Max", @@ -530,7 +530,7 @@ PatchCanvas::disconnect(boost::shared_ptr<FlowCanvas::Connectable> src_port, const boost::shared_ptr<Ingen::GUI::Port> dst = boost::dynamic_pointer_cast<Ingen::GUI::Port>(dst_port); - + App::instance().engine()->disconnect(src->model()->path(), dst->model()->path()); } @@ -540,7 +540,7 @@ bool PatchCanvas::canvas_event(GdkEvent* event) { assert(event); - + bool ret = false; switch (event->type) { @@ -553,11 +553,11 @@ PatchCanvas::canvas_event(GdkEvent* event) ret = true; } break; - + case GDK_KEY_PRESS: case GDK_KEY_RELEASE: ret = canvas_key_event(&event->key); - + default: break; } @@ -565,7 +565,7 @@ PatchCanvas::canvas_event(GdkEvent* event) return (ret ? true : Canvas::canvas_event(event)); } - + bool PatchCanvas::canvas_key_event(GdkEventKey* event) { @@ -635,22 +635,22 @@ PatchCanvas::copy_selection() serialiser.serialise(port_module->port()); } } - + for (list<boost::shared_ptr<FlowCanvas::Connection> >::iterator c = _selected_connections.begin(); c != _selected_connections.end(); ++c) { boost::shared_ptr<Connection> connection = boost::dynamic_pointer_cast<Connection>(*c); if (connection) serialiser.serialise_connection(_patch, connection->model()); } - + string result = serialiser.finish(); _paste_count = 0; - + Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get(); clipboard->set_text(result); } - + void PatchCanvas::paste() { @@ -683,7 +683,7 @@ PatchCanvas::paste() if (!_patch->path().is_root()) clipboard.new_patch(_patch->path(), _patch->poly()); - + boost::optional<Raul::Path> data_path; boost::optional<Raul::Path> parent; boost::optional<Raul::Symbol> symbol; @@ -695,7 +695,7 @@ PatchCanvas::paste() ClashAvoider avoider(*App::instance().store().get(), clipboard, &clipboard); parser->parse_string(App::instance().world(), &avoider, str, "", data_path, parent, symbol); - + for (Store::iterator i = clipboard.begin(); i != clipboard.end(); ++i) { if (_patch->path().is_root() && i->first.is_root()) { //cout << "Skipping root" << endl; @@ -732,7 +732,7 @@ PatchCanvas::paste() App::instance().engine()->connect(i->first, i->second); }*/ } - + void PatchCanvas::generate_port_name( @@ -765,7 +765,7 @@ PatchCanvas::menu_add_control(ControlType type) GraphObject::Properties data = get_initial_data(); float x = data["ingenuity:canvas-x"].get_float(); float y = data["ingenuity:canvas-y"].get_float(); - + cerr << "ADD CONTROL: " << (unsigned)type << " @ " << x << ", " << y << endl; add_item(boost::shared_ptr<FlowCanvas::Item>( @@ -803,7 +803,7 @@ PatchCanvas::load_plugin(WeakPtr<PluginModel> weak_plugin) ss << name << "_" << offset; name = ss.str(); } - + const Path path = _patch->path().base() + name; // FIXME: polyphony? App::instance().engine()->new_node(path, plugin->uri()); @@ -830,10 +830,10 @@ GraphObject::Properties PatchCanvas::get_initial_data() { GraphObject::Properties result; - + result["ingenuity:canvas-x"] = Atom((float)_last_click_x); result["ingenuity:canvas-y"] = Atom((float)_last_click_y); - + return result; } diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp index d3b55936..6a708869 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/PatchCanvas.hpp @@ -1,15 +1,15 @@ /* 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 @@ -45,7 +45,7 @@ namespace Client { class PatchModel; } using Ingen::Client::PatchModel; namespace GUI { - + class NodeModule; @@ -57,7 +57,7 @@ class PatchCanvas : public FlowCanvas::Canvas { public: PatchCanvas(SharedPtr<PatchModel> patch, int width, int height); - + virtual ~PatchCanvas() {} void build(); @@ -82,13 +82,13 @@ public: void select_all(); void show_menu(GdkEvent* event); - + bool canvas_key_event(GdkEventKey* event); - + private: enum ControlType { NUMBER, BUTTON }; void menu_add_control(ControlType type); - + void generate_port_name( const string& sym_base, string& sym, const string& name_base, string& name); @@ -96,7 +96,7 @@ private: void menu_add_port( const string& sym_base, const string& name_base, const string& type, bool is_output); - + void menu_load_plugin(); void menu_new_patch(); void menu_load_patch(); @@ -116,11 +116,11 @@ private: SLV2PluginClasses classes, const LV2Children& children); #endif - + GraphObject::Properties get_initial_data(); bool canvas_event(GdkEvent* event); - + SharedPtr<FlowCanvas::Port> get_port_view(SharedPtr<PortModel> port); void connect(boost::shared_ptr<FlowCanvas::Connectable> src, @@ -140,7 +140,7 @@ private: typedef std::multimap<const std::string, Gtk::Menu*> ClassMenus; ClassMenus _class_menus; - + bool _human_names; bool _show_port_names; Gtk::Menu* _menu; diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index ffb05e8d..d7933b1d 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -1,15 +1,15 @@ /* 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 @@ -62,11 +62,11 @@ PatchPortModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortMod ret->add_port(port); ret->set_port(port); ret->set_menu(port->menu()); - + for (GraphObject::Properties::const_iterator m = model->variables().begin(); m != model->variables().end(); ++m) ret->set_variable(m->first, m->second); - + for (GraphObject::Properties::const_iterator m = model->properties().begin(); m != model->properties().end(); ++m) ret->set_property(m->first, m->second); @@ -86,20 +86,20 @@ PatchPortModule::create_menu() Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference(); xml->get_widget_derived("object_menu", _menu); _menu->init(_model, true); - + set_menu(_menu); } void PatchPortModule::store_location() -{ +{ const float x = static_cast<float>(property_x()); const float y = static_cast<float>(property_y()); - + const Atom& existing_x = _model->get_property("ingenuity:canvas-x"); const Atom& existing_y = _model->get_property("ingenuity:canvas-y"); - + if (existing_x.type() != Atom::FLOAT || existing_y.type() != Atom::FLOAT || existing_x.get_float() != x || existing_y.get_float() != y) { App::instance().engine()->set_property(_model->path(), "ingenuity:canvas-x", Atom(x)); @@ -118,7 +118,7 @@ PatchPortModule::show_human_names(bool b) set_name(name.get_string()); else set_name(_model->symbol()); - + resize(); } diff --git a/src/gui/PatchPortModule.hpp b/src/gui/PatchPortModule.hpp index 2a1cf704..c9363a3d 100644 --- a/src/gui/PatchPortModule.hpp +++ b/src/gui/PatchPortModule.hpp @@ -1,15 +1,15 @@ /* 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 @@ -35,7 +35,7 @@ using namespace Ingen::Client; namespace Ingen { namespace GUI { - + class PatchCanvas; class Port; class PortMenu; @@ -53,10 +53,10 @@ public: static boost::shared_ptr<PatchPortModule> create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortModel> model, bool human); - + virtual void store_location(); void show_human_names(bool b); - + void set_name(const std::string& n); SharedPtr<PortModel> port() const { return _model; } @@ -68,7 +68,7 @@ protected: void set_selected(bool b); void set_port(SharedPtr<Port> port) { _port = port; } - + void set_variable(const Raul::URI& predicate, const Raul::Atom& value); void set_property(const Raul::URI& predicate, const Raul::Atom& value); diff --git a/src/gui/PatchPropertiesWindow.cpp b/src/gui/PatchPropertiesWindow.cpp index 0fc080e0..915379fe 100644 --- a/src/gui/PatchPropertiesWindow.cpp +++ b/src/gui/PatchPropertiesWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -52,11 +52,11 @@ PatchPropertiesWindow::set_patch(SharedPtr<PatchModel> patch_model) { property_title() = patch_model->path().str() + " Properties"; _patch_model = patch_model; - + const Atom& name_atom = _patch_model->get_property("doap:name"); _name_entry->set_text( (name_atom.type() == Atom::STRING) ? name_atom.get_string() : "" ); - + const Atom& author_atom = _patch_model->get_property("dc:creator"); _author_entry->set_text( (author_atom.type() == Atom::STRING) ? author_atom.get_string() : "" ); @@ -81,7 +81,7 @@ PatchPropertiesWindow::cancel_clicked() const Atom& desc_atom = _patch_model->get_property("dc:description"); _textview->get_buffer()->set_text( (desc_atom.type() == Atom::STRING) ? desc_atom.get_string() : "" ); - + hide(); } diff --git a/src/gui/PatchPropertiesWindow.hpp b/src/gui/PatchPropertiesWindow.hpp index 1020bffc..8954a3ca 100644 --- a/src/gui/PatchPropertiesWindow.hpp +++ b/src/gui/PatchPropertiesWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -29,7 +29,7 @@ using Ingen::Client::PatchModel; namespace Ingen { namespace GUI { - + /** Patch Properties Window. * @@ -44,7 +44,7 @@ public: void present(SharedPtr<PatchModel> patch_model) { set_patch(patch_model); Gtk::Window::present(); } void set_patch(SharedPtr<PatchModel> patch_model); - + void cancel_clicked(); void ok_clicked(); diff --git a/src/gui/PatchTreeWindow.cpp b/src/gui/PatchTreeWindow.cpp index 0b699f64..bf78a803 100644 --- a/src/gui/PatchTreeWindow.cpp +++ b/src/gui/PatchTreeWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -29,7 +29,7 @@ using namespace Raul; namespace Ingen { namespace GUI { - + PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) @@ -37,7 +37,7 @@ PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject, , _enable_signal(true) { xml->get_widget_derived("patches_treeview", _patches_treeview); - + _patch_treestore = Gtk::TreeStore::create(_patch_tree_columns); _patches_treeview->set_window(this); _patches_treeview->set_model(_patch_treestore); @@ -53,16 +53,16 @@ PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject, Gtk::CellRendererToggle* enabled_renderer = dynamic_cast<Gtk::CellRendererToggle*>( _patches_treeview->get_column_cell_renderer(1)); enabled_renderer->property_activatable() = true; - + _patch_tree_selection = _patches_treeview->get_selection(); - + //m_patch_tree_selection->signal_changed().connect( - // sigc::mem_fun(this, &PatchTreeWindow::event_patch_selected)); + // sigc::mem_fun(this, &PatchTreeWindow::event_patch_selected)); _patches_treeview->signal_row_activated().connect( sigc::mem_fun(this, &PatchTreeWindow::event_patch_activated)); enabled_renderer->signal_toggled().connect( sigc::mem_fun(this, &PatchTreeWindow::event_patch_enabled_toggled)); - + _patches_treeview->columns_autosize(); } @@ -100,7 +100,7 @@ PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm) } else { Gtk::TreeModel::Children children = _patch_treestore->children(); Gtk::TreeModel::iterator c = find_patch(children, pm->parent()->path()); - + if (c != children.end()) { Gtk::TreeModel::iterator iter = _patch_treestore->append(c->children()); Gtk::TreeModel::Row row = *iter; @@ -181,7 +181,7 @@ PatchTreeWindow::event_patch_activated(const Gtk::TreeModel::Path& path, Gtk::Tr Gtk::TreeModel::iterator active = _patch_treestore->get_iter(path); Gtk::TreeModel::Row row = *active; SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col]; - + App::instance().window_factory()->present_patch(pm); } @@ -192,10 +192,10 @@ PatchTreeWindow::event_patch_enabled_toggled(const Glib::ustring& path_str) Gtk::TreeModel::Path path(path_str); Gtk::TreeModel::iterator active = _patch_treestore->get_iter(path); Gtk::TreeModel::Row row = *active; - + SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col]; assert(pm); - + if (_enable_signal) App::instance().engine()->set_variable(pm->path(), "ingen:enabled", (bool)!pm->enabled()); } @@ -225,17 +225,17 @@ PatchTreeWindow::patch_renamed(const Path& old_path, const Path& new_path) Gtk::TreeModel::iterator i = find_patch(_patch_treestore->children(), old_path); - + if (i != _patch_treestore->children().end()) { Gtk::TreeModel::Row row = *i; row[_patch_tree_columns.name_col] = new_path.name(); } else { cerr << "[PatchTreeWindow] Unable to find patch " << old_path << endl; } - + _enable_signal = true; } - + } // namespace GUI } // namespace Ingen diff --git a/src/gui/PatchTreeWindow.hpp b/src/gui/PatchTreeWindow.hpp index 3998891c..f662a29a 100644 --- a/src/gui/PatchTreeWindow.hpp +++ b/src/gui/PatchTreeWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -59,14 +59,14 @@ protected: void event_patch_enabled_toggled(const Glib::ustring& path_str); Gtk::TreeModel::iterator find_patch(Gtk::TreeModel::Children root, const Raul::Path& path); - + PatchTreeView* _patches_treeview; struct PatchTreeModelColumns : public Gtk::TreeModel::ColumnRecord { PatchTreeModelColumns() { add(name_col); add(enabled_col); add(patch_model_col); } - + Gtk::TreeModelColumn<Glib::ustring> name_col; Gtk::TreeModelColumn<bool> enabled_col; Gtk::TreeModelColumn<SharedPtr<Client::PatchModel> > patch_model_col; @@ -88,22 +88,22 @@ public: {} void set_window(PatchTreeWindow* win) { _window = win; } - + bool on_button_press_event(GdkEventButton* ev) { bool ret = Gtk::TreeView::on_button_press_event(ev); - + if ((ev->type == GDK_BUTTON_PRESS) && (ev->button == 3)) _window->show_patch_menu(ev); return ret; } - + private: PatchTreeWindow* _window; }; // struct PatchTreeView - + } // namespace GUI } // namespace Ingen diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp index 9b4f291a..a36a08d5 100644 --- a/src/gui/PatchView.cpp +++ b/src/gui/PatchView.cpp @@ -1,15 +1,15 @@ /* 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 @@ -84,7 +84,7 @@ PatchView::set_patch(SharedPtr<PatchModel> patch) for (GraphObject::Properties::const_iterator i = patch->properties().begin(); i != patch->properties().end(); ++i) property_changed(i->first, i->second); - + for (GraphObject::Properties::const_iterator i = patch->variables().begin(); i != patch->variables().end(); ++i) variable_changed(i->first, i->second); @@ -109,13 +109,13 @@ PatchView::set_patch(SharedPtr<PatchModel> patch) _edit_mode_but->signal_toggled().connect(sigc::mem_fun( *this, &PatchView::editable_toggled)); - + _poly_spin->signal_value_changed().connect( sigc::mem_fun(*this, &PatchView::poly_changed)); _canvas->signal_item_entered.connect( sigc::mem_fun(*this, &PatchView::canvas_item_entered)); - + _canvas->signal_item_left.connect( sigc::mem_fun(*this, &PatchView::canvas_item_left)); @@ -133,7 +133,7 @@ SharedPtr<PatchView> PatchView::create(SharedPtr<PatchModel> patch) { - + const Glib::RefPtr<Gnome::Glade::Xml>& xml = GladeFactory::new_glade_reference("patch_view_box"); PatchView* result = NULL; xml->get_widget_derived("patch_view_box", result); @@ -173,7 +173,7 @@ PatchView::canvas_item_entered(Gnome::Canvas::Item* item) NodeModule* m = dynamic_cast<NodeModule*>(item); if (m) signal_object_entered.emit(m->node().get()); - + Port* p = dynamic_cast<Port*>(item); if (p) signal_object_entered.emit(p->model().get()); @@ -188,7 +188,7 @@ PatchView::canvas_item_left(Gnome::Canvas::Item* item) signal_object_left.emit(m->node().get()); return; } - + Port* p = dynamic_cast<Port*>(item); if (p) signal_object_left.emit(p->model().get()); diff --git a/src/gui/PatchView.hpp b/src/gui/PatchView.hpp index 705af7b8..339e0159 100644 --- a/src/gui/PatchView.hpp +++ b/src/gui/PatchView.hpp @@ -1,15 +1,15 @@ /* 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 @@ -63,7 +63,7 @@ public: SharedPtr<PatchCanvas> canvas() const { return _canvas; } SharedPtr<PatchModel> patch() const { return _patch; } Gtk::ToolItem* breadcrumb_container() const { return _breadcrumb_container; } - + void set_editable(bool editable); static SharedPtr<PatchView> create(SharedPtr<PatchModel> patch); @@ -83,7 +83,7 @@ private: void canvas_item_entered(Gnome::Canvas::Item* item); void canvas_item_left(Gnome::Canvas::Item* item); - + void property_changed(const Raul::URI& predicate, const Raul::Atom& value); void variable_changed(const Raul::URI& predicate, const Raul::Atom& value); @@ -91,7 +91,7 @@ private: SharedPtr<PatchModel> _patch; SharedPtr<PatchCanvas> _canvas; - + Gtk::ScrolledWindow* _canvas_scrolledwindow; Gtk::Toolbar* _toolbar; diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp index cc882f8d..6fc6e954 100644 --- a/src/gui/PatchWindow.cpp +++ b/src/gui/PatchWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -98,7 +98,7 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad if (engine_name == "ingen:internal") engine_name = "internal engine"; _status_bar->push(string("Connected to ") + engine_name, STATUS_CONTEXT_ENGINE); - + _menu_import->signal_activate().connect( sigc::mem_fun(this, &PatchWindow::event_import)); _menu_import_location->signal_activate().connect( @@ -150,14 +150,14 @@ PatchWindow::PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glad _menu_help_about->signal_activate().connect(sigc::hide_return( sigc::mem_fun(App::instance(), &App::show_about))); - + _breadcrumb_box = new BreadCrumbBox(); _breadcrumb_box->signal_patch_selected.connect(sigc::mem_fun(this, &PatchWindow::set_patch_from_path)); #ifndef HAVE_CURL _menu_upload->hide(); #endif - + Glib::RefPtr<Gtk::Clipboard> clipboard = Gtk::Clipboard::get(); clipboard->signal_owner_change().connect(sigc::mem_fun(this, &PatchWindow::event_clipboard_changed)); } @@ -174,9 +174,9 @@ PatchWindow::~PatchWindow() /** Set the patch controller from a Path (for use by eg. BreadCrumbBox) */ -void +void PatchWindow::set_patch_from_path(const Path& path, SharedPtr<PatchView> view) -{ +{ if (view) { assert(view->patch()->path() == path); App::instance().window_factory()->present_patch(view->patch(), this, view); @@ -199,7 +199,7 @@ PatchWindow::set_patch(SharedPtr<PatchModel> patch, SharedPtr<PatchView> view) return; _enable_signal = false; - + new_port_connection.disconnect(); removed_port_connection.disconnect(); edit_mode_connection.disconnect(); @@ -213,10 +213,10 @@ PatchWindow::set_patch(SharedPtr<PatchModel> patch, SharedPtr<PatchView> view) if (!_view) _view = _breadcrumb_box->view(patch->path()); - + if (!_view) _view = PatchView::create(patch); - + assert(_view); // Add view to our viewport @@ -236,7 +236,7 @@ PatchWindow::set_patch(SharedPtr<PatchModel> patch, SharedPtr<PatchView> view) _breadcrumb_box->build(patch->path(), _view); _breadcrumb_box->show(); - + _menu_view_control_window->property_sensitive() = false; for (NodeModel::Ports::const_iterator p = patch->ports().begin(); @@ -261,7 +261,7 @@ PatchWindow::set_patch(SharedPtr<PatchModel> patch, SharedPtr<PatchView> view) sigc::mem_fun(this, &PatchWindow::patch_port_removed)); removed_port_connection = patch->signal_editable.connect( sigc::mem_fun(this, &PatchWindow::editable_changed)); - + show_all(); _view->signal_object_entered.connect(sigc::mem_fun(this, &PatchWindow::object_entered)); @@ -284,7 +284,7 @@ void PatchWindow::patch_port_removed(SharedPtr<PortModel> port) { if (port->type().is_control() && port->is_input()) { - + bool found_control = false; for (NodeModel::Ports::const_iterator i = _patch->ports().begin(); i != _patch->ports().end(); ++i) { @@ -293,7 +293,7 @@ PatchWindow::patch_port_removed(SharedPtr<PortModel> port) break; } } - + _menu_view_control_window->property_sensitive() = found_control; } } @@ -309,7 +309,7 @@ PatchWindow::object_entered(ObjectModel* model) if (plugin) msg.append((boost::format(" (%1%)") % plugin->human_name()).str()); } - + PortModel* port = dynamic_cast<PortModel*>(model); if (port) { NodeModel* parent = dynamic_cast<NodeModel*>(port->parent().get()); @@ -322,7 +322,7 @@ PatchWindow::object_entered(ObjectModel* model) msg.append((boost::format(" (%1%)") % human_name).str()); } } - + const Atom& value = port->value(); if (value.is_valid()) { const Redland::Node node = AtomRDF::atom_to_node( @@ -416,7 +416,7 @@ PatchWindow::event_save_as() Gtk::FileChooserDialog dialog(*this, "Save Patch", Gtk::FILE_CHOOSER_ACTION_SAVE); dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - Gtk::Button* save_button = dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); + Gtk::Button* save_button = dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); save_button->property_has_default() = true; Gtk::FileFilter filt; @@ -441,7 +441,7 @@ PatchWindow::event_save_as() string base = filename.substr(0, filename.find(".")); if (base.find("/") != string::npos) base = base.substr(base.find_last_of("/") + 1); - + if (!Symbol::is_valid(base)) { Gtk::MessageDialog error_dialog(*this, "<b>Ingen patch file names must be valid symbols</b>", true, @@ -500,14 +500,14 @@ void PatchWindow::event_draw() { Gtk::FileChooserDialog dialog(*this, "Draw to DOT", Gtk::FILE_CHOOSER_ACTION_SAVE); - + dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - Gtk::Button* save_button = dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); + Gtk::Button* save_button = dialog.add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); save_button->property_has_default() = true; - + int result = dialog.run(); - - if (result == Gtk::RESPONSE_OK) { + + if (result == Gtk::RESPONSE_OK) { string filename = dialog.get_filename(); if (filename.find(".") == string::npos) filename += ".dot"; @@ -523,7 +523,7 @@ PatchWindow::event_draw() confirm = (confirm_dialog.run() == Gtk::RESPONSE_YES); } fin.close(); - + if (confirm) { _view->canvas()->render_to_dot(filename); _status_bar->push( @@ -599,24 +599,24 @@ PatchWindow::on_key_press_event(GdkEventKey* event) bool ret = false; ret = _view->canvas()->canvas_key_event(event); - + if (!ret) ret = Gtk::Window::on_key_press_event(event); - + return ret; } - + bool PatchWindow::on_key_release_event(GdkEventKey* event) { bool ret = false; ret = _view->canvas()->canvas_key_event(event); - + if (!ret) ret = Gtk::Window::on_key_release_event(event); - + return ret; } @@ -633,7 +633,7 @@ PatchWindow::event_quit() { Gtk::Widget* kill_img = Gtk::manage( new Gtk::Image(Gtk::Stock::CLOSE, Gtk::ICON_SIZE_BUTTON)); - + Gtk::Widget* close_img = Gtk::manage( new Gtk::Image(Gtk::Stock::QUIT, Gtk::ICON_SIZE_BUTTON)); @@ -643,7 +643,7 @@ PatchWindow::event_quit() Gtk::MessageDialog d(*this, msg, true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true); - + d.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); if (!App::instance().world()->local_engine) { diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp index 63707a1e..696262aa 100644 --- a/src/gui/PatchWindow.hpp +++ b/src/gui/PatchWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -37,7 +37,7 @@ namespace Client { using namespace Ingen::Client; namespace GUI { - + class LoadPluginWindow; class LoadPatchWindow; class NewSubpatchWindow; @@ -59,7 +59,7 @@ class PatchWindow : public Gtk::Window public: PatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& glade_xml); ~PatchWindow(); - + void set_patch_from_path(const Raul::Path& path, SharedPtr<PatchView> view); void set_patch(SharedPtr<PatchModel> pc, SharedPtr<PatchView> view); @@ -72,7 +72,7 @@ protected: void on_hide(); bool on_key_press_event(GdkEventKey* event); bool on_key_release_event(GdkEventKey* event); - + private: void patch_port_added(SharedPtr<PortModel> port); @@ -107,7 +107,7 @@ private: SharedPtr<PatchModel> _patch; SharedPtr<PatchView> _view; - + sigc::connection new_port_connection; sigc::connection removed_port_connection; sigc::connection edit_mode_connection; @@ -116,7 +116,7 @@ private: bool _position_stored; int _x; int _y; - + Gtk::MenuItem* _menu_import; Gtk::MenuItem* _menu_import_location; Gtk::MenuItem* _menu_save; diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index e7daac0a..974be2b4 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -1,15 +1,15 @@ /* 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 @@ -54,13 +54,13 @@ Port::Port( delete _menu; _menu = NULL; - + pm->signal_renamed.connect(sigc::mem_fun(this, &Port::renamed)); if (pm->type().is_control()) { set_toggled(pm->is_toggle()); show_control(); - + float min = 0.0f, max = 1.0f; boost::shared_ptr<NodeModel> parent = PtrCast<NodeModel>(pm->parent()); if (parent) @@ -72,9 +72,9 @@ Port::Port( pm->signal_variable.connect(sigc::mem_fun(this, &Port::variable_changed)); pm->signal_value_changed.connect(sigc::mem_fun(this, &Port::value_changed)); } - + pm->signal_activity.connect(sigc::mem_fun(this, &Port::activity)); - + value_changed(pm->value()); } @@ -113,7 +113,7 @@ Port::value_changed(const Atom& value) cerr << "WARNING: Unknown port value type " << (unsigned)value.type() << endl; } - + void Port::activity() { diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp index 10e00a88..82ec0833 100644 --- a/src/gui/Port.hpp +++ b/src/gui/Port.hpp @@ -1,15 +1,15 @@ /* 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 @@ -35,7 +35,7 @@ namespace GUI { /** A Port on an Module. - * + * * \ingroup GUI */ class Port : public FlowCanvas::Port @@ -51,13 +51,13 @@ public: SharedPtr<PortModel> model() const { return _port_model.lock(); } void create_menu(); - + virtual void set_control(float value, bool signal); void value_changed(const Raul::Atom& value); void activity(); - + private: - + void variable_changed(const Raul::URI& key, const Raul::Atom& value); void renamed(); diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index 11c1243a..e224f0d4 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -1,15 +1,15 @@ /* 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 @@ -41,20 +41,20 @@ PortMenu::init(SharedPtr<PortModel> port, bool patch_port) { ObjectMenu::init(port); _patch_port = patch_port; - + if ( ! PtrCast<PatchModel>(port->parent()) ) { _polyphonic_menuitem->set_sensitive(false); _rename_menuitem->hide(); _destroy_menuitem->hide(); } - + if (port->type() == DataType::EVENT) _polyphonic_menuitem->hide(); - + _enable_signal = true; } - + void PortMenu::on_menu_disconnect() { diff --git a/src/gui/PortMenu.hpp b/src/gui/PortMenu.hpp index d617e01f..ae55029a 100644 --- a/src/gui/PortMenu.hpp +++ b/src/gui/PortMenu.hpp @@ -1,15 +1,15 @@ /* 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 @@ -38,7 +38,7 @@ class PortMenu : public ObjectMenu { public: PortMenu(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml); - + void init(SharedPtr<PortModel> port, bool patch_port = false); private: diff --git a/src/gui/PortPropertiesWindow.cpp b/src/gui/PortPropertiesWindow.cpp index 3333ae70..54f015e5 100644 --- a/src/gui/PortPropertiesWindow.cpp +++ b/src/gui/PortPropertiesWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -40,10 +40,10 @@ PortPropertiesWindow::PortPropertiesWindow(BaseObjectType* cobject, const Glib:: xml->get_widget("port_properties_max_spinner", _max_spinner); xml->get_widget("port_properties_cancel_button", _cancel_button); xml->get_widget("port_properties_ok_button", _ok_button); - + _cancel_button->signal_clicked().connect(sigc::mem_fun(this, &PortPropertiesWindow::cancel)); - + _ok_button->signal_clicked().connect(sigc::mem_fun(this, &PortPropertiesWindow::ok)); } @@ -56,7 +56,7 @@ void PortPropertiesWindow::present(SharedPtr<PortModel> pm) { assert(pm); - + for (list<sigc::connection>::iterator i = _connections.begin(); i != _connections.end(); ++i) (*i).disconnect(); @@ -65,7 +65,7 @@ PortPropertiesWindow::present(SharedPtr<PortModel> pm) _port_model = pm; set_title(pm->path().str() + " Properties"); - + float min = 0.0f, max = 1.0f; boost::shared_ptr<NodeModel> parent = PtrCast<NodeModel>(_port_model->parent()); if (parent) @@ -77,11 +77,11 @@ PortPropertiesWindow::present(SharedPtr<PortModel> pm) _min_spinner->set_value(min); _connections.push_back(_min_spinner->signal_value_changed().connect( sigc::mem_fun(*this, &PortPropertiesWindow::min_changed))); - + _max_spinner->set_value(max); _connections.push_back(_max_spinner->signal_value_changed().connect( sigc::mem_fun(*this, &PortPropertiesWindow::max_changed))); - + _connections.push_back(pm->signal_variable.connect( sigc::mem_fun(this, &PortPropertiesWindow::variable_change))); @@ -102,7 +102,7 @@ PortPropertiesWindow::variable_change(const URI& key, const Atom& value) else if (key.str() == "lv2:maximum") _max_spinner->set_value(value.get_float()); } - + //_enable_signal = true; } @@ -113,7 +113,7 @@ PortPropertiesWindow::min_changed() const float val = _port_model->value().get_float(); float min = _min_spinner->get_value(); float max = _max_spinner->get_value(); - + if (min > val) { _min_spinner->set_value(val); return; // avoid recursion @@ -135,7 +135,7 @@ PortPropertiesWindow::max_changed() const float val = _port_model->value().get_float(); float min = _min_spinner->get_value(); float max = _max_spinner->get_value(); - + if (max < val) { _max_spinner->set_value(val); return; // avoid recursion diff --git a/src/gui/PortPropertiesWindow.hpp b/src/gui/PortPropertiesWindow.hpp index 2cf160bc..6e9c8c26 100644 --- a/src/gui/PortPropertiesWindow.hpp +++ b/src/gui/PortPropertiesWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -44,7 +44,7 @@ private: void variable_change(const Raul::URI& key, const Raul::Atom& value); void min_changed(); void max_changed(); - + void ok(); void cancel(); diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp index 8770a89e..cd5a1f61 100644 --- a/src/gui/RenameWindow.cpp +++ b/src/gui/RenameWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -96,7 +96,7 @@ RenameWindow::name_changed() } else { _message_label->set_text(""); _ok_button->property_sensitive() = true; - } + } } diff --git a/src/gui/RenameWindow.hpp b/src/gui/RenameWindow.hpp index 524f97ff..e3b50ca5 100644 --- a/src/gui/RenameWindow.hpp +++ b/src/gui/RenameWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -28,7 +28,7 @@ namespace Ingen { namespace GUI { -/** Rename window. Handles renaming of any (Ingen) object. +/** Rename window. Handles renaming of any (Ingen) object. * * \ingroup GUI */ @@ -45,7 +45,7 @@ private: void name_changed(); void cancel_clicked(); void ok_clicked(); - + SharedPtr<ObjectModel> _object; Gtk::Entry* _name_entry; diff --git a/src/gui/SubpatchModule.cpp b/src/gui/SubpatchModule.cpp index d407f6db..48baf299 100644 --- a/src/gui/SubpatchModule.cpp +++ b/src/gui/SubpatchModule.cpp @@ -1,15 +1,15 @@ /* 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 @@ -64,13 +64,13 @@ void SubpatchModule::browse_to_patch() { assert(_patch->parent()); - + SharedPtr<PatchModel> parent = PtrCast<PatchModel>(_patch->parent()); PatchWindow* const preferred = ( (parent) ? App::instance().window_factory()->patch_window(parent) : NULL ); - + App::instance().window_factory()->present_patch(_patch, preferred); } diff --git a/src/gui/SubpatchModule.hpp b/src/gui/SubpatchModule.hpp index b01e1e29..edf77761 100644 --- a/src/gui/SubpatchModule.hpp +++ b/src/gui/SubpatchModule.hpp @@ -1,15 +1,15 @@ /* 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 @@ -36,7 +36,7 @@ using namespace Ingen::Client; namespace Ingen { namespace GUI { - + class PatchCanvas; class NodeControlWindow; diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index 3a33d5ac..361440be 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -1,15 +1,15 @@ /* 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 @@ -36,7 +36,7 @@ ThreadedLoader::ThreadedLoader(SharedPtr<EngineInterface> engine) , _deprecated_loader(engine) { set_name("Loader"); - + if (parser()) start(); else @@ -72,7 +72,7 @@ void ThreadedLoader::_whipped() { _mutex.lock(); - + while ( ! _events.empty() ) { _events.front()(); _events.pop_front(); @@ -98,7 +98,7 @@ ThreadedLoader::load_patch(bool merge, else engine_base = engine_parent.get().base(); } - + // Filthy hack to load deprecated patches based on file extension if (document_uri.substr(document_uri.length()-3) == ".om") { _events.push_back(sigc::hide_return(sigc::bind( @@ -120,9 +120,9 @@ ThreadedLoader::load_patch(bool merge, engine_symbol, engine_data))); } - + whip(); - + _mutex.unlock(); } @@ -137,7 +137,7 @@ ThreadedLoader::save_patch(SharedPtr<PatchModel> model, const string& filename) model, filename))); _mutex.unlock(); - + whip(); } diff --git a/src/gui/ThreadedLoader.hpp b/src/gui/ThreadedLoader.hpp index cdf331a4..eb334413 100644 --- a/src/gui/ThreadedLoader.hpp +++ b/src/gui/ThreadedLoader.hpp @@ -1,15 +1,15 @@ /* 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 @@ -68,10 +68,10 @@ public: SharedPtr<Parser> parser(); -private: +private: void save_patch_event(SharedPtr<PatchModel> model, const string& filename); - + /** Returns nothing and takes no parameters (because they have all been bound) */ typedef sigc::slot<void> Closure; diff --git a/src/gui/UploadPatchWindow.cpp b/src/gui/UploadPatchWindow.cpp index 96594924..b5834a1d 100644 --- a/src/gui/UploadPatchWindow.cpp +++ b/src/gui/UploadPatchWindow.cpp @@ -1,15 +1,15 @@ /* 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 @@ -52,7 +52,7 @@ UploadPatchWindow::UploadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr xml->get_widget("upload_patch_progress", _upload_progress); xml->get_widget("upload_patch_cancel_button", _cancel_button); xml->get_widget("upload_patch_upload_button", _upload_button); - + _symbol_entry->signal_changed().connect(sigc::mem_fun(this, &UploadPatchWindow::symbol_changed)); _short_name_entry->signal_changed().connect(sigc::mem_fun(this, &UploadPatchWindow::short_name_changed)); @@ -65,7 +65,7 @@ void UploadPatchWindow::present(SharedPtr<PatchModel> patch) { _patch = patch; - + Gtk::Window::present(); } @@ -78,7 +78,7 @@ UploadPatchWindow::on_show() Raul::Atom atom = _patch->get_property("lv2:symbol"); if (atom.is_valid()) _symbol_entry->set_text(atom.get_string()); - + atom = _patch->get_variable("doap:name"); if (atom.is_valid()) _short_name_entry->set_text(atom.get_string()); @@ -129,7 +129,7 @@ UploadPatchWindow::short_name_changed() && _short_name_entry->get_text().length() > 0); } - + size_t UploadThread::curl_read_cb(void *ptr, size_t size, size_t nmemb, void *data) { @@ -187,7 +187,7 @@ UploadThread::_run() long response; curl_easy_getinfo(_curl, CURLINFO_RESPONSE_CODE, &response); - + printf("Server returned %ld\n", response); _win->set_response(response); @@ -195,7 +195,7 @@ UploadThread::_run() curl_slist_free_all(_headers); curl_easy_cleanup(_curl); - + _headers = NULL; _curl = NULL; } @@ -208,7 +208,7 @@ UploadPatchWindow::progress_callback() const int response = _response.get(); _upload_progress->set_fraction(progress / 100.0); - + if (progress == 100) { if (response == 200) { _upload_progress->set_text("Transfer completed"); @@ -252,18 +252,18 @@ UploadPatchWindow::upload_clicked() const string uri = string("http://rdf.drobilla.net/ingen_patches/") .append(symbol).append(".ingen.ttl"); - + const string str = s.to_string(_patch, uri, extra_rdf); _thread = new UploadThread(this, str, uri); _thread->start(); - + _upload_button->set_sensitive(false); Glib::signal_timeout().connect( sigc::mem_fun(this, &UploadPatchWindow::progress_callback), 100); -} +} void diff --git a/src/gui/UploadPatchWindow.hpp b/src/gui/UploadPatchWindow.hpp index 7bc08bfb..9f314af3 100644 --- a/src/gui/UploadPatchWindow.hpp +++ b/src/gui/UploadPatchWindow.hpp @@ -1,15 +1,15 @@ /* 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 @@ -46,7 +46,7 @@ public: private: static size_t curl_read_cb(void* ptr, size_t size, size_t nmemb, void *stream); static int curl_progress_cb(void* thread, double dltotal, double dlnow, double ultotal, double ulnow); - + void _run(); CURL* _curl; @@ -73,7 +73,7 @@ public: void set_response(int response) { _response = response; } void set_progress(int pct) { _progress_pct = pct; } - + private: bool is_symbol(const Glib::ustring& str); void symbol_changed(); @@ -87,7 +87,7 @@ private: UploadThread* _thread; SharedPtr<PatchModel> _patch; - + Raul::AtomicInt _progress_pct; Raul::AtomicInt _response; @@ -98,7 +98,7 @@ private: Gtk::Button* _upload_button; }; - + } // namespace GUI } // namespace Ingen diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index 5d05c853..38ed8cfe 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -1,15 +1,15 @@ /* 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 @@ -62,7 +62,7 @@ WindowFactory::WindowFactory() xml->get_widget_derived("node_properties_win", _node_properties_win); xml->get_widget_derived("port_properties_win", _port_properties_win); xml->get_widget_derived("rename_win", _rename_win); - + #ifdef HAVE_CURL xml->get_widget_derived("upload_patch_win", _upload_patch_win); #endif @@ -73,10 +73,10 @@ WindowFactory::~WindowFactory() { for (PatchWindowMap::iterator i = _patch_windows.begin(); i != _patch_windows.end(); ++i) delete i->second; - + for (ControlWindowMap::iterator i = _control_windows.begin(); i != _control_windows.end(); ++i) delete i->second; - + } @@ -85,12 +85,12 @@ WindowFactory::clear() { for (PatchWindowMap::iterator i = _patch_windows.begin(); i != _patch_windows.end(); ++i) delete i->second; - + _patch_windows.clear(); - + for (ControlWindowMap::iterator i = _control_windows.begin(); i != _control_windows.end(); ++i) delete i->second; - + _control_windows.clear(); } @@ -118,7 +118,7 @@ WindowFactory::patch_window(SharedPtr<PatchModel> patch) return (w == _patch_windows.end()) ? NULL : w->second; } - + NodeControlWindow* WindowFactory::control_window(SharedPtr<NodeModel> node) { @@ -169,7 +169,7 @@ WindowFactory::new_patch_window(SharedPtr<PatchModel> patch, SharedPtr<PatchView PatchWindow* win = NULL; xml->get_widget_derived("patch_win", win); assert(win); - + win->set_patch(patch, view); _patch_windows[patch->path()] = win; @@ -204,7 +204,7 @@ WindowFactory::remove_patch_window(PatchWindow* win, GdkEventAny* ignored) _patch_windows.erase(w); delete win; - + return false; } @@ -250,7 +250,7 @@ WindowFactory::remove_control_window(NodeControlWindow* win, GdkEventAny* ignore _control_windows.erase(w); delete win; - + return true; } @@ -281,7 +281,7 @@ WindowFactory::present_load_patch(SharedPtr<PatchModel> patch, GraphObject::Prop _load_patch_win->present(patch, data); } - + void WindowFactory::present_load_remote_patch(SharedPtr<PatchModel> patch, GraphObject::Properties data) { @@ -328,7 +328,7 @@ WindowFactory::present_load_subpatch(SharedPtr<PatchModel> patch, GraphObject::P if (w != _patch_windows.end()) _load_subpatch_win->set_transient_for(*w->second); - + _load_subpatch_win->present(patch, data); } @@ -340,7 +340,7 @@ WindowFactory::present_rename(SharedPtr<ObjectModel> object) if (w != _patch_windows.end()) _rename_win->set_transient_for(*w->second); - + _rename_win->present(object); } @@ -357,17 +357,17 @@ WindowFactory::present_properties(SharedPtr<ObjectModel> object) _patch_properties_win->present(patch); return; } - + SharedPtr<NodeModel> node = PtrCast<NodeModel>(object); if (node) { PatchWindowMap::iterator w = _patch_windows.find(node->path().parent()); if (w != _patch_windows.end()) _node_properties_win->set_transient_for(*w->second); - + _node_properties_win->present(node); return; } - + SharedPtr<PortModel> port = PtrCast<PortModel>(object); if (port) { PatchWindowMap::iterator w = _patch_windows.find(port->path().parent().parent()); diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp index 60f195f2..a5e60b2c 100644 --- a/src/gui/WindowFactory.hpp +++ b/src/gui/WindowFactory.hpp @@ -1,15 +1,15 @@ /* 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 @@ -81,7 +81,7 @@ public: void present_load_subpatch(SharedPtr<PatchModel> patch, GraphObject::Properties data=GraphObject::Properties()); void present_rename(SharedPtr<ObjectModel> object); void present_properties(SharedPtr<ObjectModel> object); - + bool remove_patch_window(PatchWindow* win, GdkEventAny* ignored = NULL); void clear(); diff --git a/src/gui/cmdline.h b/src/gui/cmdline.h index 6f1f9259..c2e004e6 100644 --- a/src/gui/cmdline.h +++ b/src/gui/cmdline.h @@ -45,7 +45,7 @@ struct gengetopt_args_info char * path_arg; /* Target path for loaded patch. */ char * path_orig; /* Target path for loaded patch original value given at command line. */ const char *path_help; /* Target path for loaded patch help description. */ - + int help_given ; /* Whether help was given. */ int version_given ; /* Whether version was given. */ int engine_given ; /* Whether engine was given. */ diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 984651f4..050ed927 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/gui/gui.hpp b/src/gui/gui.hpp index d4e8f399..6395d7df 100644 --- a/src/gui/gui.hpp +++ b/src/gui/gui.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/ingen/cmdline.c b/src/ingen/cmdline.c index bb41cb23..39ffff3e 100644 --- a/src/ingen/cmdline.c +++ b/src/ingen/cmdline.c @@ -1,7 +1,7 @@ /* - File autogenerated by gengetopt + File autogenerated by gengetopt generated with the following command: - gengetopt -g + gengetopt -g The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -99,7 +99,7 @@ void clear_args (struct gengetopt_args_info *args_info) args_info->path_orig = NULL; args_info->run_arg = NULL; args_info->run_orig = NULL; - + } static @@ -119,7 +119,7 @@ void init_args_info(struct gengetopt_args_info *args_info) args_info->parallelism_help = gengetopt_args_info_help[9] ; args_info->path_help = gengetopt_args_info_help[10] ; args_info->run_help = gengetopt_args_info_help[11] ; - + } void @@ -164,7 +164,7 @@ void cmdline_parser_params_init(struct cmdline_parser_params *params) { if (params) - { + { params->override = 0; params->initialize = 1; params->check_required = 1; @@ -176,9 +176,9 @@ cmdline_parser_params_init(struct cmdline_parser_params *params) struct cmdline_parser_params * cmdline_parser_params_create(void) { - struct cmdline_parser_params *params = + struct cmdline_parser_params *params = (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params)); - cmdline_parser_params_init(params); + cmdline_parser_params_init(params); return params; } @@ -210,8 +210,8 @@ cmdline_parser_release (struct gengetopt_args_info *args_info) free_string_field (&(args_info->path_orig)); free_string_field (&(args_info->run_arg)); free_string_field (&(args_info->run_orig)); - - + + clear_given (args_info); } @@ -263,7 +263,7 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) write_into_file(outfile, "path", args_info->path_orig, 0); if (args_info->run_given) write_into_file(outfile, "run", args_info->run_orig, 0); - + i = EXIT_SUCCESS; return i; @@ -328,7 +328,7 @@ cmdline_parser_ext (int argc, char * const *argv, struct gengetopt_args_info *ar cmdline_parser_free (args_info); exit (EXIT_FAILURE); } - + return result; } @@ -337,7 +337,7 @@ cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_ { int result; struct cmdline_parser_params params; - + params.override = override; params.initialize = initialize; params.check_required = check_required; @@ -351,7 +351,7 @@ cmdline_parser2 (int argc, char * const *argv, struct gengetopt_args_info *args_ cmdline_parser_free (args_info); exit (EXIT_FAILURE); } - + return result; } @@ -384,7 +384,7 @@ static char *package_name = 0; */ static int update_arg(void *field, char **orig_field, - unsigned int *field_given, unsigned int *prev_given, + unsigned int *field_given, unsigned int *prev_given, char *value, char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, @@ -403,17 +403,17 @@ int update_arg(void *field, char **orig_field, if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given))) { if (short_opt != '-') - fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", + fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n", package_name, long_opt, short_opt, (additional_error ? additional_error : "")); else - fprintf (stderr, "%s: `--%s' option given more than once%s\n", + fprintf (stderr, "%s: `--%s' option given more than once%s\n", package_name, long_opt, (additional_error ? additional_error : "")); return 1; /* failure */ } - + if (field_given && *field_given && ! override) return 0; if (prev_given) @@ -483,14 +483,14 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf int error = 0; struct gengetopt_args_info local_args_info; - + int override; int initialize; int check_required; int check_ambiguity; - + package_name = argv[0]; - + override = params->override; initialize = params->initialize; check_required = params->check_required; @@ -543,120 +543,120 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf exit (EXIT_SUCCESS); case 'C': /* Client OSC port. */ - - - if (update_arg( (void *)&(args_info->client_port_arg), + + + if (update_arg( (void *)&(args_info->client_port_arg), &(args_info->client_port_orig), &(args_info->client_port_given), &(local_args_info.client_port_given), optarg, 0, 0, ARG_INT, check_ambiguity, override, 0, 0, "client-port", 'C', additional_error)) goto failure; - + break; case 'c': /* Connect to existing engine at URI. */ - - - if (update_arg( (void *)&(args_info->connect_arg), + + + if (update_arg( (void *)&(args_info->connect_arg), &(args_info->connect_orig), &(args_info->connect_given), &(local_args_info.connect_given), optarg, 0, "osc.udp://localhost:16180", ARG_STRING, check_ambiguity, override, 0, 0, "connect", 'c', additional_error)) goto failure; - + break; case 'e': /* Run (JACK) engine. */ - - + + if (update_arg((void *)&(args_info->engine_flag), 0, &(args_info->engine_given), &(local_args_info.engine_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "engine", 'e', additional_error)) goto failure; - + break; case 'E': /* Engine OSC port. */ - - - if (update_arg( (void *)&(args_info->engine_port_arg), + + + if (update_arg( (void *)&(args_info->engine_port_arg), &(args_info->engine_port_orig), &(args_info->engine_port_given), &(local_args_info.engine_port_given), optarg, 0, "16180", ARG_INT, check_ambiguity, override, 0, 0, "engine-port", 'E', additional_error)) goto failure; - + break; case 'g': /* Launch the GTK graphical interface. */ - - + + if (update_arg((void *)&(args_info->gui_flag), 0, &(args_info->gui_given), &(local_args_info.gui_given), optarg, 0, 0, ARG_FLAG, check_ambiguity, override, 1, 0, "gui", 'g', additional_error)) goto failure; - + break; case 'n': /* JACK client name. */ - - - if (update_arg( (void *)&(args_info->jack_name_arg), + + + if (update_arg( (void *)&(args_info->jack_name_arg), &(args_info->jack_name_orig), &(args_info->jack_name_given), &(local_args_info.jack_name_given), optarg, 0, "ingen", ARG_STRING, check_ambiguity, override, 0, 0, "jack-name", 'n', additional_error)) goto failure; - + break; case 'l': /* Load patch. */ - - - if (update_arg( (void *)&(args_info->load_arg), + + + if (update_arg( (void *)&(args_info->load_arg), &(args_info->load_orig), &(args_info->load_given), &(local_args_info.load_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "load", 'l', additional_error)) goto failure; - + break; case 'p': /* Number of concurrent process threads. */ - - - if (update_arg( (void *)&(args_info->parallelism_arg), + + + if (update_arg( (void *)&(args_info->parallelism_arg), &(args_info->parallelism_orig), &(args_info->parallelism_given), &(local_args_info.parallelism_given), optarg, 0, "1", ARG_INT, check_ambiguity, override, 0, 0, "parallelism", 'p', additional_error)) goto failure; - + break; case 'L': /* Target path for loaded patch. */ - - - if (update_arg( (void *)&(args_info->path_arg), + + + if (update_arg( (void *)&(args_info->path_arg), &(args_info->path_orig), &(args_info->path_given), &(local_args_info.path_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "path", 'L', additional_error)) goto failure; - + break; case 'r': /* Run script. */ - - - if (update_arg( (void *)&(args_info->run_arg), + + + if (update_arg( (void *)&(args_info->run_arg), &(args_info->run_orig), &(args_info->run_given), &(local_args_info.run_given), optarg, 0, 0, ARG_STRING, check_ambiguity, override, 0, 0, "run", 'r', additional_error)) goto failure; - + break; case 0: /* Long option with no short option */ @@ -681,7 +681,7 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf return 0; failure: - + cmdline_parser_release (&local_args_info); return (EXIT_FAILURE); } diff --git a/src/ingen/cmdline.h b/src/ingen/cmdline.h index 8777d391..e185ffbe 100644 --- a/src/ingen/cmdline.h +++ b/src/ingen/cmdline.h @@ -1,6 +1,6 @@ /** @file cmdline.h * @brief The header file for the command line option parser - * generated by GNU Gengetopt + * generated by GNU Gengetopt * http://www.gnu.org/software/gengetopt. * DO NOT modify this file, since it can be overwritten * @author GNU Gengetopt by Lorenzo Bettini */ @@ -62,7 +62,7 @@ struct gengetopt_args_info char * run_arg; /**< @brief Run script. */ char * run_orig; /**< @brief Run script original value given at command line. */ const char *run_help; /**< @brief Run script help description. */ - + unsigned int help_given ; /**< @brief Whether help was given. */ unsigned int version_given ; /**< @brief Whether version was given. */ unsigned int client_port_given ; /**< @brief Whether client-port was given. */ @@ -161,7 +161,7 @@ void cmdline_parser_print_help(void); void cmdline_parser_print_version(void); /** - * Initializes all the fields a cmdline_parser_params structure + * Initializes all the fields a cmdline_parser_params structure * to their default values * @param params the structure to initialize */ diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index b5256c21..4bf60080 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -1,15 +1,15 @@ /* 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 @@ -180,14 +180,14 @@ main(int argc, char** argv) cerr << "Unable to load engine module." << endl; } } - + /* Load client library */ if (args.load_given || args.gui_given) { client_module = Ingen::Shared::load_module("ingen_client"); if (!client_module) cerr << "Unable to load client module." << endl; } - + /* If we don't have a local engine interface (for GUI), use network */ if (client_module && ! engine_interface) { SharedPtr<Shared::EngineInterface> (*new_remote_interface)(const std::string&) = NULL; @@ -200,7 +200,7 @@ main(int argc, char** argv) return -1; } } - + /* Activate the engine, if we have one */ if (engine) { Ingen::JackAudioDriver* (*new_driver)( @@ -217,9 +217,9 @@ main(int argc, char** argv) engine->activate(args.parallelism_arg); } - + world->engine = engine_interface; - + void (*gui_run)() = NULL; /* Load GUI */ @@ -247,7 +247,7 @@ main(int argc, char** argv) boost::optional<Path> data_path = Path("/"); boost::optional<Path> parent; boost::optional<Symbol> symbol; - + if (args.path_given) { const Glib::ustring path = args.path_arg; if (Path::is_valid(path)) { @@ -266,15 +266,15 @@ main(int argc, char** argv) bool found = false; if (!world->serialisation_module) world->serialisation_module = Ingen::Shared::load_module("ingen_serialisation"); - + Serialisation::Parser* (*new_parser)() = NULL; if (world->serialisation_module) found = world->serialisation_module->get_symbol("new_parser", (void*&)new_parser); - + if (world->serialisation_module && found) { SharedPtr<Serialisation::Parser> parser(new_parser()); - + // Assumption: Containing ':' means URI, otherwise filename string uri = args.load_arg; if (uri.find(':') == string::npos) { @@ -293,7 +293,7 @@ main(int argc, char** argv) return -1; } } - + /* Run GUI (if applicable) */ if (run_gui) gui_run(); @@ -319,14 +319,14 @@ main(int argc, char** argv) #else cerr << "This build of ingen does not support scripting." << endl; #endif - + /* Listen to OSC and do our own main thing. */ } else if (engine && !run_gui) { signal(SIGINT, catch_int); signal(SIGTERM, catch_int); engine->main(); } - + if (engine) { engine->deactivate(); engine.reset(); diff --git a/src/module/Module.cpp b/src/module/Module.cpp index 9a9b2976..7bdb3a4a 100644 --- a/src/module/Module.cpp +++ b/src/module/Module.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/module/Module.hpp b/src/module/Module.hpp index a91e6803..1e7eae7c 100644 --- a/src/module/Module.hpp +++ b/src/module/Module.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/module/World.hpp b/src/module/World.hpp index 94a99775..222de34a 100644 --- a/src/module/World.hpp +++ b/src/module/World.hpp @@ -1,15 +1,15 @@ /* 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 @@ -64,7 +64,7 @@ struct World { SharedPtr<Serialisation::Serialiser> serialiser; SharedPtr<Serialisation::Parser> parser; SharedPtr<Store> store; - + SharedPtr<Glib::Module> serialisation_module; }; diff --git a/src/module/global.cpp b/src/module/global.cpp index 994d7d04..06eb74c9 100644 --- a/src/module/global.cpp +++ b/src/module/global.cpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/module/global.hpp b/src/module/global.hpp index 1aa46be6..0a706199 100644 --- a/src/module/global.hpp +++ b/src/module/global.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index c68d6ccf..36d1a422 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -1,15 +1,15 @@ /* 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 @@ -55,7 +55,7 @@ relative_uri(Glib::ustring base, const Glib::ustring uri, bool leading_slash) size_t last_slash = base.find_last_of("/"); if (last_slash != string::npos) base = base.substr(0, last_slash + 1); - + size_t last_hash = base.find_last_of("#"); if (last_hash != string::npos) base = base.substr(0, last_hash + 1); @@ -99,12 +99,12 @@ uri_child(const Glib::ustring base, const Glib::ustring child, bool trailing_sla Glib::ustring ret = (base[base.length()-1] == '/' || child[0] == '/') ? base + child : base + '/' + child; - + if (trailing_slash && (ret == "" || ret[ret.length()-1] != '/')) ret = ret + "/"; else if (!trailing_slash && ret != "" && ret[ret.length()-1] == '/') ret = ret.substr(0, ret.length()-1); - + return ret; } @@ -143,7 +143,7 @@ Parser::parse_document( boost::optional<GraphObject::Properties> data) { normalise_uri(document_uri); - + Redland::Model model(*world->rdf_world, document_uri, document_uri); cout << "[Parser] Parsing document " << document_uri << endl; @@ -156,13 +156,13 @@ Parser::parse_document( boost::optional<Path> parsed_path = parse(world, target, model, document_uri, data_path, parent, symbol, data); - + if (parsed_path) { target->set_variable(*parsed_path, "ingen:document", Atom(document_uri.c_str())); } else { cerr << "WARNING: document URI lost" << endl; } - + return parsed_path; } @@ -179,12 +179,12 @@ Parser::parse_string( boost::optional<GraphObject::Properties> data) { Redland::Model model(*world->rdf_world, str.c_str(), str.length(), base_uri); - + cout << "Parsing " << (data_path ? data_path->str() : "*") << " from string"; if (base_uri != "") cout << "(base " << base_uri << ")"; cout << endl; - + bool ret = parse(world, target, model, base_uri, data_path, parent, symbol, data); const Glib::ustring subject = Glib::ustring("<") + base_uri + Glib::ustring(">"); parse_connections(world, target, model, subject, parent ? *parent : "/"); @@ -210,12 +210,12 @@ Parser::parse_update( Glib::ustring query_str = Glib::ustring("SELECT DISTINCT ?o WHERE { ?o a owl:Nothing }"); Redland::Query query(*world->rdf_world, query_str); Redland::Query::Results results = query.run(*world->rdf_world, model, base_uri); - + for (Redland::Query::Results::iterator i = results.begin(); i != results.end(); ++i) { const Redland::Node& object = (*i)["o"]; target->destroy(object.to_string()); } - + // Variable settings query = Redland::Query(*world->rdf_world, "SELECT DISTINCT ?path ?varkey ?varval WHERE {\n" @@ -223,7 +223,7 @@ Parser::parse_update( "?variable rdf:predicate ?varkey ;\n" " rdf:value ?varval .\n" "}"); - + results = Redland::Query::Results(query.run(*world->rdf_world, model, base_uri)); for (Redland::Query::Results::iterator i = results.begin(); i != results.end(); ++i) { @@ -239,13 +239,13 @@ Parser::parse_update( // Connections parse_connections(world, target, model, base_uri, "/"); - + // Port values query = Redland::Query(*world->rdf_world, "SELECT DISTINCT ?path ?value WHERE {\n" "?path ingen:value ?value .\n" "}"); - + results = Redland::Query::Results(query.run(*world->rdf_world, model, base_uri)); for (Redland::Query::Results::iterator i = results.begin(); i != results.end(); ++i) { @@ -272,14 +272,14 @@ Parser::parse( boost::optional<GraphObject::Properties> data) { const Redland::Node::Type res = Redland::Node::RESOURCE; - + const Glib::ustring query_str = data_path ? Glib::ustring("SELECT DISTINCT ?t WHERE { <") + data_path->chop_start("/") + "> a ?t . }" : Glib::ustring("SELECT DISTINCT ?s ?t WHERE { ?s a ?t . }"); Redland::Query query(*world->rdf_world, query_str); Redland::Query::Results results(query.run(*world->rdf_world, model, document_uri)); - + const Redland::Node patch_class (*world->rdf_world, res, NS_INGEN "Patch"); const Redland::Node node_class (*world->rdf_world, res, NS_INGEN "Node"); const Redland::Node internal_class (*world->rdf_world, res, NS_INGEN "Internal"); @@ -287,7 +287,7 @@ Parser::parse( const Redland::Node in_port_class (*world->rdf_world, res, NS_LV2 "InputPort"); const Redland::Node out_port_class (*world->rdf_world, res, NS_LV2 "OutputPort"); const Redland::Node lv2_class (*world->rdf_world, res, NS_LV2 "Plugin"); - + const Redland::Node subject_node = (data_path && !data_path->is_root()) ? Redland::Node(*world->rdf_world, res, data_path->chop_start("/")) : model.base_uri(); @@ -304,21 +304,21 @@ Parser::parse( path_str = relative_uri(document_uri, subject.to_c_string(), true); else if (path_str == "" || path_str[0] != '/') path_str = "/" + path_str; - + if (!Path::is_valid(path_str)) { cerr << "WARNING: Invalid path '" << path_str << "', object skipped" << endl; continue; } - + const bool is_plugin = (rdf_class == ladspa_class) || (rdf_class == lv2_class) || (rdf_class == internal_class); - + const bool is_object = (rdf_class == patch_class) || (rdf_class == node_class) || (rdf_class == in_port_class) || (rdf_class == out_port_class); - + const Glib::ustring subject_uri_tok = Glib::ustring("<").append(subject).append(">"); if (is_object) { @@ -331,7 +331,7 @@ Parser::parse( cerr << "WARNING: Invalid path '" << path << "' transformed to /" << endl; path = "/"; } - + if (rdf_class == patch_class) { ret = parse_patch(world, target, model, subject, parent, symbol, data); } else if (rdf_class == node_class) { @@ -344,7 +344,7 @@ Parser::parse( cerr << "Failed to parse object " << path << endl; return boost::optional<Path>(); } - + if (data_path && subject.to_string() == data_path->str()) root_path = ret; @@ -354,7 +354,7 @@ Parser::parse( } } - + return root_path; } @@ -379,7 +379,7 @@ Parser::parse_patch( if (poly_param != data.get().end() && poly_param->second.type() == Atom::INT) patch_poly = poly_param->second.get_int32(); } - + const Glib::ustring subject = subject_node.to_turtle_token(); //cout << "**** Parse patch " << subject << endl; @@ -398,11 +398,11 @@ Parser::parse_patch( cerr << "WARNING: Patch has non-integer polyphony, assuming 1" << endl; } } - + /* No polyphony value anywhere, 1 it is */ if (patch_poly == 0) patch_poly = 1; - + const Glib::ustring base_uri = model.base_uri().to_string(); string symbol; @@ -425,7 +425,7 @@ Parser::parse_patch( /* Create patch */ Path patch_path(patch_path_str); target->new_patch(patch_path, patch_poly); - + /* Find patches in document */ Redland::Query query(*world->rdf_world, Glib::ustring( @@ -438,7 +438,7 @@ Parser::parse_patch( Glib::Mutex::Lock lock(world->rdf_world->mutex()); patches.insert((*i)["patch"].to_string()); } - + typedef multimap<std::string, Redland::Node> Properties; typedef map<string, Redland::Node> Resources; typedef map<string, Properties> Objects; @@ -514,7 +514,7 @@ Parser::parse_patch( target->set_variable(node_path, key, AtomRDF::node_to_atom(j->second)); } } - + /* Create plugin nodes */ for (Objects::iterator i = plugin_nodes.begin(); i != plugin_nodes.end(); ++i) { Types::iterator type_i = types.find(i->first); @@ -528,7 +528,7 @@ Parser::parse_patch( target->set_variable(node_path, key, AtomRDF::node_to_atom(j->second)); } } - + /* Load node ports */ query = Redland::Query(*world->rdf_world, Glib::ustring( @@ -557,7 +557,7 @@ Parser::parse_patch( target->set_variable(port_path, key, AtomRDF::node_to_atom((*i)["val"])); } } - + /* Find ports on this patch */ query = Redland::Query(*world->rdf_world, Glib::ustring( @@ -576,7 +576,7 @@ Parser::parse_patch( patch_ports.insert(make_pair(port.to_string(), Properties())); } } - + /* Load patch ports */ query = Redland::Query(*world->rdf_world, Glib::ustring( @@ -633,8 +633,8 @@ Parser::parse_patch( parse_connections(world, target, model, subject, "/"); parse_variables(world, target, model, subject_node, patch_path, data); - - + + /* Enable */ query = Redland::Query(*world->rdf_world, Glib::ustring( "SELECT DISTINCT ?enabled WHERE {\n") @@ -678,7 +678,7 @@ Parser::parse_node( cerr << "[Parser] ERROR: Node missing mandatory rdf:instanceOf property" << endl; return boost::optional<Path>(); } - + const Redland::Node& plugin_node = (*results.begin())["plug"]; if (plugin_node.type() != Redland::Node::RESOURCE) { cerr << "[Parser] ERROR: node's rdf:instanceOf property is not a resource" << endl; @@ -725,7 +725,7 @@ Parser::parse_port( if (val_node.to_string() != "") target->set_port_value(path, AtomRDF::node_to_atom(val_node)); } - + parse_variables(world, target, model, subject_node, path, data); return path; } @@ -789,7 +789,7 @@ Parser::parse_variables( if (key != "") target->set_variable(path, key, AtomRDF::node_to_atom(val)); } - + // Set passed variables last to override any loaded values if (data) for (GraphObject::Properties::const_iterator i = data.get().begin(); diff --git a/src/serialisation/Parser.hpp b/src/serialisation/Parser.hpp index eea5ca9b..87fbddd0 100644 --- a/src/serialisation/Parser.hpp +++ b/src/serialisation/Parser.hpp @@ -1,15 +1,15 @@ /* 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 @@ -37,7 +37,7 @@ public: virtual ~Parser() {} typedef Shared::GraphObject::Properties Properties; - + virtual bool parse_document( Ingen::Shared::World* world, Shared::CommonInterface* target, @@ -46,7 +46,7 @@ public: boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), boost::optional<Properties> data=boost::optional<Properties>()); - + virtual bool parse_string( Ingen::Shared::World* world, Shared::CommonInterface* target, @@ -56,7 +56,7 @@ public: boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), boost::optional<Properties> data=boost::optional<Properties>()); - + virtual bool parse_update( Ingen::Shared::World* world, Shared::CommonInterface* target, @@ -86,7 +86,7 @@ private: boost::optional<Raul::Path> parent=boost::optional<Raul::Path>(), boost::optional<Raul::Symbol> symbol=boost::optional<Raul::Symbol>(), boost::optional<Properties> data=boost::optional<Properties>()); - + boost::optional<Raul::Path> parse_node( Ingen::Shared::World* world, Ingen::Shared::CommonInterface* target, @@ -102,7 +102,7 @@ private: const Redland::Node& subject, const Raul::Path& path, boost::optional<Properties> data=boost::optional<Properties>()); - + bool parse_variables( Ingen::Shared::World* world, Ingen::Shared::CommonInterface* target, diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index cb598eb7..d64cf684 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -1,15 +1,15 @@ /* 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 @@ -62,7 +62,7 @@ Serialiser::Serialiser(Shared::World& world, SharedPtr<Shared::Store> store) , _world(*world.rdf_world) { } - + void Serialiser::to_file(const Record& record) @@ -133,7 +133,7 @@ Serialiser::write_bundle(const Record& record) write_manifest(bundle_uri, records); } - + string Serialiser::to_string(SharedPtr<GraphObject> object, const string& base_uri, @@ -141,7 +141,7 @@ Serialiser::to_string(SharedPtr<GraphObject> object, { start_to_string(object->path(), base_uri); serialise(object); - + Redland::Resource base_rdf_node(_model->world(), base_uri); for (GraphObject::Properties::const_iterator v = extra_rdf.begin(); v != extra_rdf.end(); ++v) { if (v->first.find(":") != string::npos) { @@ -228,7 +228,7 @@ Serialiser::instance_rdf_node(const Path& path) { assert(_model); assert(path.is_child_of(_root_path)); - + if (path == _root_path) return Redland::Resource(_model->world(), _base_uri); else @@ -242,7 +242,7 @@ Serialiser::class_rdf_node(const Path& path) { assert(_model); assert(path.is_child_of(_root_path)); - + if (path == _root_path) return Redland::Resource(_model->world(), _base_uri); else @@ -269,14 +269,14 @@ Serialiser::serialise(SharedPtr<GraphObject> object) throw (std::logic_error) } return; } - + SharedPtr<Shared::Node> node = PtrCast<Shared::Node>(object); if (node) { const Redland::Resource plugin_id(_model->world(), node->plugin()->uri().str()); serialise_node(node, plugin_id, instance_rdf_node(node->path())); return; } - + SharedPtr<Shared::Port> port = PtrCast<Shared::Port>(object); if (port) { serialise_port(port.get(), instance_rdf_node(port->path())); @@ -292,10 +292,10 @@ void Serialiser::serialise_patch(SharedPtr<Shared::Patch> patch, const Redland::Node& patch_id) { assert(_model); - + _model->add_statement(patch_id, "rdf:type", Redland::Resource(_model->world(), "ingen:Patch")); - + _model->add_statement(patch_id, "rdf:type", Redland::Resource(_model->world(), "lv2:Plugin")); @@ -316,7 +316,7 @@ Serialiser::serialise_patch(SharedPtr<Shared::Patch> patch, const Redland::Node& for (GraphObject::const_iterator n = _store->children_begin(patch); n != _store->children_end(patch); ++n) { - + if (n->second->graph_parent() != patch.get()) continue; @@ -337,13 +337,13 @@ Serialiser::serialise_patch(SharedPtr<Shared::Patch> patch, const Redland::Node& } bool root = (patch->path() == _root_path); - + for (uint32_t i=0; i < patch->num_ports(); ++i) { Port* p = patch->port(i); const Redland::Node port_id = root ? instance_rdf_node(p->path()) : class_rdf_node(p->path()); - + // Ensure lv2:name always exists so Patch is a valid LV2 plugin if (p->properties().find("lv2:name") == p->properties().end()) p->set_property("lv2:name", Atom(Atom::STRING, p->symbol())); @@ -368,7 +368,7 @@ Serialiser::serialise_plugin(const Shared::Plugin& plugin) _model->add_statement(plugin_id, "rdf:type", Redland::Resource(_model->world(), plugin.type_uri())); -} +} void @@ -381,7 +381,7 @@ Serialiser::serialise_node(SharedPtr<Shared::Node> node, class_id); _model->add_statement(node_id, "lv2:symbol", Redland::Literal(_model->world(), node->path().name())); - + for (uint32_t i=0; i < node->num_ports(); ++i) { Port* p = node->port(i); const Redland::Node port_id = instance_rdf_node(p->path()); @@ -403,14 +403,14 @@ Serialiser::serialise_port(const Port* port, const Redland::Node& port_id) else _model->add_statement(port_id, "rdf:type", Redland::Resource(_model->world(), "lv2:OutputPort")); - + _model->add_statement(port_id, "rdf:type", Redland::Resource(_model->world(), port->type().uri())); - + if (dynamic_cast<Patch*>(port->graph_parent())) _model->add_statement(port_id, "rdf:instanceOf", class_rdf_node(port->path())); - + if (port->is_input() && port->type() == DataType::CONTROL) _model->add_statement(port_id, "ingen:value", AtomRDF::atom_to_node(_model->world(), Atom(port->value()))); @@ -429,13 +429,13 @@ Serialiser::serialise_port_class(const Port* port, const Redland::Node& port_id) else _model->add_statement(port_id, "rdf:type", Redland::Resource(_model->world(), "lv2:OutputPort")); - + _model->add_statement(port_id, "rdf:type", Redland::Resource(_model->world(), port->type().uri())); - + _model->add_statement(port_id, "lv2:index", AtomRDF::atom_to_node(_model->world(), Atom((int)port->index()))); - + if (!port->get_property("lv2:default").is_valid()) { if (port->is_input()) { if (port->value().is_valid()) { @@ -486,7 +486,7 @@ Serialiser::serialise_properties(Redland::Node subject, const GraphObject::Prope } } } - + void Serialiser::serialise_variables(Redland::Node subject, const GraphObject::Properties& variables) diff --git a/src/serialisation/Serialiser.hpp b/src/serialisation/Serialiser.hpp index 95425bad..7c0710d8 100644 --- a/src/serialisation/Serialiser.hpp +++ b/src/serialisation/Serialiser.hpp @@ -1,15 +1,15 @@ /* 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 @@ -53,7 +53,7 @@ class Serialiser { public: Serialiser(Shared::World& world, SharedPtr<Shared::Store> store); - + typedef Shared::GraphObject::Properties Properties; struct Record { @@ -68,7 +68,7 @@ public: typedef std::list<Record> Records; void to_file(const Record& record); - + void write_bundle(const Record& record); void write_manifest(const std::string& bundle_uri, @@ -77,18 +77,18 @@ public: std::string to_string(SharedPtr<Shared::GraphObject> object, const std::string& base_uri, const Properties& extra_rdf); - + void start_to_string(const Raul::Path& root, const std::string& base_uri); void serialise(SharedPtr<Shared::GraphObject> object) throw (std::logic_error); void serialise_plugin(const Shared::Plugin& p); void serialise_connection(SharedPtr<Shared::GraphObject> parent, SharedPtr<Shared::Connection> c) throw (std::logic_error); - + std::string finish(); - + private: enum Mode { TO_FILE, TO_STRING }; - + void start_to_filename(const std::string& filename); void setup_prefixes(); @@ -101,7 +101,7 @@ private: void serialise_properties(Redland::Node subject, const Properties& properties); void serialise_variables(Redland::Node subject, const Properties& variables); - + Redland::Node instance_rdf_node(const Raul::Path& path); Redland::Node class_rdf_node(const Raul::Path& path); diff --git a/src/serialisation/serialisation.cpp b/src/serialisation/serialisation.cpp index 172db2a1..ad125d4f 100644 --- a/src/serialisation/serialisation.cpp +++ b/src/serialisation/serialisation.cpp @@ -1,15 +1,15 @@ /* 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 @@ -31,7 +31,7 @@ new_parser() return new Parser(); } - + Ingen::Serialisation::Serialiser* new_serialiser(Ingen::Shared::World* world, SharedPtr<Shared::Store> store) { diff --git a/src/serialisation/serialisation.hpp b/src/serialisation/serialisation.hpp index a250945b..5778d34b 100644 --- a/src/serialisation/serialisation.hpp +++ b/src/serialisation/serialisation.hpp @@ -1,15 +1,15 @@ /* 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 diff --git a/src/shared/Builder.cpp b/src/shared/Builder.cpp index d1ddee32..dee39b2d 100644 --- a/src/shared/Builder.cpp +++ b/src/shared/Builder.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 diff --git a/src/shared/Builder.hpp b/src/shared/Builder.hpp index c49937fe..f6f083a2 100644 --- a/src/shared/Builder.hpp +++ b/src/shared/Builder.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 diff --git a/src/shared/ClashAvoider.cpp b/src/shared/ClashAvoider.cpp index 4995aa5e..f57db45e 100644 --- a/src/shared/ClashAvoider.cpp +++ b/src/shared/ClashAvoider.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -41,7 +41,7 @@ ClashAvoider::map_path(const Raul::Path& in) { //cout << "MAP PATH: " << in; //cout << endl << "**** MAP PATH: " << in << endl; - + unsigned offset = 0; bool has_offset = false; size_t pos = in.find_last_of("_"); @@ -51,7 +51,7 @@ ClashAvoider::map_path(const Raul::Path& in) } //cout << "OFFSET: " << offset << endl; - + // Path without _n suffix Path base_path = in; if (has_offset) @@ -65,7 +65,7 @@ ClashAvoider::map_path(const Raul::Path& in) return m->second; } else { typedef std::pair<SymbolMap::iterator, bool> InsertRecord; - + // See if parent is mapped Path parent = in.parent(); do { @@ -86,7 +86,7 @@ ClashAvoider::map_path(const Raul::Path& in) assert(i.second); //cout << " (3) " << i.first->second << endl;; return i.first->second; - + // Append _2 _3 etc until an unused symbol is found } else { while (true) { @@ -100,7 +100,7 @@ ClashAvoider::map_path(const Raul::Path& in) parent_str = "/"; //cout << "***** PARENT: " << parent_str << endl; } - + if (offset == 0) offset = 2; diff --git a/src/shared/ClashAvoider.hpp b/src/shared/ClashAvoider.hpp index 0334610d..221cba32 100644 --- a/src/shared/ClashAvoider.hpp +++ b/src/shared/ClashAvoider.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -41,54 +41,54 @@ public: : _store(store), _target(target), _also_avoid(also_avoid) {} void set_target(CommonInterface& target) { _target = target; } - + // Bundles void bundle_begin() { _target.bundle_begin(); } void bundle_end() { _target.bundle_end(); } - + // Object commands - + virtual bool new_object(const GraphObject* object); virtual void new_patch(const Raul::Path& path, uint32_t poly); - + virtual void new_node(const Raul::Path& path, const Raul::URI& plugin_uri); - + virtual void new_port(const Raul::Path& path, const Raul::URI& type, uint32_t index, bool is_output); - + virtual void rename(const Raul::Path& old_path, const Raul::Path& new_path); - + virtual void connect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void disconnect(const Raul::Path& src_port_path, const Raul::Path& dst_port_path); - + virtual void set_variable(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_property(const Raul::URI& subject_path, const Raul::URI& predicate, const Raul::Atom& value); - + virtual void set_port_value(const Raul::Path& port_path, const Raul::Atom& value); - + virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value); - + virtual void destroy(const Raul::Path& path); - + virtual void clear_patch(const Raul::Path& patch_path); - + private: const Raul::URI map_uri(const Raul::URI& in); const Raul::Path map_path(const Raul::Path& in); diff --git a/src/shared/HTTPSender.cpp b/src/shared/HTTPSender.cpp index e5cd80dc..6d036989 100644 --- a/src/shared/HTTPSender.cpp +++ b/src/shared/HTTPSender.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -59,7 +59,7 @@ HTTPSender::HTTPSender() fprintf(stderr, "Error calling bind (%s)\n", strerror(errno)); _listen_sock = -1; } - + // Find port number socklen_t length = sizeof(addr); if (getsockname(_listen_sock, (struct sockaddr*)&addr, &length) == -1) { @@ -67,7 +67,7 @@ HTTPSender::HTTPSender() _listen_sock = -1; return; } - + if (listen(_listen_sock, 1) < 0 ) { cerr << "Error calling listen: %s" << strerror(errno) << endl; _listen_sock = -1; @@ -96,7 +96,7 @@ HTTPSender::_run() cerr << "Unable to open socket, exiting sender thread" << endl; return; } - + // Accept connection if ((_client_sock = accept(_listen_sock, NULL, NULL) ) < 0) { cerr << "Error calling accept: " << strerror(errno) << endl; @@ -139,7 +139,7 @@ HTTPSender::bundle_end() _mutex.unlock(); } - + void HTTPSender::send_chunk(const std::string& buf) { diff --git a/src/shared/HTTPSender.hpp b/src/shared/HTTPSender.hpp index 1077b76d..61cd4142 100644 --- a/src/shared/HTTPSender.hpp +++ b/src/shared/HTTPSender.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -34,7 +34,7 @@ public: // Message bundling void bundle_begin(); void bundle_end(); - + // Transfers (loose bundling) void transfer_begin() { bundle_begin(); } void transfer_end() { bundle_end(); } @@ -45,7 +45,7 @@ protected: void _run(); void send_chunk(const std::string& buf); - + enum SendState { Immediate, SendingBundle }; Glib::Mutex _mutex; diff --git a/src/shared/LV2Features.cpp b/src/shared/LV2Features.cpp index 2e7eb10e..99e181a2 100644 --- a/src/shared/LV2Features.cpp +++ b/src/shared/LV2Features.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -23,8 +23,8 @@ using namespace std; namespace Ingen { namespace Shared { - - + + LV2Features::LV2Features() : _lv2_features((LV2_Feature**)malloc(sizeof(LV2_Feature*))) { @@ -60,7 +60,7 @@ LV2Features::add_feature(const std::string& uri, LV2_Feature* feature, void* con _lv2_features[_features.size()-1] = feature; _lv2_features[_features.size()] = NULL; } - + } // namespace Shared } // namespace Ingen diff --git a/src/shared/LV2Features.hpp b/src/shared/LV2Features.hpp index 3ffbe520..8636d993 100644 --- a/src/shared/LV2Features.hpp +++ b/src/shared/LV2Features.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -26,10 +26,10 @@ #include <map> #include <string> #include "slv2/slv2.h" - + namespace Ingen { namespace Shared { - + /** Stuff that may need to be passed to an LV2 plugin (i.e. LV2 features). */ @@ -44,9 +44,9 @@ public: }; typedef std::map<std::string, Feature> Features; - + const Feature* feature(const std::string& uri); - + void add_feature(const std::string& uri, LV2_Feature* feature, void* controller); LV2_Feature** lv2_features() const { return _lv2_features; } diff --git a/src/shared/LV2URIMap.cpp b/src/shared/LV2URIMap.cpp index c01dfea0..55ed659f 100644 --- a/src/shared/LV2URIMap.cpp +++ b/src/shared/LV2URIMap.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -25,7 +25,7 @@ using namespace std; namespace Ingen { namespace Shared { - + LV2URIMap::LV2URIMap() : next_uri_id(1) @@ -36,7 +36,7 @@ LV2URIMap::LV2URIMap() uri_map_feature.data = &uri_map_feature_data; } - + uint32_t LV2URIMap::uri_to_id(const char* map, const char* uri) @@ -51,7 +51,7 @@ LV2URIMap::uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data, const char* uri) { // TODO: map ignored, < UINT16_MAX assumed - + LV2URIMap* me = (LV2URIMap*)callback_data; uint32_t ret = 0; @@ -62,7 +62,7 @@ LV2URIMap::uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data, ret = me->next_uri_id++; me->uri_map.insert(make_pair(string(uri), ret)); } - + /*cout << "URI MAP (" << (map ? (void*)map : NULL) << "): " << uri << " -> " << ret << endl;*/ diff --git a/src/shared/LV2URIMap.hpp b/src/shared/LV2URIMap.hpp index 7da53a09..239e220e 100644 --- a/src/shared/LV2URIMap.hpp +++ b/src/shared/LV2URIMap.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -28,17 +28,17 @@ #include <boost/utility.hpp> #include "slv2/slv2.h" #include "common/lv2ext/lv2_uri_map.h" - + namespace Ingen { namespace Shared { - + /** Implementation of the LV2 URI Map extension */ class LV2URIMap : public boost::noncopyable { public: LV2URIMap(); - + LV2_Feature* feature() { return &uri_map_feature; } uint32_t uri_to_id(const char* map, @@ -46,11 +46,11 @@ public: private: typedef std::map<std::string, uint32_t> URIMap; - + static uint32_t uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data, const char* map, const char* uri); - + LV2_Feature uri_map_feature; LV2_URI_Map_Feature uri_map_feature_data; URIMap uri_map; diff --git a/src/shared/OSCSender.cpp b/src/shared/OSCSender.cpp index dab5338e..834675b5 100644 --- a/src/shared/OSCSender.cpp +++ b/src/shared/OSCSender.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -52,7 +52,7 @@ OSCSender::bundle_end() transfer_end(); } - + void OSCSender::transfer_begin() { @@ -74,7 +74,7 @@ OSCSender::transfer_end() _send_state = Immediate; } - + int OSCSender::send(const char *path, const char *types, ...) { @@ -83,13 +83,13 @@ OSCSender::send(const char *path, const char *types, ...) va_list args; va_start(args, types); - + lo_message msg = lo_message_new(); int ret = lo_message_add_varargs(msg, types, args); - + if (!ret) send_message(path, msg); - + va_end(args); return ret; @@ -105,7 +105,7 @@ OSCSender::send_message(const char* path, lo_message msg) if (!_enabled) return; - + if (_transfer) { if (lo_bundle_length(_transfer) + lo_message_length(msg, path) > MAX_BUNDLE_SIZE) { if (_send_state == SendingBundle) diff --git a/src/shared/OSCSender.hpp b/src/shared/OSCSender.hpp index da91caed..08f212be 100644 --- a/src/shared/OSCSender.hpp +++ b/src/shared/OSCSender.hpp @@ -1,15 +1,15 @@ /* 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 @@ -30,11 +30,11 @@ public: virtual ~OSCSender() {} lo_address address() const { return _address; } - + // Message bundling void bundle_begin(); void bundle_end(); - + // Transfers (loose bundling) void transfer_begin(); void transfer_end(); diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp index e8fbec35..fc2004af 100644 --- a/src/shared/ResourceImpl.cpp +++ b/src/shared/ResourceImpl.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 diff --git a/src/shared/ResourceImpl.hpp b/src/shared/ResourceImpl.hpp index 9cddbbf6..f164ce8d 100644 --- a/src/shared/ResourceImpl.hpp +++ b/src/shared/ResourceImpl.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 diff --git a/src/shared/Store.cpp b/src/shared/Store.cpp index 481f81c8..b843d80f 100644 --- a/src/shared/Store.cpp +++ b/src/shared/Store.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -79,7 +79,7 @@ Store::find_child(SharedPtr<Shared::GraphObject> parent, const string& child_nam else return SharedPtr<Shared::GraphObject>(); } - + unsigned Store::child_name_offset(const Raul::Path& parent, diff --git a/src/shared/Store.hpp b/src/shared/Store.hpp index 1f52e1e9..4fa53773 100644 --- a/src/shared/Store.hpp +++ b/src/shared/Store.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -30,21 +30,21 @@ namespace Shared { class Store : public Raul::PathTable< SharedPtr<Shared::GraphObject> > { public: virtual ~Store() {} - + virtual void add(Shared::GraphObject* o); typedef Raul::Table< Raul::Path, SharedPtr<Shared::GraphObject> > Objects; const_iterator children_begin(SharedPtr<Shared::GraphObject> o) const; const_iterator children_end(SharedPtr<Shared::GraphObject> o) const; - + SharedPtr<Shared::GraphObject> find_child(SharedPtr<Shared::GraphObject> parent, const std::string& child_name) const; unsigned child_name_offset(const Raul::Path& parent, const Raul::Symbol& symbol, bool allow_zero=true); - + Glib::RWLock& lock() { return _lock; } private: diff --git a/src/shared/runtime_paths.cpp b/src/shared/runtime_paths.cpp index 15bafa50..f487deae 100644 --- a/src/shared/runtime_paths.cpp +++ b/src/shared/runtime_paths.cpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 @@ -42,7 +42,7 @@ set_bundle_path_from_code(void* function) char bin_loc[PATH_MAX]; realpath(dli.dli_fname, bin_loc); - + #ifdef BUNDLE string bundle = bin_loc; bundle = bundle.substr(0, bundle.find_last_of("/")); diff --git a/src/shared/runtime_paths.hpp b/src/shared/runtime_paths.hpp index 5ee1aebc..e654b684 100644 --- a/src/shared/runtime_paths.hpp +++ b/src/shared/runtime_paths.hpp @@ -1,15 +1,15 @@ /* This file is part of Ingen. * Copyright (C) 2008 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 |