diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-06-02 21:41:35 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-06-02 21:41:35 +0000 |
commit | 449aab3c465bbbf66d221fac3d7ea559f1720357 (patch) | |
tree | 6843cc40c88250a132acac701271f1504cd2df04 /libs/surfaces/generic_midi/generic_midi_control_protocol.h | |
parent | 9c0d7d72d70082a54f823cd44c0ccda5da64bb6f (diff) |
rollback to 3428, before the mysterious removal of libs/* at 3431/3432
git-svn-id: svn://localhost/ardour2/branches/3.0@3435 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/generic_midi/generic_midi_control_protocol.h')
-rw-r--r-- | libs/surfaces/generic_midi/generic_midi_control_protocol.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.h b/libs/surfaces/generic_midi/generic_midi_control_protocol.h new file mode 100644 index 0000000000..dfff8810d1 --- /dev/null +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.h @@ -0,0 +1,72 @@ +#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&); + + 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 */ |