namespace and filename cleanup
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 25 Nov 2015 01:12:01 +0000 (20:12 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 25 Nov 2015 01:12:12 +0000 (20:12 -0500)
libs/surfaces/faderport/faderport.cc
libs/surfaces/faderport/faderport.h
libs/surfaces/faderport/faderport_interface.cc
libs/surfaces/faderport/fmcp_gui.cc [deleted file]
libs/surfaces/faderport/gui.cc [new file with mode: 0644]
libs/surfaces/faderport/wscript

index f0bb593c59cfeb95766194ca56828d4ee4e649b0..eadbfd6145d9177b021e57a9f9ecf2d240cd03b5 100644 (file)
@@ -48,6 +48,7 @@
 #include "faderport.h"
 
 using namespace ARDOUR;
+using namespace ArdourSurface;
 using namespace PBD;
 using namespace Glib;
 using namespace std;
index ec4217e80bb64db4ee9d651c4dd47dc498f9eb26..1bb456c8525b1c0df736a44002b9c2c6fae8effa 100644 (file)
@@ -61,6 +61,8 @@ class MIDIControllable;
 class MIDIFunction;
 class MIDIAction;
 
+namespace ArdourSurface {
+
 class FaderPort : public ARDOUR::ControlProtocol {
   public:
        FaderPort (ARDOUR::Session&);
@@ -166,4 +168,6 @@ class FaderPort : public ARDOUR::ControlProtocol {
        std::map<int,ButtonID> buttons;
 };
 
+}
+
 #endif /* ardour_surface_faderport_h */
index 77809b7dbf071e5bb1f44065e3fa63b5de4040a7..70f5b92d29b2e066da9302619e12f1a8737add1f 100644 (file)
@@ -23,6 +23,7 @@
 #include "faderport.h"
 
 using namespace ARDOUR;
+using namespace ArdourSurface;
 
 static ControlProtocol*
 new_faderport_midi_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
diff --git a/libs/surfaces/faderport/fmcp_gui.cc b/libs/surfaces/faderport/fmcp_gui.cc
deleted file mode 100644 (file)
index 46239af..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
-    Copyright (C) 2009-2012 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the 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 program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <iostream>
-#include <list>
-#include <string>
-
-#include <gtkmm/comboboxtext.h>
-#include <gtkmm/label.h>
-#include <gtkmm/box.h>
-#include <gtkmm/adjustment.h>
-#include <gtkmm/spinbutton.h>
-#include <gtkmm/table.h>
-
-#include "gtkmm2ext/gtk_ui.h"
-#include "gtkmm2ext/utils.h"
-
-#include "faderport.h"
-
-#include "i18n.h"
-
-class GMCPGUI : public Gtk::VBox
-{
-public:
-       GMCPGUI (FaderPort&);
-       ~GMCPGUI ();
-
-private:
-       FaderPort& cp;
-       Gtk::ComboBoxText map_combo;
-       Gtk::Adjustment bank_adjustment;
-       Gtk::SpinButton bank_spinner;
-       Gtk::CheckButton motorised_button;
-       Gtk::Adjustment threshold_adjustment;
-       Gtk::SpinButton threshold_spinner;
-
-       void binding_changed ();
-       void bank_changed ();
-       void motorised_changed ();
-       void threshold_changed ();
-};
-
-using namespace PBD;
-using namespace ARDOUR;
-using namespace std;
-using namespace Gtk;
-using namespace Gtkmm2ext;
-
-void*
-FaderPort::get_gui () const
-{
-       if (!gui) {
-               const_cast<FaderPort*>(this)->build_gui ();
-       }
-       static_cast<Gtk::VBox*>(gui)->show_all();
-       return gui;
-}
-
-void
-FaderPort::tear_down_gui ()
-{
-       if (gui) {
-               Gtk::Widget *w = static_cast<Gtk::VBox*>(gui)->get_parent();
-               if (w) {
-                       w->hide();
-                       delete w;
-               }
-       }
-       delete (GMCPGUI*) gui;
-       gui = 0;
-}
-
-void
-FaderPort::build_gui ()
-{
-       gui = (void*) new GMCPGUI (*this);
-}
-
-/*--------------------*/
-
-GMCPGUI::GMCPGUI (FaderPort& p)
-       : cp (p)
-       , bank_adjustment (1, 1, 100, 1, 10)
-       , bank_spinner (bank_adjustment)
-       , motorised_button ("Motorised")
-       , threshold_adjustment (p.threshold(), 1, 127, 1, 10)
-       , threshold_spinner (threshold_adjustment)
-{
-}
-
-GMCPGUI::~GMCPGUI ()
-{
-}
-
-void
-GMCPGUI::bank_changed ()
-{
-//     int new_bank = bank_adjustment.get_value() - 1;
-//     cp.set_current_bank (new_bank);
-}
-
-void
-GMCPGUI::binding_changed ()
-{
-}
-
-void
-GMCPGUI::motorised_changed ()
-{
-//     cp.set_motorised (motorised_button.get_active ());
-}
-
-void
-GMCPGUI::threshold_changed ()
-{
-//     cp.set_threshold (threshold_adjustment.get_value());
-}
diff --git a/libs/surfaces/faderport/gui.cc b/libs/surfaces/faderport/gui.cc
new file mode 100644 (file)
index 0000000..c32c855
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+    Copyright (C) 2009-2012 Paul Davis
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the 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 program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <iostream>
+#include <list>
+#include <string>
+
+#include <gtkmm/comboboxtext.h>
+#include <gtkmm/label.h>
+#include <gtkmm/box.h>
+#include <gtkmm/adjustment.h>
+#include <gtkmm/spinbutton.h>
+#include <gtkmm/table.h>
+
+#include "gtkmm2ext/gtk_ui.h"
+#include "gtkmm2ext/utils.h"
+
+#include "faderport.h"
+
+#include "i18n.h"
+
+namespace ArdourSurface {
+
+class GMCPGUI : public Gtk::VBox
+{
+public:
+       GMCPGUI (FaderPort&);
+       ~GMCPGUI ();
+
+private:
+       FaderPort& cp;
+       Gtk::ComboBoxText map_combo;
+       Gtk::Adjustment bank_adjustment;
+       Gtk::SpinButton bank_spinner;
+       Gtk::CheckButton motorised_button;
+       Gtk::Adjustment threshold_adjustment;
+       Gtk::SpinButton threshold_spinner;
+
+       void binding_changed ();
+       void bank_changed ();
+       void motorised_changed ();
+       void threshold_changed ();
+};
+
+}
+
+using namespace PBD;
+using namespace ARDOUR;
+using namespace ArdourSurface;
+using namespace std;
+using namespace Gtk;
+using namespace Gtkmm2ext;
+
+void*
+FaderPort::get_gui () const
+{
+       if (!gui) {
+               const_cast<FaderPort*>(this)->build_gui ();
+       }
+       static_cast<Gtk::VBox*>(gui)->show_all();
+       return gui;
+}
+
+void
+FaderPort::tear_down_gui ()
+{
+       if (gui) {
+               Gtk::Widget *w = static_cast<Gtk::VBox*>(gui)->get_parent();
+               if (w) {
+                       w->hide();
+                       delete w;
+               }
+       }
+       delete (GMCPGUI*) gui;
+       gui = 0;
+}
+
+void
+FaderPort::build_gui ()
+{
+       gui = (void*) new GMCPGUI (*this);
+}
+
+/*--------------------*/
+
+GMCPGUI::GMCPGUI (FaderPort& p)
+       : cp (p)
+       , bank_adjustment (1, 1, 100, 1, 10)
+       , bank_spinner (bank_adjustment)
+       , motorised_button ("Motorised")
+       , threshold_adjustment (p.threshold(), 1, 127, 1, 10)
+       , threshold_spinner (threshold_adjustment)
+{
+}
+
+GMCPGUI::~GMCPGUI ()
+{
+}
+
+void
+GMCPGUI::bank_changed ()
+{
+//     int new_bank = bank_adjustment.get_value() - 1;
+//     cp.set_current_bank (new_bank);
+}
+
+void
+GMCPGUI::binding_changed ()
+{
+}
+
+void
+GMCPGUI::motorised_changed ()
+{
+//     cp.set_motorised (motorised_button.get_active ());
+}
+
+void
+GMCPGUI::threshold_changed ()
+{
+//     cp.set_threshold (threshold_adjustment.get_value());
+}
index 73f4504d2bcfc2a29543766e3b6d37546f39e2f2..eb52858b487f80a7543148e852ab47bc784a8ba5 100644 (file)
@@ -16,7 +16,7 @@ def build(bld):
     obj = bld(features = 'cxx cxxshlib')
     obj.source = '''
             faderport.cc
-            fmcp_gui.cc
+            gui.cc
             faderport_interface.cc
     '''
     obj.export_includes = ['.']