summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/smpte_subtitle_asset.cc38
-rw-r--r--src/smpte_subtitle_asset.h3
2 files changed, 17 insertions, 24 deletions
diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc
index 28d8b261..9878ea1f 100644
--- a/src/smpte_subtitle_asset.cc
+++ b/src/smpte_subtitle_asset.cc
@@ -49,36 +49,30 @@ SMPTESubtitleAsset::SMPTESubtitleAsset ()
}
-/** Construct a SMPTESubtitleAsset by reading an XML or MXF file.
+/** Construct a SMPTESubtitleAsset by reading an MXF file.
* @param file Filename.
- * @param mxf true if file is an MXF, false if it is XML.
*/
-SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file, bool mxf)
+SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file)
: SubtitleAsset (file)
{
shared_ptr<cxml::Document> xml (new cxml::Document ("SubtitleReel"));
- if (mxf) {
- ASDCP::TimedText::MXFReader reader;
- Kumu::Result_t r = reader.OpenRead (file.string().c_str ());
- if (ASDCP_FAILURE (r)) {
- boost::throw_exception (MXFFileError ("could not open MXF file for reading", file, r));
- }
-
- string s;
- reader.ReadTimedTextResource (s, 0, 0);
- stringstream t;
- t << s;
- xml->read_stream (t);
-
- ASDCP::WriterInfo info;
- reader.FillWriterInfo (info);
- _id = read_writer_info (info);
- } else {
- xml->read_file (file);
- _id = xml->string_child("Id").substr (9);
+ ASDCP::TimedText::MXFReader reader;
+ Kumu::Result_t r = reader.OpenRead (file.string().c_str ());
+ if (ASDCP_FAILURE (r)) {
+ boost::throw_exception (MXFFileError ("could not open MXF file for reading", file, r));
}
+ string s;
+ reader.ReadTimedTextResource (s, 0, 0);
+ stringstream t;
+ t << s;
+ xml->read_stream (t);
+
+ ASDCP::WriterInfo info;
+ reader.FillWriterInfo (info);
+ _id = read_writer_info (info);
+
_load_font_nodes = type_children<dcp::SMPTELoadFontNode> (xml, "LoadFont");
_content_title_text = xml->string_child ("ContentTitleText");
diff --git a/src/smpte_subtitle_asset.h b/src/smpte_subtitle_asset.h
index 37f58c6f..a01ef775 100644
--- a/src/smpte_subtitle_asset.h
+++ b/src/smpte_subtitle_asset.h
@@ -39,9 +39,8 @@ public:
SMPTESubtitleAsset ();
/** @param file File name
- * @param mxf true if `file' is a MXF, or false if it is an XML file.
*/
- SMPTESubtitleAsset (boost::filesystem::path file, bool mxf = true);
+ SMPTESubtitleAsset (boost::filesystem::path file);
bool equals (
boost::shared_ptr<const Asset>,