forked from ebu/libadm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
multiple_languages_1.cpp
56 lines (48 loc) · 2.14 KB
/
multiple_languages_1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <sstream>
#include "adm/adm.hpp"
#include "adm/utilities/object_creation.hpp"
#include "adm/write.hpp"
int main() {
using namespace adm;
// create ADM elements
auto programmeEn = AudioProgramme::create(
AudioProgrammeName("English Programme"), AudioProgrammeLanguage("en"));
auto programmeDe = AudioProgramme::create(
AudioProgrammeName("German Programme"), AudioProgrammeLanguage("de"));
auto contentEn = AudioContent::create(AudioContentName("Englisch Content"),
AudioContentLanguage("en"));
auto contentDe = AudioContent::create(AudioContentName("German Content"),
AudioContentLanguage("de"));
auto ambienceContent = AudioContent::create(AudioContentName("Ambience"));
auto musicContent = AudioContent::create(AudioContentName("Music"));
auto englishNarrator = createSimpleObject("English Narrator");
auto germanNarrator = createSimpleObject("German Narrator");
auto ambience = createSimpleObject("Ambience");
auto music = createSimpleObject("Music");
englishNarrator.audioChannelFormat->add(
AudioBlockFormatObjects(SphericalPosition()));
germanNarrator.audioChannelFormat->add(
AudioBlockFormatObjects(SphericalPosition()));
ambience.audioChannelFormat->add(
AudioBlockFormatObjects(SphericalPosition()));
music.audioChannelFormat->add(AudioBlockFormatObjects(SphericalPosition()));
programmeEn->addReference(contentEn);
programmeEn->addReference(ambienceContent);
programmeEn->addReference(musicContent);
programmeDe->addReference(contentDe);
programmeDe->addReference(ambienceContent);
programmeDe->addReference(musicContent);
contentEn->addReference(englishNarrator.audioObject);
contentDe->addReference(germanNarrator.audioObject);
ambienceContent->addReference(ambience.audioObject);
musicContent->addReference(music.audioObject);
auto admDocument = Document::create();
admDocument->add(programmeEn);
admDocument->add(programmeDe);
// write XML data to stdout
std::stringstream xmlStream;
writeXml(xmlStream, admDocument);
std::cout << xmlStream.str();
return 0;
}