summaryrefslogtreecommitdiff
path: root/src/MXF.cpp
diff options
context:
space:
mode:
authorBrogan Ross <brogan.ross@bydeluxe.com>2021-01-28 10:54:15 -0800
committerBrogan Ross <brogan.ross@bydeluxe.com>2021-01-28 10:54:15 -0800
commita445d5132dbbcf27656fe47d4db277db1ae31e38 (patch)
tree62fa63aa8c2fe4be27224c4f736c0b9a2e48caa9 /src/MXF.cpp
parent8400c964b7852fd5be2b23640bf665cf69d85593 (diff)
adding SLVS language assignment functionality
Diffstat (limited to 'src/MXF.cpp')
-rwxr-xr-xsrc/MXF.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/MXF.cpp b/src/MXF.cpp
index 83954f7..974f61f 100755
--- a/src/MXF.cpp
+++ b/src/MXF.cpp
@@ -1599,6 +1599,7 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label
InterchangeObject_list_t& descriptor_list, ui32_t& channel_count)
{
std::string symbol_buf;
+ std::string current_language;
channel_count = 0;
ASDCP::MXF::SoundfieldGroupLabelSubDescriptor *current_soundfield = 0, *prev_soundfield = 0;
std::string::const_iterator i;
@@ -1695,6 +1696,15 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label
symbol_buf.clear();
current_soundfield = 0;
}
+ else if ( *i == ':' )
+ {
+ // Limits the usage to the SLVS channel, but can easily be extended to set individual languages, or soundfield group languages
+ if ( symbol_buf.compare("SLVS") != 0 ) {
+ DefaultLogSink().Error("Channel specific language may only be used with SLVS tag\n");
+ return false;
+ }
+ current_language += *i;
+ }
else if ( *i == ',' )
{
if ( ! symbol_buf.empty() && ! symbol_buf.compare("-") )
@@ -1730,15 +1740,35 @@ ASDCP::MXF::decode_mca_string(const std::string& s, const mca_label_map_t& label
channel_descr->MCAChannelID = channel_count++ + 1;
channel_descr->MCATagSymbol = (i->second.requires_prefix ? "ch" : "") + i->first;
channel_descr->MCATagName = i->second.tag_name;
- channel_descr->RFC5646SpokenLanguage = language;
+ if ( current_language.empty() )
+ {
+ channel_descr->RFC5646SpokenLanguage = language;
+ }
+ else
+ {
+ channel_descr->RFC5646SpokenLanguage = current_language;
+ }
+ current_language.empty();
channel_descr->MCALabelDictionaryID = i->second.ul;
descriptor_list.push_back(reinterpret_cast<ASDCP::MXF::InterchangeObject*>(channel_descr));
symbol_buf.clear();
+ current_language.clear();
}
}
else if ( *i == '-' || isalnum(*i) )
{
- symbol_buf += *i;
+ if ( ! current_language.empty() )
+ {
+ if ( current_language.compare(":") == 0)
+ {
+ current_language.clear();
+ }
+ current_language += *i;
+ }
+ else
+ {
+ symbol_buf += *i;
+ }
}
else if ( ! isspace(*i) )
{