/*
Copyright (C) 2006 Paul Davis
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
#include <glibmm/threads.h>
#include "ardour/types.h"
+#include "ardour/port.h"
#include "control_protocol/control_protocol.h"
namespace PBD {
class Controllable;
- class ControllableDescriptor;
-}
+}
namespace ARDOUR {
- class Session;
+ class AsyncMIDIPort;
+ class ControllableDescriptor;
class MidiPort;
+ class Session;
}
namespace MIDI {
int set_active (bool yn);
static bool probe() { return true; }
- MIDI::Port* input_port () const { return _input_port; }
- MIDI::Port* output_port () const { return _output_port; }
+ void stripable_selection_changed () {}
+
+ std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles ();
+
+ boost::shared_ptr<ARDOUR::Port> input_port () const;
+ boost::shared_ptr<ARDOUR::Port> output_port () const;
+
void set_feedback_interval (ARDOUR::microseconds_t);
int set_feedback (bool yn);
bool get_feedback () const;
- boost::shared_ptr<PBD::Controllable> lookup_controllable (const PBD::ControllableDescriptor&) const;
+ boost::shared_ptr<PBD::Controllable> lookup_controllable (const ARDOUR::ControllableDescriptor&) const;
+
+ void maybe_start_touch (PBD::Controllable*);
XMLNode& get_state ();
int set_state (const XMLNode&, int version);
int load_bindings (const std::string&);
void drop_bindings ();
-
+
+ void check_used_event (int, int);
+
std::string current_binding() const { return _current_binding; }
struct MapInfo {
void prev_bank ();
void set_motorised (bool);
-
+
bool motorised () const {
return _motorised;
}
return _threshold;
}
+ PBD::Signal0<void> ConnectionChange;
+
private:
- MIDI::Port* _input_port;
- MIDI::Port* _output_port;
+ boost::shared_ptr<ARDOUR::Bundle> _input_bundle;
+ boost::shared_ptr<ARDOUR::Bundle> _output_bundle;
+ boost::shared_ptr<ARDOUR::AsyncMIDIPort> _input_port;
+ boost::shared_ptr<ARDOUR::AsyncMIDIPort> _output_port;
+
ARDOUR::microseconds_t _feedback_interval;
ARDOUR::microseconds_t last_feedback_time;
typedef std::list<MIDIAction*> MIDIActions;
MIDIActions actions;
- typedef std::pair<MIDIControllable*,PBD::ScopedConnection> MIDIPendingControllable;
+ struct MIDIPendingControllable {
+ MIDIControllable* mc;
+ bool own_mc;
+ PBD::ScopedConnection connection;
+
+ MIDIPendingControllable (MIDIControllable* c, bool omc)
+ : mc (c)
+ , own_mc (omc)
+ {}
+ };
typedef std::list<MIDIPendingControllable* > MIDIPendingControllables;
MIDIPendingControllables pending_controllables;
Glib::Threads::Mutex controllables_lock;
void reset_controllables ();
void drop_all ();
+ enum ConnectionState {
+ InputConnected = 0x1,
+ OutputConnected = 0x2
+ };
+
+ int connection_state;
+ bool connection_handler (boost::weak_ptr<ARDOUR::Port>, std::string name1, boost::weak_ptr<ARDOUR::Port>, std::string name2, bool yn);
+ PBD::ScopedConnection port_connection;
+ void connected();
+
std::string _current_binding;
uint32_t _bank_size;
uint32_t _current_bank;
mutable void *gui;
void build_gui ();
+
+
};
#endif /* ardour_generic_midi_control_protocol_h */