Allow annotation text to be set when combining DCPs.
authorCarl Hetherington <cth@carlh.net>
Sun, 30 May 2021 18:58:31 +0000 (20:58 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 30 May 2021 18:58:31 +0000 (20:58 +0200)
src/lib/combine_dcp_job.cc
src/lib/combine_dcp_job.h
src/tools/dcpomatic_combiner.cc

index 3497d4b72a6a986cb8cf611d00af5a8b4fdaa0e1..ae6d8b289f2926b0053e7edb179e3fc261fa2305 100644 (file)
@@ -20,6 +20,7 @@
 
 
 #include "combine_dcp_job.h"
+#include "compose.hpp"
 #include <dcp/combine.h>
 #include <dcp/exceptions.h>
 
@@ -31,10 +32,11 @@ using std::vector;
 using std::shared_ptr;
 
 
-CombineDCPJob::CombineDCPJob (vector<boost::filesystem::path> inputs, boost::filesystem::path output)
+CombineDCPJob::CombineDCPJob (vector<boost::filesystem::path> inputs, boost::filesystem::path output, string annotation_text)
        : Job (shared_ptr<Film>())
        , _inputs (inputs)
        , _output (output)
+       , _annotation_text (annotation_text)
 {
 
 }
@@ -58,7 +60,14 @@ void
 CombineDCPJob::run ()
 {
        try {
-               dcp::combine (_inputs, _output);
+               dcp::combine (
+                       _inputs,
+                       _output,
+                       String::compose("libdcp %1", dcp::version),
+                       String::compose("libdcp %1", dcp::version),
+                       dcp::LocalTime().as_string(),
+                       _annotation_text
+                       );
        } catch (dcp::CombineError& e) {
                set_state (FINISHED_ERROR);
                set_error (e.what(), "");
index 97bf201101d70fb94e3de763fe93b00d5522e374..4a7e02b8b4e2d055c3947748d52c8ddc5a12b8a1 100644 (file)
@@ -26,7 +26,7 @@
 class CombineDCPJob : public Job
 {
 public:
-       CombineDCPJob (std::vector<boost::filesystem::path> inputs, boost::filesystem::path output);
+       CombineDCPJob (std::vector<boost::filesystem::path> inputs, boost::filesystem::path output, std::string annotation_text);
 
        std::string name () const;
        std::string json_name () const;
@@ -35,5 +35,6 @@ public:
 private:
        std::vector<boost::filesystem::path> _inputs;
        boost::filesystem::path _output;
+       std::string _annotation_text;
 };
 
index 566ec82f1fe8d90e502c2ceb7e963f98a3bd8d9a..4a783d6346f65679d289a29035199b7401c24bc4 100644 (file)
@@ -104,7 +104,13 @@ public:
                        true
                        );
 
-               auto output = new wxBoxSizer (wxHORIZONTAL);
+               auto output = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
+               output->AddGrowableCol (1, 1);
+
+               add_label_to_sizer (output, overall_panel, _("Annotation text"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
+               _annotation_text = new wxTextCtrl (overall_panel, wxID_ANY, wxT(""));
+               output->Add (_annotation_text, 1, wxEXPAND);
+
                add_label_to_sizer (output, overall_panel, _("Output DCP folder"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
                _output = new DirPickerCtrl (overall_panel);
                output->Add (_output, 1, wxEXPAND);
@@ -162,7 +168,7 @@ private:
                }
 
                auto jm = JobManager::instance ();
-               jm->add (make_shared<CombineDCPJob>(_inputs, output));
+               jm->add (make_shared<CombineDCPJob>(_inputs, output, wx_to_std(_annotation_text->GetValue())));
                bool const ok = display_progress (_("DCP-o-matic Combine"), _("Combining DCPs"));
                if (!ok) {
                        return;
@@ -189,6 +195,7 @@ private:
        }
 
        EditableList<boost::filesystem::path, DirDialogWrapper>* _input;
+       wxTextCtrl* _annotation_text = nullptr;
        DirPickerCtrl* _output;
        vector<boost::filesystem::path> _inputs;
        Button* _combine;