ardour/libs/surfaces/generic_midi/generic_midi_control_protocol.h
Carl Hetherington 79f91c7a20 Part 1 of loading 2.X sessions; some things work, some things don't, hacks a-plenty.
LOADING 2.X SESSIONS WITH THIS COMMIT IN PLACE WILL (PROBABLY) CORRUPT THE .ardour FILE,
MAKING THE SESSION UNLOADABLE ON 2.X AND LOSING INFORMATION.

So don't do that unless you make a backup of the session file first.



git-svn-id: svn://localhost/ardour2/branches/3.0@5786 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-10-15 00:57:55 +00:00

72 lines
1.6 KiB
C++

#ifndef ardour_generic_midi_control_protocol_h
#define ardour_generic_midi_control_protocol_h
#include <set>
#include <glibmm/thread.h>
#include <ardour/types.h>
#include <control_protocol/control_protocol.h>
namespace MIDI {
class Port;
}
namespace PBD {
class Controllable;
}
namespace ARDOUR {
class Session;
}
class MIDIControllable;
class GenericMidiControlProtocol : public ARDOUR::ControlProtocol {
public:
GenericMidiControlProtocol (ARDOUR::Session&);
virtual ~GenericMidiControlProtocol();
int set_active (bool yn);
static bool probe() { return true; }
MIDI::Port* port () const { return _port; }
void set_feedback_interval (ARDOUR::microseconds_t);
int set_feedback (bool yn);
bool get_feedback () const;
XMLNode& get_state ();
int set_state (const XMLNode&, int version = 3000);
private:
MIDI::Port* _port;
ARDOUR::microseconds_t _feedback_interval;
ARDOUR::microseconds_t last_feedback_time;
bool do_feedback;
bool auto_binding;
void _send_feedback ();
void send_feedback ();
typedef std::set<MIDIControllable*> MIDIControllables;
MIDIControllables controllables;
typedef std::list<std::pair<MIDIControllable*,sigc::connection> > MIDIPendingControllables;
MIDIPendingControllables pending_controllables;
Glib::Mutex controllables_lock;
Glib::Mutex pending_lock;
bool start_learning (PBD::Controllable*);
void stop_learning (PBD::Controllable*);
void learning_stopped (MIDIControllable*);
void create_binding (PBD::Controllable*, int, int);
void delete_binding (PBD::Controllable*);
void auto_binding_on();
void auto_binding_off();
};
#endif /* ardour_generic_midi_control_protocol_h */