From b84b50d2bbbfcd196d62344eaeef7fb08e3d686c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 13 May 2009 16:04:14 +0000 Subject: Strip trailing whitespace. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@1999 a436a847-0d15-0410-975c-d299462d15a1 --- src/AlsaDriver.cpp | 56 +++++++++++++-------------- src/AlsaDriver.hpp | 22 +++++------ src/DBus.hpp | 6 +-- src/Driver.hpp | 18 ++++----- src/GladeFile.hpp | 8 ++-- src/JackDbusDriver.cpp | 10 ++--- src/JackDbusDriver.hpp | 10 ++--- src/JackDriver.cpp | 80 +++++++++++++++++++-------------------- src/JackDriver.hpp | 20 +++++----- src/LashClient.hpp | 6 +-- src/LashProxy.cpp | 6 +-- src/LashProxy.hpp | 6 +-- src/LoadProjectDialog.hpp | 6 +-- src/Patchage.cpp | 96 +++++++++++++++++++++++------------------------ src/Patchage.hpp | 22 +++++------ src/PatchageCanvas.cpp | 28 +++++++------- src/PatchageCanvas.hpp | 12 +++--- src/PatchageEvent.cpp | 16 ++++---- src/PatchageEvent.hpp | 14 +++---- src/PatchageModule.hpp | 16 ++++---- src/PatchagePort.hpp | 6 +-- src/PortID.hpp | 8 ++-- src/Project.hpp | 2 +- src/ProjectList.cpp | 2 +- src/Session.hpp | 6 +-- src/StateManager.cpp | 34 ++++++++--------- src/StateManager.hpp | 10 ++--- src/Widget.hpp | 4 +- src/binary_location.h | 6 +-- src/main.cpp | 14 +++---- 30 files changed, 275 insertions(+), 275 deletions(-) diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index 32c5f24..44569f3 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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 @@ AlsaDriver::AlsaDriver(Patchage* app) } -AlsaDriver::~AlsaDriver() +AlsaDriver::~AlsaDriver() { detach(); } @@ -59,7 +59,7 @@ AlsaDriver::attach(bool /*launch_daemon*/) _app->status_msg("[ALSA] Attached"); snd_seq_set_client_name(_seq, "Patchage"); - + pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 50000); @@ -67,14 +67,14 @@ AlsaDriver::attach(bool /*launch_daemon*/) ret = pthread_create(&_refresh_thread, &attr, &AlsaDriver::refresh_main, this); if (ret) cerr << "Couldn't start refresh thread" << endl; - + signal_attached.emit(); } } void -AlsaDriver::detach() +AlsaDriver::detach() { if (_seq) { pthread_cancel(_refresh_thread); @@ -96,7 +96,7 @@ AlsaDriver::refresh() return; assert(_seq); - + refresh_ports(); refresh_connections(); } @@ -240,7 +240,7 @@ AlsaDriver::create_port(boost::shared_ptr parent, } -/** Refresh all Alsa Midi ports. +/** Refresh all Alsa Midi ports. */ void AlsaDriver::refresh_ports() @@ -254,7 +254,7 @@ AlsaDriver::refresh_ports() snd_seq_port_info_t* pinfo; snd_seq_port_info_alloca(&pinfo); - + boost::shared_ptr parent; boost::shared_ptr port; @@ -279,10 +279,10 @@ AlsaDriver::refresh_connections() { assert(is_attached()); assert(_seq); - + boost::shared_ptr m; boost::shared_ptr p; - + for (ItemList::iterator i = _app->canvas()->items().begin(); i != _app->canvas()->items().end(); ++i) { m = boost::dynamic_pointer_cast(*i); @@ -304,25 +304,25 @@ AlsaDriver::add_connections(boost::shared_ptr port) { assert(is_attached()); assert(_seq); - + const snd_seq_addr_t* addr = port->alsa_addr(); boost::shared_ptr connected_port; - + // Fix a problem with duplex->duplex connections (would show up twice) // No sense doing them all twice anyway.. if (port->is_input()) return; - + snd_seq_query_subscribe_t* subsinfo; snd_seq_query_subscribe_alloca(&subsinfo); snd_seq_query_subscribe_set_root(subsinfo, addr); snd_seq_query_subscribe_set_index(subsinfo, 0); - + while (!snd_seq_query_port_subscribers(_seq, subsinfo)) { const snd_seq_addr_t* connected_addr = snd_seq_query_subscribe_get_addr(subsinfo); if (!connected_addr) continue; - + PortID id(*connected_addr, true); connected_port = _app->canvas()->find_port(id); @@ -336,17 +336,17 @@ AlsaDriver::add_connections(boost::shared_ptr port) /** Connects two Alsa Midi ports. - * + * * \return Whether connection succeeded. */ bool -AlsaDriver::connect(boost::shared_ptr src_port, boost::shared_ptr dst_port) +AlsaDriver::connect(boost::shared_ptr src_port, boost::shared_ptr dst_port) { const snd_seq_addr_t* src = src_port->alsa_addr(); const snd_seq_addr_t* dst = dst_port->alsa_addr(); bool result = true; - + if (src && dst) { snd_seq_port_subscribe_t* subs; snd_seq_port_subscribe_malloc(&subs); @@ -368,7 +368,7 @@ AlsaDriver::connect(boost::shared_ptr src_port, boost::shared_ptr< result = false; } } - + if (result) _app->status_msg(string("[ALSA] Connected ") + src_port->full_name() + " -> " + dst_port->full_name()); @@ -381,15 +381,15 @@ AlsaDriver::connect(boost::shared_ptr src_port, boost::shared_ptr< /** Disconnects two Alsa Midi ports. - * + * * \return Whether disconnection succeeded. */ bool -AlsaDriver::disconnect(boost::shared_ptr src_port, boost::shared_ptr dst_port) +AlsaDriver::disconnect(boost::shared_ptr src_port, boost::shared_ptr dst_port) { const snd_seq_addr_t* src = src_port->alsa_addr(); const snd_seq_addr_t* dst = dst_port->alsa_addr(); - + bool result = true; snd_seq_port_subscribe_t* subs; @@ -405,13 +405,13 @@ AlsaDriver::disconnect(boost::shared_ptr src_port, boost::shared_p cerr << "Error: Attempt to unsubscribe Alsa ports that are not subscribed." << endl; result = false; } - + int ret = snd_seq_unsubscribe_port(_seq, subs); if (ret < 0) { cerr << "Alsa unsubscription failed: " << snd_strerror(ret) << endl; result = false; } - + if (result) _app->status_msg(string("[ALSA] Disconnected ") + src_port->full_name() + " -> " + dst_port->full_name()); @@ -435,7 +435,7 @@ AlsaDriver::create_refresh_port() snd_seq_port_info_set_name(port_info, "System Announcement Reciever"); snd_seq_port_info_set_capability(port_info, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE|SND_SEQ_PORT_CAP_NO_EXPORT); - + snd_seq_port_info_set_type(port_info, SND_SEQ_PORT_TYPE_APPLICATION); ret = snd_seq_create_port(_seq, port_info); @@ -449,7 +449,7 @@ AlsaDriver::create_refresh_port() snd_seq_port_info_get_port(port_info), SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_ANNOUNCE); - + if (ret) { cerr << "Could not connect to system announcer port: " << snd_strerror(ret) << endl; return false; diff --git a/src/AlsaDriver.hpp b/src/AlsaDriver.hpp index 38396f1..4b7c13f 100644 --- a/src/AlsaDriver.hpp +++ b/src/AlsaDriver.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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 @@ class AlsaDriver : public Driver public: AlsaDriver(Patchage* app); ~AlsaDriver(); - + void attach(bool launch_daemon = false); void detach(); bool is_attached() const { return (_seq != NULL); } void refresh(); - + boost::shared_ptr create_port_view( Patchage* patchage, const PortID& id); @@ -53,13 +53,13 @@ public: boost::shared_ptr dst_port); void print_addr(snd_seq_addr_t addr); - + private: void refresh_ports(); void refresh_connections(); - + void add_connections(boost::shared_ptr port); - + bool create_refresh_port(); static void* refresh_main(void* me); void _refresh_main(); @@ -69,20 +69,20 @@ private: Patchage* patchage, const std::string& client_name, ModuleType type); - + void create_port_view_internal( Patchage* patchage, snd_seq_addr_t addr, boost::shared_ptr& parent, boost::shared_ptr& port); - + boost::shared_ptr create_port( boost::shared_ptr parent, const std::string& name, bool is_input, snd_seq_addr_t addr); - + Patchage* _app; snd_seq_t* _seq; pthread_t _refresh_thread; diff --git a/src/DBus.hpp b/src/DBus.hpp index ffcabbb..983d274 100644 --- a/src/DBus.hpp +++ b/src/DBus.hpp @@ -1,16 +1,16 @@ /* This file is part of Patchage. * Copyright (C) 2008 Dave Robillard * Copyright (C) 2008 Nedko Arnaudov - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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/Driver.hpp b/src/Driver.hpp index 4c9d313..822b89d 100644 --- a/src/Driver.hpp +++ b/src/Driver.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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 @@ class PatchageCanvas; class Driver { public: virtual ~Driver() {} - + virtual void process_events(Patchage* app) { while (!events().empty()) { PatchageEvent& ev = events().front(); @@ -45,17 +45,17 @@ public: virtual void refresh() = 0; virtual void destroy_all() {} - + virtual boost::shared_ptr create_port_view( Patchage* patchage, const PortID& id) = 0; - + virtual bool connect(boost::shared_ptr src_port, boost::shared_ptr dst_port) = 0; - + virtual bool disconnect(boost::shared_ptr src_port, boost::shared_ptr dst_port) = 0; - + Raul::SRSWQueue& events() { return _events; } sigc::signal signal_attached; @@ -63,7 +63,7 @@ public: protected: Driver(size_t event_queue_size) : _events(event_queue_size) {} - + Raul::SRSWQueue _events; }; diff --git a/src/GladeFile.hpp b/src/GladeFile.hpp index 5a0d812..2f10a80 100644 --- a/src/GladeFile.hpp +++ b/src/GladeFile.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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: ss << "Unable to find " << base_name << ".glade in " << PATCHAGE_DATA_DIR << std::endl; throw std::runtime_error(ss.str()); } - + fs.close(); return Gnome::Glade::Xml::create(glade_filename); diff --git a/src/JackDbusDriver.cpp b/src/JackDbusDriver.cpp index feb1923..d5da26d 100644 --- a/src/JackDbusDriver.cpp +++ b/src/JackDbusDriver.cpp @@ -1,16 +1,16 @@ // -*- Mode: C++ ; indent-tabs-mode: t -*- /* This file is part of Patchage. * Copyright (C) 2008 Nedko Arnaudov - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA @@ -474,7 +474,7 @@ JackDriver::stop_server() } dbus_message_unref(reply_ptr); - + if (!_server_started) { _server_started = false; signal_detached.emit(); @@ -614,7 +614,7 @@ JackDriver::remove_port( module->remove_port(port); port.reset(); - + // No empty modules (for now) if (module->num_ports() == 0) { _app->canvas()->remove_item(module); diff --git a/src/JackDbusDriver.hpp b/src/JackDbusDriver.hpp index 932f14f..0a6b864 100644 --- a/src/JackDbusDriver.hpp +++ b/src/JackDbusDriver.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2008 Nedko Arnaudov - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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: bool is_attached() const; bool is_realtime() const; - + void refresh(); bool @@ -75,7 +75,7 @@ public: find_port_view( Patchage* patchage, const PortID& ref); - + boost::shared_ptr create_port_view( Patchage* patchage, diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index 87ab1bf..ff937ac 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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 @@ JackDriver::JackDriver(Patchage* app) } -JackDriver::~JackDriver() +JackDriver::~JackDriver() { detach(); } @@ -57,12 +57,12 @@ JackDriver::~JackDriver() /** Connect to Jack. */ void -JackDriver::attach(bool launch_daemon) +JackDriver::attach(bool launch_daemon) { // Already connected if (_client) return; - + jack_set_error_function(error_cb); jack_options_t options = (!launch_daemon) ? JackNoStartServer : JackNullOption; @@ -81,7 +81,7 @@ JackDriver::attach(bool launch_daemon) jack_set_graph_order_callback(client, jack_graph_order_cb, this); jack_set_buffer_size_callback(client, jack_buffer_size_cb, this); jack_set_xrun_callback(client, jack_xrun_cb, this); - + _buffer_size = jack_get_buffer_size(client); if (!jack_activate(client)) { @@ -97,7 +97,7 @@ JackDriver::attach(bool launch_daemon) void -JackDriver::detach() +JackDriver::detach() { Glib::Mutex::Lock lock(_shutdown_mutex); if (_client) { @@ -136,7 +136,7 @@ JackDriver::destroy_all() _app->enqueue_resize(module); } } - + boost::shared_ptr JackDriver::create_port_view(Patchage* patchage, @@ -146,7 +146,7 @@ JackDriver::create_port_view(Patchage* patchage, if (id.type == PortID::JACK_ID) jack_port = jack_port_by_id(_client, id.id.jack_id); - + if (jack_port == NULL) return boost::shared_ptr(); @@ -167,7 +167,7 @@ JackDriver::create_port_view(Patchage* patchage, boost::shared_ptr parent = _app->canvas()->find_module(module_name, type); - + bool resize = false; if (!parent) { @@ -188,10 +188,10 @@ JackDriver::create_port_view(Patchage* patchage, parent->add_port(port); resize = true; } - + if (resize) _app->enqueue_resize(parent); - + return port; } @@ -213,7 +213,7 @@ JackDriver::create_port(boost::shared_ptr parent, jack_port_t* p cerr << "WARNING: " << jack_port_name(port) << " has unknown type \'" << type_str << "\'" << endl; return boost::shared_ptr(); } - + boost::shared_ptr ret( new PatchagePort(parent, port_type, jack_port_short_name(port), (jack_port_flags(port) & JackPortIsInput), @@ -234,16 +234,16 @@ JackDriver::shutdown() * To be called from GTK thread only. */ void -JackDriver::refresh() +JackDriver::refresh() { const char** ports; jack_port_t* port; // Jack can take _client away from us at any time throughout here :/ // Shortest locks possible is the best solution I can figure out - + Glib::Mutex::Lock lock(_shutdown_mutex); - + if (_client == NULL) { shutdown(); return; @@ -259,7 +259,7 @@ JackDriver::refresh() string port1_name; string client2_name; string port2_name; - + // Add all ports for (int i=0; ports[i]; ++i) { port = jack_port_by_name(_client, ports[i]); @@ -305,13 +305,13 @@ JackDriver::refresh() _app->enqueue_resize(m); } - + // Add all connections for (int i=0; ports[i]; ++i) { port = jack_port_by_name(_client, ports[i]); const char** connected_ports = jack_port_get_all_connections(_client, port); - + if (connected_ports) { for (int j=0; connected_ports[j]; ++j) { client1_name = ports[i]; @@ -346,11 +346,11 @@ JackDriver::refresh() if (src && dst && !src->is_connected_to(dst)) _app->canvas()->add_connection(src, dst, port1->color() + 0x22222200); } - + free(connected_ports); } } - + free(ports); } @@ -389,16 +389,16 @@ JackDriver::connect(boost::shared_ptr src_port, boost::shared_ptr< { if (_client == NULL) return false; - + int result = jack_connect(_client, src_port->full_name().c_str(), dst_port->full_name().c_str()); - + if (result == 0) _app->status_msg(string("[JACK] Connected ") + src_port->full_name() + " -> " + dst_port->full_name()); else _app->status_msg(string("[JACK] Unable to connect ") + src_port->full_name() + " -> " + dst_port->full_name()); - + return (!result); } @@ -414,20 +414,20 @@ JackDriver::disconnect(boost::shared_ptr const src_port, boost::sh return false; int result = jack_disconnect(_client, src_port->full_name().c_str(), dst_port->full_name().c_str()); - + if (result == 0) _app->status_msg(string("[JACK] Disconnected ") + src_port->full_name() + " -> " + dst_port->full_name()); else _app->status_msg(string("[JACK] Unable to disconnect ") + src_port->full_name() + " -> " + dst_port->full_name()); - + return (!result); } void -JackDriver::jack_client_registration_cb(const char* name, int registered, void* jack_driver) +JackDriver::jack_client_registration_cb(const char* name, int registered, void* jack_driver) { assert(jack_driver); JackDriver* me = reinterpret_cast(jack_driver); @@ -444,12 +444,12 @@ JackDriver::jack_client_registration_cb(const char* name, int registered, void* void -JackDriver::jack_port_registration_cb(jack_port_id_t port_id, int registered, void* jack_driver) +JackDriver::jack_port_registration_cb(jack_port_id_t port_id, int registered, void* jack_driver) { assert(jack_driver); JackDriver* me = reinterpret_cast(jack_driver); assert(me->_client); - + jack_reset_max_delayed_usecs(me->_client); if (registered) { @@ -461,7 +461,7 @@ JackDriver::jack_port_registration_cb(jack_port_id_t port_id, int registered, vo void -JackDriver::jack_port_connect_cb(jack_port_id_t src, jack_port_id_t dst, int connect, void* jack_driver) +JackDriver::jack_port_connect_cb(jack_port_id_t src, jack_port_id_t dst, int connect, void* jack_driver) { assert(jack_driver); JackDriver* me = reinterpret_cast(jack_driver); @@ -478,25 +478,25 @@ JackDriver::jack_port_connect_cb(jack_port_id_t src, jack_port_id_t dst, int con int -JackDriver::jack_graph_order_cb(void* jack_driver) +JackDriver::jack_graph_order_cb(void* jack_driver) { assert(jack_driver); JackDriver* me = reinterpret_cast(jack_driver); assert(me->_client); - + jack_reset_max_delayed_usecs(me->_client); - + return 0; } int -JackDriver::jack_buffer_size_cb(jack_nframes_t buffer_size, void* jack_driver) +JackDriver::jack_buffer_size_cb(jack_nframes_t buffer_size, void* jack_driver) { assert(jack_driver); JackDriver* me = reinterpret_cast(jack_driver); assert(me->_client); - + jack_reset_max_delayed_usecs(me->_client); me->_buffer_size = buffer_size; @@ -517,7 +517,7 @@ JackDriver::jack_xrun_cb(void* jack_driver) me->_xruns++; me->_xrun_delay = jack_get_xrun_delayed_usecs(me->_client); jack_reset_max_delayed_usecs(me->_client); - + return 0; } @@ -571,7 +571,7 @@ JackDriver::set_buffer_size(jack_nframes_t size) _buffer_size = size; return true; } - + if (jack_set_buffer_size(_client, size)) { _app->status_msg("[JACK] ERROR: Unable to set buffer size"); return false; @@ -591,8 +591,8 @@ JackDriver::get_max_dsp_load() const float rate = sample_rate(); const float size = buffer_size(); - const float period = size / rate * 1000000; // usec - + const float period = size / rate * 1000000; // usec + if (max_delay > period) { max_load = 1.0; jack_reset_max_delayed_usecs(_client); diff --git a/src/JackDriver.hpp b/src/JackDriver.hpp index d987077..2bdb990 100644 --- a/src/JackDriver.hpp +++ b/src/JackDriver.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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,13 +41,13 @@ class JackDriver : public Driver public: JackDriver(Patchage* app); ~JackDriver(); - + void attach(bool launch_daemon); void detach(); bool is_attached() const { return (_client != NULL); } bool is_realtime() const { return _client && jack_is_realtime(_client); } - + void refresh(); void destroy_all(); @@ -67,7 +67,7 @@ public: void start_transport() { jack_transport_start(_client); } void stop_transport() { jack_transport_stop(_client); } - + void reset_xruns(); void reset_max_dsp_load(); @@ -77,9 +77,9 @@ public: zero.valid = (jack_position_bits_t)0; jack_transport_reposition(_client, &zero); } - + jack_client_t* client() { return _client; } - + jack_nframes_t buffer_size(); bool set_buffer_size(jack_nframes_t size); @@ -90,7 +90,7 @@ public: float get_max_dsp_load(); private: - + boost::shared_ptr create_port( boost::shared_ptr parent, jack_port_t* port); @@ -111,7 +111,7 @@ private: jack_client_t* _client; Glib::Mutex _shutdown_mutex; - + bool _is_activated; jack_position_t _last_pos; jack_nframes_t _buffer_size; diff --git a/src/LashClient.hpp b/src/LashClient.hpp index 65f6caa..70e5d6f 100644 --- a/src/LashClient.hpp +++ b/src/LashClient.hpp @@ -2,16 +2,16 @@ /* This file is part of Patchage. * Copyright (C) 2008 Dave Robillard * Copyright (C) 2008 Nedko Arnaudov - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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/LashProxy.cpp b/src/LashProxy.cpp index 1d1580d..fb4fffc 100644 --- a/src/LashProxy.cpp +++ b/src/LashProxy.cpp @@ -624,7 +624,7 @@ LashProxy::close_project(const string& project_name) { DBusMessage* reply_ptr; const char* const project_name_cstr = project_name.c_str(); - + if (!_impl->call(true, LASH_IFACE_CONTROL, "ProjectClose", &reply_ptr, DBUS_TYPE_STRING, &project_name_cstr, DBUS_TYPE_INVALID)) { return; } @@ -680,9 +680,9 @@ LashProxy::get_loaded_project_properties( const char* value_type; dbus_bool_t value_bool; const char* value_string; - + const char* const project_name_cstr = name.c_str(); - + if (!_impl->call( true, LASH_IFACE_CONTROL, diff --git a/src/LashProxy.hpp b/src/LashProxy.hpp index fb2f3ff..086a543 100644 --- a/src/LashProxy.hpp +++ b/src/LashProxy.hpp @@ -2,16 +2,16 @@ /* This file is part of Patchage. * Copyright (C) 2008 Dave Robillard * Copyright (C) 2008 Nedko Arnaudov - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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/LoadProjectDialog.hpp b/src/LoadProjectDialog.hpp index 3f6c2c1..c2fc8d1 100644 --- a/src/LoadProjectDialog.hpp +++ b/src/LoadProjectDialog.hpp @@ -1,16 +1,16 @@ /* This file is part of Patchage. * Copyright (C) 2008 Dave Robillard * Copyright (C) 2008 Nedko Arnaudov - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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/Patchage.cpp b/src/Patchage.cpp index eaa252d..fc037a2 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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 @@ gtkmm_get_ink_pixel_size (Glib::RefPtr layout, int& height) { Pango::Rectangle ink_rect = layout->get_ink_extents (); - + width = (ink_rect.get_width() + PANGO_SCALE / 2) / PANGO_SCALE; height = (ink_rect.get_height() + PANGO_SCALE / 2) / PANGO_SCALE; } @@ -70,14 +70,14 @@ gtkmm_get_ink_pixel_size (Glib::RefPtr layout, static void gtkmm_set_width_for_given_text (Gtk::Widget &w, const gchar *text, gint hpadding/*, gint vpadding*/) - + { int old_width, old_height; w.get_size_request(old_width, old_height); int width, height; w.ensure_style (); - + gtkmm_get_ink_pixel_size (w.create_pango_layout (text), width, height); w.set_size_request(width + hpadding, old_height);//height + vpadding); } @@ -157,7 +157,7 @@ Patchage::Patchage(int argc, char** argv) _about_win->property_program_name() = "Patchage"; _about_win->property_logo_icon_name() = "patchage"; gtk_window_set_default_icon_name("patchage"); - + gtkmm_set_width_for_given_text(*_buffer_size_combo, "4096 frames", 40); _main_scrolledwin->add(*_canvas); @@ -198,7 +198,7 @@ Patchage::Patchage(int argc, char** argv) _menu_alsa_connect->set_sensitive(false); _menu_alsa_disconnect->set_sensitive(false); #endif - + _menu_store_positions->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_store_positions)); _menu_file_quit->signal_activate().connect( @@ -215,7 +215,7 @@ Patchage::Patchage(int argc, char** argv) sigc::mem_fun(this, &Patchage::on_show_projects)); _menu_help_about->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_help_about)); - + _messages_clear_but->signal_clicked().connect( sigc::mem_fun(this, &Patchage::on_messages_clear)); _messages_close_but->signal_clicked().connect( @@ -225,9 +225,9 @@ Patchage::Patchage(int argc, char** argv) _canvas->show(); _main_win->present(); - + _state_manager->load(_settings_filename); - + _main_win->resize( static_cast(_state_manager->get_window_size().x), static_cast(_state_manager->get_window_size().y)); @@ -235,13 +235,13 @@ Patchage::Patchage(int argc, char** argv) _main_win->move( static_cast(_state_manager->get_window_location().x), static_cast(_state_manager->get_window_location().y)); - + _about_win->set_transient_for(*_main_win); - + #if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS) _jack_driver = new JackDriver(this); _jack_driver->signal_detached.connect(sigc::mem_fun(this, &Patchage::driver_detached)); - + _menu_jack_connect->signal_activate().connect(sigc::bind( sigc::mem_fun(_jack_driver, &JackDriver::attach), true)); _menu_jack_disconnect->signal_activate().connect( @@ -260,7 +260,7 @@ Patchage::Patchage(int argc, char** argv) #else _project_list_viewport->hide(); #endif - + connect_widgets(); update_state(); @@ -272,7 +272,7 @@ Patchage::Patchage(int argc, char** argv) } -Patchage::~Patchage() +Patchage::~Patchage() { #if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS) delete _jack_driver; @@ -284,7 +284,7 @@ Patchage::~Patchage() delete _lash_proxy; #endif delete _state_manager; - + _about_win.destroy(); _messages_win.destroy(); //_main_win.destroy(); @@ -313,10 +313,10 @@ Patchage::attach() //m_status_bar->push("Connected to JACK server"); } - + bool -Patchage::idle_callback() +Patchage::idle_callback() { // Initial run, attach if (_attach) { @@ -330,7 +330,7 @@ Patchage::idle_callback() _jack_driver->process_events(this); } #endif - + // Process any ALSA events #ifdef HAVE_ALSA if (_alsa_driver) { @@ -347,7 +347,7 @@ Patchage::idle_callback() if (_alsa_driver && !_alsa_driver->is_attached()) _alsa_driver->destroy_all(); } - + _refresh = false; _driver_detached = false; @@ -392,7 +392,7 @@ Patchage::update_load() last_max_dsp_load = max_dsp_load; } #endif - + return true; } @@ -406,12 +406,12 @@ Patchage::zoom(double z) void -Patchage::refresh() +Patchage::refresh() { assert(_canvas); if (_enable_refresh) { - + _canvas->destroy(); #if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS) @@ -423,7 +423,7 @@ Patchage::refresh() if (_alsa_driver) _alsa_driver->refresh(); #endif - + flush_resize(); } } @@ -484,7 +484,7 @@ Patchage::info_msg(const std::string& msg) void -Patchage::status_msg(const string& msg) +Patchage::status_msg(const string& msg) { if (_status_text->get_buffer()->size() > 0) _status_text->get_buffer()->insert(_status_text->get_buffer()->end(), "\n"); @@ -499,7 +499,7 @@ Patchage::update_state() { for (ItemList::iterator i = _canvas->items().begin(); i != _canvas->items().end(); ++i) { SharedPtr module = PtrCast(*i); - if (module) + if (module) module->load_location(); } } @@ -521,19 +521,19 @@ Patchage::connect_widgets() sigc::mem_fun(this, &Patchage::refresh)); _jack_driver->signal_attached.connect(sigc::bind( sigc::mem_fun(*_menu_jack_disconnect, &Gtk::MenuItem::set_sensitive), true)); - + _jack_driver->signal_detached.connect(sigc::bind( sigc::mem_fun(*_menu_jack_connect, &Gtk::MenuItem::set_sensitive), true)); _jack_driver->signal_detached.connect(sigc::bind( sigc::mem_fun(*_menu_jack_disconnect, &Gtk::MenuItem::set_sensitive), false)); #endif -#ifdef HAVE_ALSA +#ifdef HAVE_ALSA _alsa_driver->signal_attached.connect(sigc::bind( sigc::mem_fun(*_menu_alsa_connect, &Gtk::MenuItem::set_sensitive), false)); _alsa_driver->signal_attached.connect(sigc::bind( sigc::mem_fun(*_menu_alsa_disconnect, &Gtk::MenuItem::set_sensitive), true)); - + _alsa_driver->signal_detached.connect(sigc::bind( sigc::mem_fun(*_menu_alsa_connect, &Gtk::MenuItem::set_sensitive), true)); _alsa_driver->signal_detached.connect(sigc::bind( @@ -547,7 +547,7 @@ Patchage::show_load_project_dialog() { std::list projects; _lash_proxy->get_available_projects(projects); - + LoadProjectDialog dialog(this); dialog.run(projects); } @@ -567,7 +567,7 @@ Patchage::set_lash_available(bool available) #ifdef HAVE_ALSA void -Patchage::menu_alsa_connect() +Patchage::menu_alsa_connect() { _alsa_driver->attach(false); _alsa_driver->refresh(); @@ -575,7 +575,7 @@ Patchage::menu_alsa_connect() void -Patchage::menu_alsa_disconnect() +Patchage::menu_alsa_disconnect() { _alsa_driver->detach(); refresh(); @@ -584,16 +584,16 @@ Patchage::menu_alsa_disconnect() void -Patchage::on_arrange() +Patchage::on_arrange() { assert(_canvas); - + _canvas->arrange(); } - + void -Patchage::on_help_about() +Patchage::on_help_about() { _about_win->run(); _about_win->hide(); @@ -608,16 +608,16 @@ Patchage::on_messages_clear() _status_text->get_buffer()->end()); } - + void -Patchage::on_messages_close() +Patchage::on_messages_close() { _menu_view_messages->set_active(false); } - + bool -Patchage::on_messages_delete(GdkEventAny*) +Patchage::on_messages_delete(GdkEventAny*) { _menu_view_messages->set_active(false); return true; @@ -625,7 +625,7 @@ Patchage::on_messages_delete(GdkEventAny*) void -Patchage::on_quit() +Patchage::on_quit() { #ifdef HAVE_ALSA _alsa_driver->detach(); @@ -656,9 +656,9 @@ Patchage::on_show_projects() _project_list_viewport->hide(); } - + void -Patchage::on_store_positions() +Patchage::on_store_positions() { store_window_location(); _state_manager->save(_settings_filename); @@ -666,7 +666,7 @@ Patchage::on_store_positions() void -Patchage::on_view_toolbar() +Patchage::on_view_toolbar() { if (_menu_view_toolbar->get_active()) _toolbar->show(); @@ -674,9 +674,9 @@ Patchage::on_view_toolbar() _toolbar->hide(); } - + bool -Patchage::on_scroll(GdkEventScroll* ev) +Patchage::on_scroll(GdkEventScroll* ev) { cout << "ON SCROLL" << endl; return false; @@ -693,7 +693,7 @@ Patchage::buffer_size_changed() update_toolbar(); } else { jack_nframes_t buffer_size = 1 << (selected+5); - + if ( ! _jack_driver->set_buffer_size(buffer_size)) update_toolbar(); // reset combo box to actual value } diff --git a/src/Patchage.hpp b/src/Patchage.hpp index 4c3da57..cf4b828 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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,9 +44,9 @@ public: ~Patchage(); boost::shared_ptr canvas() const { return _canvas; } - + Gtk::Window* window() { return _main_win.get(); } - + StateManager* state_manager() const { return _state_manager; } JackDriver* jack_driver() const { return _jack_driver; } #ifdef HAVE_ALSA @@ -57,16 +57,16 @@ public: #endif #ifdef HAVE_LASH LashProxy* lash_proxy() const { return _lash_proxy; } - + void show_load_project_dialog(); void set_lash_available(bool available); #endif - + Glib::RefPtr xml() { return _xml; } - + void attach(); void quit() { _main_win->hide(); } - + void refresh(); inline void queue_refresh() { _refresh = true; } inline void driver_detached() { _driver_detached = true; } @@ -102,7 +102,7 @@ protected: void update_toolbar(); void buffer_size_changed(); - + Glib::RefPtr _xml; #if defined(HAVE_LASH) || defined(HAVE_JACK_DBUS) @@ -136,7 +136,7 @@ protected: bool _driver_detached; bool _refresh; bool _enable_refresh; - + Widget _about_win; Widget _buffer_size_combo; Widget _clear_load_but; diff --git a/src/PatchageCanvas.cpp b/src/PatchageCanvas.cpp index 10fe33e..cfbf267 100644 --- a/src/PatchageCanvas.cpp +++ b/src/PatchageCanvas.cpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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 @@ PatchageCanvas::find_port(const PortID& id) #if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS) jack_port_t* jack_port = NULL; #endif - + SharedPtr module; boost::shared_ptr pp; @@ -84,36 +84,36 @@ PatchageCanvas::find_port(const PortID& id) jack_port = jack_port_by_id(_app->jack_driver()->client(), id.id.jack_id); if (!jack_port) return boost::shared_ptr(); - + _app->jack_driver()->port_names(id, module_name, port_name); - + module = find_module(module_name, (jack_port_flags(jack_port) & JackPortIsInput) ? Input : Output); - + if (module) return PtrCast(module->get_port(port_name)); else return boost::shared_ptr(); - + break; #endif - + #ifdef HAVE_ALSA case PortID::ALSA_ADDR: for (ItemList::iterator m = _items.begin(); m != _items.end(); ++m) { SharedPtr module = PtrCast(*m); if (!module) continue; - + for (PortVector::const_iterator p = module->ports().begin(); p != module->ports().end(); ++p) { pp = boost::dynamic_pointer_cast(*p); if (!pp) continue; - + if (pp->type() == ALSA_MIDI) { /*cerr << "ALSA PORT: " << (int)pp->alsa_addr()->client << ":" << (int)pp->alsa_addr()->port << endl;*/ - + if (pp->alsa_addr() && pp->alsa_addr()->client == id.id.alsa_addr.client && pp->alsa_addr()->port == id.id.alsa_addr.port) { @@ -180,7 +180,7 @@ PatchageCanvas::disconnect(boost::shared_ptr port1, boost::shared_p status_message("ERROR: Attempt to disconnect mismatched/unknown ports"); return; } - + if ((input->type() == JACK_AUDIO && output->type() == JACK_AUDIO) || (input->type() == JACK_MIDI && output->type() == JACK_MIDI)) { #if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS) @@ -216,7 +216,7 @@ PatchageCanvas::get_port(const string& node_name, const string& port_name) if (module->name() == node_name && port) return port; } - + return boost::shared_ptr(); } diff --git a/src/PatchageCanvas.hpp b/src/PatchageCanvas.hpp index 0687bac..1dd7a5a 100644 --- a/src/PatchageCanvas.hpp +++ b/src/PatchageCanvas.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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,15 +37,15 @@ using namespace FlowCanvas; class PatchageCanvas : public Canvas { public: PatchageCanvas(Patchage* _app, int width, int height); - + boost::shared_ptr find_module(const string& name, ModuleType type); boost::shared_ptr find_port(const PortID& id); - + void connect(boost::shared_ptr port1, boost::shared_ptr port2); void disconnect(boost::shared_ptr port1, boost::shared_ptr port2); void status_message(const string& msg); - + boost::shared_ptr get_item(const string& name); boost::shared_ptr get_port(const string& module_name, const string& port_name); diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp index 4fbefdf..370143a 100644 --- a/src/PatchageEvent.cpp +++ b/src/PatchageEvent.cpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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,7 +56,7 @@ PatchageEvent::execute(Patchage* patchage) _str = NULL; } else if (_type == PORT_CREATION) { - + Driver* driver = NULL; if (_port_1.type == PortID::JACK_ID) { #if defined(USE_LIBJACK) || defined(HAVE_JACK_DBUS) @@ -89,7 +89,7 @@ PatchageEvent::execute(Patchage* patchage) module->remove_port(port); patchage->enqueue_resize(module); port.reset(); - + // No empty modules (for now) if (module->num_ports() == 0) { patchage->canvas()->remove_item(module); @@ -103,17 +103,17 @@ PatchageEvent::execute(Patchage* patchage) } } else if (_type == CONNECTION) { - + SharedPtr port_1 = patchage->canvas()->find_port(_port_1); SharedPtr port_2 = patchage->canvas()->find_port(_port_2); - + if (port_1 && port_2) patchage->canvas()->add_connection(port_1, port_2, port_1->color() + 0x22222200); else cerr << "Unable to find port to connect" << endl; } else if (_type == DISCONNECTION) { - + SharedPtr port_1 = patchage->canvas()->find_port(_port_1); SharedPtr port_2 = patchage->canvas()->find_port(_port_2); diff --git a/src/PatchageEvent.hpp b/src/PatchageEvent.hpp index c567a9c..337909d 100644 --- a/src/PatchageEvent.hpp +++ b/src/PatchageEvent.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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: : _str(NULL) , _type(type) {} - + PatchageEvent(Type type, const char* str) : _str(strdup(str)) // FIXME: not realtime (jack) :( , _type(type) @@ -62,7 +62,7 @@ public: , _port_1(port) , _type(type) {} - + template PatchageEvent(Type type, P port_1, P port_2) : _str(NULL) @@ -70,11 +70,11 @@ public: , _port_2(port_2, true) , _type(type) {} - + void execute(Patchage* patchage); inline Type type() const { return (Type)_type; } - + private: char* _str; PortID _port_1; diff --git a/src/PatchageModule.hpp b/src/PatchageModule.hpp index 0eac76f..363e459 100644 --- a/src/PatchageModule.hpp +++ b/src/PatchageModule.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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,12 +57,12 @@ public: items.push_back(Gtk::Menu_Helpers::MenuElem("Disconnect All", sigc::mem_fun(this, &PatchageModule::menu_disconnect_all))); } - + void move(double dx, double dy) { FlowCanvas::Module::move(dx, dy); store_location(); } - + void load_location() { boost::shared_ptr canvas = _canvas.lock(); if (!canvas) @@ -76,12 +76,12 @@ public: move_to((canvas->width()/2) - 100 + rand() % 400, (canvas->height()/2) - 100 + rand() % 400); } - + virtual void store_location() { Coord loc(property_x().get_value(), property_y().get_value()); _app->state_manager()->set_module_location(_name, _type, loc); } - + void split() { assert(_type == InputOutput); _app->state_manager()->set_module_split(_name, true); @@ -95,7 +95,7 @@ public: } virtual void show_dialog() {} - + virtual void menu_disconnect_all() { for (PortVector::iterator p = _ports.begin(); p != _ports.end(); ++p) (*p)->disconnect_all(); diff --git a/src/PatchagePort.hpp b/src/PatchagePort.hpp index caabfb8..e85b1f0 100644 --- a/src/PatchagePort.hpp +++ b/src/PatchagePort.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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/PortID.hpp b/src/PortID.hpp index 5d3f636..a57d9d1 100644 --- a/src/PortID.hpp +++ b/src/PortID.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2008 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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 @@ struct PortID { PortID() : type(NULL_PORT_ID) { memset(&id, 0, sizeof(id)); } - + enum { NULL_PORT_ID, JACK_ID, ALSA_ADDR } type; #ifdef USE_LIBJACK diff --git a/src/Project.hpp b/src/Project.hpp index 15e2b26..6236ead 100644 --- a/src/Project.hpp +++ b/src/Project.hpp @@ -36,7 +36,7 @@ public: ~Project(); void clear(); - + typedef std::list< boost::shared_ptr > Clients; const std::string& get_name() const; diff --git a/src/ProjectList.cpp b/src/ProjectList.cpp index cc9d3ab..9438a5e 100644 --- a/src/ProjectList.cpp +++ b/src/ProjectList.cpp @@ -131,7 +131,7 @@ ProjectListImpl::on_button_press_event(GdkEventButton* event) sigc::mem_fun(*this, &ProjectListImpl::on_menu_popup_save_project), project))); - + menulist.push_back(Gtk::Menu_Helpers::MenuElem( (string)"_Close project '" + name + "'", sigc::bind( diff --git a/src/Session.hpp b/src/Session.hpp index 4fc0591..0342794 100644 --- a/src/Session.hpp +++ b/src/Session.hpp @@ -1,16 +1,16 @@ // -*- Mode: C++ ; indent-tabs-mode: t -*- /* This file is part of Patchage. * Copyright (C) 2008 Nedko Arnaudov - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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/StateManager.cpp b/src/StateManager.cpp index f5dcc94..0b8c55c 100644 --- a/src/StateManager.cpp +++ b/src/StateManager.cpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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 @@ StateManager::StateManager() bool -StateManager::get_module_location(const string& name, ModuleType type, Coord& loc) +StateManager::get_module_location(const string& name, ModuleType type, Coord& loc) { map::const_iterator i = _module_settings.find(name); if (i == _module_settings.end()) return false; const ModuleSettings& settings = (*i).second; - + switch (type) { case Input: if (settings.input_location) { @@ -70,7 +70,7 @@ StateManager::get_module_location(const string& name, ModuleType type, Coord& lo void -StateManager::set_module_location(const string& name, ModuleType type, Coord loc) +StateManager::set_module_location(const string& name, ModuleType type, Coord loc) { retry: map::iterator i = _module_settings.find(name); @@ -115,19 +115,19 @@ StateManager::get_module_split(const string& name, bool default_val) const void -StateManager::set_module_split(const string& name, bool split) +StateManager::set_module_split(const string& name, bool split) { _module_settings[name].split = split; } void -StateManager::load(const string& filename) -{ +StateManager::load(const string& filename) +{ _module_settings.clear(); cerr << "Loading configuration file " << filename << endl; - + std::ifstream is; is.open(filename.c_str(), std::ios::in); @@ -145,7 +145,7 @@ StateManager::load(const string& filename) is >> s; _window_location.y = atoi(s.c_str()); } - + is >> s; if (s == "window_size") { is >> s; @@ -160,7 +160,7 @@ StateManager::load(const string& filename) msg.append(s).append("\""); throw std::runtime_error(msg); } - + is >> s; _zoom = atof(s.c_str()); @@ -171,7 +171,7 @@ StateManager::load(const string& filename) while (1) { is >> s; if (is.eof()) break; - + // Old versions didn't quote, so need to support both :/ if (s[0] == '\"') { if (s.length() > 1 && s[s.length()-1] == '\"') { @@ -217,7 +217,7 @@ write_module_settings_entry( } void -StateManager::save(const string& filename) +StateManager::save(const string& filename) { std::ofstream os; os.open(filename.c_str(), std::ios::out); @@ -249,14 +249,14 @@ StateManager::save(const string& filename) float -StateManager::get_zoom() +StateManager::get_zoom() { return _zoom; } void -StateManager::set_zoom(float zoom) +StateManager::set_zoom(float zoom) { _zoom = zoom; } @@ -266,7 +266,7 @@ int StateManager::get_port_color(PortType type) { // Darkest tango palette colour, with S -= 6, V -= 6, w/ transparency - + if (type == JACK_AUDIO) return 0x244678C0; else if (type == JACK_MIDI) diff --git a/src/StateManager.hpp b/src/StateManager.hpp index 3899eef..87267ff 100644 --- a/src/StateManager.hpp +++ b/src/StateManager.hpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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,10 +46,10 @@ public: void set_module_split(const std::string& name, bool split); bool get_module_split(const std::string& name, bool default_val) const; - + float get_zoom(); void set_zoom(float zoom); - + int get_port_color(PortType type); Coord get_window_location() { return _window_location; } diff --git a/src/Widget.hpp b/src/Widget.hpp index 56eb6d8..fa340bf 100644 --- a/src/Widget.hpp +++ b/src/Widget.hpp @@ -1,6 +1,6 @@ /* This file is part of Patchage * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) @@ -41,6 +41,6 @@ public: private: W* _me; }; - + #endif // PATCHAGE_WIDGET_HPP diff --git a/src/binary_location.h b/src/binary_location.h index 9030e2c..4244f4f 100644 --- a/src/binary_location.h +++ b/src/binary_location.h @@ -1,15 +1,15 @@ /* Find the location of the program in the filesytem. * Copyright (C) 2008 Dave Robillard - * + * * This is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * This is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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/main.cpp b/src/main.cpp index e8f379a..e77d8c7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,15 +1,15 @@ /* This file is part of Patchage. * Copyright (C) 2007 Dave Robillard - * + * * Patchage is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. - * + * * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * + * * You should have received a copy of the GNU General Public 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,20 +24,20 @@ int main(int argc, char** argv) { try { - + Glib::thread_init(); Gnome::Canvas::init(); Gtk::Main app(argc, argv); - + Patchage patchage(argc, argv); app.run(*patchage.window()); - + } catch (std::exception& e) { std::cerr << "Caught exception, aborting. Error message was: " << e.what() << std::endl; return 1; - + } catch (Glib::Exception& e) { std::cerr << "Caught exception, aborting. Error message was: " << e.what() << std::endl; -- cgit v1.2.1