summaryrefslogtreecommitdiff
path: root/libs/ardour/broadcast_info.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-09-29 01:20:09 +0200
committerRobin Gareus <robin@gareus.org>2015-09-29 01:20:30 +0200
commitb8ccf8acccdab918beef6bd6d37ffaf754cf31ed (patch)
tree0e896610e80952bd1ee6efb88c9b31484efa39bb /libs/ardour/broadcast_info.cc
parentdeabc0f41b33f877abade96b56770b35bafea71e (diff)
BWF USID according to EBU-R99
Diffstat (limited to 'libs/ardour/broadcast_info.cc')
-rw-r--r--libs/ardour/broadcast_info.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/libs/ardour/broadcast_info.cc b/libs/ardour/broadcast_info.cc
index a08d2c7991..7e092db21b 100644
--- a/libs/ardour/broadcast_info.cc
+++ b/libs/ardour/broadcast_info.cc
@@ -90,12 +90,19 @@ BroadcastInfo::set_originator_ref_from_session (Session const & /*session*/)
/* Serial number is 12 chars */
std::ostringstream serial_number;
- serial_number << "ARDOUR" << "r" << std::setfill('0') << std::right << std::setw(5) << revision;
-
+ serial_number << PROGRAM_NAME << revision;
+
+ /* https://tech.ebu.ch/docs/r/r099.pdf
+ * CC Country code: (2 characters) based on the ISO 3166-1 standard
+ * OOO Organisation code: (3 characters) based on the EBU facility codes, Tech 3279
+ * NNNNNNNNNNNN Serial number: (12 characters extracted from the recorder model and serial number) This should identify the machine’s type and serial number.
+ * HHMMSS OriginationTime (6 characters,) from the <OriginationTime> field of the BWF.
+ * RRRRRRRRR Random Number (9 characters 0-9) Generated locally by the recorder using some reasonably random algorithm.
+ */
snprintf_bounded_null_filled (info->originator_reference, sizeof (info->originator_reference), "%2s%3s%12s%02d%02d%02d%9d",
- SessionMetadata::Metadata()->country().c_str(),
- SessionMetadata::Metadata()->organization().c_str(),
- serial_number.str().c_str(),
+ SessionMetadata::Metadata()->country().substr (0, 2).c_str(),
+ SessionMetadata::Metadata()->organization().substr (0, 3).c_str(),
+ serial_number.str().substr (0, 12).c_str(),
_time.tm_hour,
_time.tm_min,
_time.tm_sec,