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

allow multiple loudnessMetadata elements in audioProgramme and audioContent #84

Closed
tomjnixon opened this issue May 5, 2021 · 4 comments · Fixed by #110
Closed

allow multiple loudnessMetadata elements in audioProgramme and audioContent #84

tomjnixon opened this issue May 5, 2021 · 4 comments · Fixed by #110
Assignees
Labels

Comments

@tomjnixon
Copy link
Member

In BS.2076-2, there may be multiple loudnessMetadata elements in audioProgramme and audioContent; see tables 32 and 38,

@tomjnixon
Copy link
Member Author

We're not sure what the API of this should be.

One option would be to wrap this in a class:

struct LoudnessMetadatas {
  using tag = ...;
  std::vector<LoudnessMetadata> data;
};

audioObject.get<LoudnessMetadatas>().get();
audioObject.set(LoudnessMetadatas{std::vector<LoudnessMetadata>{...}});

... or to just use a std::vector<LoudnessMetadata> directly:

using LoudnessMetadatas = std::vector<LoudnessMetadata>;
audioObject.get<LoudnessMetadatas>();
audioObject.set(std::vector<LoudnessMetadata>{...});

... or to add an API to AudioObject to add and remove LoudnessMetadatas:

std::shared_ptr<LoudnessMetadata> loudnessMetadata = LoudnessMetadata::create();
audioObject.add(loudnessMetadata);
audioObject.remove(loudnessMetadata);
audioObject.getLoudnessMetadata() -> std::vector<std::shared_ptr<LoudnessMetadata>>

I think we both prefer option 2.

@tomjnixon
Copy link
Member Author

The decision here should probably apply to #90, too

@rsjbailey
Copy link
Contributor

rsjbailey commented May 7, 2021

Elsewhere in the library where there is this sort of relationship (for example
SpeakerLabels in AudioBlockFormatDirectSpeakers) the plural type is just an alias for std::vector, then there are add() and remove() methods for the singular type in the parent.

@tomjnixon
Copy link
Member Author

Oh yeah! I tried to think of other cases like that, but didn't spot that one.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment