mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
NO-OP: whitespace
This commit is contained in:
parent
91a213427e
commit
2377927fc1
1 changed files with 438 additions and 478 deletions
|
|
@ -26,14 +26,14 @@
|
|||
#include "evoral/Range.h"
|
||||
|
||||
#include "ardour/amp.h"
|
||||
#include "ardour/audio_buffer.h"
|
||||
#include "ardour/audioengine.h"
|
||||
#include "ardour/audioplaylist.h"
|
||||
#include "ardour/audio_buffer.h"
|
||||
#include "ardour/butler.h"
|
||||
#include "ardour/debug.h"
|
||||
#include "ardour/disk_reader.h"
|
||||
#include "ardour/midi_ring_buffer.h"
|
||||
#include "ardour/midi_playlist.h"
|
||||
#include "ardour/midi_ring_buffer.h"
|
||||
#include "ardour/midi_track.h"
|
||||
#include "ardour/pannable.h"
|
||||
#include "ardour/playlist.h"
|
||||
|
|
@ -77,7 +77,8 @@ DiskReader::~DiskReader ()
|
|||
void
|
||||
DiskReader::ReaderChannelInfo::resize (samplecnt_t bufsize)
|
||||
{
|
||||
delete rbuf; rbuf = 0;
|
||||
delete rbuf;
|
||||
rbuf = 0;
|
||||
|
||||
rbuf = new PlaybackBuffer<Sample> (bufsize);
|
||||
/* touch memory to lock it */
|
||||
|
|
@ -196,13 +197,13 @@ float
|
|||
DiskReader::buffer_load () const
|
||||
{
|
||||
/* Note: for MIDI it's not trivial to differentiate the following two cases:
|
||||
|
||||
1. The playback buffer is empty because the system has run out of time to fill it.
|
||||
2. The playback buffer is empty because there is no more data on the playlist.
|
||||
|
||||
If we use a simple buffer load computation, we will report that the MIDI diskstream
|
||||
cannot keep up when #2 happens, when in fact it can. Since MIDI data rates
|
||||
are so low compared to audio, just use the audio value here.
|
||||
*
|
||||
* 1. The playback buffer is empty because the system has run out of time to fill it.
|
||||
* 2. The playback buffer is empty because there is no more data on the playlist.
|
||||
*
|
||||
* If we use a simple buffer load computation, we will report that the MIDI diskstream
|
||||
* cannot keep up when #2 happens, when in fact it can. Since MIDI data rates
|
||||
* are so low compared to audio, just use the audio value here.
|
||||
*/
|
||||
|
||||
boost::shared_ptr<ChannelList> c = channels.reader ();
|
||||
|
|
@ -282,18 +283,15 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
bool declick_out = (_declick_amp.gain () != target_gain) && target_gain == 0.0;
|
||||
|
||||
if (!_session.cfg ()->get_use_transport_fades () || (_session.exporting () && !_session.realtime_export ())) {
|
||||
|
||||
/* no transport fades or exporting - no declick out logic */
|
||||
|
||||
_declick_amp.set_gain (target_gain);
|
||||
declick_out = false;
|
||||
|
||||
} else {
|
||||
|
||||
/* using transport fades and not exporting - declick login in effect */
|
||||
|
||||
if (ms == MonitoringDisk) {
|
||||
|
||||
/* Only monitoring from disk, so if we've finished a
|
||||
* declick (for stop/locate), do not accidentally pass
|
||||
* any data from disk to our outputs.
|
||||
|
|
@ -301,8 +299,7 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
|
||||
if ((target_gain == 0.0) && (_declick_amp.gain () == target_gain)) {
|
||||
/* we were heading for zero (declick out for
|
||||
stop), and we've reached there. Done.
|
||||
*/
|
||||
* stop), and we've reached there. Done. */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -337,7 +334,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
}
|
||||
|
||||
if (!result_required || ((ms & MonitoringDisk) == 0) || still_locating || _no_disk_output) {
|
||||
|
||||
/* no need for actual disk data, just advance read pointer */
|
||||
|
||||
if (!still_locating || _no_disk_output) {
|
||||
|
|
@ -354,7 +350,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
}
|
||||
|
||||
} else {
|
||||
|
||||
/* we need audio data from disk */
|
||||
|
||||
size_t n_buffers = bufs.count ().n_audio ();
|
||||
|
|
@ -371,7 +366,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
const sampleoffset_t declick_offs = _declick_offs;
|
||||
|
||||
for (n = 0, chan = c->begin (); chan != c->end (); ++chan, ++n) {
|
||||
|
||||
ChannelInfo* chaninfo (*chan);
|
||||
AudioBuffer& output (bufs.get_audio (n % n_buffers));
|
||||
|
||||
|
|
@ -395,7 +389,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
_declick_amp.set_gain (initial_declick_gain);
|
||||
|
||||
if (!declick_out) {
|
||||
|
||||
const samplecnt_t available = chaninfo->rbuf->read (disk_buf.data (), disk_samples_to_consume);
|
||||
|
||||
if (disk_samples_to_consume > available) {
|
||||
|
|
@ -406,16 +399,15 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
}
|
||||
|
||||
} else if (_declick_amp.gain () != target_gain) {
|
||||
|
||||
assert (target_gain == 0);
|
||||
|
||||
/* note that this is a non-committing read: it
|
||||
retrieves data from the ringbuffer but does not
|
||||
advance the read pointer. As a result,
|
||||
subsequent calls (as we declick) need to
|
||||
pass in an offset describing where to read
|
||||
from. We maintain _declick_offs across calls
|
||||
to ::run()
|
||||
* retrieves data from the ringbuffer but does not
|
||||
* advance the read pointer. As a result,
|
||||
* subsequent calls (as we declick) need to
|
||||
* pass in an offset describing where to read
|
||||
* from. We maintain _declick_offs across calls
|
||||
* to ::run()
|
||||
*/
|
||||
|
||||
const samplecnt_t total = chaninfo->rbuf->read (disk_buf.data (), nframes, false, declick_offs);
|
||||
|
|
@ -427,9 +419,7 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
|
||||
_declick_amp.apply_gain (disk_buf, nframes, target_gain);
|
||||
|
||||
/* _declick_amp is now left with the correct gain after
|
||||
* processing nframes
|
||||
*/
|
||||
/* _declick_amp is now left with the correct gain after processing nframes */
|
||||
|
||||
Amp::apply_simple_gain (disk_buf, nframes, scaling);
|
||||
|
||||
|
|
@ -440,7 +430,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
midi:
|
||||
|
||||
/* MIDI data handling */
|
||||
|
|
@ -448,7 +437,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
const bool no_playlist_modification_pending = !(pending_overwrite () & PlaylistModified);
|
||||
|
||||
if (bufs.count ().n_midi ()) {
|
||||
|
||||
MidiBuffer& dst (bufs.get_midi (0));
|
||||
|
||||
if (run_must_resolve) {
|
||||
|
|
@ -464,7 +452,6 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
|
|||
/* decide if we need the butler */
|
||||
|
||||
if (!still_locating && no_playlist_modification_pending) {
|
||||
|
||||
bool butler_required = false;
|
||||
|
||||
if (speed < 0.0) {
|
||||
|
|
@ -531,7 +518,6 @@ DiskReader::set_pending_overwrite (OverwriteReason why)
|
|||
/* called from audio thread, so we can use the read ptr and playback sample as we wish */
|
||||
|
||||
if (!c->empty ()) {
|
||||
|
||||
const samplecnt_t reserved_size = c->front ()->rbuf->reserved_size ();
|
||||
const samplecnt_t bufsize = c->front ()->rbuf->bufsize ();
|
||||
|
||||
|
|
@ -540,27 +526,25 @@ DiskReader::set_pending_overwrite (OverwriteReason why)
|
|||
overwrite_offset = c->front ()->rbuf->read_ptr ();
|
||||
|
||||
if (overwrite_offset > reserved_size) {
|
||||
|
||||
/*
|
||||
|----------------------------------------------------------------------|
|
||||
^ ^
|
||||
RRRRRRRRRRRRRRRRoverwrite_offset (old read_ptr)
|
||||
|<- second ->|<------------------ first chunk ------------------------>|
|
||||
|
||||
Fill the the end of the buffer ("first chunk"), above
|
||||
* |----------------------------------------------------------------------|
|
||||
* ^ ^
|
||||
* RRRRRRRRRRRRRRRRoverwrite_offset (old read_ptr)
|
||||
* |<- second ->|<------------------ first chunk ------------------------>|
|
||||
*
|
||||
* Fill the the end of the buffer ("first chunk"), above
|
||||
*/
|
||||
|
||||
overwrite_offset -= reserved_size;
|
||||
|
||||
} else {
|
||||
|
||||
/*
|
||||
|----------------------------------------------------------------------|
|
||||
RRRRRRRRE^ RRRRRRRRR
|
||||
overwrite_offset (old read_ptr)
|
||||
|< second chunk >|<first>|
|
||||
|
||||
Fill the end of the buffer ("R1R1R1" aka "first" above)
|
||||
* |----------------------------------------------------------------------|
|
||||
* RRRRRRRRE^ RRRRRRRRR
|
||||
* overwrite_offset (old read_ptr)
|
||||
* |< second chunk >|<first>|
|
||||
*
|
||||
* Fill the end of the buffer ("R1R1R1" aka "first" above)
|
||||
*/
|
||||
|
||||
overwrite_offset = bufsize - (reserved_size - overwrite_offset);
|
||||
|
|
@ -578,7 +562,6 @@ DiskReader::set_pending_overwrite (OverwriteReason why)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -638,7 +621,6 @@ DiskReader::overwrite_existing_audio ()
|
|||
* simply replace the contents of the buffer.
|
||||
*/
|
||||
|
||||
|
||||
boost::shared_ptr<ChannelList> c = channels.reader ();
|
||||
|
||||
if (c->empty ()) {
|
||||
|
|
@ -672,7 +654,6 @@ DiskReader::overwrite_existing_audio ()
|
|||
bool ret = true;
|
||||
|
||||
for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan, ++n) {
|
||||
|
||||
samplepos_t start = overwrite_sample;
|
||||
|
||||
Sample* buf = (*chan)->rbuf->buffer ();
|
||||
|
|
@ -751,6 +732,7 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
|||
/* called via non_realtime_locate() from butler thread */
|
||||
|
||||
int ret = -1;
|
||||
|
||||
const bool read_reversed = !_session.transport_will_roll_forwards ();
|
||||
const bool read_loop = (bool)_loop_location;
|
||||
|
||||
|
|
@ -769,7 +751,6 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
|||
*/
|
||||
|
||||
if ((_last_read_reversed.value_or (read_reversed) == read_reversed) && (_last_read_loop.value_or (read_loop) == read_loop)) {
|
||||
|
||||
if (sample == playback_sample && !complete_refill) {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -796,10 +777,10 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
|||
}
|
||||
|
||||
/* move the intended read target, so that after the refill is done,
|
||||
the intended read target is "reservation" from the start of the
|
||||
playback buffer. Then increment the read ptr, so that we can
|
||||
potentially do an internal seek backwards of up "reservation"
|
||||
samples.
|
||||
* the intended read target is "reservation" from the start of the
|
||||
* playback buffer. Then increment the read ptr, so that we can
|
||||
* potentially do an internal seek backwards of up "reservation"
|
||||
* samples.
|
||||
*/
|
||||
|
||||
samplecnt_t shift = sample > c->front ()->rbuf->reservation_size () ? c->front ()->rbuf->reservation_size () : sample;
|
||||
|
|
@ -808,8 +789,7 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
|||
|
||||
if (read_reversed) {
|
||||
/* reading in reverse, so start at a later sample, and read
|
||||
"backwards" from there.
|
||||
*/
|
||||
* "backwards" from there. */
|
||||
shift = -shift;
|
||||
}
|
||||
|
||||
|
|
@ -823,18 +803,15 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
|||
|
||||
if (complete_refill) {
|
||||
/* call _do_refill() to refill the entire buffer, using
|
||||
the largest reads possible.
|
||||
*/
|
||||
while ((ret = do_refill_with_alloc (false, read_reversed)) > 0) ;
|
||||
* the largest reads possible. */
|
||||
while ((ret = do_refill_with_alloc (false, read_reversed)) > 0)
|
||||
;
|
||||
} else {
|
||||
/* call _do_refill() to refill just one chunk, and then
|
||||
return.
|
||||
*/
|
||||
/* call _do_refill() to refill just one chunk, and then return. */
|
||||
ret = do_refill_with_alloc (true, read_reversed);
|
||||
}
|
||||
|
||||
if (shift) {
|
||||
|
||||
/* now tell everyone where we really are, leaving the
|
||||
* "reserved" data represented by "shift" available in the
|
||||
* buffer for backwards-internal-seek
|
||||
|
|
@ -898,8 +875,8 @@ DiskReader::internal_playback_seek (sampleoffset_t distance)
|
|||
playback_sample += off;
|
||||
}
|
||||
|
||||
static
|
||||
void swap_by_ptr (Sample *first, Sample *last)
|
||||
static void
|
||||
swap_by_ptr (Sample* first, Sample* last)
|
||||
{
|
||||
while (first < last) {
|
||||
Sample tmp = *first;
|
||||
|
|
@ -935,7 +912,6 @@ DiskReader::audio_read (Sample* sum_buffer,
|
|||
/* XXX we don't currently play loops in reverse. not sure why */
|
||||
|
||||
if (!reversed) {
|
||||
|
||||
samplecnt_t loop_length = 0;
|
||||
|
||||
/* Make the use of a Location atomic for this read operation.
|
||||
|
|
@ -952,14 +928,13 @@ DiskReader::audio_read (Sample* sum_buffer,
|
|||
loop_length = loop_end - loop_start;
|
||||
}
|
||||
|
||||
/* if we are looping, ensure that the first sample we read is at the correct
|
||||
position within the loop.
|
||||
/* if we are looping, ensure that the first sample we read is at the
|
||||
* correct position within the loop.
|
||||
*/
|
||||
|
||||
if (loc && start >= loop_end) {
|
||||
start = loop_start + ((start - loop_start) % loop_length);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (reversed) {
|
||||
|
|
@ -967,11 +942,9 @@ DiskReader::audio_read (Sample* sum_buffer,
|
|||
}
|
||||
|
||||
/* We need this while loop in case we hit a loop boundary, in which case our read from
|
||||
the playlist must be split into more than one section.
|
||||
*/
|
||||
* the playlist must be split into more than one section. */
|
||||
|
||||
while (cnt) {
|
||||
|
||||
/* take any loop into account. we can't read past the end of the loop. */
|
||||
|
||||
if (loc && (loop_end - start < cnt)) {
|
||||
|
|
@ -999,7 +972,6 @@ DiskReader::audio_read (Sample* sum_buffer,
|
|||
}
|
||||
|
||||
if (loc) {
|
||||
|
||||
/* Looping: do something (maybe) about the loop boundaries */
|
||||
|
||||
switch (Config->get_loop_fade_choice ()) {
|
||||
|
|
@ -1019,11 +991,9 @@ DiskReader::audio_read (Sample* sum_buffer,
|
|||
}
|
||||
|
||||
if (reversed) {
|
||||
|
||||
swap_by_ptr (sum_buffer, sum_buffer + this_read - 1);
|
||||
|
||||
} else {
|
||||
|
||||
/* if we read to the end of the loop, go back to the beginning */
|
||||
|
||||
if (reloop) {
|
||||
|
|
@ -1054,9 +1024,9 @@ int
|
|||
DiskReader::do_refill_with_alloc (bool partial_fill, bool reversed)
|
||||
{
|
||||
/* We limit disk reads to at most 4MB chunks, which with floating point
|
||||
samples would be 1M samples. But we might use 16 or 14 bit samples,
|
||||
in which case 4MB is more samples than that. Therefore size this for
|
||||
the smallest sample value .. 4MB = 2M samples (16 bit).
|
||||
* samples would be 1M samples. But we might use 16 or 14 bit samples,
|
||||
* in which case 4MB is more samples than that. Therefore size this for
|
||||
* the smallest sample value .. 4MB = 2M samples (16 bit).
|
||||
*/
|
||||
|
||||
boost::scoped_array<Sample> sum_buf (new Sample[2 * 1048576]);
|
||||
|
|
@ -1070,7 +1040,7 @@ int
|
|||
DiskReader::refill (Sample* sum_buffer, Sample* mixdown_buffer, float* gain_buffer, samplecnt_t fill_level, bool reversed)
|
||||
{
|
||||
/* NOTE: Audio refill MUST come first so that in contexts where ONLY it
|
||||
is called, _last_read_reversed is set correctly.
|
||||
* is called, _last_read_reversed is set correctly.
|
||||
*/
|
||||
|
||||
if (refill_audio (sum_buffer, mixdown_buffer, gain_buffer, fill_level, reversed)) {
|
||||
|
|
@ -1084,7 +1054,6 @@ DiskReader::refill (Sample* sum_buffer, Sample* mixdown_buffer, float* gain_buff
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/** Get some more data from disk and put it in our channels' bufs,
|
||||
* if there is suitable space in them.
|
||||
*
|
||||
|
|
@ -1138,14 +1107,14 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
|||
}
|
||||
|
||||
/* if we're running close to normal speed and there isn't enough
|
||||
space to do disk_read_chunk_samples of I/O, then don't bother.
|
||||
|
||||
at higher speeds, just do it because the sync between butler
|
||||
and audio thread may not be good enough.
|
||||
|
||||
Note: it is a design assumption that disk_read_chunk_samples is smaller
|
||||
than the playback buffer size, so this check should never trip when
|
||||
the playback buffer is empty.
|
||||
* space to do disk_read_chunk_samples of I/O, then don't bother.
|
||||
*
|
||||
* at higher speeds, just do it because the sync between butler
|
||||
* and audio thread may not be good enough.
|
||||
*
|
||||
* Note: it is a design assumption that disk_read_chunk_samples is smaller
|
||||
* than the playback buffer size, so this check should never trip when
|
||||
* the playback buffer is empty.
|
||||
*/
|
||||
|
||||
DEBUG_TRACE (DEBUG::DiskIO, string_compose ("%1: space to refill %2 vs. chunk %3 (speed = %4)\n", name (), total_space, _chunk_samples, _session.transport_speed ()));
|
||||
|
|
@ -1154,8 +1123,8 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
|||
}
|
||||
|
||||
/* when slaved, don't try to get too close to the read pointer. this
|
||||
leaves space for the buffer reversal to have something useful to
|
||||
work with.
|
||||
* leaves space for the buffer reversal to have something useful to
|
||||
* work with.
|
||||
*/
|
||||
|
||||
if (_slaved && total_space < (samplecnt_t) (c->front ()->rbuf->bufsize () / 2)) {
|
||||
|
|
@ -1166,7 +1135,6 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
|||
samplepos_t fsa = file_sample[DataType::AUDIO];
|
||||
|
||||
if (reversed) {
|
||||
|
||||
if (fsa == 0) {
|
||||
/* at start: nothing to do but fill with silence */
|
||||
for (chan_n = 0, i = c->begin (); i != c->end (); ++i, ++chan_n) {
|
||||
|
|
@ -1185,7 +1153,6 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
|||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (fsa == max_samplepos) {
|
||||
/* at end: nothing to do but fill with silence */
|
||||
for (chan_n = 0, i = c->begin (); i != c->end (); ++i, ++chan_n) {
|
||||
|
|
@ -1223,11 +1190,12 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
|||
|
||||
samplepos_t file_sample_tmp = fsa;
|
||||
|
||||
// int64_t before = g_get_monotonic_time ();
|
||||
// int64_t elapsed;
|
||||
#if 0
|
||||
int64_t before = g_get_monotonic_time ();
|
||||
int64_t elapsed;
|
||||
#endif
|
||||
|
||||
for (chan_n = 0, i = c->begin (); i != c->end (); ++i, ++chan_n) {
|
||||
|
||||
ChannelInfo* chan (*i);
|
||||
|
||||
/* we want all channels to read from the same position, but
|
||||
|
|
@ -1249,11 +1217,9 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
|||
samplecnt_t nread;
|
||||
|
||||
if (!_playlists[DataType::AUDIO]) {
|
||||
|
||||
chan->rbuf->write_zero (to_read);
|
||||
|
||||
} else {
|
||||
|
||||
if ((nread = audio_read (sum_buffer, mixdown_buffer, gain_buffer, file_sample_tmp, to_read, rci, chan_n, reversed)) != to_read) {
|
||||
error << string_compose (_("DiskReader %1: when refilling, cannot read %2 from playlist at sample %3"), name (), to_read, fsa) << endmsg;
|
||||
ret = -1;
|
||||
|
|
@ -1275,8 +1241,10 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
|||
}
|
||||
}
|
||||
|
||||
// elapsed = g_get_monotonic_time () - before;
|
||||
// cerr << '\t' << name() << ": bandwidth = " << (byte_size_for_read / 1048576.0) / (elapsed/1000000.0) << "MB/sec\n";
|
||||
#if 0
|
||||
elapsed = g_get_monotonic_time () - before;
|
||||
cerr << '\t' << name() << ": bandwidth = " << (byte_size_for_read / 1048576.0) / (elapsed/1000000.0) << "MB/sec\n";
|
||||
#endif
|
||||
|
||||
file_sample[DataType::AUDIO] = file_sample_tmp;
|
||||
assert (file_sample[DataType::AUDIO] >= 0);
|
||||
|
|
@ -1312,7 +1280,6 @@ DiskReader::playlist_ranges_moved (list< Evoral::RangeMove<samplepos_t> > const
|
|||
for (list<Evoral::RangeMove<samplepos_t>>::const_iterator i = movements_samples.begin ();
|
||||
i != movements_samples.end ();
|
||||
++i) {
|
||||
|
||||
movements.push_back (Evoral::RangeMove<double> (i->from, i->length, i->to));
|
||||
}
|
||||
|
||||
|
|
@ -1365,9 +1332,7 @@ DiskReader::move_processor_automation (boost::weak_ptr<Processor> p, list< Evora
|
|||
if (things_moved) {
|
||||
_session.add_command (
|
||||
new MementoCommand<AutomationList> (
|
||||
*al.get(), &before, &al->get_state ()
|
||||
)
|
||||
);
|
||||
*al.get (), &before, &al->get_state ()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1401,10 +1366,10 @@ DiskReader::get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, sample
|
|||
|
||||
if (ms & MonitoringInput) {
|
||||
/* data from disk needs to be *merged* not written into the
|
||||
dst, because it may contain input data that we want to
|
||||
monitor. Since RTMidiBuffer currently (Oct 2019) has no
|
||||
suitable method, put the disk data into a scratch buffer and
|
||||
then merge later.
|
||||
* dst, because it may contain input data that we want to
|
||||
* monitor. Since RTMidiBuffer currently (Oct 2019) has no
|
||||
* suitable method, put the disk data into a scratch buffer and
|
||||
* then merge later.
|
||||
*/
|
||||
|
||||
target = &scratch_bufs.get_midi (0);
|
||||
|
|
@ -1417,13 +1382,10 @@ DiskReader::get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, sample
|
|||
}
|
||||
|
||||
if (!_no_disk_output) {
|
||||
|
||||
const samplecnt_t nframes = abs (end_sample - start_sample);
|
||||
|
||||
if (ms & MonitoringDisk) {
|
||||
|
||||
/* disk data needed
|
||||
*/
|
||||
/* disk data needed */
|
||||
|
||||
Location* loc = _loop_location;
|
||||
|
||||
|
|
@ -1437,7 +1399,6 @@ DiskReader::get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, 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));
|
||||
|
||||
do {
|
||||
|
||||
samplepos_t effective_end;
|
||||
|
||||
effective_start = loop_range.squish (effective_start);
|
||||
|
|
@ -1474,8 +1435,8 @@ DiskReader::get_midi_playback (MidiBuffer& dst, samplepos_t start_sample, sample
|
|||
|
||||
if (ms & MonitoringInput) {
|
||||
/* merges data from disk (in "target", which is a scratch
|
||||
buffer in this case) into the actual destination buffer
|
||||
(which holds existing input data).
|
||||
* buffer in this case) into the actual destination buffer
|
||||
* (which holds existing input data).
|
||||
*/
|
||||
dst.merge_from (*target, nframes);
|
||||
}
|
||||
|
|
@ -1506,9 +1467,9 @@ void
|
|||
DiskReader::dec_no_disk_output ()
|
||||
{
|
||||
/* this is called unconditionally when things happen that ought to end
|
||||
a period of "no disk output". It's OK for that to happen when there
|
||||
was no corresponding call to ::inc_no_disk_output(), but we must
|
||||
stop the value from becoming negative.
|
||||
* a period of "no disk output". It's OK for that to happen when there
|
||||
* was no corresponding call to ::inc_no_disk_output(), but we must
|
||||
* stop the value from becoming negative.
|
||||
*/
|
||||
|
||||
do {
|
||||
|
|
@ -1647,7 +1608,6 @@ DiskReader::Declicker::reset (samplepos_t loop_start, samplepos_t loop_end, bool
|
|||
fade_start = loop_end - fade_length;
|
||||
fade_end = loop_end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1661,12 +1621,13 @@ DiskReader::Declicker::run (Sample* buf, samplepos_t read_start, samplepos_t rea
|
|||
return;
|
||||
}
|
||||
|
||||
/* Determine how the read range overlaps with the fade range, so we can determine which part of the fade gain vector
|
||||
to apply to which part of the buffer.
|
||||
/* Determine how the read range overlaps with the fade range, so we can determine
|
||||
* which part of the fade gain vector to apply to which part of the buffer.
|
||||
*
|
||||
* see also DiskReader::maybe_xfade_loop()
|
||||
*/
|
||||
|
||||
switch (Evoral::coverage (fade_start, fade_end, read_start, read_end)) {
|
||||
|
||||
case Evoral::OverlapInternal:
|
||||
/* note: start and end points cannot coincide (see evoral/Range.h)
|
||||
*
|
||||
|
|
@ -1739,12 +1700,13 @@ DiskReader::maybe_xfade_loop (Sample* buf, samplepos_t read_start, samplepos_t r
|
|||
return;
|
||||
}
|
||||
|
||||
/* Determine how the read range overlaps with the fade range, so we can determine which part of the fade gain vector
|
||||
to apply to which part of the buffer.
|
||||
/* Determine how the read range overlaps with the fade range, so we can determine
|
||||
* which part of the fade gain vector to apply to which part of the buffer.
|
||||
*
|
||||
* see also DiskReader::Declicker::run()
|
||||
*/
|
||||
|
||||
switch (Evoral::coverage (fade_start, fade_end, read_start, read_end)) {
|
||||
|
||||
case Evoral::OverlapInternal:
|
||||
/* note: start and end points cannot coincide (see evoral/Range.h)
|
||||
*
|
||||
|
|
@ -1878,7 +1840,6 @@ DiskReader::reload_loop ()
|
|||
uint32_t channel = 0;
|
||||
|
||||
for (ChannelList::iterator chan = c->begin (); chan != c->end (); ++chan, ++channel) {
|
||||
|
||||
ReaderChannelInfo* rci = dynamic_cast<ReaderChannelInfo*> (*chan);
|
||||
|
||||
rci->resize_preloop (loop_fade_length);
|
||||
|
|
@ -1888,6 +1849,5 @@ DiskReader::reload_loop ()
|
|||
} else {
|
||||
memset (rci->pre_loop_buffer, 0, sizeof (Sample) * loop_fade_length);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue