summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-02-19 23:22:31 +0100
committerCarl Hetherington <cth@carlh.net>2024-02-19 23:22:31 +0100
commit51dda295b5bd63e6635ae17786e4657c41a3678a (patch)
tree77e57cb29e188d3b66f9d60c11b5ed6176ad4c93 /src/tools
parent8af709285d056476933dbfaf63c9b2121fbd4ce8 (diff)
parentf23b9491dcd25d02f7966f39dfdbb0ad998aa5ad (diff)
Merge tag 'v2.16.77' into v2.17.x
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc18
-rw-r--r--src/tools/dcpomatic_cli.cc3
2 files changed, 17 insertions, 4 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 5333f34ae..f65037c2f 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -37,6 +37,7 @@
#include "wx/full_config_dialog.h"
#include "wx/hints_dialog.h"
#include "wx/html_dialog.h"
+#include "wx/file_dialog.h"
#include "wx/i18n_hook.h"
#include "wx/id.h"
#include "wx/job_manager_view.h"
@@ -250,6 +251,7 @@ enum {
ID_tools_system_information,
ID_tools_restore_default_preferences,
ID_tools_export_preferences,
+ ID_tools_import_preferences,
ID_help_report_a_problem,
/* IDs for shortcuts (with no associated menu item) */
ID_add_file,
@@ -362,6 +364,7 @@ public:
Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_system_information, this),ID_tools_system_information);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_restore_default_preferences, this), ID_tools_restore_default_preferences);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_export_preferences, this), ID_tools_export_preferences);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_import_preferences, this), ID_tools_import_preferences);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::help_about, this), wxID_ABOUT);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::help_report_a_problem, this), ID_help_report_a_problem);
@@ -765,9 +768,8 @@ private:
void tools_export_preferences ()
{
- wxFileDialog dialog(
- this, _("Specify ZIP file"), wxEmptyString, wxT("dcpomatic_config.zip"), wxT("ZIP files (*.zip)|*.zip"),
- wxFD_SAVE | wxFD_OVERWRITE_PROMPT
+ FileDialog dialog(
+ this, _("Specify ZIP file"), wxT("ZIP files (*.zip)|*.zip"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT, "Preferences", string("dcpomatic_config.zip")
);
if (dialog.ShowModal() == wxID_OK) {
@@ -785,6 +787,15 @@ private:
}
}
+ void tools_import_preferences()
+ {
+ FileDialog dialog(this, _("Specify ZIP file"), wxT("ZIP files (*.zip)|*.zip"), wxFD_OPEN, "Preferences");
+
+ if (dialog.show()) {
+ Config::instance()->load_from_zip(dialog.path());
+ }
+ }
+
void jobs_make_dcp ()
{
double required;
@@ -1426,6 +1437,7 @@ private:
add_item (tools, _("Restore default preferences"), ID_tools_restore_default_preferences, ALWAYS);
tools->AppendSeparator ();
add_item (tools, _("Export preferences..."), ID_tools_export_preferences, ALWAYS);
+ add_item (tools, _("Import preferences..."), ID_tools_import_preferences, ALWAYS);
wxMenu* help = new wxMenu;
#ifdef __WXOSX__
diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc
index c335db616..9cb3c832a 100644
--- a/src/tools/dcpomatic_cli.cc
+++ b/src/tools/dcpomatic_cli.cc
@@ -94,12 +94,13 @@ print_dump (shared_ptr<Film> film)
cout << film->dcp_name (true) << "\n"
<< film->container()->container_nickname() << " at " << ((film->resolution() == Resolution::TWO_K) ? "2K" : "4K") << "\n"
<< (film->j2k_bandwidth() / 1000000) << "Mbit/s" << "\n"
+ << "Duration " << (film->length().timecode(film->video_frame_rate())) << "\n"
<< "Output " << film->video_frame_rate() << "fps " << (film->three_d() ? "3D" : "2D") << " " << (film->audio_frame_rate() / 1000) << "kHz\n"
<< (film->interop() ? "Inter-Op" : "SMPTE") << " " << (film->encrypted() ? "encrypted" : "unencrypted") << "\n";
for (auto c: film->content()) {
cout << "\n"
- << c->path(0) << "\n"
+ << c->path(0).string() << "\n"
<< "\tat " << c->position().seconds ()
<< " length " << c->full_length(film).seconds ()
<< " start trim " << c->trim_start().seconds ()