/* if per-track or global rec-enable turned on while the other was already on, we've started recording */
- if ((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record) ||
+ if (((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record)) ||
((change & global_rec_enabled) && can_record && (!(change & track_rec_enabled) && record_enabled()))) {
/* starting to record: compute first+last frames */
first_recordable_frame = transport_frame + _capture_offset;
+ // cerr << "set FRF = " << transport_frame << " + " << _capture_offset << " = " << first_recordable_frame << endl;
last_recordable_frame = max_frames;
capture_start_frame = transport_frame;
/* was stopped, now rolling (and recording) */
if (_alignment_style == ExistingMaterial) {
- first_recordable_frame += _session.worst_output_latency();
+ //cerr << "A FRF += " << _session.worst_output_latency () << endl;
+ // first_recordable_frame += _session.worst_output_latency();
} else {
- first_recordable_frame += _roll_delay;
+ // cerr << "B FRF += " << _roll_delay<< endl;
+ // first_recordable_frame += _roll_delay;
}
} else {
this is needed.
*/
+ // cerr << "1 FRF += " << _capture_offset << endl;
first_recordable_frame += _capture_offset;
} else {
on the output latency.
*/
+ // cerr << "2 FRF += " << _session.worst_output_latency() << endl;
first_recordable_frame += _session.worst_output_latency();
}
} else {
if (Config->get_punch_in()) {
+ // cerr << "3 FRF += " << _roll_delay << endl;
first_recordable_frame += _roll_delay;
} else {
capture_start_frame -= _roll_delay;
}
+ // cerr << _name << " FRF = " << first_recordable_frame << " CSF = " << capture_start_frame << endl;
+
if (recordable() && destructive()) {
boost::shared_ptr<ChannelList> c = channels.reader();
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
}
int
-AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, nframes_t offset, bool can_record, bool rec_monitors_input)
+AudioDiskstream::process (nframes_t transport_frame, nframes_t nframes, bool can_record, bool rec_monitors_input)
{
uint32_t n;
boost::shared_ptr<ChannelList> c = channels.reader();
rec_offset
*/
- memcpy (chaninfo->current_capture_buffer, _io->input(n)->get_buffer (rec_nframes) + offset + rec_offset, sizeof (Sample) * rec_nframes);
+ memcpy (chaninfo->current_capture_buffer, _io->get_input_buffer (n, rec_nframes) + rec_offset, sizeof (Sample) * rec_nframes);
} else {
goto out;
}
- Sample* buf = _io->input (n)->get_buffer (nframes) + offset;
+ Sample* buf = _io->get_input_buffer (n, nframes);
nframes_t first = chaninfo->capture_vector.len[0];
memcpy (chaninfo->capture_wrap_buffer, buf, sizeof (Sample) * first);
vector.buf[1] = 0;
boost::shared_ptr<ChannelList> c = channels.reader();
- for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
+ int nn = 0;
+ for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++nn) {
(*chan)->capture_buf->get_read_vector (&vector);
boost::shared_ptr<ChannelList> c = channels.reader();
uint32_t n;
- if (!recordable()) {
+ if (!_session.writable() || !recordable()) {
return;
}