summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-15 02:06:56 +0000
committerDavid Robillard <d@drobilla.net>2010-12-15 02:06:56 +0000
commit3379430e15a59a96562e8cdebe7cbf81efc1b3d3 (patch)
treeab6f2dfafb7f78323e47d6de8e5c9dcde9adab71
parent9e117275efe6585e2039130a5729bd75c120706e (diff)
downloadpatchage-3379430e15a59a96562e8cdebe7cbf81efc1b3d3.tar.gz
patchage-3379430e15a59a96562e8cdebe7cbf81efc1b3d3.tar.bz2
patchage-3379430e15a59a96562e8cdebe7cbf81efc1b3d3.zip
Clean up code.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2692 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/AlsaDriver.cpp10
-rw-r--r--src/AlsaDriver.hpp2
-rw-r--r--src/DBus.cpp34
-rw-r--r--src/DBus.hpp30
-rw-r--r--src/Driver.hpp2
-rw-r--r--src/GladeFile.hpp5
-rw-r--r--src/JackDriver.cpp13
-rw-r--r--src/LoadProjectDialog.cpp13
-rw-r--r--src/LoadProjectDialog.hpp2
-rw-r--r--src/Patchage.cpp39
-rw-r--r--src/Patchage.hpp6
-rw-r--r--src/PatchageCanvas.cpp19
-rw-r--r--src/PatchageCanvas.hpp10
-rw-r--r--src/PatchageEvent.cpp6
-rw-r--r--src/PatchageEvent.hpp9
-rw-r--r--src/PatchageModule.hpp12
-rw-r--r--src/PatchagePort.hpp7
-rw-r--r--src/PortID.hpp9
-rw-r--r--src/Project.hpp1
-rw-r--r--src/ProjectList.cpp22
-rw-r--r--src/Session.cpp2
-rw-r--r--src/Widget.hpp1
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 <string>
-#include <set>
#include <cassert>
-#include "raul/log.hpp"
+#include <set>
+#include <string>
+
#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 <pthread.h>
#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 <stdexcept>
+
#include <boost/format.hpp>
+
+#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 <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus.h>
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 <boost/shared_ptr.hpp>
#include <sigc++/sigc++.h>
+
#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 <string>
#include <fstream>
#include <sstream>
#include <stdexcept>
+#include <string>
+
#include <libglademm/xml.h>
+
#include "patchage-config.h"
#include "binary_location.h"
+
class GladeFile {
public:
static Glib::RefPtr<Gnome::Glade::Xml> 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 <cassert>
#include <cstring>
-#include <string>
#include <set>
-#include "patchage-config.h"
+#include <string>
+
#include <jack/jack.h>
#include <jack/statistics.h>
#include <jack/thread.h>
-#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 <list>
+
#include <gtkmm.h>
+
#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 <pthread.h>
+
#include <cmath>
-#include <sstream>
#include <fstream>
-#include <pthread.h>
-#include <libgnomecanvasmm.h>
-#include <libglademm/xml.h>
+#include <sstream>
+
#include <gtk/gtkwindow.h>
-#include "raul/SharedPtr.hpp"
+#include <libglademm/xml.h>
+#include <libgnomecanvasmm.h>
+
#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 <jack/statistics.h>
-#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 <jack/statistics.h>
+#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 <string>
#include <set>
+#include <string>
+
#include <boost/shared_ptr.hpp>
-#include <libgnomecanvasmm.h>
#include <libglademm/xml.h>
+#include <libgnomecanvasmm.h>
+
#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 <string>
+
+#include "patchage-config.h"
+
#ifdef HAVE_ALSA
-#include <alsa/asoundlib.h>
+ #include <alsa/asoundlib.h>
#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 <cstring>
+
+#include "patchage-config.h"
+
#ifdef USE_LIBJACK
-#include <jack/jack.h>
+ #include <jack/jack.h>
#endif
#ifdef HAVE_ALSA
-#include <alsa/asoundlib.h>
+ #include <alsa/asoundlib.h>
#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 <string>
+
#include <libgnomecanvasmm.h>
+
+#include "patchage-config.h"
+
#ifdef HAVE_ALSA
-#include <alsa/asoundlib.h>
+ #include <alsa/asoundlib.h>
#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 <string>
+
#include <boost/shared_ptr.hpp>
+
#include "flowcanvas/Port.hpp"
#include "flowcanvas/Module.hpp"
+#include "patchage-config.h"
+
#ifdef HAVE_ALSA
-#include <alsa/asoundlib.h>
+ #include <alsa/asoundlib.h>
#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 <cstring>
+#include <iostream>
+
#include "patchage-config.h"
-#include <iostream>
-#include <cstring>
#ifdef USE_LIBJACK
-#include <jack/jack.h>
+ #include <jack/jack.h>
#endif
#ifdef HAVE_ALSA
-#include <alsa/asoundlib.h>
+ #include <alsa/asoundlib.h>
#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 <string>
#include <list>
+
#include <boost/shared_ptr.hpp>
#include <sigc++/signal.h>
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 <gtkmm.h>
#include <libglademm/xml.h>
-#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<Gtk::TreeView> _widget;
- ProjectList_column_record _columns;
- Glib::RefPtr<Gtk::TreeStore> _model;
- Gtk::Menu _menu_popup;
-
ProjectListImpl(
Glib::RefPtr<Gnome::Glade::Xml> xml,
Patchage* app);
@@ -60,6 +54,12 @@ struct ProjectListImpl : public sigc::trackable {
void on_menu_popup_close_project(shared_ptr<Project> project);
void on_menu_popup_project_properties(shared_ptr<Project> project);
void on_menu_popup_close_all_projects();
+
+ Patchage* _app;
+ Widget<Gtk::TreeView> _widget;
+ ProjectList_column_record _columns;
+ Glib::RefPtr<Gtk::TreeStore> _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 <string>
+
#include <boost/utility.hpp>
#include <libglademm/xml.h>