Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ADM import support from 3rd party tools #259

Merged
merged 99 commits into from
Feb 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
ff1c4d8
Simpler lookup for legacy DS index to PF ID
firthm01 Oct 23, 2023
5f09d69
Common Def helper pulls pos, labels and LFE
firthm01 Oct 24, 2023
fae0484
Simplify use of AdmCommonDefinitionHelper in HOA plugin
firthm01 Oct 27, 2023
ae3e2dd
More helpful ID fields in CD helper
firthm01 Oct 28, 2023
6b7d6db
Remove hardcoded layouts: remove lists and helpers
firthm01 Nov 3, 2023
c481759
Remove hardcoded layouts: DS->Scene metadata changes
firthm01 Nov 3, 2023
2e3bd75
Remove hardcoded layouts: EARPluginSuite uses pack format ids
firthm01 Nov 3, 2023
c4bd8b8
Remove hardcoded layouts: ProgrammeStoreAdmSerializer doesn't use lay…
firthm01 Nov 3, 2023
514b0f4
Remove hardcoded layouts: Make DS UI use pack format ID
firthm01 Nov 3, 2023
c10a223
Remove hardcoded layouts: Mon UI uses pack format ID
firthm01 Nov 3, 2023
7f9ecf4
Remove hardcoded layouts: Fix up Scene UI
firthm01 Nov 3, 2023
4a64970
Remove hardcoded layouts: Fix tests
firthm01 Nov 3, 2023
95e83e8
Remove hardcoded layouts: Check getPackFormatData has val before use
firthm01 Nov 4, 2023
4d952eb
niceName for channel formats - use speakerLabels for DS
firthm01 Nov 4, 2023
e09a35e
Other code to use new niceName prop
firthm01 Nov 4, 2023
873cb6e
ChannelFormatData is a class
firthm01 Nov 5, 2023
ff4b31d
PackFormatData is a class
firthm01 Nov 6, 2023
8153184
Speaker labels map
firthm01 Nov 6, 2023
9311762
Remove CF "niceName" and use specific label props
firthm01 Nov 6, 2023
02c831f
Constness in speaker label lookup table
firthm01 Nov 6, 2023
f040fab
channelFormatNiceNames map can be a static const
firthm01 Nov 6, 2023
2028eb7
Fix silly compare length arg
firthm01 Nov 6, 2023
ad7383f
Improve PackFormatData label generation
firthm01 Nov 6, 2023
3cf3a4c
rn AdmCommonDefinitionHelper to AdmPresetDefinitionsHelper
firthm01 Nov 7, 2023
44a7ce5
DS labels: Tidy existing positioning code
firthm01 Nov 7, 2023
9f86dac
DS labels: nice label radius calc
firthm01 Nov 7, 2023
bed5737
DS labels: Basic alg for inner/outer spk label placement
firthm01 Nov 7, 2023
1eb4d41
DS labels: Nudge labels to make clear which spk
firthm01 Nov 7, 2023
582f0d1
DS labels: Prefer nudging inners over outers
firthm01 Nov 7, 2023
14bc33b
DS labels: Make more space for speaker layers
firthm01 Nov 8, 2023
75b6dbe
DS labels: Split speaker_layer into header and source
firthm01 Nov 8, 2023
c174147
DS labels: move alg code into SpeakerLabelPlacement class
firthm01 Nov 8, 2023
109df67
DS labels: consolidate copied bits of code
firthm01 Nov 8, 2023
4a4e7e4
DS label: consistency in struct and called func args
firthm01 Nov 9, 2023
c7c83a6
DS label: consistency in struct and called func args - update header
firthm01 Nov 9, 2023
2732d3b
Pull in supplementary defs to helper
firthm01 Nov 9, 2023
04a7b66
Sort DS speaker layouts by channel count
firthm01 Nov 9, 2023
2c88f25
isCommonDefinition funcs
firthm01 Nov 9, 2023
2f60c63
Use AdmPresetDefinitionsHelper singleton in ProgrammeStoreAdmSerializer
firthm01 Nov 9, 2023
474d968
Add missing definitions from supplements
firthm01 Nov 10, 2023
94bec42
AdmPresetDefinitionsHelper needs to be able to look up PFs by CFs
firthm01 Nov 10, 2023
4a4d71e
Look up custom PFs during import by CFs
firthm01 Nov 10, 2023
7eb6cec
Improve speaker labeling. Support custom CFs.
firthm01 Nov 11, 2023
19de175
mv cartesianspeakerlayouts.h/.cpp
firthm01 Nov 11, 2023
8e94b36
PF Data lookup methods collected in AdmPresetDefinitionsHelper
firthm01 Nov 11, 2023
ae21379
Fix lvalue arg issue - MacOS builds
firthm01 Nov 12, 2023
e65bdb9
Consolidate all the "isCommonDefinition" checks
firthm01 Nov 15, 2023
7afabb0
Only ever match supposed Common Def PFs by ID
firthm01 Nov 15, 2023
35008cd
FB360 import supports supplementary definitions for DS types
firthm01 Nov 16, 2023
ae86645
VISR import supports supplementary definitions for DS types
firthm01 Nov 16, 2023
37f66b3
Update AdmPresetDefinitionsHelper prop name in ADM Export Source VST
firthm01 Nov 17, 2023
4b248ab
Simplify createTopLevelObject ATUID lookup
firthm01 Nov 17, 2023
4233e64
copyMissingTreeElms method to copy supplementary defs
firthm01 Nov 17, 2023
8b156f8
ProgrammeStoreAdmSerializer supports supplementary definitions for DS
firthm01 Nov 17, 2023
cb11429
Simplify addPresetDefinitionObjectTo even more
firthm01 Nov 17, 2023
2f72af0
createTopLevelObject can shared logic between HOA and DS
firthm01 Nov 17, 2023
c8b0c8f
Support preset defs in EAR export code
firthm01 Nov 17, 2023
0109a4e
Move addPresetDefinitionObjectTo to the helper class
firthm01 Nov 17, 2023
8798a7b
Improve comments in EarVstExportSources
firthm01 Nov 18, 2023
6e26642
Break up addPresetDefinitionObjectTo into reusable code
firthm01 Nov 18, 2023
e204f87
ObjectHolder audioPackFormat prop populated
firthm01 Nov 18, 2023
402e1eb
Support preset defs in ADM VST export code
firthm01 Nov 18, 2023
1a14347
Objects in ADM VST use 2076-2 structures too
firthm01 Nov 18, 2023
1d9a66f
Update libadm - reassignId fixes
firthm01 Dec 8, 2023
4e01fbd
Lookup CFs by props
firthm01 Dec 11, 2023
aeacaba
Fix build
firthm01 Dec 12, 2023
12da035
Fix crash when DS layout is unset
firthm01 Dec 20, 2023
805655c
Remove unused line in ADM Exp Src plugin
firthm01 Dec 20, 2023
6547b1e
Custom CFs must always be matched by properties
firthm01 Dec 20, 2023
a09c793
Call reassignIds after generating doc in ProgrammeStoreAdmSerializer
firthm01 Dec 21, 2023
3810fc9
List custom defs after common and in lighter font
firthm01 Jan 3, 2024
8eba33e
Same light/bold font logic for HOA PFs
firthm01 Jan 3, 2024
aec32eb
Neater, safer, faster ID generation
firthm01 Feb 6, 2024
b48078c
Apply ID gen optimisation in store serialiser and fix bug
firthm01 Feb 6, 2024
0a97de3
stable_sort on speaker locations
firthm01 Feb 7, 2024
5a6f5ca
Avoid passing raw ptrs around in SpeakerLabelPlacement
firthm01 Feb 7, 2024
162adf9
Improve matchingSpeakers with std::equal
firthm01 Feb 8, 2024
5b51e78
Remove unreq includes and don't inline convertPackFormatToEpsMetadata
firthm01 Feb 8, 2024
0f3dc28
Avoid copies of shared_ptrs where unnecessary
firthm01 Feb 8, 2024
fb98063
Ensure consistency of dropdown entry ordering
firthm01 Feb 8, 2024
8d8a355
Constness of methods in AdmPresetDefinitionsHelper
firthm01 Feb 8, 2024
3360df8
default ctor/dtor for AdmPresetDefinitionsHelper
firthm01 Feb 8, 2024
c85edcc
typeDefinitionDatas stored as vec rather than map
firthm01 Feb 10, 2024
f7c8340
Use const for TypeDefinitionData
firthm01 Feb 12, 2024
218a812
Constness of PackFormatData and ChannelFormatData
firthm01 Feb 12, 2024
5651c47
Constness of relatedChannelFormats/relatedPackFormats
firthm01 Feb 12, 2024
9ff952e
Improve CF equality code
firthm01 Feb 12, 2024
6b14e36
Remove unnecessary line of code
firthm01 Feb 12, 2024
204d005
Simplify use of optionals
firthm01 Feb 12, 2024
4c09fa7
Avoid unnecessary copy
firthm01 Feb 12, 2024
1a27b3a
Move simple assignments to initialiser lists
firthm01 Feb 13, 2024
318e265
Guard against shorter than expected speaker urns
firthm01 Feb 13, 2024
4c144b0
Consolidate ITU URN parsing code
firthm01 Feb 13, 2024
32a7207
Tidy setupPresetDefinitionObject before further work
firthm01 Feb 13, 2024
76ce3fb
getDocumentAudioPackFormat func to break up setupPresetDefinitionObject
firthm01 Feb 13, 2024
d0f81e5
getElementRelationships shouldn't need to be called separately to pop…
firthm01 Feb 13, 2024
6937ccc
Simplify matching of channel formats in a pack format
firthm01 Feb 13, 2024
856dc72
Shouldn't std::move a const
firthm01 Feb 13, 2024
e7d6caa
Enforce use of AdmPresetDefinitionsHelper as singleton using reference
firthm01 Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove hardcoded layouts: EARPluginSuite uses pack format ids
WIP - will not compile at this stage
  • Loading branch information
firthm01 committed Dec 14, 2023
commit 2e3bd7593e94da3ad5b64c784ca079aa6a0277b4
47 changes: 24 additions & 23 deletions reaper-adm-extension/src/reaper_adm/pluginsuite_ear.cpp
Original file line number Diff line number Diff line change
@@ -125,21 +125,17 @@ std::vector<int> determineUsedDirectSpeakersTrackMappingValues(PluginInstance& p
auto trackMapping = plugin.getParameterWithConvertToInt(*(trackMappingParam.get()));
assert(trackMapping.has_value());

auto packFormatIdValueParam = createPluginParameter(static_cast<int>(EarDirectSpeakersParameters::PACKFORMAT_ID_VALUE), { PACKFORMAT_ID_VALUE_MIN, PACKFORMAT_ID_VALUE_MAX });
auto packFormatIdValue = plugin.getParameterWithConvertToInt(*(packFormatIdValueParam.get()));
assert(packFormatIdValue.has_value());

int trackWidth = 1; // Track mapping is single channel by default.
if(packFormatIdValue.has_value()) {
auto speakerLayoutIndex = ear::plugin::getIndexFromPackFormatIdValue(*packFormatIdValue);
if(speakerLayoutIndex >= 0) {
trackWidth = ear::plugin::SPEAKER_SETUPS[speakerLayoutIndex].speakers.size();
}
}

if(trackMapping.has_value() && *trackMapping >= 0) {
for(int channelCounter = 0; channelCounter < trackWidth; channelCounter++) {
usedValues.push_back((*trackMapping) + channelCounter);
auto packFormatIdParam = createPluginParameter(static_cast<int>(EarDirectSpeakersParameters::PACKFORMAT_ID_VALUE), { PACKFORMAT_ID_VALUE_MIN, PACKFORMAT_ID_VALUE_MAX });
auto packFormatId = plugin.getParameterWithConvertToInt(*(packFormatIdParam.get()));
assert(packFormatId.has_value());

if (trackMapping.has_value() && *trackMapping >= 0 && packFormatId.has_value()) {
auto pfData = AdmCommonDefinitionHelper::getSingleton()->getPackFormatData(1, *packFormatId);
if (pfData) {
int trackWidth = pfData->relatedChannelFormats.size();
for (int channelCounter = 0; channelCounter < trackWidth; channelCounter++) {
usedValues.push_back((*trackMapping) + channelCounter);
}
}
}

@@ -424,25 +420,30 @@ void EARPluginSuite::onCreateDirectTrack(TrackElement & trackElement, const Reap
if(automationElements.size() > 0) {
auto channel = automationElements.front()->channel();
auto packFormat = channel.packFormat();
auto speakerLayoutIndex = ear::plugin::getIndexFromPackFormatId(adm::formatId(packFormat->get<adm::AudioPackFormatId>()));
auto packFormatIdValue = packFormat->get<adm::AudioPackFormatId>().get<adm::AudioPackFormatIdValue>().get();

if(speakerLayoutIndex < 0) {
auto pfData = AdmCommonDefinitionHelper::getSingleton()->getPackFormatData(1, packFormatIdValue);
if (!pfData) {
// Could be cart pf
auto cartLayout = getCartLayout(*packFormat);
if(cartLayout) {
speakerLayoutIndex = ear::plugin::getIndexFromPackFormatId(getMappedCommonPackId(*cartLayout));
if (cartLayout) {
auto altPfIdStr = getMappedCommonPackId(*cartLayout);
auto altPfId = adm::parseAudioPackFormatId(altPfIdStr);
auto altPfIdValue = altPfId.get<adm::AudioPackFormatIdValue>().get();
pfData = AdmCommonDefinitionHelper::getSingleton()->getPackFormatData(1, altPfIdValue);
if (pfData) {
packFormatIdValue = altPfIdValue;
}
}
}

if(speakerLayoutIndex >= 0) {

if(pfData) {
int32_t routingToScene = -1;
if(trackInfo.routingStartChannel.has_value()) {
routingToScene = *trackInfo.routingStartChannel;
}

auto plugin = createAndNamePlugin(DIRECTSPEAKERS_METADATA_PLUGIN_NAME, trackInfo.track.get(), &trackElement, routingToScene);

auto packFormatIdValue = ear::plugin::SPEAKER_SETUPS[speakerLayoutIndex].packFormatIdValue;
plugin->setParameter(*directPackFormatIdValueParameter, directPackFormatIdValueParameter->forwardMap(packFormatIdValue));

if(routingToScene >= 0) {