Rename Choice::add to Choice::add_entry.
[dcpomatic.git] / src / lib / export_config.cc
index 66c5e3d664075c067ee44fa42db277290fc5688e..4dfbb902796565df2d49337d62eec8c2ca98fc00 100644 (file)
@@ -63,6 +63,8 @@ ExportConfig::read(cxml::ConstNodePtr node)
                _format = ExportFormat::SUBTITLES_DCP;
        } else if (format == "h264-aac") {
                _format = ExportFormat::H264_AAC;
+       } else if (format == "prores-4444") {
+               _format = ExportFormat::PRORES_4444;
        } else {
                _format = ExportFormat::PRORES_HQ;
        }
@@ -75,13 +77,17 @@ ExportConfig::read(cxml::ConstNodePtr node)
 
 
 void
-ExportConfig::write(xmlpp::Element* node) const
+ExportConfig::write(xmlpp::Element* element) const
 {
        string name;
 
        switch (_format) {
+               case ExportFormat::PRORES_4444:
+                       name = "prores-4444";
+                       break;
                case ExportFormat::PRORES_HQ:
-                       name = "prores";
+                       /* Write this but we also accept 'prores' for backwards compatibility */
+                       name = "prores-hq";
                        break;
                case ExportFormat::H264_AAC:
                        name = "h264-aac";
@@ -91,11 +97,11 @@ ExportConfig::write(xmlpp::Element* node) const
                        break;
        }
 
-       node->add_child("Format")->add_child_text(name);
-       node->add_child("MixdownToStereo")->add_child_text(_mixdown_to_stereo ? "1" : "0");
-       node->add_child("SplitReels")->add_child_text(_split_reels ? "1" : "0");
-       node->add_child("SplitStreams")->add_child_text(_split_streams ? "1" : "0");
-       node->add_child("X264CRF")->add_child_text(dcp::raw_convert<string>(_x264_crf));
+       cxml::add_text_child(element, "Format", name);
+       cxml::add_text_child(element, "MixdownToStereo", _mixdown_to_stereo ? "1" : "0");
+       cxml::add_text_child(element, "SplitReels", _split_reels ? "1" : "0");
+       cxml::add_text_child(element, "SplitStreams", _split_streams ? "1" : "0");
+       cxml::add_text_child(element, "X264CRF", dcp::raw_convert<string>(_x264_crf));
 }