mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-26 06:58:22 +01:00
add config parameter to control missing-region-channel behaviour. not controllable from GUI in this commit. default behaviour is as in ardour 2.8.7
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@6923 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
035a8d02bc
commit
8f58400278
2 changed files with 21 additions and 11 deletions
|
|
@ -146,6 +146,7 @@ CONFIG_VARIABLE (nframes_t, over_length_long, "over-length-long", 10)
|
|||
|
||||
/* miscellany */
|
||||
|
||||
CONFIG_VARIABLE (bool, replicate_missing_region_channels, "replicate-missing-region-channels", false)
|
||||
CONFIG_VARIABLE (bool, hiding_groups_deactivates_groups, "hiding-groups-deactivates-groups", true)
|
||||
CONFIG_VARIABLE (bool, verify_remove_last_capture, "verify-remove-last-capture", true)
|
||||
CONFIG_VARIABLE (bool, no_new_session_dialog, "no-new-session-dialog", false)
|
||||
|
|
|
|||
|
|
@ -537,6 +537,10 @@ AudioRegion::_read_at (const SourceList& srcs, nframes_t limit,
|
|||
nframes_t to_read;
|
||||
bool raw = (rops == ReadOpsNone);
|
||||
|
||||
if (n_channels() == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (muted() && !raw) {
|
||||
return 0; /* read nothing */
|
||||
}
|
||||
|
|
@ -583,18 +587,23 @@ AudioRegion::_read_at (const SourceList& srcs, nframes_t limit,
|
|||
|
||||
} else {
|
||||
|
||||
/* track is N-channel, this region has less channels, so use a relevant channel
|
||||
*/
|
||||
|
||||
uint32_t channel = n_channels() % chan_n;
|
||||
|
||||
if (srcs[channel]->read (mixdown_buffer, _start + internal_offset, to_read) != to_read) {
|
||||
return 0; /* "read nothing" */
|
||||
}
|
||||
|
||||
/* adjust read data count appropriately since this was a duplicate read */
|
||||
srcs[channel]->dec_read_data_count (to_read);
|
||||
if (Config->get_replicate_missing_region_channels()) {
|
||||
/* track is N-channel, this region has less channels, so use a relevant channel
|
||||
*/
|
||||
|
||||
uint32_t channel = n_channels() % chan_n;
|
||||
|
||||
if (srcs[channel]->read (mixdown_buffer, _start + internal_offset, to_read) != to_read) {
|
||||
return 0; /* "read nothing" */
|
||||
}
|
||||
|
||||
/* adjust read data count appropriately since this was a duplicate read */
|
||||
srcs[channel]->dec_read_data_count (to_read);
|
||||
|
||||
} else {
|
||||
/* region has no data for requested channel, so make it silent */
|
||||
memset (mixdown_buffer, 0, to_read * sizeof (Sample));
|
||||
}
|
||||
}
|
||||
|
||||
if (rops & ReadOpsFades) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue