MachineControl::CommandSignature MMC_CommandSignature;
MachineControl::ResponseSignature MMC_ResponseSignature;
-MultiAllocSingleReleasePool Session::MIDIRequest::pool ("midi", sizeof (Session::MIDIRequest), 256);
+MultiAllocSingleReleasePool Session::MIDIRequest::pool ("midi", sizeof (Session::MIDIRequest), 1024);
int
Session::use_config_midi_ports ()
poke_midi_thread ();
if (_midi_port) {
- LockMonitor lm (route_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (route_lock, false, __LINE__, __FILE__);
for (RouteList::iterator i = routes.begin(); i != routes.end(); ++i) {
(*i)->reset_midi_control (_midi_port, midi_control);
}
{
if (midi_feedback) {
// send out current state of all routes
- LockMonitor lm (route_lock, __LINE__, __FILE__);
+ RWLockMonitor lm (route_lock, false, __LINE__, __FILE__);
for (RouteList::iterator i = routes.begin(); i != routes.end(); ++i) {
(*i)->send_all_midi_feedback ();
}
save_state ("", true);
atomic_set (&_record_status, Enabled);
- RecordEnabled (); /* EMIT SIGNAL */
+ RecordStateChanged (); /* EMIT SIGNAL */
request_transport_speed (1.0);
Session::mmc_record_exit (MIDI::MachineControl &mmc)
{
if (mmc_control) {
- disable_record ();
+ disable_record (false);
}
}
{
if (mmc_control) {
- /* don't take route or diskstream lock: if using dynamic punch,
- this could cause a dropout. XXX is that really OK?
- or should we queue a rec-enable request?
- */
-
- size_t n;
RouteList::iterator i;
-
- for (n = 0, i = routes.begin(); i != routes.end(); ++i) {
+ RWLockMonitor (route_lock, false, __LINE__, __FILE__);
+
+ for (i = routes.begin(); i != routes.end(); ++i) {
AudioTrack *at;
if ((at = dynamic_cast<AudioTrack*>(*i)) != 0) {
- if (n++ == trk) {
+ if (trk == at->remote_control_id()) {
at->set_record_enable (enabled, &mmc);
break;
}
}
}
+ // Compensate for audio latency
+ outbound_mtc_smpte_frame += _worst_output_latency;
+
next_quarter_frame_to_send = 0;
// Sync slave to the same smpte time as we are on (except if negative, see above)
smpte_increment( transmitting_smpte_time );
// Re-calculate timing of first quarter frame
smpte_to_sample( transmitting_smpte_time, outbound_mtc_smpte_frame, true /* use_offset */, false );
+ // Compensate for audio latency
+ outbound_mtc_smpte_frame += _worst_output_latency;
}
}
}
bool restart;
vector<MIDI::Port*> ports;
- PBD::ThreadCreated (pthread_self(), X_("MIDI"));
+ PBD::ThreadCreatedWithRequestSize (pthread_self(), X_("MIDI"), 2048);
memset (&rtparam, 0, sizeof (rtparam));
rtparam.sched_priority = 9; /* XXX should be relative to audio (JACK) thread */
tmp = i;
++tmp;
- if (!(*i)) {
+ if (!(*i)()) {
midi_timeouts.erase (i);
}