mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
Remove code related to capture-offset.
This commit is contained in:
parent
d98f87d542
commit
2fa1f1b0b3
5 changed files with 18 additions and 105 deletions
|
|
@ -87,8 +87,6 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor
|
|||
|
||||
PBD::Signal0<void> AlignmentStyleChanged;
|
||||
|
||||
void set_input_latency (samplecnt_t);
|
||||
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
std::list<boost::shared_ptr<Source> >& last_capture_sources () { return _last_capture_sources; }
|
||||
|
|
@ -114,9 +112,6 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor
|
|||
virtual void request_input_monitoring (bool) {}
|
||||
virtual void ensure_input_monitoring (bool) {}
|
||||
|
||||
samplecnt_t capture_offset() const { return _capture_offset; }
|
||||
virtual void set_capture_offset ();
|
||||
|
||||
int seek (samplepos_t sample, bool complete_refill);
|
||||
|
||||
static PBD::Signal0<void> Overrun;
|
||||
|
|
@ -132,8 +127,6 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor
|
|||
PBD::Signal0<void> RecordEnableChanged;
|
||||
PBD::Signal0<void> RecordSafeChanged;
|
||||
|
||||
void check_record_status (samplepos_t transport_sample, bool can_record);
|
||||
|
||||
void transport_looped (samplepos_t transport_sample);
|
||||
void transport_stopped_wallclock (struct tm&, time_t, bool abort);
|
||||
|
||||
|
|
@ -148,7 +141,6 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor
|
|||
void set_align_style_from_io();
|
||||
void setup_destructive_playlist ();
|
||||
void use_destructive_playlist ();
|
||||
void prepare_to_stop (samplepos_t transport_pos, samplepos_t audible_sample);
|
||||
|
||||
void engage_record_enable ();
|
||||
void disengage_record_enable ();
|
||||
|
|
@ -172,8 +164,6 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor
|
|||
samplepos_t capture_start_sample;
|
||||
samplecnt_t capture_captured;
|
||||
bool was_recording;
|
||||
samplecnt_t adjust_capture_position;
|
||||
samplecnt_t _capture_offset;
|
||||
samplepos_t first_recordable_sample;
|
||||
samplepos_t last_recordable_sample;
|
||||
int last_possibly_recording;
|
||||
|
|
@ -197,6 +187,7 @@ class LIBARDOUR_API DiskWriter : public DiskIOProcessor
|
|||
MidiBuffer _gui_feed_buffer;
|
||||
mutable Glib::Threads::Mutex _gui_feed_buffer_mutex;
|
||||
|
||||
void check_record_status (samplepos_t transport_sample, double speed, bool can_record);
|
||||
void finish_capture (boost::shared_ptr<ChannelList> c);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ class LIBARDOUR_API Track : public Route, public Recordable
|
|||
bool realtime_speed_change ();
|
||||
void transport_stopped_wallclock (struct tm &, time_t, bool);
|
||||
bool pending_overwrite () const;
|
||||
void prepare_to_stop (samplepos_t, samplepos_t);
|
||||
void set_slaved (bool);
|
||||
ChanCount n_channels ();
|
||||
samplepos_t get_capture_start_sample (uint32_t n = 0) const;
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@ DiskWriter::DiskWriter (Session& s, string const & str, DiskIOProcessor::Flag f)
|
|||
, capture_start_sample (0)
|
||||
, capture_captured (0)
|
||||
, was_recording (false)
|
||||
, adjust_capture_position (0)
|
||||
, _capture_offset (0)
|
||||
, first_recordable_sample (max_samplepos)
|
||||
, last_recordable_sample (max_samplepos)
|
||||
, last_possibly_recording (0)
|
||||
|
|
@ -88,7 +86,7 @@ DiskWriter::set_write_source_name (string const & str)
|
|||
}
|
||||
|
||||
void
|
||||
DiskWriter::check_record_status (samplepos_t transport_sample, bool can_record)
|
||||
DiskWriter::check_record_status (samplepos_t transport_sample, double speed, bool can_record)
|
||||
{
|
||||
int possibly_recording;
|
||||
int rolling;
|
||||
|
|
@ -110,34 +108,28 @@ DiskWriter::check_record_status (samplepos_t transport_sample, bool can_record)
|
|||
return;
|
||||
}
|
||||
|
||||
const samplecnt_t existing_material_offset = _session.worst_playback_latency();
|
||||
|
||||
if (possibly_recording == fully_rec_enabled) {
|
||||
|
||||
if (last_possibly_recording == fully_rec_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
capture_start_sample = _session.transport_sample();
|
||||
first_recordable_sample = capture_start_sample + _capture_offset;
|
||||
last_recordable_sample = max_samplepos;
|
||||
capture_start_sample = transport_sample;
|
||||
first_recordable_sample = capture_start_sample + _input_latency;
|
||||
if (_alignment_style == ExistingMaterial) {
|
||||
// XXX
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::CaptureAlignment, string_compose ("%1: @ %7 (%9) FRF = %2 CSF = %4 CO = %5, EMO = %6 RD = %8 WOL %10 WTL %11\n",
|
||||
name(), first_recordable_sample, last_recordable_sample, capture_start_sample,
|
||||
_capture_offset,
|
||||
existing_material_offset,
|
||||
transport_sample,
|
||||
_session.transport_sample(),
|
||||
_session.worst_output_latency(),
|
||||
_session.worst_track_latency()));
|
||||
DEBUG_TRACE (DEBUG::CaptureAlignment, string_compose ("%1: @ %7 (%9) FRF = %2 CSF = %4 CO = %5, EMO = %6 RD = %8 WOL %10 WTL %11\n",
|
||||
name(), first_recordable_sample, last_recordable_sample, capture_start_sample,
|
||||
0,
|
||||
0,
|
||||
transport_sample,
|
||||
_session.transport_sample(),
|
||||
_session.worst_output_latency(),
|
||||
_session.worst_track_latency()));
|
||||
|
||||
|
||||
if (_alignment_style == ExistingMaterial) {
|
||||
first_recordable_sample += existing_material_offset;
|
||||
DEBUG_TRACE (DEBUG::CaptureAlignment, string_compose ("\tshift FRF by EMO %1\n",
|
||||
first_recordable_sample));
|
||||
}
|
||||
|
||||
prepare_record_status (capture_start_sample);
|
||||
|
||||
} else {
|
||||
|
|
@ -156,10 +148,10 @@ DiskWriter::check_record_status (samplepos_t transport_sample, bool can_record)
|
|||
} else {
|
||||
/* punch out */
|
||||
|
||||
last_recordable_sample = _session.transport_sample() + _capture_offset;
|
||||
last_recordable_sample = _session.transport_sample();
|
||||
|
||||
if (_alignment_style == ExistingMaterial) {
|
||||
last_recordable_sample += existing_material_offset;
|
||||
//XXX
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -217,29 +209,6 @@ DiskWriter::calculate_record_range (Evoral::OverlapType ot, samplepos_t transpor
|
|||
first_recordable_sample, last_recordable_sample, rec_nframes, rec_offset));
|
||||
}
|
||||
|
||||
void
|
||||
DiskWriter::prepare_to_stop (samplepos_t transport_sample, samplepos_t audible_sample)
|
||||
{
|
||||
switch (_alignment_style) {
|
||||
case ExistingMaterial:
|
||||
last_recordable_sample = transport_sample + _capture_offset;
|
||||
DEBUG_TRACE (DEBUG::CaptureAlignment, string_compose("%1: prepare to stop sets last recordable sample to %2 + %3 = %4\n", _name, transport_sample, _capture_offset, last_recordable_sample));
|
||||
break;
|
||||
|
||||
case CaptureTime:
|
||||
last_recordable_sample = audible_sample; // note that capture_offset is zero
|
||||
/* we may already have captured audio before the last_recordable_sample (audible sample),
|
||||
so deal with this.
|
||||
*/
|
||||
if (last_recordable_sample > capture_start_sample) {
|
||||
capture_captured = min (capture_captured, last_recordable_sample - capture_start_sample);
|
||||
}
|
||||
DEBUG_TRACE (DEBUG::CaptureAlignment, string_compose("%1: prepare to stop sets last recordable sample to audible sample @ %2\n", _name, audible_sample));
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
DiskWriter::engage_record_enable ()
|
||||
{
|
||||
|
|
@ -293,31 +262,6 @@ DiskWriter::get_captured_samples (uint32_t n) const
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
DiskWriter::set_input_latency (samplecnt_t l)
|
||||
{
|
||||
Processor::set_input_latency (l);
|
||||
set_capture_offset ();
|
||||
}
|
||||
|
||||
void
|
||||
DiskWriter::set_capture_offset ()
|
||||
{
|
||||
switch (_alignment_style) {
|
||||
case ExistingMaterial:
|
||||
_capture_offset = _input_latency;
|
||||
break;
|
||||
|
||||
case CaptureTime:
|
||||
default:
|
||||
_capture_offset = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::CaptureAlignment, string_compose ("%1: using input latency %4, capture offset set to %2 with style = %3\n", name(), _capture_offset, enum_2_string (_alignment_style), _input_latency));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DiskWriter::set_align_style (AlignStyle a, bool force)
|
||||
{
|
||||
|
|
@ -327,7 +271,6 @@ DiskWriter::set_align_style (AlignStyle a, bool force)
|
|||
|
||||
if ((a != _alignment_style) || force) {
|
||||
_alignment_style = a;
|
||||
set_capture_offset ();
|
||||
AlignmentStyleChanged ();
|
||||
}
|
||||
}
|
||||
|
|
@ -428,7 +371,7 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
|
||||
_need_butler = false;
|
||||
|
||||
check_record_status (start_sample, can_record);
|
||||
check_record_status (start_sample, 1, can_record);
|
||||
|
||||
if (nframes == 0) {
|
||||
return;
|
||||
|
|
@ -452,8 +395,6 @@ DiskWriter::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
get_location_times (loop_loc, &loop_start, &loop_end, &loop_length);
|
||||
}
|
||||
|
||||
adjust_capture_position = 0;
|
||||
|
||||
if (nominally_recording || (re && was_recording && _session.get_record_enabled() && (_session.config.get_punch_in() || _session.preroll_record_punch_enabled()))) {
|
||||
|
||||
Evoral::OverlapType ot = Evoral::coverage (first_recordable_sample, last_recordable_sample, start_sample, end_sample);
|
||||
|
|
|
|||
|
|
@ -1590,13 +1590,6 @@ Session::stop_transport (bool abort, bool clear_state)
|
|||
boost::shared_ptr<RouteList> rl = routes.reader();
|
||||
samplepos_t stop_target = audible_sample();
|
||||
|
||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
||||
if (tr) {
|
||||
tr->prepare_to_stop (_transport_sample, stop_target);
|
||||
}
|
||||
}
|
||||
|
||||
SubState new_bits;
|
||||
|
||||
if (actively_recording() && /* we are recording */
|
||||
|
|
|
|||
|
|
@ -425,8 +425,6 @@ Track::no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sam
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool can_record = _session.actively_recording ();
|
||||
|
||||
/* no outputs? nothing to do ... what happens if we have sends etc. ? */
|
||||
|
||||
if (n_outputs().n_total() == 0 && !ARDOUR::Profile->get_mixbus()) {
|
||||
|
|
@ -460,10 +458,7 @@ Track::no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sam
|
|||
*/
|
||||
}
|
||||
|
||||
_disk_writer->check_record_status (start_sample, can_record);
|
||||
|
||||
bool be_silent;
|
||||
|
||||
MonitorState const s = monitoring_state ();
|
||||
/* we are not rolling, so be silent even if we are monitoring disk, as there
|
||||
will be no disk data coming in.
|
||||
|
|
@ -740,12 +735,6 @@ Track::pending_overwrite () const
|
|||
return _disk_reader->pending_overwrite ();
|
||||
}
|
||||
|
||||
void
|
||||
Track::prepare_to_stop (samplepos_t t, samplepos_t a)
|
||||
{
|
||||
_disk_writer->prepare_to_stop (t, a);
|
||||
}
|
||||
|
||||
void
|
||||
Track::set_slaved (bool s)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue