forked from ebu/libadm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate_from_scratch.cpp
34 lines (28 loc) · 1016 Bytes
/
create_from_scratch.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
#include <iostream>
#include <sstream>
#include "adm/adm.hpp"
#include "adm/utilities/id_assignment.hpp"
#include "adm/utilities/object_creation.hpp"
#include "adm/write.hpp"
int main() {
using namespace adm;
// create ADM elements
auto admProgramme = AudioProgramme::create(
AudioProgrammeName("Alice and Bob talking in the forrest"));
auto speechContent = AudioContent::create(AudioContentName("Speech"));
auto atmoContent = AudioContent::create(AudioContentName("Atmo"));
admProgramme->addReference(speechContent);
admProgramme->addReference(atmoContent);
auto holder = createSimpleObject("Alice");
speechContent->addReference(holder.audioObject);
holder = createSimpleObject("Bob");
speechContent->addReference(holder.audioObject);
auto admDocument = Document::create();
admDocument->add(admProgramme);
reassignIds(admDocument);
// write XML data to stdout
std::stringstream xmlStream;
writeXml(xmlStream, admDocument);
std::cout << xmlStream.str();
return 0;
}