correctly track is disk read (audio) should be forwards/backwards, and what was done last time we read from disk
This commit is contained in:
parent
7ca068f8d5
commit
1e9af51f36
@ -20,6 +20,8 @@
|
|||||||
#ifndef __ardour_disk_reader_h__
|
#ifndef __ardour_disk_reader_h__
|
||||||
#define __ardour_disk_reader_h__
|
#define __ardour_disk_reader_h__
|
||||||
|
|
||||||
|
#include <boost/optional.hpp>
|
||||||
|
|
||||||
#include "pbd/i18n.h"
|
#include "pbd/i18n.h"
|
||||||
|
|
||||||
#include "evoral/Curve.h"
|
#include "evoral/Curve.h"
|
||||||
@ -191,6 +193,7 @@ private:
|
|||||||
DeclickAmp _declick_amp;
|
DeclickAmp _declick_amp;
|
||||||
sampleoffset_t _declick_offs;
|
sampleoffset_t _declick_offs;
|
||||||
MidiStateTracker _tracker;
|
MidiStateTracker _tracker;
|
||||||
|
boost::optional<bool> _last_read_reversed;
|
||||||
|
|
||||||
int _do_refill_with_alloc (bool partial_fill);
|
int _do_refill_with_alloc (bool partial_fill);
|
||||||
|
|
||||||
|
@ -630,7 +630,7 @@ DiskReader::overwrite_existing_audio ()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool reversed = _session.transport_speed() < 0.0f;
|
const bool reversed = !_session.transport_will_roll_forwards ();
|
||||||
|
|
||||||
sampleoffset_t chunk1_offset;
|
sampleoffset_t chunk1_offset;
|
||||||
samplecnt_t chunk1_cnt;
|
samplecnt_t chunk1_cnt;
|
||||||
@ -739,6 +739,7 @@ DiskReader::seek (samplepos_t sample, bool complete_refill)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
ChannelList::iterator chan;
|
ChannelList::iterator chan;
|
||||||
boost::shared_ptr<ChannelList> c = channels.reader();
|
boost::shared_ptr<ChannelList> c = channels.reader();
|
||||||
|
const bool read_reversed = !_session.transport_will_roll_forwards ();
|
||||||
|
|
||||||
if (c->empty()) {
|
if (c->empty()) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -966,6 +967,7 @@ DiskReader::audio_read (Sample* sum_buffer,
|
|||||||
sum_buffer += this_read;
|
sum_buffer += this_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_last_read_reversed = reversed;
|
||||||
return rcnt;
|
return rcnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1021,12 +1023,14 @@ DiskReader::refill_audio (Sample* sum_buffer, Sample* mixdown_buffer, float* gai
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
bool const reversed = _session.transport_speed() < 0.0f;
|
bool const reversed = !_session.transport_will_roll_forwards ();
|
||||||
samplecnt_t zero_fill;
|
samplecnt_t zero_fill;
|
||||||
uint32_t chan_n;
|
uint32_t chan_n;
|
||||||
ChannelList::iterator i;
|
ChannelList::iterator i;
|
||||||
boost::shared_ptr<ChannelList> c = channels.reader();
|
boost::shared_ptr<ChannelList> c = channels.reader();
|
||||||
|
|
||||||
|
_last_read_reversed = !_session.transport_will_roll_forwards ();
|
||||||
|
|
||||||
if (c->empty()) {
|
if (c->empty()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user