NO-OP/Optimize Bounce: Lookup data-type only once
This is to prepare for midi-to-audio bounce: allow to change the data-type to be used as output.
This commit is contained in:
parent
7450d69189
commit
a1c19911db
@ -6113,6 +6113,8 @@ Session::write_one_track (Track& track, samplepos_t start, samplepos_t end,
|
|||||||
string legal_playlist_name;
|
string legal_playlist_name;
|
||||||
string possible_path;
|
string possible_path;
|
||||||
|
|
||||||
|
DataType data_type = track.data_type();
|
||||||
|
|
||||||
if (end <= start) {
|
if (end <= start) {
|
||||||
error << string_compose (_("Cannot write a range where end <= start (e.g. %1 <= %2)"),
|
error << string_compose (_("Cannot write a range where end <= start (e.g. %1 <= %2)"),
|
||||||
end, start) << endmsg;
|
end, start) << endmsg;
|
||||||
@ -6122,7 +6124,7 @@ Session::write_one_track (Track& track, samplepos_t start, samplepos_t end,
|
|||||||
diskstream_channels = track.bounce_get_output_streams (diskstream_channels, endpoint,
|
diskstream_channels = track.bounce_get_output_streams (diskstream_channels, endpoint,
|
||||||
include_endpoint, for_export, for_freeze);
|
include_endpoint, for_export, for_freeze);
|
||||||
|
|
||||||
if (diskstream_channels.n(track.data_type()) < 1) {
|
if (diskstream_channels.n(data_type) < 1) {
|
||||||
error << _("Cannot write a range with no data.") << endmsg;
|
error << _("Cannot write a range with no data.") << endmsg;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -6149,10 +6151,10 @@ Session::write_one_track (Track& track, samplepos_t start, samplepos_t end,
|
|||||||
|
|
||||||
legal_playlist_name = legalize_for_path (playlist->name());
|
legal_playlist_name = legalize_for_path (playlist->name());
|
||||||
|
|
||||||
for (uint32_t chan_n = 0; chan_n < diskstream_channels.n(track.data_type()); ++chan_n) {
|
for (uint32_t chan_n = 0; chan_n < diskstream_channels.n(data_type); ++chan_n) {
|
||||||
|
|
||||||
string base_name = string_compose ("%1-%2-bounce", playlist->name(), chan_n);
|
string base_name = string_compose ("%1-%2-bounce", playlist->name(), chan_n);
|
||||||
string path = ((track.data_type() == DataType::AUDIO)
|
string path = ((data_type == DataType::AUDIO)
|
||||||
? new_audio_source_path (legal_playlist_name, diskstream_channels.n_audio(), chan_n, false, true)
|
? new_audio_source_path (legal_playlist_name, diskstream_channels.n_audio(), chan_n, false, true)
|
||||||
: new_midi_source_path (legal_playlist_name));
|
: new_midi_source_path (legal_playlist_name));
|
||||||
|
|
||||||
@ -6161,7 +6163,7 @@ Session::write_one_track (Track& track, samplepos_t start, samplepos_t end,
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
source = SourceFactory::createWritable (track.data_type(), *this, path, false, sample_rate());
|
source = SourceFactory::createWritable (data_type, *this, path, false, sample_rate());
|
||||||
}
|
}
|
||||||
|
|
||||||
catch (failed_constructor& err) {
|
catch (failed_constructor& err) {
|
||||||
|
Loading…
Reference in New Issue
Block a user