summaryrefslogtreecommitdiff
path: root/src/lib/config.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-02-05 00:21:42 +0000
committerCarl Hetherington <cth@carlh.net>2018-02-05 00:21:42 +0000
commitcad7088414d36f6cdcc6f52eef192f78d92f3e07 (patch)
tree50b9dc18ebc1bf7ec04dbd0f562b8679dac7f992 /src/lib/config.cc
parent918124fb0b2fdf05bf98aee2c74c85387f1d8638 (diff)
Fix KDM target buttons for DKDMs too (#1137).
Diffstat (limited to 'src/lib/config.cc')
-rw-r--r--src/lib/config.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 6ae850bff..a54858cdb 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -132,6 +132,7 @@ Config::set_defaults ()
_sound = true;
_sound_output = optional<string> ();
_last_kdm_write_type = KDM_WRITE_FLAT;
+ _last_dkdm_write_type = DKDM_WRITE_INTERNAL;
/* I think the scaling factor here should be the ratio of the longest frame
encode time to the shortest; if the thread count is T, longest time is L
@@ -383,6 +384,13 @@ try
_last_kdm_write_type = KDM_WRITE_ZIP;
}
}
+ if (f.optional_string_child("LastDKDMWriteType")) {
+ if (f.optional_string_child("LastDKDMWriteType").get() == "internal") {
+ _last_dkdm_write_type = DKDM_WRITE_INTERNAL;
+ } else if (f.optional_string_child("LastDKDMWriteType").get() == "file") {
+ _last_dkdm_write_type = DKDM_WRITE_FILE;
+ }
+ }
_frames_in_memory_multiplier = f.optional_number_child<int>("FramesInMemoryMultiplier").get_value_or(3);
/* Replace any cinemas from config.xml with those from the configured file */
@@ -691,6 +699,16 @@ Config::write_config () const
break;
}
}
+ if (_last_dkdm_write_type) {
+ switch (_last_dkdm_write_type.get()) {
+ case DKDM_WRITE_INTERNAL:
+ root->add_child("LastDKDMWriteType")->add_child_text("internal");
+ break;
+ case DKDM_WRITE_FILE:
+ root->add_child("LastDKDMWriteType")->add_child_text("file");
+ break;
+ }
+ }
/* [XML] FramesInMemoryMultiplier value to multiply the encoding threads count by to get the maximum number of
frames to be held in memory at once.
*/