From 3379430e15a59a96562e8cdebe7cbf81efc1b3d3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 15 Dec 2010 02:06:56 +0000 Subject: Clean up code. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2692 a436a847-0d15-0410-975c-d299462d15a1 --- src/AlsaDriver.cpp | 10 ++++++---- src/AlsaDriver.hpp | 2 +- src/DBus.cpp | 34 ++++++++++++++++++---------------- src/DBus.hpp | 30 +++++++++++++++--------------- src/Driver.hpp | 2 ++ src/GladeFile.hpp | 5 ++++- src/JackDriver.cpp | 13 ++++++++----- src/LoadProjectDialog.cpp | 13 +++++++------ src/LoadProjectDialog.hpp | 2 ++ src/Patchage.cpp | 39 ++++++++++++++++++++++----------------- src/Patchage.hpp | 6 ++++-- src/PatchageCanvas.cpp | 19 +++++++++++-------- src/PatchageCanvas.hpp | 10 +++++++--- src/PatchageEvent.cpp | 6 +++--- src/PatchageEvent.hpp | 9 ++++++--- src/PatchageModule.hpp | 12 +++++++++--- src/PatchagePort.hpp | 7 +++++-- src/PortID.hpp | 9 +++++---- src/Project.hpp | 1 + src/ProjectList.cpp | 22 +++++++++++----------- src/Session.cpp | 2 +- src/Widget.hpp | 1 + 22 files changed, 149 insertions(+), 105 deletions(-) diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index d3a5abd..8def786 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -15,14 +15,16 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include #include -#include "raul/log.hpp" +#include +#include + #include "raul/SharedPtr.hpp" -#include "PatchageCanvas.hpp" +#include "raul/log.hpp" + #include "AlsaDriver.hpp" #include "Patchage.hpp" +#include "PatchageCanvas.hpp" #include "PatchageModule.hpp" #include "PatchagePort.hpp" diff --git a/src/AlsaDriver.hpp b/src/AlsaDriver.hpp index 662d8ae..d4f6f86 100644 --- a/src/AlsaDriver.hpp +++ b/src/AlsaDriver.hpp @@ -26,10 +26,10 @@ #include #include "Driver.hpp" +#include "PatchageModule.hpp" class Patchage; class PatchagePort; - /** Handles all externally driven functionality, registering ports etc. */ class AlsaDriver : public Driver diff --git a/src/DBus.cpp b/src/DBus.cpp index 72502b8..065aae4 100644 --- a/src/DBus.cpp +++ b/src/DBus.cpp @@ -16,9 +16,11 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "DBus.hpp" #include + #include + +#include "DBus.hpp" #include "Patchage.hpp" #define DBUS_CALL_DEFAULT_TIMEOUT 1000 // in milliseconds @@ -44,14 +46,14 @@ DBus::DBus(Patchage* app) bool DBus::call( - bool response_expected, - const char * service, - const char * object, - const char * iface, - const char * method, - DBusMessage ** reply_ptr_ptr, - int in_type, - va_list ap) + bool response_expected, + const char* service, + const char* object, + const char* iface, + const char* method, + DBusMessage** reply_ptr_ptr, + int in_type, + va_list ap) { DBusMessage* request_ptr; DBusMessage* reply_ptr; @@ -91,13 +93,13 @@ DBus::call( bool DBus::call( - bool response_expected, - const char * serivce, - const char * object, - const char * iface, - const char * method, - DBusMessage ** reply_ptr_ptr, - int in_type, + bool response_expected, + const char* serivce, + const char* object, + const char* iface, + const char* method, + DBusMessage** reply_ptr_ptr, + int in_type, ...) { bool ret; diff --git a/src/DBus.hpp b/src/DBus.hpp index 9960efa..6475a05 100644 --- a/src/DBus.hpp +++ b/src/DBus.hpp @@ -19,9 +19,9 @@ #ifndef PATCHAGE_DBUS_HPP #define PATCHAGE_DBUS_HPP -#include -#include #include +#include +#include class Patchage; @@ -30,23 +30,23 @@ public: DBus(Patchage* app); bool call( - bool response_expected, - const char* service, - const char* object, - const char* iface, - const char* method, + bool response_expected, + const char* service, + const char* object, + const char* iface, + const char* method, DBusMessage** reply_ptr, - int in_type, - va_list ap); + int in_type, + va_list ap); bool call( - bool response_expected, - const char* service, - const char* object, - const char* iface, - const char* method, + bool response_expected, + const char* service, + const char* object, + const char* iface, + const char* method, DBusMessage** reply_ptr, - int in_type, + int in_type, ...); DBusConnection* connection() { return _connection; } diff --git a/src/Driver.hpp b/src/Driver.hpp index ae8d452..6584688 100644 --- a/src/Driver.hpp +++ b/src/Driver.hpp @@ -20,7 +20,9 @@ #include #include + #include "raul/SRSWQueue.hpp" + #include "PatchageEvent.hpp" class PatchagePort; diff --git a/src/GladeFile.hpp b/src/GladeFile.hpp index dbec7e9..00583c2 100644 --- a/src/GladeFile.hpp +++ b/src/GladeFile.hpp @@ -18,14 +18,17 @@ #ifndef PATCHAGE_GLADEFILE_HPP #define PATCHAGE_GLADEFILE_HPP -#include #include #include #include +#include + #include + #include "patchage-config.h" #include "binary_location.h" + class GladeFile { public: static Glib::RefPtr open(const std::string& base_name) { diff --git a/src/JackDriver.cpp b/src/JackDriver.cpp index 7bdcb72..8e610a4 100644 --- a/src/JackDriver.cpp +++ b/src/JackDriver.cpp @@ -17,18 +17,21 @@ #include #include -#include #include -#include "patchage-config.h" +#include + #include #include #include -#include "raul/log.hpp" + #include "raul/SharedPtr.hpp" -#include "PatchageCanvas.hpp" -#include "PatchageEvent.hpp" +#include "raul/log.hpp" + +#include "patchage-config.h" #include "JackDriver.hpp" #include "Patchage.hpp" +#include "PatchageCanvas.hpp" +#include "PatchageEvent.hpp" #include "PatchageModule.hpp" using namespace std; diff --git a/src/LoadProjectDialog.cpp b/src/LoadProjectDialog.cpp index 026da1e..f886fcd 100644 --- a/src/LoadProjectDialog.cpp +++ b/src/LoadProjectDialog.cpp @@ -25,12 +25,13 @@ convert_timestamp_to_string( const time_t timestamp, std::string& timestamp_string) { - GDate mtime, now; - gint days_diff; - struct tm tm_mtime; - time_t time_now; - const gchar *format; - gchar buf[256]; + GDate mtime; + GDate now; + gint days_diff; + struct tm tm_mtime; + time_t time_now; + const gchar* format; + gchar buf[256]; if (timestamp == 0) { timestamp_string = "Unknown"; diff --git a/src/LoadProjectDialog.hpp b/src/LoadProjectDialog.hpp index 90bba6a..df5dbc9 100644 --- a/src/LoadProjectDialog.hpp +++ b/src/LoadProjectDialog.hpp @@ -20,7 +20,9 @@ #define PATCHAGE_LOAD_PROJECT_DIALOG_H #include + #include + #include "Widget.hpp" class Patchage; diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 559e125..e5588e7 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -15,39 +15,44 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include -#include #include -#include -#include -#include +#include + #include -#include "raul/SharedPtr.hpp" +#include +#include + #include "flowcanvas/Module.hpp" +#include "raul/SharedPtr.hpp" #include "patchage-config.h" #include "GladeFile.hpp" -#if defined(HAVE_JACK_DBUS) -#include "JackDbusDriver.hpp" -#elif defined(USE_LIBJACK) -#include "JackDriver.hpp" -#include -#endif #include "Patchage.hpp" #include "PatchageCanvas.hpp" #include "PatchageEvent.hpp" #include "StateManager.hpp" + +#if defined(HAVE_JACK_DBUS) + #include "JackDbusDriver.hpp" +#elif defined(USE_LIBJACK) + #include "JackDriver.hpp" + #include +#endif + #ifdef HAVE_ALSA -#include "AlsaDriver.hpp" + #include "AlsaDriver.hpp" #endif #if defined(HAVE_LASH) || defined(HAVE_JACK_DBUS) -#include "DBus.hpp" + #include "DBus.hpp" #endif #ifdef HAVE_LASH -#include "LashProxy.hpp" -#include "LoadProjectDialog.hpp" -#include "ProjectList.hpp" -#include "Session.hpp" + #include "LashProxy.hpp" + #include "LoadProjectDialog.hpp" + #include "ProjectList.hpp" + #include "Session.hpp" #endif #define LOG_TO_STATUS 1 diff --git a/src/Patchage.hpp b/src/Patchage.hpp index ee3eba5..58c4ad9 100644 --- a/src/Patchage.hpp +++ b/src/Patchage.hpp @@ -18,11 +18,13 @@ #ifndef PATCHAGE_PATCHAGE_HPP #define PATCHAGE_PATCHAGE_HPP -#include #include +#include + #include -#include #include +#include + #include "patchage-config.h" #include "Widget.hpp" diff --git a/src/PatchageCanvas.cpp b/src/PatchageCanvas.cpp index f3ffca0..c172a12 100644 --- a/src/PatchageCanvas.cpp +++ b/src/PatchageCanvas.cpp @@ -15,21 +15,24 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "raul/SharedPtr.hpp" #include "patchage-config.h" -#include "PatchageCanvas.hpp" -#include "Patchage.hpp" + +#include "raul/SharedPtr.hpp" + #if defined(HAVE_JACK_DBUS) -#include "JackDbusDriver.hpp" + #include "JackDbusDriver.hpp" #elif defined(USE_LIBJACK) -#include "JackDriver.hpp" + #include "JackDriver.hpp" #endif -#include "PatchageModule.hpp" -#include "PatchagePort.hpp" #ifdef HAVE_ALSA -#include "AlsaDriver.hpp" + #include "AlsaDriver.hpp" #endif +#include "Patchage.hpp" +#include "PatchageCanvas.hpp" +#include "PatchageModule.hpp" +#include "PatchagePort.hpp" + PatchageCanvas::PatchageCanvas(Patchage* app, int width, int height) : FlowCanvas::Canvas(width, height) , _app(app) diff --git a/src/PatchageCanvas.hpp b/src/PatchageCanvas.hpp index 57af310..66daf90 100644 --- a/src/PatchageCanvas.hpp +++ b/src/PatchageCanvas.hpp @@ -18,14 +18,18 @@ #ifndef PATCHAGE_PATCHAGECANVAS_HPP #define PATCHAGE_PATCHAGECANVAS_HPP -#include "patchage-config.h" #include + +#include "patchage-config.h" + #ifdef HAVE_ALSA -#include + #include #endif + #include "flowcanvas/Canvas.hpp" -#include "StateManager.hpp" + #include "PatchageEvent.hpp" +#include "StateManager.hpp" class Patchage; class PatchageModule; diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp index 3085585..3c9a82f 100644 --- a/src/PatchageEvent.cpp +++ b/src/PatchageEvent.cpp @@ -25,12 +25,12 @@ #include "PatchageEvent.hpp" #include "Driver.hpp" #if defined(HAVE_JACK_DBUS) -#include "JackDbusDriver.hpp" + #include "JackDbusDriver.hpp" #elif defined(USE_LIBJACK) -#include "JackDriver.hpp" + #include "JackDriver.hpp" #endif #ifdef HAVE_ALSA -#include "AlsaDriver.hpp" + #include "AlsaDriver.hpp" #endif using namespace std; diff --git a/src/PatchageEvent.hpp b/src/PatchageEvent.hpp index 20053e5..1650657 100644 --- a/src/PatchageEvent.hpp +++ b/src/PatchageEvent.hpp @@ -18,14 +18,17 @@ #ifndef PATCHAGE_PATCHAGEEVENT_HPP #define PATCHAGE_PATCHAGEEVENT_HPP -#include "patchage-config.h" #include + +#include "patchage-config.h" + #ifdef USE_LIBJACK -#include + #include #endif #ifdef HAVE_ALSA -#include + #include #endif + #include "PatchagePort.hpp" #include "PortID.hpp" diff --git a/src/PatchageModule.hpp b/src/PatchageModule.hpp index 8cbec6e..99c23f6 100644 --- a/src/PatchageModule.hpp +++ b/src/PatchageModule.hpp @@ -18,17 +18,23 @@ #ifndef PATCHAGE_PATCHAGEMODULE_HPP #define PATCHAGE_PATCHAGEMODULE_HPP -#include "patchage-config.h" #include + #include + +#include "patchage-config.h" + #ifdef HAVE_ALSA -#include + #include #endif + #include "flowcanvas/Canvas.hpp" #include "flowcanvas/Module.hpp" + +#include "Patchage.hpp" #include "PatchageCanvas.hpp" -#include "StateManager.hpp" #include "PatchagePort.hpp" +#include "StateManager.hpp" using namespace FlowCanvas; diff --git a/src/PatchagePort.hpp b/src/PatchagePort.hpp index 183eac6..f6c734e 100644 --- a/src/PatchagePort.hpp +++ b/src/PatchagePort.hpp @@ -18,14 +18,17 @@ #ifndef PATCHAGE_PATCHAGEPORT_HPP #define PATCHAGE_PATCHAGEPORT_HPP -#include "patchage-config.h" #include + #include + #include "flowcanvas/Port.hpp" #include "flowcanvas/Module.hpp" +#include "patchage-config.h" + #ifdef HAVE_ALSA -#include + #include #endif using namespace FlowCanvas; diff --git a/src/PortID.hpp b/src/PortID.hpp index 84cc28e..b3c2eb6 100644 --- a/src/PortID.hpp +++ b/src/PortID.hpp @@ -18,15 +18,16 @@ #ifndef PATCHAGE_PORTID_HPP #define PATCHAGE_PORTID_HPP +#include +#include + #include "patchage-config.h" -#include -#include #ifdef USE_LIBJACK -#include + #include #endif #ifdef HAVE_ALSA -#include + #include #endif #include "PatchagePort.hpp" diff --git a/src/Project.hpp b/src/Project.hpp index 6236ead..0509bf6 100644 --- a/src/Project.hpp +++ b/src/Project.hpp @@ -21,6 +21,7 @@ #include #include + #include #include diff --git a/src/ProjectList.cpp b/src/ProjectList.cpp index c7dbb89..155a878 100644 --- a/src/ProjectList.cpp +++ b/src/ProjectList.cpp @@ -19,13 +19,13 @@ #include #include -#include "ProjectList.hpp" -#include "Widget.hpp" -#include "Session.hpp" -#include "Project.hpp" -#include "ProjectPropertiesDialog.hpp" #include "LashClient.hpp" #include "LashProxy.hpp" +#include "Project.hpp" +#include "ProjectList.hpp" +#include "ProjectPropertiesDialog.hpp" +#include "Session.hpp" +#include "Widget.hpp" using boost::shared_ptr; using namespace std; @@ -36,12 +36,6 @@ struct ProjectList_column_record : public Gtk::TreeModel::ColumnRecord { }; struct ProjectListImpl : public sigc::trackable { - Patchage* _app; - Widget _widget; - ProjectList_column_record _columns; - Glib::RefPtr _model; - Gtk::Menu _menu_popup; - ProjectListImpl( Glib::RefPtr xml, Patchage* app); @@ -60,6 +54,12 @@ struct ProjectListImpl : public sigc::trackable { void on_menu_popup_close_project(shared_ptr project); void on_menu_popup_project_properties(shared_ptr project); void on_menu_popup_close_all_projects(); + + Patchage* _app; + Widget _widget; + ProjectList_column_record _columns; + Glib::RefPtr _model; + Gtk::Menu _menu_popup; }; ProjectList::ProjectList( diff --git a/src/Session.cpp b/src/Session.cpp index ec508a6..85d9a58 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -16,9 +16,9 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "LashClient.hpp" #include "Project.hpp" #include "Session.hpp" -#include "LashClient.hpp" using namespace std; using boost::shared_ptr; diff --git a/src/Widget.hpp b/src/Widget.hpp index a74d69c..055517c 100644 --- a/src/Widget.hpp +++ b/src/Widget.hpp @@ -19,6 +19,7 @@ #define PATCHAGE_WIDGET_HPP #include + #include #include -- cgit v1.2.1