13
0

fix behavior of DiskReader when moved after an instrument

This commit is contained in:
Paul Davis 2019-12-14 19:34:13 -07:00
parent 1881d73f43
commit b2bc934e21
2 changed files with 32 additions and 1 deletions

View File

@ -50,6 +50,8 @@ public:
static samplecnt_t default_chunk_samples ();
static void set_chunk_samples (samplecnt_t n) { _chunk_samples = n; }
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
void run (BufferSet& /*bufs*/, samplepos_t /*start_sample*/, samplepos_t /*end_sample*/, double speed, pframes_t /*nframes*/, bool /*result_required*/);
void realtime_handle_transport_stopped ();
void realtime_locate (bool);

View File

@ -536,7 +536,7 @@ DiskReader::overwrite_existing_audio ()
{
boost::shared_ptr<ChannelList> c = channels.reader();
if (c->empty ()) {
if (c->empty () || !_playlists[DataType::AUDIO]) {
return true;
}
@ -1683,3 +1683,32 @@ DiskReader::reload_loop ()
}
}
bool
DiskReader::can_support_io_configuration (const ChanCount& in, ChanCount& out)
{
if (!DiskIOProcessor::can_support_io_configuration (in, out)) {
return false;
}
/* DiskIO might have done this too, but do it again anyway as a
* starting point.
*/
out == in;
if (_playlists[DataType::AUDIO]) {
ChannelList::size_type naudio = max (ChannelList::size_type (1), channels.reader()->size());
if (out.n_audio() < naudio) {
out.set (DataType::AUDIO, naudio);
}
}
if (_playlists[DataType::MIDI]) {
if (out.n_midi() != 1) {
out.set (DataType::MIDI, 1);
}
}
return true;
}