put all of the Mackie control surface code into the ArdourSurface namespace

This commit is contained in:
Paul Davis 2015-04-15 20:37:20 -04:00
parent 12cb11b286
commit 4512d013eb
37 changed files with 131 additions and 53 deletions

View file

@ -23,6 +23,7 @@
#include "surface.h"
#include "control_group.h"
using namespace ArdourSurface;
using namespace Mackie;
Control*

View 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

View file

@ -3,6 +3,7 @@
#include <vector>
namespace ArdourSurface {
namespace Mackie {
class Control;
@ -37,6 +38,7 @@ private:
std::string _name;
};
}
}
#endif

View file

@ -34,8 +34,10 @@
#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;
}

View 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__ */

View file

@ -33,9 +33,11 @@
#include "i18n.h"
using namespace Mackie;
using namespace PBD;
using namespace ARDOUR;
using namespace ArdourSurface;
using namespace Mackie;
using std::string;
using std::vector;

View 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__ */

View file

@ -35,9 +35,11 @@
#include "i18n.h"
using namespace Mackie;
using namespace PBD;
using namespace ARDOUR;
using namespace ArdourSurface;
using namespace Mackie;
using std::string;
using std::vector;

View 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__ */

View file

@ -24,6 +24,7 @@
#include "control_group.h"
#include "mackie_control_protocol.h"
using namespace ArdourSurface;
using namespace Mackie;
Control*

View 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

View 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

View 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 ();
};
}

View 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)

View file

@ -21,6 +21,7 @@
#include "surface.h"
#include "control_group.h"
using namespace ArdourSurface;
using namespace Mackie;
const int Jog::ID = 0x3c;

View 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__ */

View file

@ -29,6 +29,7 @@
#include <algorithm>
using namespace ArdourSurface;
using namespace Mackie;
JogWheel::JogWheel (MackieControlProtocol & mcp)

View file

@ -7,6 +7,8 @@
#include <deque>
#include <queue>
namespace ArdourSurface {
class MackieControlProtocol;
namespace Mackie
@ -29,6 +31,7 @@ private:
Mode _mode;
};
}
}
#endif

View file

@ -21,6 +21,7 @@
#include "surface.h"
#include "control_group.h"
using namespace ArdourSurface;
using namespace Mackie;
const int Led::FaderTouch = 0x70;

View 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__ */

View 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

View file

@ -71,9 +71,10 @@
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);
}

View 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

View file

@ -37,10 +37,11 @@
* 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 &)

View 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)

View 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__ */

View 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 */

View 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__ */

View file

@ -55,10 +55,11 @@
#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) \

View 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__ */

View file

@ -53,11 +53,12 @@
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 */

View 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

View file

@ -44,9 +44,10 @@
#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)

View 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

View 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

View file

@ -19,14 +19,19 @@
#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;
}
}

View 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