XMLNode *child;
nlist = node.children();
+
+ if (version >= 3000) {
+ if ((child = find_named_node (node, X_("Diskstream"))) != 0) {
+ boost::shared_ptr<MidiDiskstream> ds (new MidiDiskstream (_session, *child));
+ ds->do_refill_with_alloc ();
+ set_diskstream (ds);
+ }
+ }
+
+ /* set rec-enable control *AFTER* setting up diskstream, because it may want to operate
+ on the diskstream as it sets its own state
+ */
+
for (niter = nlist.begin(); niter != nlist.end(); ++niter){
child = *niter;
}
}
- if (version >= 3000) {
- if ((child = find_named_node (node, X_("Diskstream"))) != 0) {
- boost::shared_ptr<MidiDiskstream> ds (new MidiDiskstream (_session, *child));
- ds->do_refill_with_alloc ();
- set_diskstream (ds);
- }
- }
-
pending_state = const_cast<XMLNode*> (&node);
if (_session.state_of_the_state() & Session::Loading) {
}
int
-MidiTrack::roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
+MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
bool can_record, bool rec_monitors_input, bool& needs_butler)
{
Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
return 0;
}
- nframes_t transport_frame = _session.transport_frame();
-
+ framepos_t transport_frame = _session.transport_frame();
if ((nframes = check_initial_delay (nframes, transport_frame)) == 0) {
/* need to do this so that the diskstream sets its
write_out_of_band_data (bufs, start_frame, end_frame, nframes);
- process_output_buffers (bufs, start_frame, end_frame, nframes,
- (!_session.get_record_enabled() || !Config->get_do_not_record_plugins()), declick);
+ /* final argument: don't waste time with automation if we're recording or we've just stopped (yes it can happen) */
+ process_output_buffers (bufs, start_frame, end_frame, nframes,
+ (!_session.get_record_enabled() || !Config->get_do_not_record_plugins()), declick,
+ (!diskstream->record_enabled() && !_session.transport_stopped()));
}
_main_outs->flush_buffers (nframes, end_frame - start_frame - 1);
}
int
-MidiTrack::no_roll (nframes_t nframes, framepos_t start_frame, framepos_t end_frame,
+MidiTrack::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
bool state_changing, bool can_record, bool rec_monitors_input)
{
int ret = Track::no_roll (nframes, start_frame, end_frame, state_changing, can_record, rec_monitors_input);
}
void
-MidiTrack::handle_transport_stopped (bool abort, bool did_locate, bool flush_processors)
+MidiTrack::realtime_handle_transport_stopped ()
{
- Route::handle_transport_stopped (abort, did_locate, flush_processors);
+ Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+ if (!lm.locked ()) {
+ return;
+ }
+
+ for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
+ (*i)->realtime_handle_transport_stopped ();
+ }
}
void
-MidiTrack::push_midi_input_to_step_edit_ringbuffer (nframes_t nframes)
+MidiTrack::push_midi_input_to_step_edit_ringbuffer (framecnt_t nframes)
{
PortSet& ports (_input->ports());
for (MidiBuffer::const_iterator e = mb->begin(); e != mb->end(); ++e) {
- const Evoral::MIDIEvent<nframes_t> ev(*e, false);
+ const Evoral::MIDIEvent<framepos_t> ev(*e, false);
/* note on, since for step edit, note length is determined
elsewhere
}
void
-MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framepos_t /*end*/, nframes_t nframes)
+MidiTrack::write_out_of_band_data (BufferSet& bufs, framepos_t /*start*/, framepos_t /*end*/, framecnt_t nframes)
{
// Append immediate events
MidiBuffer& buf (bufs.get_midi (0));
}
int
-MidiTrack::export_stuff (BufferSet& /*bufs*/, nframes_t /*nframes*/, framepos_t /*end_frame*/)
+MidiTrack::export_stuff (BufferSet& /*bufs*/, framecnt_t /*nframes*/, framepos_t /*end_frame*/)
{
return -1;
}
void
-MidiTrack::set_latency_delay (nframes_t longest_session_latency)
+MidiTrack::set_latency_delay (framecnt_t longest_session_latency)
{
Route::set_latency_delay (longest_session_latency);
_diskstream->set_roll_delay (_roll_delay);
boost::shared_ptr<Region>
-MidiTrack::bounce_range (nframes_t /*start*/, nframes_t /*end*/, InterThreadInfo& /*itt*/, bool /*enable_processing*/)
+MidiTrack::bounce_range (framepos_t /*start*/, framepos_t /*end*/, InterThreadInfo& /*itt*/, bool /*enable_processing*/)
{
throw;
//vector<MidiSource*> srcs;