summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-02-18 20:53:54 +0000
committerDavid Robillard <d@drobilla.net>2009-02-18 20:53:54 +0000
commit1f9c3f34d95ecc148b2e796e6361d1c16f533d6c (patch)
treed35cdfc92919533fe33ecea350e5469f6ce81c12 /libs
parent22088e77a75c4eb2a7ed369ce3491b87f208329e (diff)
Fix MIDI controller feedback.
Make control surfaces menu less weird. git-svn-id: svn://localhost/ardour2/branches/3.0@4625 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session_midi.cc4
-rw-r--r--libs/midi++2/jack_midiport.cc9
-rw-r--r--libs/midi++2/midi++/jack.h1
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc3
-rw-r--r--libs/surfaces/generic_midi/midicontrollable.cc6
5 files changed, 11 insertions, 12 deletions
diff --git a/libs/ardour/session_midi.cc b/libs/ardour/session_midi.cc
index b85df5b714..f5dc9993d5 100644
--- a/libs/ardour/session_midi.cc
+++ b/libs/ardour/session_midi.cc
@@ -777,7 +777,6 @@ Session::change_midi_ports ()
* This resets the MTC code, the next quarter frame message that is sent will be
* the first one with the beginning of this cycle as the new start point.
*/
-
int
Session::send_full_time_code(nframes_t nframes)
{
@@ -835,8 +834,7 @@ Session::send_full_time_code(nframes_t nframes)
return 0;
}
-
-/** Sends MTC (quarter-frame) messages for this cycle.
+/** Send MTC (quarter-frame) messages for this cycle.
* Must be called exactly once per cycle from the audio thread. Realtime safe.
* This function assumes the state of full SMPTE is sane, eg. the slave is
* expecting quarter frame messages and has the right frame of reference (any
diff --git a/libs/midi++2/jack_midiport.cc b/libs/midi++2/jack_midiport.cc
index 0f707a4b21..0eb867ebe7 100644
--- a/libs/midi++2/jack_midiport.cc
+++ b/libs/midi++2/jack_midiport.cc
@@ -89,6 +89,12 @@ JACK_MidiPort::cycle_start (nframes_t nframes)
}
}
+void
+JACK_MidiPort::cycle_end ()
+{
+ flush(jack_port_get_buffer(_jack_output_port, _nframes_this_cycle));
+}
+
int
JACK_MidiPort::write(byte * msg, size_t msglen, timestamp_t timestamp)
{
@@ -102,8 +108,7 @@ JACK_MidiPort::write(byte * msg, size_t msglen, timestamp_t timestamp)
non_process_thread_fifo.get_write_vector (&vec);
if (vec.len[0] + vec.len[1] < 1) {
- error << "no space in FIFO for non-process thread MIDI write"
- << endmsg;
+ error << "no space in FIFO for non-process thread MIDI write" << endmsg;
return 0;
}
diff --git a/libs/midi++2/midi++/jack.h b/libs/midi++2/midi++/jack.h
index 01f96671be..255264b1d8 100644
--- a/libs/midi++2/midi++/jack.h
+++ b/libs/midi++2/midi++/jack.h
@@ -53,6 +53,7 @@ public:
virtual int selectable() const { return -1; }
virtual void cycle_start(nframes_t nframes);
+ virtual void cycle_end();
static std::string typestring;
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index 9f6441eb4b..fbf27e18c7 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -125,8 +125,7 @@ GenericMidiControlProtocol::_send_feedback ()
return;
}
- // FIXME
- //_port->write (buf, (int32_t) (end - buf));
+ _port->write (buf, (int32_t) (end - buf), 0);
}
bool
diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc
index 7bf730b0f5..1a044d8ef3 100644
--- a/libs/surfaces/generic_midi/midicontrollable.cc
+++ b/libs/surfaces/generic_midi/midicontrollable.cc
@@ -98,8 +98,6 @@ MIDIControllable::stop_learning ()
void
MIDIControllable::drop_external_control ()
{
- cerr << "Dropping existing control using " << connections << " connections\n";
-
if (connections > 0) {
midi_sense_connection[0].disconnect ();
}
@@ -286,8 +284,6 @@ MIDIControllable::bind_midi (channel_t chn, eventType ev, MIDI::byte additional)
default:
break;
}
-
- cerr << "MIDI bound with " << connections << endl;
}
void
@@ -303,7 +299,7 @@ MIDIControllable::send_feedback ()
msg[1] = control_additional;
msg[2] = (byte) (controllable.get_value() * 127.0f);
- //_port.write (msg, 3);
+ _port.write (msg, 3, 0);
}
MIDI::byte*