mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 09:06:33 +01:00
NO-OP: clang-format, whitespace
This commit is contained in:
parent
ed7683d029
commit
d85277f532
1 changed files with 37 additions and 43 deletions
|
|
@ -186,7 +186,6 @@ DiskReader::set_state (const XMLNode& node, int version)
|
||||||
void
|
void
|
||||||
DiskReader::realtime_handle_transport_stopped ()
|
DiskReader::realtime_handle_transport_stopped ()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (_session.exporting () && !_session.realtime_export ()) {
|
if (_session.exporting () && !_session.realtime_export ()) {
|
||||||
_declick_amp.set_gain (0);
|
_declick_amp.set_gain (0);
|
||||||
}
|
}
|
||||||
|
|
@ -278,10 +277,10 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
||||||
ChannelList::const_iterator chan;
|
ChannelList::const_iterator chan;
|
||||||
sampleoffset_t disk_samples_to_consume;
|
sampleoffset_t disk_samples_to_consume;
|
||||||
MonitorState ms = _track.monitoring_state ();
|
MonitorState ms = _track.monitoring_state ();
|
||||||
const bool midi_only = (c->empty() || !_playlists[DataType::AUDIO]);
|
const bool midi_only = (c->empty () || !_playlists[DataType::AUDIO]);
|
||||||
bool no_disk_output = _no_disk_output.load () != 0;
|
bool no_disk_output = _no_disk_output.load () != 0;
|
||||||
|
|
||||||
if (!check_active()) {
|
if (!check_active ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -397,7 +396,7 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
||||||
Location* loc = _loop_location;
|
Location* loc = _loop_location;
|
||||||
if (loc) {
|
if (loc) {
|
||||||
Temporal::Range loop_range (loc->start (), loc->end ());
|
Temporal::Range loop_range (loc->start (), loc->end ());
|
||||||
ss = loop_range.squish (timepos_t (playback_sample)).samples();
|
ss = loop_range.squish (timepos_t (playback_sample)).samples ();
|
||||||
playback_sample = ss;
|
playback_sample = ss;
|
||||||
}
|
}
|
||||||
if (ss != playback_sample) {
|
if (ss != playback_sample) {
|
||||||
|
|
@ -489,7 +488,7 @@ midi:
|
||||||
Location* loc = _loop_location;
|
Location* loc = _loop_location;
|
||||||
if (loc) {
|
if (loc) {
|
||||||
Temporal::Range loop_range (loc->start (), loc->end ());
|
Temporal::Range loop_range (loc->start (), loc->end ());
|
||||||
playback_sample = loop_range.squish (timepos_t (playback_sample)).samples();
|
playback_sample = loop_range.squish (timepos_t (playback_sample)).samples ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_playlists[DataType::AUDIO]) {
|
if (_playlists[DataType::AUDIO]) {
|
||||||
|
|
@ -537,7 +536,7 @@ DiskReader::configuration_changed ()
|
||||||
if (!c->empty ()) {
|
if (!c->empty ()) {
|
||||||
ReaderChannelInfo* chaninfo = dynamic_cast<ReaderChannelInfo*> (c->front ());
|
ReaderChannelInfo* chaninfo = dynamic_cast<ReaderChannelInfo*> (c->front ());
|
||||||
if (!chaninfo->initialized) {
|
if (!chaninfo->initialized) {
|
||||||
seek (_session.transport_sample(), true);
|
seek (_session.transport_sample (), true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -558,7 +557,6 @@ DiskReader::set_pending_overwrite (OverwriteReason why)
|
||||||
/* called from audio thread, so we can use the read ptr and playback sample as we wish */
|
/* called from audio thread, so we can use the read ptr and playback sample as we wish */
|
||||||
|
|
||||||
if (!c->empty ()) {
|
if (!c->empty ()) {
|
||||||
|
|
||||||
if (c->size () > 1) {
|
if (c->size () > 1) {
|
||||||
/* Align newly added buffers.
|
/* Align newly added buffers.
|
||||||
*
|
*
|
||||||
|
|
@ -690,10 +688,10 @@ DiskReader::overwrite_existing_audio ()
|
||||||
size_t chunk1_cnt;
|
size_t chunk1_cnt;
|
||||||
size_t chunk2_cnt;
|
size_t chunk2_cnt;
|
||||||
|
|
||||||
const size_t to_overwrite = c->front()->rbuf->overwritable_at (overwrite_offset);
|
const size_t to_overwrite = c->front ()->rbuf->overwritable_at (overwrite_offset);
|
||||||
|
|
||||||
chunk1_offset = overwrite_offset;
|
chunk1_offset = overwrite_offset;
|
||||||
chunk1_cnt = min (c->front()->rbuf->bufsize() - (size_t) overwrite_offset, to_overwrite);
|
chunk1_cnt = min (c->front ()->rbuf->bufsize () - (size_t)overwrite_offset, to_overwrite);
|
||||||
|
|
||||||
/* note: because we are overwriting buffer contents but not moving the
|
/* note: because we are overwriting buffer contents but not moving the
|
||||||
* write/read pointers, we actually want to fill all the way to the
|
* write/read pointers, we actually want to fill all the way to the
|
||||||
|
|
@ -717,7 +715,6 @@ DiskReader::overwrite_existing_audio ()
|
||||||
samplepos_t start;
|
samplepos_t start;
|
||||||
|
|
||||||
for (auto const& chan : *c) {
|
for (auto const& chan : *c) {
|
||||||
|
|
||||||
Sample* buf = chan->rbuf->buffer ();
|
Sample* buf = chan->rbuf->buffer ();
|
||||||
ReaderChannelInfo* rci = dynamic_cast<ReaderChannelInfo*> (chan);
|
ReaderChannelInfo* rci = dynamic_cast<ReaderChannelInfo*> (chan);
|
||||||
|
|
||||||
|
|
@ -728,16 +725,15 @@ DiskReader::overwrite_existing_audio ()
|
||||||
start = overwrite_sample;
|
start = overwrite_sample;
|
||||||
|
|
||||||
if (chunk1_cnt) {
|
if (chunk1_cnt) {
|
||||||
if (audio_read (buf + chunk1_offset, mixdown_buffer.get (), gain_buffer.get (), start, chunk1_cnt, rci, n, reversed) != (samplecnt_t) chunk1_cnt) {
|
if (audio_read (buf + chunk1_offset, mixdown_buffer.get (), gain_buffer.get (), start, chunk1_cnt, rci, n, reversed) != (samplecnt_t)chunk1_cnt) {
|
||||||
error << string_compose (_("DiskReader %1: when overwriting(1), cannot read %2 from playlist at sample %3"), id (), chunk1_cnt, overwrite_sample) << endmsg;
|
error << string_compose (_("DiskReader %1: when overwriting(1), cannot read %2 from playlist at sample %3"), id (), chunk1_cnt, overwrite_sample) << endmsg;
|
||||||
ret = false;
|
ret = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chunk2_cnt) {
|
if (chunk2_cnt) {
|
||||||
if (audio_read (buf, mixdown_buffer.get (), gain_buffer.get (), start, chunk2_cnt, rci, n, reversed) != (samplecnt_t) chunk2_cnt) {
|
if (audio_read (buf, mixdown_buffer.get (), gain_buffer.get (), start, chunk2_cnt, rci, n, reversed) != (samplecnt_t)chunk2_cnt) {
|
||||||
error << string_compose (_("DiskReader %1: when overwriting(2), cannot read %2 from playlist at sample %3"), id (), chunk2_cnt, overwrite_sample) << endmsg;
|
error << string_compose (_("DiskReader %1: when overwriting(2), cannot read %2 from playlist at sample %3"), id (), chunk2_cnt, overwrite_sample) << endmsg;
|
||||||
ret = false;
|
ret = false;
|
||||||
}
|
}
|
||||||
|
|
@ -837,7 +833,7 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((size_t) abs (sample - playback_sample) < (c->front ()->rbuf->reserved_size () / 6)) {
|
if ((size_t)abs (sample - playback_sample) < (c->front ()->rbuf->reserved_size () / 6)) {
|
||||||
/* we're close enough. Note: this is a heuristic */
|
/* we're close enough. Note: this is a heuristic */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -865,7 +861,7 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
||||||
* samples.
|
* samples.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const samplecnt_t rsize = (samplecnt_t) c->front()->rbuf->reservation_size();
|
const samplecnt_t rsize = (samplecnt_t)c->front ()->rbuf->reservation_size ();
|
||||||
samplecnt_t shift = (sample > rsize ? rsize : sample);
|
samplecnt_t shift = (sample > rsize ? rsize : sample);
|
||||||
|
|
||||||
if (read_reversed) {
|
if (read_reversed) {
|
||||||
|
|
@ -945,7 +941,7 @@ DiskReader::internal_playback_seek (sampleoffset_t distance)
|
||||||
std::shared_ptr<ChannelList const> c = channels.reader ();
|
std::shared_ptr<ChannelList const> c = channels.reader ();
|
||||||
for (auto const& chan : *c) {
|
for (auto const& chan : *c) {
|
||||||
if (distance < 0) {
|
if (distance < 0) {
|
||||||
off = 0 - (sampleoffset_t) chan->rbuf->decrement_read_ptr (::llabs (distance));
|
off = 0 - (sampleoffset_t)chan->rbuf->decrement_read_ptr (::llabs (distance));
|
||||||
} else {
|
} else {
|
||||||
off = chan->rbuf->increment_read_ptr (distance);
|
off = chan->rbuf->increment_read_ptr (distance);
|
||||||
}
|
}
|
||||||
|
|
@ -997,7 +993,6 @@ DiskReader::audio_read (Sample* sum_buffer,
|
||||||
/* XXX we don't currently play loops in reverse. not sure why */
|
/* XXX we don't currently play loops in reverse. not sure why */
|
||||||
|
|
||||||
if (!reversed) {
|
if (!reversed) {
|
||||||
|
|
||||||
/* Make the use of a Location atomic for this read operation.
|
/* Make the use of a Location atomic for this read operation.
|
||||||
|
|
||||||
Note: Locations don't get deleted, so all we care about
|
Note: Locations don't get deleted, so all we care about
|
||||||
|
|
@ -1010,12 +1005,11 @@ DiskReader::audio_read (Sample* sum_buffer,
|
||||||
loop_start = loc->start_sample ();
|
loop_start = loc->start_sample ();
|
||||||
loop_end = loc->end_sample ();
|
loop_end = loc->end_sample ();
|
||||||
|
|
||||||
const Temporal::Range loop_range (loc->start(), loc->end());
|
const Temporal::Range loop_range (loc->start (), loc->end ());
|
||||||
start = loop_range.squish (timepos_t (start)).samples();
|
start = loop_range.squish (timepos_t (start)).samples ();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
start -= cnt;
|
start -= cnt;
|
||||||
start = max (samplepos_t (0), start);
|
start = max (samplepos_t (0), start);
|
||||||
}
|
}
|
||||||
|
|
@ -1315,7 +1309,7 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!rci->initialized) {
|
if (!rci->initialized) {
|
||||||
DEBUG_TRACE (DEBUG::DiskIO, string_compose (" -- Init ReaderChannel '%1' read: %2 samples, at: %4, avail: %5\n", name (), to_read, file_sample_tmp , rci->rbuf->read_space ()));
|
DEBUG_TRACE (DEBUG::DiskIO, string_compose (" -- Init ReaderChannel '%1' read: %2 samples, at: %4, avail: %5\n", name (), to_read, file_sample_tmp, rci->rbuf->read_space ()));
|
||||||
rci->initialized = true;
|
rci->initialized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1473,18 +1467,18 @@ DiskReader::get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, sample
|
||||||
* if start_sample = 1000; squish() does nothing because 1000 < 1000.12.
|
* if start_sample = 1000; squish() does nothing because 1000 < 1000.12.
|
||||||
* This is solved by creating the range using (rounded) sample-times.
|
* This is solved by creating the range using (rounded) sample-times.
|
||||||
*/
|
*/
|
||||||
const Temporal::Range loop_range (loc->start ().samples(), loc->end ().samples());
|
const Temporal::Range loop_range (loc->start ().samples (), loc->end ().samples ());
|
||||||
samplepos_t effective_start = start_sample;
|
samplepos_t effective_start = start_sample;
|
||||||
samplecnt_t cnt = nframes;
|
samplecnt_t cnt = nframes;
|
||||||
sampleoffset_t offset = 0;
|
sampleoffset_t offset = 0;
|
||||||
const samplepos_t loop_end = loc->end_sample();
|
const samplepos_t loop_end = loc->end_sample ();
|
||||||
|
|
||||||
DEBUG_TRACE (DEBUG::MidiDiskIO, string_compose ("LOOP read, loop is %1..%2 range is %3..%4 nf %5\n", loc->start (), loc->end (), start_sample, end_sample, nframes));
|
DEBUG_TRACE (DEBUG::MidiDiskIO, string_compose ("LOOP read, loop is %1..%2 range is %3..%4 nf %5\n", loc->start (), loc->end (), start_sample, end_sample, nframes));
|
||||||
|
|
||||||
do {
|
do {
|
||||||
samplepos_t effective_end;
|
samplepos_t effective_end;
|
||||||
|
|
||||||
effective_start = loop_range.squish (timepos_t (effective_start)).samples();
|
effective_start = loop_range.squish (timepos_t (effective_start)).samples ();
|
||||||
effective_end = min (effective_start + cnt, loop_end);
|
effective_end = min (effective_start + cnt, loop_end);
|
||||||
assert (effective_end > effective_start);
|
assert (effective_end > effective_start);
|
||||||
|
|
||||||
|
|
@ -1650,11 +1644,11 @@ DiskReader::Declicker::alloc (samplecnt_t sr, bool fadein, bool linear)
|
||||||
if (linear) {
|
if (linear) {
|
||||||
if (fadein) {
|
if (fadein) {
|
||||||
for (samplecnt_t n = 0; n < loop_fade_length; ++n) {
|
for (samplecnt_t n = 0; n < loop_fade_length; ++n) {
|
||||||
vec[n] = n / (float) loop_fade_length;
|
vec[n] = n / (float)loop_fade_length;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (samplecnt_t n = 0; n < loop_fade_length; ++n) {
|
for (samplecnt_t n = 0; n < loop_fade_length; ++n) {
|
||||||
vec[n] = 1.f - n / (float) loop_fade_length;
|
vec[n] = 1.f - n / (float)loop_fade_length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fade_length = loop_fade_length - 1;
|
fade_length = loop_fade_length - 1;
|
||||||
|
|
@ -1943,7 +1937,7 @@ DiskReader::setup_preloop_buffer ()
|
||||||
Location* loc = _loop_location;
|
Location* loc = _loop_location;
|
||||||
boost::scoped_array<Sample> mix_buf (new Sample[loop_fade_length]);
|
boost::scoped_array<Sample> mix_buf (new Sample[loop_fade_length]);
|
||||||
boost::scoped_array<Sample> gain_buf (new Sample[loop_fade_length]);
|
boost::scoped_array<Sample> gain_buf (new Sample[loop_fade_length]);
|
||||||
const timepos_t read_start = timepos_t (loc->start_sample() - loop_declick_out.fade_length);
|
const timepos_t read_start = timepos_t (loc->start_sample () - loop_declick_out.fade_length);
|
||||||
const timecnt_t read_cnt = timecnt_t (loop_declick_out.fade_length);
|
const timecnt_t read_cnt = timecnt_t (loop_declick_out.fade_length);
|
||||||
|
|
||||||
uint32_t channel = 0;
|
uint32_t channel = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue