mirror of
https://github.com/cookiengineer/audacity
synced 2026-04-26 07:53:42 +02:00
Bug 2195: Treat multi-channel import / recording as multiple mono
This commit is contained in:
@@ -710,8 +710,7 @@ Track *TrackList::DoAdd(const std::shared_ptr<Track> &t)
|
|||||||
void TrackList::GroupChannels(
|
void TrackList::GroupChannels(
|
||||||
Track &track, size_t groupSize, bool resetChannels )
|
Track &track, size_t groupSize, bool resetChannels )
|
||||||
{
|
{
|
||||||
// If group size is more than two, for now only the first two channels
|
// If group size is exactly two, group as stereo, else mono (bug 2195).
|
||||||
// are grouped as stereo, and any others remain mono
|
|
||||||
auto list = track.mList.lock();
|
auto list = track.mList.lock();
|
||||||
if ( groupSize > 0 && list.get() == this ) {
|
if ( groupSize > 0 && list.get() == this ) {
|
||||||
auto iter = track.mNode.first;
|
auto iter = track.mNode.first;
|
||||||
@@ -745,9 +744,9 @@ void TrackList::GroupChannels(
|
|||||||
|
|
||||||
if ( groupSize > 1 ) {
|
if ( groupSize > 1 ) {
|
||||||
const auto channel = *iter++;
|
const auto channel = *iter++;
|
||||||
channel->SetLinked( true );
|
channel->SetLinked( groupSize == 2 );
|
||||||
channel->SetChannel( Track::LeftChannel );
|
channel->SetChannel( groupSize == 2? Track::LeftChannel : Track::MonoChannel );
|
||||||
(*iter++)->SetChannel( Track::RightChannel );
|
(*iter++)->SetChannel( groupSize == 2? Track::RightChannel : Track::MonoChannel );
|
||||||
while (iter != after)
|
while (iter != after)
|
||||||
(*iter++)->SetChannel( Track::MonoChannel );
|
(*iter++)->SetChannel( Track::MonoChannel );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user