diff --git a/src/lib/mrvApp/mrvSettingsObject.cpp b/src/lib/mrvApp/mrvSettingsObject.cpp index bf008c25f..1eb45468a 100644 --- a/src/lib/mrvApp/mrvSettingsObject.cpp +++ b/src/lib/mrvApp/mrvSettingsObject.cpp @@ -325,6 +325,17 @@ namespace mrv return p.settings[name] = defaultValue; } + bool SettingsObject::hasValue(const std::string& name) + { + TLRENDER_P(); + auto i = p.settings.find(name); + if (i != p.settings.end()) + { + return true; + } + return false; + } + template < typename T > T SettingsObject::getValue(const std::string& name) { T out; diff --git a/src/lib/mrvApp/mrvSettingsObject.h b/src/lib/mrvApp/mrvSettingsObject.h index f54fb84a1..4683abc0a 100644 --- a/src/lib/mrvApp/mrvSettingsObject.h +++ b/src/lib/mrvApp/mrvSettingsObject.h @@ -57,6 +57,9 @@ namespace mrv //! Get a value safely. template < typename T > T getValue(const std::string&); + //! Check if it has a value. + bool hasValue(const std::string&); + //! Get default value safely. template < typename T > T getDefaultValue(const std::string&); diff --git a/src/lib/mrvWidgets/mrvSaveMovieOptionsUI.fl b/src/lib/mrvWidgets/mrvSaveMovieOptionsUI.fl index 2b8e36efc..0eb42ae9d 100644 --- a/src/lib/mrvWidgets/mrvSaveMovieOptionsUI.fl +++ b/src/lib/mrvWidgets/mrvSaveMovieOptionsUI.fl @@ -208,7 +208,7 @@ v->hide();} } Fl_Window uiAdvancedSettings { label {Advanced Settings} open - xywh {720 371 411 310} type Double hide hotspot modal + xywh {1185 376 411 310} type Double hide hotspot modal } { Fl_Check_Button Override { label Override @@ -424,7 +424,7 @@ settings->setValue("SaveMovie/Color TRC", value);} label Cancel user_data uiAdvancedSettings user_data_type {Fl_Double_Window*} callback {Override->value(0); -v->hide();} selected +v->hide();} xywh {239 242 90 29} } } @@ -863,8 +863,7 @@ for (auto entry : entries) const int value = settings->getValue("SaveMovie/Resolution"); o->value(value);} {} } - Function {add_advanced_override(Fl_Check_Button* v)} {open - } { + Function {add_advanced_override(Fl_Check_Button* v)} {} { code {auto settings = mrv::App::app->settings(); const bool value = settings->getValue("SaveMovie/Override"); v->value(value);} {} @@ -872,23 +871,39 @@ v->value(value);} {} Function {add_advanced_color_range(Fl_Choice* o)} {open } { code {const auto& settings = mrv::App::app->settings(); -const int value = settings->getValue("SaveMovie/Color Range"); +int value; +if (!settings->hasValue("SaveMovie/Color Range")) + value = o->find_index("PC"); +else + value = settings->getValue("SaveMovie/Color Range"); o->value(value);} {} } - Function {add_advanced_color_space(Fl_Choice* o)} {} { + Function {add_advanced_color_space(Fl_Choice* o)} {open + } { code {const auto& settings = mrv::App::app->settings(); -const int value = settings->getValue("SaveMovie/Color Space"); +int value; +if (!settings->hasValue("SaveMovie/Color Space")) + value = o->find_index("bt709"); +else + value = settings->getValue("SaveMovie/Color Space"); o->value(value);} {} } - Function {add_advanced_color_primaries(Fl_Choice* o)} {} { + Function {add_advanced_color_primaries(Fl_Choice* o)} {open + } { code {const auto& settings = mrv::App::app->settings(); const int value = settings->getValue("SaveMovie/Color Primaries"); o->value(value);} {} } - Function {add_advanced_color_trc(Fl_Choice* o)} {} { + Function {add_advanced_color_trc(Fl_Choice* o)} {open + } { code {const auto& settings = mrv::App::app->settings(); -const int value = settings->getValue("SaveMovie/Color TRC"); -o->value(value);} {} +int value; +if (!settings->hasValue("SaveMovie/Color TRC")) + value = o->find_index("iec61966-2-1"); +else + value = settings->getValue("SaveMovie/Color TRC"); +o->value(value);} {selected + } } Function {add_audio_codecs(Fl_Choice* o)} {} { code {auto entries = tl::ffmpeg::getAudioCodecLabels(); diff --git a/tlRender b/tlRender index 1d28050b0..724f4afa7 160000 --- a/tlRender +++ b/tlRender @@ -1 +1 @@ -Subproject commit 1d28050b0b8f6947b3b3028c05ee5fbbc8552a67 +Subproject commit 724f4afa719c3d70113053aecd3f70a13e0d055a