mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
put all of the Mackie control surface code into the ArdourSurface namespace
This commit is contained in:
parent
12cb11b286
commit
4512d013eb
37 changed files with 131 additions and 53 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include "surface.h"
|
||||
#include "control_group.h"
|
||||
|
||||
using namespace ArdourSurface;
|
||||
using namespace Mackie;
|
||||
|
||||
Control*
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
namespace ArdourSurface {
|
||||
namespace Mackie {
|
||||
|
||||
class Control;
|
||||
|
|
@ -37,6 +38,7 @@ private:
|
|||
std::string _name;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "control_group.h"
|
||||
#include "mackie_control_protocol.h"
|
||||
|
||||
using namespace ArdourSurface;
|
||||
using namespace Mackie;
|
||||
|
||||
Control*
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 ();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "surface.h"
|
||||
#include "control_group.h"
|
||||
|
||||
using namespace ArdourSurface;
|
||||
using namespace Mackie;
|
||||
|
||||
const int Jog::ID = 0x3c;
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace ArdourSurface;
|
||||
using namespace Mackie;
|
||||
|
||||
JogWheel::JogWheel (MackieControlProtocol & mcp)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@
|
|||
#include <deque>
|
||||
#include <queue>
|
||||
|
||||
namespace ArdourSurface {
|
||||
|
||||
class MackieControlProtocol;
|
||||
|
||||
namespace Mackie
|
||||
|
|
@ -29,6 +31,7 @@ private:
|
|||
Mode _mode;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "surface.h"
|
||||
#include "control_group.h"
|
||||
|
||||
using namespace ArdourSurface;
|
||||
using namespace Mackie;
|
||||
|
||||
const int Led::FaderTouch = 0x70;
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 &)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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) \
|
||||
|
|
|
|||
|
|
@ -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__ */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@ namespace ARDOUR {
|
|||
}
|
||||
|
||||
class MidiByteArray;
|
||||
|
||||
namespace ArdourSurface {
|
||||
|
||||
class MackieControlProtocol;
|
||||
|
||||
namespace Mackie
|
||||
|
|
@ -174,6 +177,7 @@ public:
|
|||
void master_gain_changed ();
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue