diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-08-15 00:37:36 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-08-15 00:37:36 +0100 |
| commit | c79c14e1ed3498094d0f82ea854ea43bea3728e1 (patch) | |
| tree | 080ad11a54d94614635b8740135e61a55c253520 /src/lib | |
| parent | 0d493e91c4bffcb60960097264a804f6208b7bba (diff) | |
Give player its own configuration dialogue.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 17 | ||||
| -rw-r--r-- | src/lib/config.h | 32 |
2 files changed, 25 insertions, 24 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 18fda63e3..f7456e269 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -125,8 +125,8 @@ Config::set_defaults () for (int i = 0; i < NAG_COUNT; ++i) { _nagged[i] = false; } - _preview_sound = false; - _preview_sound_output = optional<string> (); + _sound = false; + _sound_output = optional<string> (); _allowed_dcp_frame_rates.clear (); _allowed_dcp_frame_rates.push_back (24); @@ -342,8 +342,9 @@ try _nagged[id] = raw_convert<int>(i->content()); } } - _preview_sound = f.optional_bool_child("PreviewSound").get_value_or (false); - _preview_sound_output = f.optional_string_child("PreviewSoundOutput"); + /* The variable was renamed but not the XML tag */ + _sound = f.optional_bool_child("PreviewSound").get_value_or (false); + _sound_output = f.optional_string_child("PreviewSoundOutput"); if (f.optional_string_child("CoverSheet")) { _cover_sheet = f.optional_string_child("CoverSheet").get(); } @@ -616,11 +617,11 @@ Config::write_config () const e->set_attribute ("Id", raw_convert<string>(i)); e->add_child_text (_nagged[i] ? "1" : "0"); } - /* [XML] PreviewSound 1 to use sound in the GUI preview, otherwise 0 */ - root->add_child("PreviewSound")->add_child_text (_preview_sound ? "1" : "0"); - if (_preview_sound_output) { + /* [XML] PreviewSound 1 to use sound in the GUI preview and player, otherwise 0 */ + root->add_child("PreviewSound")->add_child_text (_sound ? "1" : "0"); + if (_sound_output) { /* [XML:opt] PreviewSoundOutput Name of the audio output to use */ - root->add_child("PreviewSoundOutput")->add_child_text (_preview_sound_output.get()); + root->add_child("PreviewSoundOutput")->add_child_text (_sound_output.get()); } /* [XML] CoverSheet Text of the cover sheet to write when making DCPs */ root->add_child("CoverSheet")->add_child_text (_cover_sheet); diff --git a/src/lib/config.h b/src/lib/config.h index 3317f1f10..b850e99a7 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -73,8 +73,8 @@ public: USE_ANY_SERVERS, SERVERS, CINEMAS, - PREVIEW_SOUND, - PREVIEW_SOUND_OUTPUT, + SOUND, + SOUND_OUTPUT, OTHER }; @@ -329,16 +329,16 @@ public: return _nagged[nag]; } - bool preview_sound () const { - return _preview_sound; + bool sound () const { + return _sound; } std::string cover_sheet () const { return _cover_sheet; } - boost::optional<std::string> preview_sound_output () const { - return _preview_sound_output; + boost::optional<std::string> sound_output () const { + return _sound_output; } void set_master_encoding_threads (int n) { @@ -563,22 +563,22 @@ public: maybe_set (_confirm_kdm_email, s); } - void set_preview_sound (bool s) { - maybe_set (_preview_sound, s, PREVIEW_SOUND); + void set_sound (bool s) { + maybe_set (_sound, s, SOUND); } - void set_preview_sound_output (std::string o) + void set_sound_output (std::string o) { - maybe_set (_preview_sound_output, o, PREVIEW_SOUND_OUTPUT); + maybe_set (_sound_output, o, SOUND_OUTPUT); } - void unset_preview_sound_output () + void unset_sound_output () { - if (!_preview_sound_output) { + if (!_sound_output) { return; } - _preview_sound_output = boost::none; + _sound_output = boost::none; changed (); } @@ -758,9 +758,9 @@ private: dcp::NameFormat _dcp_asset_filename_format; bool _jump_to_selected; bool _nagged[NAG_COUNT]; - bool _preview_sound; - /** name of a specific sound output stream to use for preview, or empty to use the default */ - boost::optional<std::string> _preview_sound_output; + bool _sound; + /** name of a specific sound output stream to use, or empty to use the default */ + boost::optional<std::string> _sound_output; std::string _cover_sheet; /** Singleton instance, or 0 */ |
