redisplay_connection = redisplay_timeout->connect (sigc::mem_fun (*this, &MackieControlProtocol::redisplay));
redisplay_timeout->attach (main_loop()->get_context());
+ if (_device_info.device_type() == DeviceInfo::HUI) {
+ Glib::RefPtr<Glib::TimeoutSource> hui_timeout = Glib::TimeoutSource::create (1000); // milliseconds
+ hui_connection = hui_timeout->connect (sigc::mem_fun (*this, &MackieControlProtocol::hui_heartbeat));
+ hui_timeout->attach (main_loop()->get_context());
+ }
+
+
} else {
BaseUI::quit ();
return 0;
}
+bool
+MackieControlProtocol::hui_heartbeat ()
+{
+ Glib::Threads::Mutex::Lock lm (surfaces_lock);
+
+ for (Surfaces::iterator s = surfaces.begin(); s != surfaces.end(); ++s) {
+ (*s)->hui_heartbeat ();
+ }
+
+ return true;
+}
+
bool
MackieControlProtocol::periodic ()
{
Mackie::DeviceProfile _device_profile;
sigc::connection periodic_connection;
sigc::connection redisplay_connection;
+ sigc::connection hui_connection;
uint32_t _current_initial_bank;
PBD::ScopedConnectionList audio_engine_connections;
PBD::ScopedConnectionList session_connections;
int create_surfaces ();
bool periodic();
bool redisplay();
+ bool hui_heartbeat ();
void build_gui ();
bool midi_input_handler (Glib::IOCondition ioc, MIDI::Port* port);
void clear_ports ();
if (_mcp.device_info().no_handshake()) {
turn_it_on ();
- }
+ }
+ if (_mcp.device_info().device_type() == DeviceInfo::HUI && ev->note_number == 0 && ev->velocity == 127) {
+ turn_it_on ();
+ }
+
/* fader touch sense is given by "buttons" 0xe..0xe7 and 0xe8 for the
* master.
*/
}
}
}
+
+void
+Surface::hui_heartbeat ()
+{
+ if (!_port) {
+ return;
+ }
+
+ MidiByteArray msg (3, MIDI::on, 0x0, 0x0);
+ _port->write (msg);
+}
void periodic (uint64_t now_usecs);
void redisplay ();
-
+ void hui_heartbeat ();
+
void handle_midi_pitchbend_message (MIDI::Parser&, MIDI::pitchbend_t, uint32_t channel_id);
void handle_midi_controller_message (MIDI::Parser&, MIDI::EventTwoBytes*);
void handle_midi_note_on_message (MIDI::Parser&, MIDI::EventTwoBytes*);