summaryrefslogtreecommitdiff
path: root/src/sound_asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-05-28 23:01:32 +0200
committerCarl Hetherington <cth@carlh.net>2023-05-28 23:01:32 +0200
commit7de292067e73b0b96fa07f8d192689d844fcb270 (patch)
tree8b9fbc0ef4baa75a75573f703e1f54737b17cb21 /src/sound_asset.cc
parent7df6916987eeff65ff2f20f99ea0edbd90116f8c (diff)
Add SoundAsset::active_channels().v1.8.72
Diffstat (limited to 'src/sound_asset.cc')
-rw-r--r--src/sound_asset.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index 7c94b549..ea952c35 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -104,6 +104,16 @@ SoundAsset::SoundAsset (boost::filesystem::path file)
}
}
+ list<ASDCP::MXF::InterchangeObject*> channel_labels;
+ rr = reader.OP1aHeader().GetMDObjectsByType(
+ asdcp_smpte_dict->ul(ASDCP::MDD_AudioChannelLabelSubDescriptor),
+ channel_labels
+ );
+
+ if (KM_SUCCESS(rr)) {
+ _active_channels = channel_labels.size();
+ }
+
_id = read_writer_info (info);
}
@@ -266,3 +276,11 @@ SoundAsset::valid_mxf (boost::filesystem::path file)
Kumu::Result_t r = reader.OpenRead (file.string().c_str());
return !ASDCP_FAILURE (r);
}
+
+
+int
+SoundAsset::active_channels() const
+{
+ return _active_channels.get_value_or(_channels);
+}
+