From 57c308b685c70bec63c4c18b5ba3270394608525 Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 30 May 2024 13:59:23 +0100 Subject: [PATCH] AudioChannelSet: Add new ITU variants of 9.0.4, 9.1.4, 9.0.6, and 9.1.6 --- .../buffers/juce_AudioChannelSet.cpp | 19 +++++++++++++----- .../buffers/juce_AudioChannelSet.h | 20 +++++++++++++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/modules/juce_audio_basics/buffers/juce_AudioChannelSet.cpp b/modules/juce_audio_basics/buffers/juce_AudioChannelSet.cpp index 97e5668f7bd..b62c8b3d7fe 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioChannelSet.cpp +++ b/modules/juce_audio_basics/buffers/juce_AudioChannelSet.cpp @@ -450,10 +450,14 @@ String AudioChannelSet::getDescription() const if (*this == create7point1point2()) return "7.1.2 Surround"; if (*this == create7point1point4()) return "7.1.4 Surround"; if (*this == create7point1point6()) return "7.1.6 Surround"; - if (*this == create9point0point4()) return "9.0.4 Surround"; - if (*this == create9point1point4()) return "9.1.4 Surround"; - if (*this == create9point0point6()) return "9.0.6 Surround"; - if (*this == create9point1point6()) return "9.1.6 Surround"; + if (*this == create9point0point4()) return "9.0.4 Surround (Atmos)"; + if (*this == create9point1point4()) return "9.1.4 Surround (Atmos)"; + if (*this == create9point0point6()) return "9.0.6 Surround (Atmos)"; + if (*this == create9point1point6()) return "9.1.6 Surround (Atmos)"; + if (*this == create9point0point4ITU()) return "9.0.4 Surround (ITU)"; + if (*this == create9point1point4ITU()) return "9.1.4 Surround (ITU)"; + if (*this == create9point0point6ITU()) return "9.0.6 Surround (ITU)"; + if (*this == create9point1point6ITU()) return "9.1.6 Surround (ITU)"; if (*this == quadraphonic()) return "Quadraphonic"; if (*this == pentagonal()) return "Pentagonal"; @@ -580,6 +584,10 @@ AudioChannelSet AudioChannelSet::create9point0point4() { return AudioChannelSet AudioChannelSet AudioChannelSet::create9point1point4() { return AudioChannelSet ({ left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, wideLeft, wideRight, topFrontLeft, topFrontRight, topRearLeft, topRearRight }); } AudioChannelSet AudioChannelSet::create9point0point6() { return AudioChannelSet ({ left, right, centre, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, wideLeft, wideRight, topFrontLeft, topFrontRight, topSideLeft, topSideRight, topRearLeft, topRearRight }); } AudioChannelSet AudioChannelSet::create9point1point6() { return AudioChannelSet ({ left, right, centre, LFE, leftSurroundSide, rightSurroundSide, leftSurroundRear, rightSurroundRear, wideLeft, wideRight, topFrontLeft, topFrontRight, topSideLeft, topSideRight, topRearLeft, topRearRight }); } +AudioChannelSet AudioChannelSet::create9point0point4ITU() { return AudioChannelSet ({ left, right, centre, leftSurround, rightSurround, leftCentre, rightCentre, leftSurroundSide, rightSurroundSide, topFrontLeft, topFrontRight, topRearLeft, topRearRight }); } +AudioChannelSet AudioChannelSet::create9point1point4ITU() { return AudioChannelSet ({ left, right, centre, LFE, leftSurround, rightSurround, leftCentre, rightCentre, leftSurroundSide, rightSurroundSide, topFrontLeft, topFrontRight, topRearLeft, topRearRight }); } +AudioChannelSet AudioChannelSet::create9point0point6ITU() { return AudioChannelSet ({ left, right, centre, leftSurround, rightSurround, leftCentre, rightCentre, leftSurroundSide, rightSurroundSide, topFrontLeft, topFrontRight, topRearLeft, topRearRight, topSideLeft, topSideRight }); } +AudioChannelSet AudioChannelSet::create9point1point6ITU() { return AudioChannelSet ({ left, right, centre, LFE, leftSurround, rightSurround, leftCentre, rightCentre, leftSurroundSide, rightSurroundSide, topFrontLeft, topFrontRight, topRearLeft, topRearRight, topSideLeft, topSideRight }); } AudioChannelSet AudioChannelSet::ambisonic (int order) { @@ -705,7 +713,8 @@ Array AudioChannelSet::channelSetsWithNumberOfChannels (int num case 14: return { AudioChannelSet::create7point1point6() }; case 16: - return { AudioChannelSet::create9point1point6() }; + return { AudioChannelSet::create9point1point6(), + AudioChannelSet::create9point1point6ITU() }; } return {}; diff --git a/modules/juce_audio_basics/buffers/juce_AudioChannelSet.h b/modules/juce_audio_basics/buffers/juce_AudioChannelSet.h index 59ba4010848..9de2a674a5f 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioChannelSet.h +++ b/modules/juce_audio_basics/buffers/juce_AudioChannelSet.h @@ -298,6 +298,26 @@ class JUCE_API AudioChannelSet */ static AudioChannelSet JUCE_CALLTYPE create9point1point6(); + /** Creates a set for a 9.0.4 ITU surround setup: + left, right, centre, leftSurround, rightSurround, leftCentre, rightCentre, leftSurroundSide, rightSurroundSide, topFrontLeft, topFrontRight, topRearLeft, topRearRight + */ + static AudioChannelSet JUCE_CALLTYPE create9point0point4ITU(); + + /** Creates a set for a 9.1.4 ITU surround setup. + left, right, centre, LFE, leftSurround, rightSurround, leftCentre, rightCentre, leftSurroundSide, rightSurroundSide, topFrontLeft, topFrontRight, topRearLeft, topRearRight + */ + static AudioChannelSet JUCE_CALLTYPE create9point1point4ITU(); + + /** Creates a set for a 9.0.6 ITU surround setup. + left, right, centre, leftSurround, rightSurround, leftCentre, rightCentre, leftSurroundSide, rightSurroundSide, topFrontLeft, topRearRight, topFrontRight, topRearRight, topSideLeft, topSideRight + */ + static AudioChannelSet JUCE_CALLTYPE create9point0point6ITU(); + + /** Creates a set for a 9.1.6 ITU surround setup. + left, right, centre, LFE, leftSurround, rightSurround, leftCentre, rightCentre, leftSurroundSide, rightSurroundSide, topFrontLeft, topRearRight, topFrontRight, topRearRight, topSideLeft, topSideRight + */ + static AudioChannelSet JUCE_CALLTYPE create9point1point6ITU(); + //============================================================================== /** Creates a set for quadraphonic surround setup (left, right, leftSurround, rightSurround)