diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-02-05 00:21:42 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-02-05 00:21:42 +0000 |
| commit | cad7088414d36f6cdcc6f52eef192f78d92f3e07 (patch) | |
| tree | 50b9dc18ebc1bf7ec04dbd0f562b8679dac7f992 /src/lib | |
| parent | 918124fb0b2fdf05bf98aee2c74c85387f1d8638 (diff) | |
Fix KDM target buttons for DKDMs too (#1137).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 18 | ||||
| -rw-r--r-- | src/lib/config.h | 14 |
2 files changed, 32 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. */ diff --git a/src/lib/config.h b/src/lib/config.h index f32b17106..db32c58a0 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -363,6 +363,15 @@ public: return _last_kdm_write_type; } + enum DKDMWriteType { + DKDM_WRITE_INTERNAL, + DKDM_WRITE_FILE + }; + + boost::optional<DKDMWriteType> last_dkdm_write_type () const { + return _last_dkdm_write_type; + } + int frames_in_memory_multiplier () const { return _frames_in_memory_multiplier; } @@ -609,6 +618,10 @@ public: maybe_set (_last_kdm_write_type, t); } + void set_last_dkdm_write_type (DKDMWriteType t) { + maybe_set (_last_dkdm_write_type, t); + } + void unset_sound_output () { if (!_sound_output) { return; @@ -817,6 +830,7 @@ private: std::string _cover_sheet; boost::optional<boost::filesystem::path> _last_player_load_directory; boost::optional<KDMWriteType> _last_kdm_write_type; + boost::optional<DKDMWriteType> _last_dkdm_write_type; int _frames_in_memory_multiplier; /** Singleton instance, or 0 */ |
