2012-04-09 09:59:35 -04:00
|
|
|
#ifndef __ardour_mackie_control_protocol_strip_h__
|
|
|
|
#define __ardour_mackie_control_protocol_strip_h__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <iostream>
|
|
|
|
|
2012-04-10 10:27:44 -04:00
|
|
|
#include "pbd/property_basics.h"
|
|
|
|
|
2012-04-09 09:59:35 -04:00
|
|
|
#include "control_group.h"
|
2012-04-10 10:27:44 -04:00
|
|
|
#include "mackie_midi_builder.h"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Route;
|
|
|
|
}
|
2012-04-09 09:59:35 -04:00
|
|
|
|
|
|
|
namespace Mackie {
|
|
|
|
|
|
|
|
class Control;
|
|
|
|
class Surface;
|
|
|
|
class Button;
|
|
|
|
class Pot;
|
|
|
|
class Fader;
|
|
|
|
class Meter;
|
|
|
|
|
|
|
|
struct StripControlDefinition {
|
|
|
|
const char* name;
|
|
|
|
uint32_t base_id;
|
2012-04-10 10:27:44 -04:00
|
|
|
Control* (*factory)(Surface&, int index, const char* name, Group&);
|
2012-04-09 09:59:35 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct GlobalControlDefinition {
|
|
|
|
const char* name;
|
|
|
|
uint32_t id;
|
2012-04-10 10:27:44 -04:00
|
|
|
Control* (*factory)(Surface&, int index, const char* name, Group&);
|
2012-04-09 09:59:35 -04:00
|
|
|
const char* group_name;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
This is the set of controls that make up a strip.
|
|
|
|
*/
|
|
|
|
class Strip : public Group
|
|
|
|
{
|
|
|
|
public:
|
2012-04-10 10:27:44 -04:00
|
|
|
Strip (Surface&, const std::string & name, int index, StripControlDefinition* ctls);
|
|
|
|
~Strip();
|
2012-04-09 09:59:35 -04:00
|
|
|
|
2012-04-10 10:27:44 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
|
|
|
|
|
|
|
|
void add (Control & control);
|
2012-04-09 09:59:35 -04:00
|
|
|
int index() const { return _index; } // zero based
|
|
|
|
|
|
|
|
Button & solo();
|
|
|
|
Button & recenable();
|
|
|
|
Button & mute();
|
|
|
|
Button & select();
|
|
|
|
Button & vselect();
|
|
|
|
Button & fader_touch();
|
|
|
|
Pot & vpot();
|
|
|
|
Fader & gain();
|
|
|
|
Meter& meter ();
|
|
|
|
|
|
|
|
bool has_solo() const { return _solo != 0; }
|
|
|
|
bool has_recenable() const { return _recenable != 0; }
|
|
|
|
bool has_mute() const { return _mute != 0; }
|
|
|
|
bool has_select() const { return _select != 0; }
|
|
|
|
bool has_vselect() const { return _vselect != 0; }
|
|
|
|
bool has_fader_touch() const { return _fader_touch != 0; }
|
|
|
|
bool has_vpot() const { return _vpot != 0; }
|
|
|
|
bool has_gain() const { return _gain != 0; }
|
|
|
|
bool has_meter() const { return _meter != 0; }
|
2012-04-10 10:27:44 -04:00
|
|
|
|
|
|
|
void set_route (boost::shared_ptr<ARDOUR::Route>);
|
|
|
|
|
|
|
|
// call all signal handlers manually
|
|
|
|
void notify_all();
|
|
|
|
|
|
|
|
bool handle_button (SurfacePort & port, Control & control, ButtonState bs);
|
|
|
|
|
|
|
|
void periodic ();
|
|
|
|
|
2012-04-09 09:59:35 -04:00
|
|
|
private:
|
|
|
|
Button* _solo;
|
|
|
|
Button* _recenable;
|
|
|
|
Button* _mute;
|
|
|
|
Button* _select;
|
|
|
|
Button* _vselect;
|
|
|
|
Button* _fader_touch;
|
|
|
|
Pot* _vpot;
|
|
|
|
Fader* _gain;
|
|
|
|
Meter* _meter;
|
|
|
|
int _index;
|
2012-04-10 10:27:44 -04:00
|
|
|
Surface* _surface;
|
2012-04-09 09:59:35 -04:00
|
|
|
|
2012-04-10 10:27:44 -04:00
|
|
|
MackieMidiBuilder builder;
|
2012-04-09 09:59:35 -04:00
|
|
|
|
2012-04-10 10:27:44 -04:00
|
|
|
boost::shared_ptr<ARDOUR::Route> _route;
|
|
|
|
PBD::ScopedConnectionList route_connections;
|
|
|
|
|
|
|
|
// Last written values for the gain and pan, to avoid overloading
|
|
|
|
// the midi connection to the surface
|
|
|
|
float _last_gain_written;
|
|
|
|
MidiByteArray _last_pan_written;
|
|
|
|
|
|
|
|
|
|
|
|
void notify_solo_changed ();
|
|
|
|
void notify_mute_changed ();
|
|
|
|
void notify_record_enable_changed ();
|
|
|
|
void notify_gain_changed (bool force_update = true);
|
|
|
|
void notify_property_changed (const PBD::PropertyChange&);
|
|
|
|
void notify_panner_changed (bool force_update = true);
|
|
|
|
void notify_active_changed ();
|
|
|
|
void notify_route_deleted ();
|
2012-04-09 09:59:35 -04:00
|
|
|
|
2012-04-10 10:27:44 -04:00
|
|
|
void update_automation ();
|
|
|
|
void update_meter ();
|
|
|
|
|
2012-04-09 09:59:35 -04:00
|
|
|
};
|
|
|
|
|
2012-04-10 10:27:44 -04:00
|
|
|
std::ostream & operator << (std::ostream &, const Strip &);
|
|
|
|
|
2012-04-09 09:59:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* __ardour_mackie_control_protocol_strip_h__ */
|