/*
- Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
USE_ANY_SERVERS,
SERVERS,
CINEMAS,
+ PREVIEW_SOUND,
+ PREVIEW_SOUND_OUTPUT,
OTHER
};
return _jump_to_selected;
}
+ bool preview_sound () const {
+ return _preview_sound;
+ }
+
+ boost::optional<std::string> preview_sound_output () const {
+ return _preview_sound_output;
+ }
+
/** @param n New number of local encoding threads */
void set_num_local_encoding_threads (int n) {
maybe_set (_num_local_encoding_threads, n);
maybe_set (_confirm_kdm_email, s);
}
+ void set_preview_sound (bool s) {
+ maybe_set (_preview_sound, s, PREVIEW_SOUND);
+ }
+
+ void set_preview_sound_output (std::string o)
+ {
+ maybe_set (_preview_sound_output, o, PREVIEW_SOUND_OUTPUT);
+ }
+
+ void unset_preview_sound_output ()
+ {
+ if (!_preview_sound_output) {
+ return;
+ }
+
+ _preview_sound_output = boost::none;
+ changed ();
+ }
+
void set_kdm_container_name_format (dcp::NameFormat n) {
maybe_set (_kdm_container_name_format, n);
}
void changed (Property p = OTHER);
boost::signals2::signal<void (Property)> Changed;
- /** Emitted if ::read() failed on an existing Config file. There is nothing
+ /** Emitted if read() failed on an existing Config file. There is nothing
a listener can do about it: this is just for information.
*/
static boost::signals2::signal<void ()> FailedToLoad;
boost::filesystem::path directory_or (boost::optional<boost::filesystem::path> dir, boost::filesystem::path a) const;
template <class T>
- void maybe_set (T& member, T new_value) {
+ void maybe_set (T& member, T new_value, Property prop = OTHER) {
if (member == new_value) {
return;
}
member = new_value;
- changed ();
+ changed (prop);
+ }
+
+ template <class T>
+ void maybe_set (boost::optional<T>& member, T new_value, Property prop = OTHER) {
+ if (member && member.get() == new_value) {
+ return;
+ }
+ member = new_value;
+ changed (prop);
}
/** number of threads to use for J2K encoding on the local machine */
dcp::NameFormat _dcp_metadata_filename_format;
dcp::NameFormat _dcp_asset_filename_format;
bool _jump_to_selected;
+ 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;
/** Singleton instance, or 0 */
static Config* _instance;