13
0
livetrax/libs/surfaces/generic_midi/generic_midi_control_protocol.h
Hans Fugal 79986643c0 r269@gandalf: fugalh | 2006-08-03 20:18:05 -0600
Trunk merge conflicts resolved


git-svn-id: svn://localhost/ardour2/branches/undo@756 d708f5d6-7413-0410-9779-e7cbd77b26cf
2006-08-04 02:18:45 +00:00

59 lines
1.3 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);
XMLNode& get_state ();
int set_state (const XMLNode&);
private:
MIDI::Port* _port;
ARDOUR::microseconds_t _feedback_interval;
ARDOUR::microseconds_t last_feedback_time;
void _send_feedback ();
void send_feedback ();
typedef std::set<MIDIControllable*> MIDIControllables;
MIDIControllables controllables;
MIDIControllables pending_controllables;
Glib::Mutex controllables_lock;
Glib::Mutex pending_lock;
bool start_learning (PBD::Controllable*);
void stop_learning (PBD::Controllable*);
void learning_stopped (MIDIControllable*);
};
#endif /* ardour_generic_midi_control_protocol_h */