Tidy and fix logging.
[dcpomatic.git] / src / tools / dcpomatic.cc
index 4354e079e4d320b41f89b6cd15ea4d556fdde2e7..bd0c40e889d9c977d543766fb75d4255063cfc02 100644 (file)
@@ -55,6 +55,7 @@
 #include "lib/version.h"
 #include "lib/signal_manager.h"
 #include "lib/log.h"
+#include "lib/screen.h"
 #include "lib/job_manager.h"
 #include "lib/exceptions.h"
 #include "lib/cinema.h"
@@ -75,6 +76,7 @@
 #include "lib/audio_content.h"
 #include "lib/check_content_change_job.h"
 #include "lib/text_content.h"
+#include "lib/dcpomatic_log.h"
 #include <dcp/exceptions.h>
 #include <dcp/raw_convert.h>
 #include <wx/generic/aboutdlgg.h>
@@ -401,6 +403,7 @@ public:
                film->set_name (path.filename().generic_string());
                film->write_metadata ();
                set_film (film);
+               dcpomatic_log = film->log ();
        }
 
        void load_film (boost::filesystem::path file)
@@ -480,7 +483,7 @@ private:
                                new_film (d->path(), d->template_name());
                        } catch (boost::filesystem::filesystem_error& e) {
 #ifdef DCPOMATIC_WINDOWS
-                               string bad_chars = "<>:\"/\\|?*";
+                               string bad_chars = "<>:\"/|?*";
                                string const filename = d->path().string();
                                string found_bad_chars;
                                for (size_t i = 0; i < bad_chars.length(); ++i) {
@@ -823,7 +826,7 @@ private:
                try {
                        kdm = _film->make_kdm (
                                Config::instance()->decryption_chain()->leaf(),
-                               vector<dcp::Certificate> (),
+                               vector<string>(),
                                d->cpl (),
                                dcp::LocalTime ("2012-01-01T01:00:00+00:00"),
                                dcp::LocalTime ("2112-01-01T01:00:00+00:00"),
@@ -872,7 +875,7 @@ private:
        {
                ContentList vc = _film_editor->content_panel()->selected_video ();
                for (ContentList::iterator i = vc.begin(); i != vc.end(); ++i) {
-                       (*i)->video->scale_and_crop_to_fit_width ();
+                       (*i)->video->scale_and_crop_to_fit_width (_film);
                }
        }
 
@@ -880,7 +883,7 @@ private:
        {
                ContentList vc = _film_editor->content_panel()->selected_video ();
                for (ContentList::iterator i = vc.begin(); i != vc.end(); ++i) {
-                       (*i)->video->scale_and_crop_to_fit_height ();
+                       (*i)->video->scale_and_crop_to_fit_height (_film);
                }
        }
 
@@ -1444,12 +1447,12 @@ private:
                if (!_film_to_create.empty ()) {
                        _frame->new_film (_film_to_create, optional<string> ());
                        if (!_content_to_add.empty ()) {
-                               BOOST_FOREACH (shared_ptr<Content> i, content_factory (_frame->film(), _content_to_add)) {
+                               BOOST_FOREACH (shared_ptr<Content> i, content_factory(_content_to_add)) {
                                        _frame->film()->examine_and_add_content (i);
                                }
                        }
                        if (!_dcp_to_add.empty ()) {
-                               _frame->film()->examine_and_add_content (shared_ptr<DCPContent> (new DCPContent (_frame->film(), _dcp_to_add)));
+                               _frame->film()->examine_and_add_content(shared_ptr<DCPContent>(new DCPContent(_dcp_to_add)));
                        }
                }