summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-04-24 20:27:13 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-04-24 20:27:13 +0000
commit72678cc230e58d84126c0e35bec27965a1be0be2 (patch)
tree75c9b08406d86640611d63b10a5a76ea68db8fe2
parent2171bba037810d3e4294b64a664b6b8e083890b6 (diff)
revert previous commit (it should work, but did not); minor tweaks elsewhere
git-svn-id: svn://localhost/ardour2/branches/3.0@12084 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/session.cc2
-rw-r--r--libs/ardour/session_process.cc1
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc16
3 files changed, 15 insertions, 4 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 3f3b6eb001..1192e898f6 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -538,7 +538,7 @@ Session::when_engine_running ()
BootMessage (_("Setup signal flow and plugins"));
-/* Reset all panners */
+ /* Reset all panners */
Delivery::reset_panners ();
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index c8f76f3d70..c002cc9008 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -96,7 +96,6 @@ Session::process (pframes_t nframes)
}
SendFeedback (); /* EMIT SIGNAL */
-
}
int
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index ae962feddc..62d7b8158b 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -68,20 +68,26 @@ GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s)
_current_bank = 0;
_bank_size = 0;
- /* XXX is it right to do all these in the same thread as whatever emits the signal? */
+ /* these signals are emitted by the MidiControlUI's event loop thread
+ * and we may as well handle them right there in the same the same
+ * thread
+ */
Controllable::StartLearning.connect_same_thread (*this, boost::bind (&GenericMidiControlProtocol::start_learning, this, _1));
Controllable::StopLearning.connect_same_thread (*this, boost::bind (&GenericMidiControlProtocol::stop_learning, this, _1));
Controllable::CreateBinding.connect_same_thread (*this, boost::bind (&GenericMidiControlProtocol::create_binding, this, _1, _2, _3));
Controllable::DeleteBinding.connect_same_thread (*this, boost::bind (&GenericMidiControlProtocol::delete_binding, this, _1));
+ Session::SendFeedback.connect (*this, MISSING_INVALIDATOR, ui_bind (&GenericMidiControlProtocol::send_feedback, this), midi_ui_context());;
+#if 0
+ /* XXXX SOMETHING GOES WRONG HERE (april 2012) - STILL DEBUGGING */
/* this signal is emitted by the process() callback, and if
* send_feedback() is going to do anything, it should do it in the
* context of the process() callback itself.
*/
Session::SendFeedback.connect_same_thread (*this, boost::bind (&GenericMidiControlProtocol::send_feedback, this));
-
+#endif
/* this one is cross-thread */
Route::RemoteControlIDChange.connect (*this, MISSING_INVALIDATOR, ui_bind (&GenericMidiControlProtocol::reset_controllables, this), midi_ui_context());
@@ -244,6 +250,9 @@ GenericMidiControlProtocol::set_feedback_interval (microseconds_t ms)
void
GenericMidiControlProtocol::send_feedback ()
{
+ /* This is executed in RT "process" context", so no blocking calls
+ */
+
if (!do_feedback) {
return;
}
@@ -264,6 +273,9 @@ GenericMidiControlProtocol::send_feedback ()
void
GenericMidiControlProtocol::_send_feedback ()
{
+ /* This is executed in RT "process" context", so no blocking calls
+ */
+
const int32_t bufsize = 16 * 1024; /* XXX too big */
MIDI::byte buf[bufsize];
int32_t bsize = bufsize;