Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "submodules/libadm"]
path = submodules/libadm
url = https://github.com/rsjtaylor/libadm.git
url = https://github.com/merktj/libadm.git
[submodule "submodules/libbw64"]
path = submodules/libbw64
url = https://github.com/ebu/libbw64.git
Expand Down
477 changes: 290 additions & 187 deletions ear-production-suite/lib/include/speaker_setups.hpp

Large diffs are not rendered by default.

32 changes: 20 additions & 12 deletions ear-production-suite/lib/messages/type_metadata.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,26 @@ enum SpeakerLayout {
ITU_BS_2051_UNKNOWN = -1;
ITU_BS_2051_0_1_0 = 0;
ITU_BS_2051_0_2_0 = 1;
ITU_BS_2051_0_5_0 = 2;
ITU_BS_2051_2_5_0 = 3;
ITU_BS_2051_4_5_0 = 4;
ITU_BS_2051_4_5_1 = 5;
ITU_BS_2051_3_7_0 = 6;
ITU_BS_2051_4_9_0 = 7;
ITU_BS_2051_9_10_3 = 8;
ITU_BS_2051_0_7_0 = 9;
ITU_BS_2051_4_7_0 = 10;
ITU_BS_2094_2_7_0_AP_00010016 = 11;
ITU_BS_755_0_3_0 = 12;
ITU_BS_2051_0_5_0_NO_LFE = 13;
ITU_BS_755_0_3_0 = 2;
ITU_BS_755_0_4_0 = 3;
ITU_BS_2051_0_5_0_NO_LFE = 4;
ITU_BS_2051_0_5_0 = 5;
ITU_BS_2051_0_6_0 = 6;
ITU_BS_2094_0_7_0_FRONT = 7;
ITU_BS_2051_0_7_0_BACK = 8;
ITU_BS_2051_2_5_0 = 9;
ITU_BS_2094_0_7_0_SIDE = 10;
ITU_BS_2094_2_5_0 = 11;
ITU_BS_2094_2_7_0_SCREEN = 12;
ITU_BS_2094_2_7_0 = 13;
ITU_BS_2051_4_5_0 = 14;
ITU_BS_2051_4_5_1 = 15;
ITU_BS_2051_3_7_0 = 16;
ITU_BS_2094_4_7_0 = 17;
ITU_BS_2051_4_7_0 = 18;
ITU_BS_2051_4_9_0 = 19;
ITU_BS_2051_9_10_3 = 20;
ITU_BS_2094_9_9_0 = 21;
}

message Speaker {
Expand Down
36 changes: 26 additions & 10 deletions ear-production-suite/lib/src/helper/protobuf_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,52 @@ std::map<SpeakerLayout, std::string>
SpeakerLayoutTranslator::SpeakerLayoutProtoToEarLUT_ = {
{SpeakerLayout::ITU_BS_2051_0_1_0, std::string("AP_00010001")},
{SpeakerLayout::ITU_BS_2051_0_2_0, std::string("AP_00010002")},
{SpeakerLayout::ITU_BS_755_0_3_0, std::string("AP_0001000a")},
{SpeakerLayout::ITU_BS_755_0_4_0, std::string("AP_0001000b")},
{SpeakerLayout::ITU_BS_2051_0_5_0_NO_LFE, std::string("AP_0001000c")},
{SpeakerLayout::ITU_BS_2051_0_5_0, std::string("AP_00010003")},
{SpeakerLayout::ITU_BS_2051_0_6_0, std::string("AP_0001000d")},
{SpeakerLayout::ITU_BS_2094_0_7_0_FRONT, std::string("AP_0001000e")},
{SpeakerLayout::ITU_BS_2051_0_7_0_BACK, std::string("AP_0001000f")},
{SpeakerLayout::ITU_BS_2051_2_5_0, std::string("AP_00010004")},
{SpeakerLayout::ITU_BS_2094_0_7_0_SIDE, std::string("AP_00010012")},
{SpeakerLayout::ITU_BS_2094_2_5_0, std::string("AP_00010013")},
{SpeakerLayout::ITU_BS_2094_2_7_0_SCREEN, std::string("AP_00010014")},
{SpeakerLayout::ITU_BS_2094_2_7_0, std::string("AP_00010016")},
{SpeakerLayout::ITU_BS_2051_4_5_0, std::string("AP_00010005")},
{SpeakerLayout::ITU_BS_2051_4_5_1, std::string("AP_00010010")},
{SpeakerLayout::ITU_BS_2051_3_7_0, std::string("AP_00010007")},
{SpeakerLayout::ITU_BS_2094_4_7_0, std::string("AP_00010015")},
{SpeakerLayout::ITU_BS_2051_4_7_0, std::string("AP_00010017")},
{SpeakerLayout::ITU_BS_2051_4_9_0, std::string("AP_00010008")},
{SpeakerLayout::ITU_BS_2051_9_10_3, std::string("AP_00010009")},
{SpeakerLayout::ITU_BS_2051_0_7_0, std::string("AP_0001000f")},
{SpeakerLayout::ITU_BS_2051_4_7_0, std::string("AP_00010017")},
{SpeakerLayout::ITU_BS_2051_0_5_0_NO_LFE, std::string{"AP_0001000c"}},
{SpeakerLayout::ITU_BS_755_0_3_0, std::string{"AP_0001000a"}},
{SpeakerLayout::ITU_BS_2094_2_7_0_AP_00010016, std::string{"AP_00020026"}}
{SpeakerLayout::ITU_BS_2094_9_9_0, std::string("AP_00010011")}
};

std::map<std::string, SpeakerLayout>
SpeakerLayoutTranslator::SpeakerLayoutEarToProtoLUT_ = {
{std::string("AP_00010001"), SpeakerLayout::ITU_BS_2051_0_1_0},
{std::string("AP_00010002"), SpeakerLayout::ITU_BS_2051_0_2_0},
{std::string("AP_0001000a"), SpeakerLayout::ITU_BS_755_0_3_0},
{std::string("AP_0001000b"), SpeakerLayout::ITU_BS_755_0_4_0},
{std::string("AP_0001000c"), SpeakerLayout::ITU_BS_2051_0_5_0_NO_LFE},
{std::string("AP_00010003"), SpeakerLayout::ITU_BS_2051_0_5_0},
{std::string("AP_0001000d"), SpeakerLayout::ITU_BS_2051_0_6_0},
{std::string("AP_0001000e"), SpeakerLayout::ITU_BS_2094_0_7_0_FRONT},
{std::string("AP_0001000f"), SpeakerLayout::ITU_BS_2051_0_7_0_BACK},
{std::string("AP_00010004"), SpeakerLayout::ITU_BS_2051_2_5_0},
{std::string("AP_00010012"), SpeakerLayout::ITU_BS_2094_0_7_0_SIDE},
{std::string("AP_00010013"), SpeakerLayout::ITU_BS_2094_2_5_0},
{std::string("AP_00010014"), SpeakerLayout::ITU_BS_2094_2_7_0_SCREEN},
{std::string("AP_00010016"), SpeakerLayout::ITU_BS_2094_2_7_0},
{std::string("AP_00010005"), SpeakerLayout::ITU_BS_2051_4_5_0},
{std::string("AP_00010010"), SpeakerLayout::ITU_BS_2051_4_5_1},
{std::string("AP_00010007"), SpeakerLayout::ITU_BS_2051_3_7_0},
{std::string("AP_00010015"), SpeakerLayout::ITU_BS_2094_4_7_0},
{std::string("AP_00010017"), SpeakerLayout::ITU_BS_2051_4_7_0},
{std::string("AP_00010008"), SpeakerLayout::ITU_BS_2051_4_9_0},
{std::string("AP_00010009"), SpeakerLayout::ITU_BS_2051_9_10_3},
{std::string("AP_0001000f"), SpeakerLayout::ITU_BS_2051_0_7_0},
{std::string("AP_00010017"), SpeakerLayout::ITU_BS_2051_4_7_0},
{std::string{"AP_0001000c"}, SpeakerLayout::ITU_BS_2051_0_5_0_NO_LFE},
{std::string{"AP_0001000a"}, SpeakerLayout::ITU_BS_755_0_3_0},
{std::string{"AP_00020026"}, SpeakerLayout::ITU_BS_2094_2_7_0_AP_00010016}
{std::string("AP_00010011"), SpeakerLayout::ITU_BS_2094_9_9_0}
};

std::string SpeakerLayoutTranslator::proto2ear(const SpeakerLayout& layout) {
Expand Down
47 changes: 25 additions & 22 deletions ear-production-suite/lib/src/programme_store_adm_serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,30 +304,33 @@ void ProgrammeStoreAdmSerializer::createTopLevelObject(
serializedObjects[connectionId] = objectHolder.audioObject;
} else if (metadata.has_ds_metadata()) {
auto layoutIndex = metadata.ds_metadata().layout();
std::string speakerSetupName;
if (layoutIndex >= 0) {
speakerSetupName = SPEAKER_SETUPS.at(layoutIndex).name;
}
auto objectHolder = addSimpleCommonDefinitionsObjectTo(
doc, metadata.name(), speakerSetupName);
setInteractivity(*objectHolder.audioObject, object);
content.addReference(objectHolder.audioObject);
auto audioPackFormatId =
adm::formatId(adm::audioPackFormatLookupTable().at(speakerSetupName));
std::vector<std::string> speakerLabels =
adm::speakerLabelsLookupTable().at(speakerSetupName);
for (auto i{0u}; i < objectHolder.audioTrackUids.size(); ++i) {
auto speakerLabel = speakerLabels.at(i);
auto audioTrackUidId =
formatId(objectHolder.audioTrackUids.at(speakerLabel)
->get<adm::AudioTrackUidId>());
auto audioTrackFormatId =
formatId(adm::audioTrackFormatLookupTable().at(speakerLabel));
chna.addAudioId(bw64::AudioId{
static_cast<uint16_t>(metadata.routing() + i + 1), audioTrackUidId,
audioTrackFormatId, audioPackFormatId});
std::vector<std::string> speakerLabels;
std::vector<std::string> trackFormatIds;
auto& speakerSetup = SPEAKER_SETUPS.at(layoutIndex);
for (auto& speaker : speakerSetup.speakers) {
speakerLabels.push_back(speaker.label);
auto channelFormatId = speaker.channelFormatId;
auto trackFormatId = channelFormatId.replace(0, 2, "AT") + "_01";
trackFormatIds.push_back(trackFormatId);
}
auto objectHolder = addSimpleCommonDefinitionsObjectTo(
doc, metadata.name(), speakerSetup.packFormatId, trackFormatIds,
speakerLabels);
setInteractivity(*objectHolder.audioObject, object);
content.addReference(objectHolder.audioObject);
for (auto i{0u}; i < objectHolder.audioTrackUids.size(); ++i) {
auto speakerLabel = speakerLabels.at(i);
auto audioTrackUidId =
formatId(objectHolder.audioTrackUids.at(speakerLabel)
->get<adm::AudioTrackUidId>());
chna.addAudioId(
bw64::AudioId{static_cast<uint16_t>(metadata.routing() + i + 1),
audioTrackUidId, trackFormatIds.at(i),
speakerSetup.packFormatId});
}
serializedObjects[connectionId] = objectHolder.audioObject;
}
serializedObjects[connectionId] = objectHolder.audioObject;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,9 @@ class ValueBoxMain : public Component {
addAndMakeVisible(speakerSetupLabel_.get());
speakerSetupsComboBox_->setDefaultText("select speaker layout");

speakerSetupsComboBox_->addTextEntry("mono (0+1+0)");
speakerSetupsComboBox_->addTextEntry("stereo (0+2+0)");
speakerSetupsComboBox_->addTextEntry("5.1 (0+5+0)");
speakerSetupsComboBox_->addTextEntry("5.1+2H (2+5+0)");
speakerSetupsComboBox_->addTextEntry("5.1+4H (4+5+0)");
speakerSetupsComboBox_->addTextEntry(" (4+5+1)");
speakerSetupsComboBox_->addTextEntry("7.2+3H (3+7+0)");
speakerSetupsComboBox_->addTextEntry("9.1+4H (4+9+0)");
speakerSetupsComboBox_->addTextEntry("22.2 (9+10+3)");
speakerSetupsComboBox_->addTextEntry("7.1 (0+7+0)");
speakerSetupsComboBox_->addTextEntry("7.1+4H (4+7+0)");
speakerSetupsComboBox_->addTextEntry("7.1+2H (2+7+0)");
speakerSetupsComboBox_->addTextEntry("3.0 (0+3+0)");
speakerSetupsComboBox_->addTextEntry("5.0 (0+5+0)");
for (auto const& setup : SPEAKER_SETUPS) {
speakerSetupsComboBox_->addTextEntry(setup.displayName + " (" + setup.name + ")" + " - " + setup.specification);
}
addAndMakeVisible(speakerSetupsComboBox_.get());

for (auto colour : EarColours::Items) {
Expand Down
23 changes: 12 additions & 11 deletions ear-production-suite/plugins/monitoring/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(SOURCES_MONITORING
)


function(add_monitoring_plugin SPEAKER_LAYOUT SPEAKER_LAYOUT_NAME PLUGIN_CODE_SUFFIX)
function(add_monitoring_plugin SPEAKER_LAYOUT SPEAKER_LAYOUT_NAME AUDIO_PACK_FORMAT_ID PLUGIN_CODE_SUFFIX)
add_juce_vst3_plugin(
ear_monitoring_${SPEAKER_LAYOUT}
SOURCES ${SOURCES_MONITORING}
Expand All @@ -18,21 +18,22 @@ function(add_monitoring_plugin SPEAKER_LAYOUT SPEAKER_LAYOUT_NAME PLUGIN_CODE_SU
ear_monitoring_${SPEAKER_LAYOUT}_VST3 PRIVATE
SPEAKER_LAYOUT="${SPEAKER_LAYOUT}"
SPEAKER_LAYOUT_NAME="${SPEAKER_LAYOUT_NAME}"
AUDIO_PACK_FORMAT_ID="${AUDIO_PACK_FORMAT_ID}"
)
target_link_libraries(ear_monitoring_${SPEAKER_LAYOUT}_VST3 PRIVATE ear-plugin-base)
install_juce_vst3_plugin(ear_monitoring_${SPEAKER_LAYOUT} "${EPS_PLUGIN_INSTALL_PREFIX}VST3/ear-production-suite")
endfunction()


add_monitoring_plugin("0+2+0" "2.0" "A0") # Let's start monitoring suffixes from A0 and increment
add_monitoring_plugin("0+2+0" "2.0" "AP_00010002" "A0") # Let's start monitoring suffixes from A0 and increment
if(EAR_PLUGINS_BUILD_ALL_MONITORING_PLUGINS)
add_monitoring_plugin("0+5+0" "5.1" "A1")
add_monitoring_plugin("2+5+0" "5.1+2H" "A2")
add_monitoring_plugin("4+5+0" "5.1+4H" "A3")
add_monitoring_plugin("4+5+1" "" "A4")
add_monitoring_plugin("3+7+0" "7.2+3H" "A5")
add_monitoring_plugin("4+9+0" "9.1+4H" "A6")
add_monitoring_plugin("9+10+3" "22.2" "A7")
add_monitoring_plugin("0+7+0" "7.1" "A8")
add_monitoring_plugin("4+7+0" "7.1+4H" "A9")
add_monitoring_plugin("0+5+0" "5.1" "AP_00010003" "A1")
add_monitoring_plugin("2+5+0" "5.1+2H" "AP_00010004" "A2")
add_monitoring_plugin("4+5+0" "5.1+4H" "AP_00010005" "A3")
add_monitoring_plugin("4+5+1" "" "AP_00010010" "A4")
add_monitoring_plugin("3+7+0" "7.2+3H" "AP_00010007" "A5")
add_monitoring_plugin("4+9+0" "9.1+4H" "AP_00010008" "A6")
add_monitoring_plugin("9+10+3" "22.2" "AP_00010009" "A7")
add_monitoring_plugin("0+7+0" "7.1" "AP_0001000f" "A8")
add_monitoring_plugin("4+7+0" "7.1+4H" "AP_00010017" "A9")
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ EarMonitoringAudioProcessorEditor::EarMonitoringAudioProcessorEditor(
addAndMakeVisible(speakerMeterBoxTop_.get());
addAndMakeVisible(speakerMeterBoxBottom_.get());

auto speakers = ear::plugin::speakerSetupByName(SPEAKER_LAYOUT).speakers;
auto speakers = ear::plugin::speakerSetupByPackFormatId(AUDIO_PACK_FORMAT_ID).speakers;
for (int i = 0; i < speakers.size(); ++i) {
std::string ituLabel = speakers.at(i).label;
auto pos = ituLabel.find("-");
Expand Down
2 changes: 1 addition & 1 deletion ear-production-suite/test/scene_gains_calculator_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void updateExpectedGainMatrix(

TEST_CASE("scene gain calculation (DirectSpeakers)") {
proto::SceneStore store;
auto obj1 = proto::convertSpeakerSetupToEpsMetadata(4);
auto obj1 = proto::convertSpeakerSetupToEpsMetadata(14);
REQUIRE(obj1->speakers_size() == 10);

auto layout = ear::getLayout("0+5+0");
Expand Down
2 changes: 1 addition & 1 deletion submodules/libadm
Submodule libadm updated 40 files
+1 −1 .github/workflows/coverage.yml
+4 −1 .github/workflows/macos.yml
+3 −5 .github/workflows/windows.yml
+3 −0 CHANGELOG.md
+7 −5 README.md
+1 −1 docs/getting_started.rst
+2 −2 docs/index.rst
+8 −7 include/adm/elements/audio_block_format_direct_speakers.hpp
+1 −0 include/adm/elements/audio_channel_format.hpp
+9 −9 include/adm/elements/position_types.hpp
+8 −8 include/adm/elements/speaker_position.hpp
+1 −0 include/adm/helper/element_range.hpp
+6 −4 include/adm/private/rapidxml_formatter.hpp
+5 −3 include/adm/private/xml_parser.hpp
+1 −0 include/adm/utilities/comparator.hpp
+1 −0 include/adm/utilities/lookup.hpp
+25 −0 include/adm/utilities/object_creation.hpp
+1 −1 resources/common_definitions.xml
+6 −21 src/elements/audio_block_format_direct_speakers.cpp
+2 −0 src/elements/audio_object.cpp
+1 −0 src/elements/audio_pack_format.cpp
+2 −0 src/elements/audio_programme.cpp
+2 −0 src/elements/audio_stream_format.cpp
+82 −51 src/elements/speaker_position.cpp
+92 −26 src/private/rapidxml_formatter.cpp
+44 −25 src/private/xml_parser.cpp
+35 −0 src/utilities/object_creation.cpp
+1 −0 tests/CMakeLists.txt
+70 −37 tests/audio_block_format_direct_speakers_tests.cpp
+1 −0 tests/audio_channel_format_tests.cpp
+106 −5 tests/speaker_position_tests.cpp
+16 −0 tests/test_data/write_default_cartesian_speaker.accepted.xml
+16 −0 tests/test_data/write_default_spherical_speaker.accepted.xml
+24 −0 tests/test_data/write_specified_cartesian_speaker.accepted.xml
+24 −0 tests/test_data/write_specified_spherical_speaker.accepted.xml
+24 −0 tests/test_data/xml_parser/audio_block_format_direct_speakers_cartesian.xml
+16 −0 tests/test_data/xml_parser/audio_block_format_direct_speakers_cartesian_bad_bound.xml
+16 −0 tests/test_data/xml_parser/audio_block_format_direct_speakers_cartesian_bad_coord.xml
+73 −3 tests/xml_parser_audio_block_format_direct_speakers_tests.cpp
+74 −0 tests/xml_writer_audio_block_format_tests.cpp