put all of the Mackie control surface code into the ArdourSurface namespace
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 16 Apr 2015 00:37:20 +0000 (20:37 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 16 Apr 2015 00:37:20 +0000 (20:37 -0400)
37 files changed:
libs/surfaces/mackie/button.cc
libs/surfaces/mackie/button.h
libs/surfaces/mackie/control_group.h
libs/surfaces/mackie/controls.cc
libs/surfaces/mackie/controls.h
libs/surfaces/mackie/device_info.cc
libs/surfaces/mackie/device_info.h
libs/surfaces/mackie/device_profile.cc
libs/surfaces/mackie/device_profile.h
libs/surfaces/mackie/fader.cc
libs/surfaces/mackie/fader.h
libs/surfaces/mackie/gui.cc
libs/surfaces/mackie/gui.h
libs/surfaces/mackie/interface.cc
libs/surfaces/mackie/jog.cc
libs/surfaces/mackie/jog.h
libs/surfaces/mackie/jog_wheel.cc
libs/surfaces/mackie/jog_wheel.h
libs/surfaces/mackie/led.cc
libs/surfaces/mackie/led.h
libs/surfaces/mackie/mackie_control_exception.h
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mackie_control_protocol.h
libs/surfaces/mackie/mcp_buttons.cc
libs/surfaces/mackie/meter.cc
libs/surfaces/mackie/meter.h
libs/surfaces/mackie/pot.cc
libs/surfaces/mackie/pot.h
libs/surfaces/mackie/strip.cc
libs/surfaces/mackie/strip.h
libs/surfaces/mackie/surface.cc
libs/surfaces/mackie/surface.h
libs/surfaces/mackie/surface_port.cc
libs/surfaces/mackie/surface_port.h
libs/surfaces/mackie/timer.h
libs/surfaces/mackie/types.cc
libs/surfaces/mackie/types.h

index 8f13c4029c0da44d17667e678fdc77ea545c8663..c4f68ebda27eb8455df70f10fe9d3b7b312471b7 100644 (file)
@@ -23,6 +23,7 @@
 #include "surface.h"
 #include "control_group.h"
 
+using namespace ArdourSurface;
 using namespace Mackie;
 
 Control*
index c5d227d7c8a8f84a1c1b9aeb13891d4aaa6ba465..e836ff9c184f065eddb4e7db754857aa333e67f6 100644 (file)
@@ -23,6 +23,8 @@
 #include "controls.h"
 #include "led.h"
 
+namespace ArdourSurface {
+
 namespace Mackie {
 
 class Surface;
@@ -162,6 +164,7 @@ private:
        Led _led;
 };
 
-}
+} // Mackie namespace
+} // ArdourSurface namespace
 
 #endif
index 1b73770fa2d3ab1c6de2b17ff1c493d5df6b13e2..4955098225f58b2f6ec9f08d97409d2e0e116fa3 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <vector>
 
+namespace ArdourSurface {
 namespace Mackie {
 
 class Control;
@@ -37,6 +38,7 @@ private:
        std::string _name;
 };
 
+}
 }
 
 #endif
index 9858f5fd1688a3d29c3a04735b6a438b405ad503..1c88c2b74cfa1a285b8333cbcda5825d399dd5e8 100644 (file)
 #include "meter.h"
 
 
-using namespace Mackie;
 using namespace std;
+using namespace ArdourSurface;
+using namespace Mackie;
+
 using ARDOUR::AutomationControl;
 
 void Group::add (Control& control)
@@ -69,20 +71,6 @@ Control::set_in_use (bool in_use)
        _in_use = in_use;
 }
 
-ostream & Mackie::operator <<  (ostream & os, const Mackie::Control & control)
-{
-       os << typeid (control).name();
-       os << " { ";
-       os << "name: " << control.name();
-       os << ", ";
-       os << "id: " << "0x" << setw(2) << setfill('0') << hex << control.id() << setfill(' ');
-       os << ", ";
-       os << "group: " << control.group().name();
-       os << " }";
-       
-       return os;
-}
-
 void
 Control::set_control (boost::shared_ptr<AutomationControl> ac)
 {
@@ -122,3 +110,17 @@ Control::stop_touch (bool mark, double when)
        }
 }
        
+ostream & operator <<  (ostream & os, const ArdourSurface::Mackie::Control & control)
+{
+       os << typeid (control).name();
+       os << " { ";
+       os << "name: " << control.name();
+       os << ", ";
+       os << "id: " << "0x" << setw(2) << setfill('0') << hex << control.id() << setfill(' ');
+       os << ", ";
+       os << "group: " << control.group().name();
+       os << " }";
+       
+       return os;
+}
+
index 0923c9772fb973775b829c486c460d57be96e97f..e8098ccf7ebf5abc58e9ed72e9598d2227a61fe8 100644 (file)
@@ -36,15 +36,15 @@ namespace ARDOUR {
        class AutomationControl;
 }
 
-namespace Mackie
-{
+namespace ArdourSurface {
+
+namespace Mackie {
 
 class Strip;
 class Group;
 class Surface;
 
-class Control
-{
+class Control {
 public:
        Control (int id, std::string name, Group& group);
        virtual ~Control() {}
@@ -56,7 +56,7 @@ public:
        bool in_use () const;
        void set_in_use (bool);
        
-       /// Keep track of the timeout so it can be updated with more incoming events
+       // Keep track of the timeout so it can be updated with more incoming events
        sigc::connection in_use_connection;
 
        virtual MidiByteArray zero() = 0;
@@ -85,8 +85,9 @@ public:
        bool _in_use;
 };
 
-std::ostream & operator <<  (std::ostream & os, const Control & control);
-
 }
+}
+
+std::ostream & operator <<  (std::ostream & os, const ArdourSurface::Mackie::Control & control);
 
 #endif /* __mackie_controls_h__ */
index 2a953fd44c2edcd5ebf4d2a1c5c013b6a7c8437a..3ec1369eea0ee3b0d9051b70d6b5e8dd971cfe1a 100644 (file)
 
 #include "i18n.h"
 
-using namespace Mackie;
 using namespace PBD;
 using namespace ARDOUR;
+using namespace ArdourSurface;
+using namespace Mackie;
+
 using std::string;
 using std::vector;
 
index 33f554fe07f829d41f3da92ccb2b0a6ab1a78dfb..9a70852ed6984c4e7bf36ae0aaa27c6a88327aaf 100644 (file)
@@ -29,6 +29,8 @@
 
 class XMLNode;
 
+namespace ArdourSurface {
+
 namespace Mackie {
 
 struct GlobalButtonInfo {
@@ -108,8 +110,9 @@ class DeviceInfo
 };
 
 
-}
+} // Mackie namespace
+} // ArdourSurface namespace
 
-std::ostream& operator<< (std::ostream& os, const Mackie::DeviceInfo& di);
+std::ostream& operator<< (std::ostream& os, const ArdourSurface::Mackie::DeviceInfo& di);
 
 #endif /* __ardour_mackie_control_protocol_device_info_h__ */
index 320dd49297b338a946cba6a4fd64ebdd245e7487..d71d6d9888ea34f2dca7ef9c2d047844504ba4cf 100644 (file)
 
 #include "i18n.h"
 
-using namespace Mackie;
 using namespace PBD;
 using namespace ARDOUR;
+using namespace ArdourSurface;
+using namespace Mackie;
+
 using std::string;
 using std::vector;
 
index 65aba486924734339e634d7c532a56497a068285..15702a688672404fd2b70376ff80d0ed4a43a831 100644 (file)
@@ -28,6 +28,8 @@
 
 class XMLNode;
 
+namespace ArdourSurface {
+
 namespace Mackie {
 
 class DeviceProfile
@@ -67,6 +69,7 @@ class DeviceProfile
        void save ();
 };
 
+}
 }
 
 #endif /* __ardour_mackie_control_protocol_device_profile_h__ */
index 4b9da7226a335ef62bbf64f8953a774cd639a7f7..cc43bf3387e3062cda1690215f1e220d8a7dca47 100644 (file)
@@ -24,6 +24,7 @@
 #include "control_group.h"
 #include "mackie_control_protocol.h"
 
+using namespace ArdourSurface;
 using namespace Mackie;
 
 Control*
index 42a485036e3c4d43b81fa0291bdf1a2f7f2e40ae..8de8a5896c04b0c83b01675bff48f94a838b6279 100644 (file)
@@ -3,6 +3,8 @@
 
 #include "controls.h"
 
+namespace ArdourSurface {
+
 namespace Mackie {
 
 class Fader : public Control
@@ -26,6 +28,7 @@ class Fader : public Control
        float position;
 };
 
+}
 }
 
 #endif
index 6753f0a97c965b7dff6d8e25ce8172f81afb7f28..105bac060c355a2db8a71a983e7340aafe7010e1 100644 (file)
@@ -42,8 +42,9 @@
 #include "i18n.h"
 
 using namespace std;
-using namespace Mackie;
 using namespace Gtk;
+using namespace ArdourSurface;
+using namespace Mackie;
 
 void*
 MackieControlProtocol::get_gui () const
index 42ee338f9960c41aa4702151d8f2ac888e6e090c..6fc0352b657a72029f306f7ad58fc7c5b780af3b 100644 (file)
@@ -16,7 +16,6 @@
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-
 #include <gtkmm/comboboxtext.h>
 #include <gtkmm/box.h>
 #include <gtkmm/spinbutton.h>
@@ -30,12 +29,14 @@ namespace Gtk {
        class CellRendererCombo;
 }
 
-class MackieControlProtocol;
-
 #include "button.h"
 
 #include "i18n.h"
 
+namespace ArdourSurface {
+
+class MackieControlProtocol;
+
 class MackieControlProtocolGUI : public Gtk::Notebook
 {
   public:
@@ -110,3 +111,5 @@ class MackieControlProtocolGUI : public Gtk::Notebook
     void discover_clicked ();
 };
 
+}
+
index abef84817d4cbf58e48023cd6f5bacc8044b4fd5..bb0a4d0509b38d1484e5ed0d220ee493174b370c 100644 (file)
@@ -28,6 +28,8 @@
 using namespace ARDOUR;
 using namespace PBD;
 using namespace std;
+using namespace ArdourSurface;
+using namespace Mackie;
 
 static ControlProtocol*
 new_mackie_protocol (ControlProtocolDescriptor*, Session* s)
index dc832868ede708dbe950a8b04e651c6ee864894c..c36b9751105281d0163d8e16d75f37a2028488ea 100644 (file)
@@ -21,6 +21,7 @@
 #include "surface.h"
 #include "control_group.h"
 
+using namespace ArdourSurface;
 using namespace Mackie;
 
 const int Jog::ID = 0x3c;
index 23451f92b2ec0a32757be3ef67a95ab9abaff832..ac1bc9e52ae3a02ccc56c7c02a1b5e7d045b69bf 100644 (file)
@@ -23,6 +23,7 @@
 #include "controls.h"
 #include "pot.h"
 
+namespace ArdourSurface {
 namespace Mackie {
 
 class Jog : public Pot
@@ -40,6 +41,7 @@ public:
        static Control* factory (Surface&, int id, const char*, Group&);
 };
 
+}
 }
 
 #endif /* __ardour_mackie_control_protocol_jog_h__ */
index f42826ac0b87402b7ba929884cf4c8714056428c..318a6452a070d58b2f242cec1d2a87b6bd1d104d 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <algorithm>
 
+using namespace ArdourSurface;
 using namespace Mackie;
 
 JogWheel::JogWheel (MackieControlProtocol & mcp)
index 0750775bdd72d755951cb5b5179de13767ccbcf2..5ef3c6c255e710639aa59ad0254891f6fa6bf5ce 100644 (file)
@@ -7,6 +7,8 @@
 #include <deque>
 #include <queue>
 
+namespace ArdourSurface { 
+
 class MackieControlProtocol;
 
 namespace Mackie
@@ -29,6 +31,7 @@ private:
        Mode _mode;
 };
 
+}
 }
 
 #endif
index 38aa5c7f3b62ac470d88abf250d1828d51a7c988..6a090cdc749207848d2413f6901ceded2c982458 100644 (file)
@@ -21,6 +21,7 @@
 #include "surface.h"
 #include "control_group.h"
 
+using namespace ArdourSurface;
 using namespace Mackie;
 
 const int Led::FaderTouch = 0x70;
index fdbeb8cd9cd061d1355455206eb588ff1ce4b679..8361c4bb8df9d0d44ee86a021ce83e50903deeee 100644 (file)
@@ -24,6 +24,8 @@
 #include "midi_byte_array.h"
 #include "types.h"
 
+namespace ArdourSurface {
+
 namespace Mackie {
 
 class Led : public Control
@@ -52,6 +54,7 @@ public:
        LedState state;
 };
 
+}
 }
 
 #endif /* __ardour_mackie_control_protocol_led_h__ */
index afe70169488b938aeb4c84fc4518a871d831d6fd..b40c5c3915e6eb9b753bd9ca0f6b67b83eb3ea3e 100644 (file)
@@ -20,8 +20,8 @@
 
 #include <stdexcept>
 
-namespace Mackie
-{
+namespace ArdourSurface {
+namespace Mackie {
 
 class MackieControlException : public std::exception
 {
@@ -42,6 +42,7 @@ private:
        std::string _msg;
 };
 
+}
 }
 
 #endif
index 5d2eadc5728dda5f8bf7c0bda332c2e434924748..76122d1f1989182a0590754f4320af170b8a1cd9 100644 (file)
 
 using namespace ARDOUR;
 using namespace std;
-using namespace Mackie;
 using namespace PBD;
 using namespace Glib;
+using namespace ArdourSurface;
+using namespace Mackie;
 
 #include "i18n.h"
 
@@ -657,9 +658,9 @@ MackieControlProtocol::set_device (const string& device_name)
 }
 
 gboolean 
-ipmidi_input_handler (GIOChannel*, GIOCondition condition, void *data)
+ArdourSurface::ipmidi_input_handler (GIOChannel*, GIOCondition condition, void *data)
 {
-        MackieControlProtocol::ipMIDIHandler* ipm = static_cast<MackieControlProtocol::ipMIDIHandler*>(data);
+       ArdourSurface::MackieControlProtocol::ipMIDIHandler* ipm = static_cast<ArdourSurface::MackieControlProtocol::ipMIDIHandler*>(data);
         return ipm->mcp->midi_input_handler (Glib::IOCondition (condition), ipm->port);
 }
 
index 1def854b8f11cf06a7fa2aa1e923d22b80291a72..1e15d8db16f5f174957ed0ae25214d6d5c5afff1 100644 (file)
@@ -50,6 +50,8 @@ namespace MIDI {
        class Port;
 }
 
+namespace ArdourSurface {
+
 namespace Mackie {
        class Surface;
        class Control;
@@ -57,6 +59,8 @@ namespace Mackie {
        class Button;
 }
 
+gboolean ipmidi_input_handler (GIOChannel*, GIOCondition condition, void *data);
+
 /**
        This handles the plugin duties, and the midi encoding and decoding,
        and the signal callbacks, mostly from ARDOUR::Route.
@@ -297,7 +301,7 @@ class MackieControlProtocol
                 MIDI::Port* port;
         };
         friend struct ipMIDIHandler; /* is this necessary */
-        friend gboolean ipmidi_input_handler (GIOChannel*, GIOCondition condition, void *data);
+       friend gboolean ArdourSurface::ipmidi_input_handler (GIOChannel*, GIOCondition condition, void *data);
 
        int create_surfaces ();
        bool periodic();
@@ -509,4 +513,6 @@ class MackieControlProtocol
        Mackie::LedState view_release (Mackie::Button&);
 };
 
+} // namespace 
+
 #endif // ardour_mackie_control_protocol_h
index 792813bf33d9798691d6d8b799a68eb94627235b..a1ea08939924f7369159ca060adc77e2991fc07d 100644 (file)
  * mackie_control_protocol.cc 
  */
 
-using namespace Mackie;
+using std::string;
 using namespace ARDOUR;
 using namespace PBD;
-using std::string;
+using namespace ArdourSurface;
+using namespace Mackie;
 
 LedState
 MackieControlProtocol::shift_press (Button &)
index fe11357d3a505751407996bea97116c65bd673d4..bc148db18506ed98c260061f728a45855d13af03 100644 (file)
@@ -27,8 +27,9 @@
 #include "surface_port.h"
 #include "control_group.h"
 
-using namespace Mackie;
 using namespace PBD;
+using namespace ArdourSurface;
+using namespace Mackie;
 
 Control*
 Meter::factory (Surface& surface, int id, const char* name, Group& group)
index db3e8cffb3469ded6892aa08301d83ce25a20d3c..9ca5656664242052c5b4029a239ea68f93732af3 100644 (file)
@@ -23,6 +23,8 @@
 #include "controls.h"
 #include "midi_byte_array.h"
 
+namespace ArdourSurface {
+
 namespace Mackie {
 
 class SurfacePort;
@@ -46,6 +48,7 @@ public:
        bool overload_on;
 };
 
-}
+} // Mackie namespace
+} // ArdourSurface namespace
 
 #endif /* __ardour_mackie_control_protocol_meter_h__ */
index 8f0298ea72b7b4df986319047d110979f349a05e..e1ddae82f8056af43f648eda4aa7cf5219e89695 100644 (file)
@@ -22,6 +22,7 @@
 #include "surface.h"
 #include "control_group.h"
 
+using namespace ArdourSurface;
 using namespace Mackie;
 
 int const Pot::External = 0x2e; /* specific ID for "vpot" representing external control */
index 3bbf0f33f43b6b9bb3649b666bf4deaef99dcd1b..9511db0b71ca4edb5486dee922367de5eaa6db9d 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "controls.h"
 
+namespace ArdourSurface {
+
 namespace Mackie {
 
 class Pot : public Control
@@ -47,6 +49,7 @@ public:
 
 };
 
+}
 }
 
 #endif /* __ardour_mackie_control_protocol_pot_h__ */
index 70a7cb90fd5eb0efd9ae980b52a25672769ea8b8..23624d12cff70ff1b94259572ef99cf3f550222d 100644 (file)
 #include "jog.h"
 #include "meter.h"
 
-using namespace Mackie;
 using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
+using namespace ArdourSurface;
+using namespace Mackie;
 
 #ifndef timeradd /// only avail with __USE_BSD
 #define timeradd(a,b,result)                         \
index c330e0e54db3a99622c609f129dc62952b5d43bf..b4515def6551fd7e82460026a42d9d28f3fb2a81 100644 (file)
@@ -23,6 +23,8 @@ namespace ARDOUR {
        class ChannelCount;
 }
 
+namespace ArdourSurface {
+
 namespace Mackie {
 
 class Control;
@@ -145,6 +147,7 @@ private:
        std::map<Evoral::Parameter,Control*> control_by_parameter;
 };
 
+}
 }
 
 #endif /* __ardour_mackie_control_protocol_strip_h__ */
index 09c5fff051dad322c559fb081a5d0478cdf3f7c3..1fea8d7c3aa0af4d48dee3861f82c8af62139dd3 100644 (file)
 
 using namespace std;
 using namespace PBD;
-using namespace Mackie;
 using ARDOUR::Route;
 using ARDOUR::Panner;
 using ARDOUR::Pannable;
 using ARDOUR::AutomationControl;
+using namespace ArdourSurface;
+using namespace Mackie;
 
 #define ui_context() MackieControlProtocol::instance() /* a UICallback-derived object that specifies the event loop for signal handling */
 
index 1ed83aef1db88af2c9a2e9ba7751af282c9a0c42..eab58e6a9f6350c209c894cc3f60a670438e123c 100644 (file)
@@ -21,6 +21,9 @@ namespace ARDOUR {
 }
 
 class MidiByteArray;
+
+namespace ArdourSurface {
+
 class MackieControlProtocol;
 
 namespace Mackie
@@ -174,6 +177,7 @@ public:
        void master_gain_changed ();
 };
 
+}
 }
 
 #endif
index 013a0019c7e797ef9982df56412a07cd8a7fbc94..c732c6869c8de922df7f98b500ce25e84d2d2b89 100644 (file)
 #include "i18n.h"
 
 using namespace std;
-using namespace Mackie;
 using namespace PBD;
 using namespace ARDOUR;
+using namespace ArdourSurface;
+using namespace Mackie;
 
 SurfacePort::SurfacePort (Surface& s)
        : _surface (&s)
index b361294fa91c6f14a9fcc4a204dc3d0955a3d679..1239bc533c7a3fcf27692d25eb41e8b8cf5fd8f5 100644 (file)
@@ -31,13 +31,16 @@ namespace MIDI {
        class Port;
 }
 
-class MackieControlProtocol;
 
 namespace ARDOUR {
        class AsyncMIDIPort;
        class Port;
 }
 
+namespace ArdourSurface {
+
+class MackieControlProtocol;
+
 namespace Mackie
 {
 
@@ -74,6 +77,7 @@ private:
 
 std::ostream& operator <<  (std::ostream& , const SurfacePort& port);
 
+}
 }
 
 #endif
index 0e19062911a48ed7c9c42d8d87c18e7c3fbe94c3..dd6066c87b2809a92098442514f0965ac578b675 100644 (file)
@@ -25,6 +25,8 @@
 #include <sys/time.h>
 #endif
 
+namespace ArdourSurface {
+
 namespace Mackie
 {
 
@@ -96,6 +98,7 @@ private:
        bool running;
 };
 
-}
+} // Mackie namespace
+} // ArdourSurface namespace
 
 #endif
index 4edb211553e4951953e0ed10e1900a88ee4e6e4f..f3a05e0f3c84b74cea6fe011cf551173aa69a90e 100644 (file)
 
 #include "types.h"
 
-namespace Mackie
-{
+namespace ArdourSurface {
+
+namespace Mackie {
+
 LedState on( LedState::on );
 LedState off( LedState::off );
 LedState flashing( LedState::flashing );
 LedState none( LedState::none );
 
-std::ostream & operator << ( std::ostream & os, const ControlState & cs )
+}
+}
+
+std::ostream & operator << ( std::ostream & os, const ArdourSurface::Mackie::ControlState & cs )
 {
        os << "ControlState { ";
        os << "pos: " << cs.pos;
@@ -44,5 +49,3 @@ std::ostream & operator << ( std::ostream & os, const ControlState & cs )
 
        return os;
 }
-
-}
index d906af6d32fbee78626a38535b9502e4a28ef20d..3095248a1a2c6f60c93664b03a8ec58e50fa8f7c 100644 (file)
@@ -20,8 +20,8 @@
 
 #include <iostream>
 
-namespace Mackie
-{
+namespace ArdourSurface  {
+namespace Mackie {
 
 enum surface_type_t { 
        mcu, 
@@ -107,6 +107,7 @@ class Group;
 class Pot;
 class Led;
 
+}
 }
 
 #endif