summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-04-07 11:51:39 +0100
committerCarl Hetherington <cth@carlh.net>2017-04-07 11:51:39 +0100
commitfdb1cacf58115881bd4d3e8cca8ba389f26400df (patch)
tree3a91ce7a4ab088d634036f91135c7ad974b27e51 /src/lib
parentab32017c7cc918ddd2cd35661cf64985e0abc79a (diff)
Make jump-to-content-start on selection in the content list optional.
This behaviour is annoying in some cases, e.g. trying to move separate subtitle files around when looking at a particular time in the preview.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc5
-rw-r--r--src/lib/config.h9
2 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index f41d40e09..79486c602 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -1,5 +1,5 @@
/*
- 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.
@@ -115,6 +115,7 @@ Config::set_defaults ()
_kdm_filename_format = dcp::NameFormat ("KDM %f %c %s");
_dcp_metadata_filename_format = dcp::NameFormat ("%t");
_dcp_asset_filename_format = dcp::NameFormat ("%t");
+ _jump_to_selected = true;
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
@@ -307,6 +308,7 @@ try
_kdm_filename_format = dcp::NameFormat (f.optional_string_child("KDMFilenameFormat").get_value_or ("KDM %f %c %s"));
_dcp_metadata_filename_format = dcp::NameFormat (f.optional_string_child("DCPMetadataFilenameFormat").get_value_or ("%t"));
_dcp_asset_filename_format = dcp::NameFormat (f.optional_string_child("DCPAssetFilenameFormat").get_value_or ("%t"));
+ _jump_to_selected = f.optional_bool_child("JumpToSelected").get_value_or (true);
/* Replace any cinemas from config.xml with those from the configured file */
if (boost::filesystem::exists (_cinemas_file)) {
@@ -474,6 +476,7 @@ Config::write_config () const
root->add_child("KDMContainerNameFormat")->add_child_text (_kdm_container_name_format.specification ());
root->add_child("DCPMetadataFilenameFormat")->add_child_text (_dcp_metadata_filename_format.specification ());
root->add_child("DCPAssetFilenameFormat")->add_child_text (_dcp_asset_filename_format.specification ());
+ root->add_child("JumpToSelected")->add_child_text (_jump_to_selected ? "1" : "0");
try {
doc.write_to_file_formatted (path("config.xml").string ());
diff --git a/src/lib/config.h b/src/lib/config.h
index c02b12eb5..80dfb1dc9 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -302,6 +302,10 @@ public:
return _dcp_asset_filename_format;
}
+ bool jump_to_selected () const {
+ return _jump_to_selected;
+ }
+
/** @param n New number of local encoding threads */
void set_num_local_encoding_threads (int n) {
maybe_set (_num_local_encoding_threads, n);
@@ -540,6 +544,10 @@ public:
void add_to_history (boost::filesystem::path p);
+ void set_jump_to_selected (bool j) {
+ maybe_set (_jump_to_selected, j);
+ }
+
void changed (Property p = OTHER);
boost::signals2::signal<void (Property)> Changed;
/** Emitted if ::read() failed on an existing Config file. There is nothing
@@ -661,6 +669,7 @@ private:
dcp::NameFormat _kdm_container_name_format;
dcp::NameFormat _dcp_metadata_filename_format;
dcp::NameFormat _dcp_asset_filename_format;
+ bool _jump_to_selected;
/** Singleton instance, or 0 */
static Config* _instance;