Merge master.
authorCarl Hetherington <cth@carlh.net>
Mon, 11 Aug 2014 21:39:20 +0000 (22:39 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 11 Aug 2014 21:39:20 +0000 (22:39 +0100)
38 files changed:
ChangeLog
debian/changelog
platform/osx/make_dmg.sh
src/lib/analyse_audio_job.cc
src/lib/analyse_audio_job.h
src/lib/audio_decoder.cc
src/lib/colour_conversion.cc
src/lib/encoder.cc
src/lib/examine_content_job.cc
src/lib/examine_content_job.h
src/lib/ffmpeg.cc
src/lib/ffmpeg_decoder.cc
src/lib/frame_rate_change.cc
src/lib/frame_rate_change.h
src/lib/image_proxy.cc
src/lib/job.cc
src/lib/job.h
src/lib/json_server.cc [deleted file]
src/lib/json_server.h [deleted file]
src/lib/playlist.cc
src/lib/ratio.cc
src/lib/scp_dcp_job.cc
src/lib/scp_dcp_job.h
src/lib/send_kdm_email_job.cc
src/lib/send_kdm_email_job.h
src/lib/transcode_job.cc
src/lib/transcode_job.h
src/lib/writer.cc
src/lib/wscript
src/tools/dcpomatic.cc
src/tools/dcpomatic_cli.cc
src/wx/dolby_certificate_dialog.cc
src/wx/timecode.cc
src/wx/timecode.h
src/wx/timing_panel.cc
src/wx/video_panel.cc
test/film_metadata_test.cc
test/job_test.cc

index fe281428425795f7c86cf586e95d28215e6eab0a..23ccae1902d6f8189f305fa33f221f08f27353ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * Add subtitle view.
 
+2014-08-09  Carl Hetherington  <cth@carlh.net>
+
+       * Version 1.72.10 released.
+
+2014-08-09  Carl Hetherington  <cth@carlh.net>
+
+       * Version 1.72.8 released.
+
+2014-08-08  Carl Hetherington  <cth@carlh.net>
+
+       * Approximate support for changing timing details of multiple
+       bits of content at the same time.
+
+       * Allow removal of multiple bits of content at the same time.
+
+       * Version 1.72.7 released.
+
 2014-08-04  Carl Hetherington  <cth@carlh.net>
 
        * Add BCC option for KDM emails.
index 09d40178298a9256211e2b1504703a01fb37445c..1da8a1f91707c709a48beaa08630d3c38924a409 100644 (file)
@@ -171,8 +171,15 @@ dcpomatic (2.0.1-1) UNRELEASED; urgency=low
   * New upstream release.
   * New upstream release.
   * New upstream release.
+<<<<<<< HEAD
 
  -- Carl Hetherington <carl@dalglish>  Wed, 06 Aug 2014 18:59:35 +0100
+=======
+  * New upstream release.
+  * New upstream release.
+
+ -- Carl Hetherington <carl@d1stkfactory>  Sat, 09 Aug 2014 12:38:18 +0100
+>>>>>>> origin/master
 
 dcpomatic (0.87-1) UNRELEASED; urgency=low
 
index 5500c42678c048599783376aaac640eefe1070ed..1174f966a07e0c34071d61c1ad4d240e3baf21f1 100644 (file)
@@ -53,6 +53,7 @@ function universal_copy_lib {
     relink="$relink|$2"
 }
 
+<<<<<<< HEAD
 universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2 "$WORK/$macos"
 universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_cli "$WORK/$macos"
 universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic2_server_cli "$WORK/$macos"
@@ -63,6 +64,18 @@ universal_copy_lib $ROOT libcxml "$WORK/$libs"
 universal_copy_lib $ROOT libdcp-1.0 "$WORK/$libs"
 universal_copy_lib $ROOT libasdcp-libdcp-1.0 "$WORK/$libs"
 universal_copy_lib $ROOT libkumu-libdcp-1.0 "$WORK/$libs"
+=======
+universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic "$WORK/$macos"
+universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic_cli "$WORK/$macos"
+universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic_server_cli "$WORK/$macos"
+universal_copy $ROOT src/dcpomatic/build/src/tools/dcpomatic_batch "$WORK/$macos"
+universal_copy $ROOT src/dcpomatic/build/src/lib/libdcpomatic.dylib "$WORK/$libs"
+universal_copy $ROOT src/dcpomatic/build/src/wx/libdcpomatic-wx.dylib "$WORK/$libs"
+universal_copy_lib $ROOT libcxml "$WORK/$libs"
+universal_copy_lib $ROOT libdcp "$WORK/$libs"
+universal_copy_lib $ROOT libasdcp-libdcp "$WORK/$libs"
+universal_copy_lib $ROOT libkumu-libdcp "$WORK/$libs"
+>>>>>>> origin/master
 universal_copy_lib $ROOT libopenjpeg "$WORK/$libs"
 universal_copy_lib $ROOT libavdevice "$WORK/$libs"
 universal_copy_lib $ROOT libavformat "$WORK/$libs"
index af58e77ac59058097be12614c8c8499656ccff93..347cc0a0fb362f95b55686ad3fb76744e746ff8f 100644 (file)
@@ -49,12 +49,6 @@ AnalyseAudioJob::name () const
        return _("Analyse audio");
 }
 
-string
-AnalyseAudioJob::json_name () const
-{
-       return N_("analyse_audio");
-}
-
 void
 AnalyseAudioJob::run ()
 {
index 4d657951b7123d57d21438c50ee273f9c807d178..a218cb3400d563354b751101eeb349bf87f81b59 100644 (file)
@@ -42,7 +42,6 @@ public:
        AnalyseAudioJob (boost::shared_ptr<const Film>, boost::shared_ptr<AudioContent>);
 
        std::string name () const;
-       std::string json_name () const;
        void run ();
 
 private:
index e4c82f64c1a7c05d33b7f02fbf043ef5aa93b80a..f425cf2808cfbf70d53f3ff2bf097a24ab0ba035 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "i18n.h"
 
-using std::stringstream;
 using std::list;
 using std::pair;
 using std::cout;
index aacefaa05502c9202178b2637dfa7dd5dbd50df6..c836cc2715728e8c75f09eb5271d4b003748dbc3 100644 (file)
@@ -30,7 +30,6 @@
 
 using std::list;
 using std::string;
-using std::stringstream;
 using std::cout;
 using std::vector;
 using boost::shared_ptr;
index e8ab5452bd404ec8a5c10cdb49ee761a8ad29f20..8caa0190c38726121d182b1f81e27ebf99b85295 100644 (file)
@@ -45,7 +45,6 @@
 
 using std::pair;
 using std::string;
-using std::stringstream;
 using std::vector;
 using std::list;
 using std::cout;
index 8f16e2e5c0c069e2ab601c4bf91cec39c1e3cebc..cbf180ffcb3bf451379e410039d5d28dfed75d80 100644 (file)
@@ -46,12 +46,6 @@ ExamineContentJob::name () const
        return _("Examine content");
 }
 
-string
-ExamineContentJob::json_name () const
-{
-       return N_("examine_content");
-}
-
 void
 ExamineContentJob::run ()
 {
index c8037224faa708737e6739d5c29bc544ee74ad0f..b6903b86bebf0ed9e80970a7382c0f07628301cc 100644 (file)
@@ -30,7 +30,6 @@ public:
        ~ExamineContentJob ();
 
        std::string name () const;
-       std::string json_name () const;
        void run ();
 
 private:
index f5af239b0a0eeba9445d85a98fbe97c767ae9658..fa369dda429c9342c2b08eed7a4b74ee50a38c35 100644 (file)
@@ -34,7 +34,6 @@ extern "C" {
 
 using std::string;
 using std::cout;
-using std::stringstream;
 using boost::shared_ptr;
 using dcp::raw_convert;
 
index 0f2c88fc9f8ce36f06f957b8c4172f6248c2c44c..4e5d9bb1ed271760e858b4a37d62fcde110fa1d4 100644 (file)
@@ -56,7 +56,6 @@ extern "C" {
 using std::cout;
 using std::string;
 using std::vector;
-using std::stringstream;
 using std::list;
 using std::min;
 using std::pair;
index 454938ada3d5043de1e983b28b40be7c2a057dd5..31fce6b6d71182625ebc0a43bc4609d1e7f5ab8c 100644 (file)
@@ -23,6 +23,8 @@
 
 #include "i18n.h"
 
+using std::string;
+
 static bool
 about_equal (float a, float b)
 {
@@ -73,7 +75,13 @@ FrameRateChange::FrameRateChange (float source_, int dcp_)
 
        speed_up = dcp / (source * factor());
        change_speed = !about_equal (speed_up, 1.0);
+}
 
+string
+FrameRateChange::description () const
+{
+       string description;
+       
        if (!skip && repeat == 1 && !change_speed) {
                description = _("Content and DCP have the same rate.\n");
        } else {
@@ -90,4 +98,6 @@ FrameRateChange::FrameRateChange (float source_, int dcp_)
                        description += String::compose (_("DCP will run at %1%% of the content speed.\n"), pc);
                }
        }
+
+       return description;
 }
index f53adc05925c1dea9fa461a491c54f2c111b6f23..f5244fea2b5d68491039b5c52db71d4ca81dd35f 100644 (file)
@@ -60,7 +60,7 @@ struct FrameRateChange
         */
        float speed_up;
 
-       std::string description;
+       std::string description () const;
 };
 
 #endif
index 233f477453416ee44dac4c0659442a751e48a701..b6b387b76081947a554290c0846cf81333acd42c 100644 (file)
@@ -34,7 +34,6 @@
 
 using std::cout;
 using std::string;
-using std::stringstream;
 using boost::shared_ptr;
 
 ImageProxy::ImageProxy (shared_ptr<Log> log)
index 594c0da34f1b5cdc7a55177e61bee698b5ac21d5..31a10a44bd6af2343ca4ddfa525ed3b4e35226ad 100644 (file)
@@ -328,29 +328,6 @@ Job::status () const
        return s.str ();
 }
 
-string
-Job::json_status () const
-{
-       boost::mutex::scoped_lock lm (_state_mutex);
-
-       switch (_state) {
-       case NEW:
-               return N_("new");
-       case RUNNING:
-               return N_("running");
-       case PAUSED:
-               return N_("paused");
-       case FINISHED_OK:
-               return N_("finished_ok");
-       case FINISHED_ERROR:
-               return N_("finished_error");
-       case FINISHED_CANCELLED:
-               return N_("finished_cancelled");
-       }
-
-       return "";
-}
-
 /** @return An estimate of the remaining time for this sub-job, in seconds */
 int
 Job::remaining_time () const
index 5e3127dc158a432522590ffec566e5cfa1e21bbf..97e3fc29637d292597d943f4c9e70a77cdd8dfad 100644 (file)
@@ -43,7 +43,6 @@ public:
 
        /** @return user-readable name of this job */
        virtual std::string name () const = 0;
-       virtual std::string json_name () const = 0;
        /** Run this job in the current thread. */
        virtual void run () = 0;
        
@@ -65,7 +64,6 @@ public:
 
        int elapsed_time () const;
        virtual std::string status () const;
-       std::string json_status () const;
        std::string sub_name () const {
                return _sub_name;
        }
diff --git a/src/lib/json_server.cc b/src/lib/json_server.cc
deleted file mode 100644 (file)
index 1be3c7d..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <boost/asio.hpp>
-#include <boost/bind.hpp>
-#include <boost/thread.hpp>
-#include "json_server.h"
-#include "job_manager.h"
-#include "job.h"
-#include "util.h"
-#include "film.h"
-#include "transcode_job.h"
-
-using std::string;
-using std::stringstream;
-using std::cout;
-using std::map;
-using std::list;
-using boost::thread;
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
-using boost::asio::ip::tcp;
-
-#define MAX_LENGTH 512
-
-enum State {
-       AWAITING_G,
-       AWAITING_E,
-       AWAITING_T,
-       AWAITING_SPACE,
-       READING_URL,
-};
-
-JSONServer::JSONServer (int port)
-{
-       new thread (boost::bind (&JSONServer::run, this, port));
-}
-
-void
-JSONServer::run (int port)
-try
-{
-       boost::asio::io_service io_service;
-       tcp::acceptor a (io_service, tcp::endpoint (tcp::v4 (), port));
-       while (true) {
-               try {
-                       shared_ptr<tcp::socket> s (new tcp::socket (io_service));
-                       a.accept (*s);
-                       handle (s);
-               }
-               catch (...) {
-
-               }
-       }
-}
-catch (...)
-{
-
-}
-
-void
-JSONServer::handle (shared_ptr<tcp::socket> socket)
-{
-       string url;
-       State state = AWAITING_G;
-
-       while (true) {
-               char data[MAX_LENGTH];
-               boost::system::error_code error;
-               size_t len = socket->read_some (boost::asio::buffer (data), error);
-               if (error) {
-                       cout << "error.\n";
-                       break;
-               }
-
-               char* p = data;
-               char* e = data + len;
-               while (p != e) {
-
-                       State old_state = state;
-                       switch (state) {
-                       case AWAITING_G:
-                               if (*p == 'G') {
-                                       state = AWAITING_E;
-                               }
-                               break;
-                       case AWAITING_E:
-                               if (*p == 'E') {
-                                       state = AWAITING_T;
-                               }
-                               break;
-                       case AWAITING_T:
-                               if (*p == 'T') {
-                                       state = AWAITING_SPACE;
-                               }
-                               break;
-                       case AWAITING_SPACE:
-                               if (*p == ' ') {
-                                       state = READING_URL;
-                               }
-                               break;
-                       case READING_URL:
-                               if (*p == ' ') {
-                                       request (url, socket);
-                                       state = AWAITING_G;
-                                       url = "";
-                               } else {
-                                       url += *p;
-                               }
-                               break;
-                       }
-
-                       if (state == old_state && state != READING_URL) {
-                               state = AWAITING_G;
-                       }
-
-                       ++p;
-               }
-       }
-}
-
-void
-JSONServer::request (string url, shared_ptr<tcp::socket> socket)
-{
-       cout << "request: " << url << "\n";
-       
-       map<string, string> r = split_get_request (url);
-       for (map<string, string>::iterator i = r.begin(); i != r.end(); ++i) {
-               cout << i->first << " => " << i->second << "\n";
-       }
-       
-       string action;
-       if (r.find ("action") != r.end ()) {
-               action = r["action"];
-       }
-       
-       stringstream json;
-       if (action == "status") {
-               
-               list<shared_ptr<Job> > jobs = JobManager::instance()->get ();
-               
-               json << "{ \"jobs\": [";
-               for (list<shared_ptr<Job> >::iterator i = jobs.begin(); i != jobs.end(); ++i) {
-
-                       json << "{ ";
-
-                       if ((*i)->film()) {
-                               json << "\"dcp\": \"" << (*i)->film()->dcp_name() << "\", ";
-                       }
-                       
-                       json << "\"name\": \""   << (*i)->json_name() << "\", "
-                            << "\"progress\": " << (*i)->progress () << ", "
-                            << "\"status\": \"" << (*i)->json_status() << "\"";
-                       json << " }";
-                       
-                       list<shared_ptr<Job> >::iterator j = i;
-                       ++j;
-                       if (j != jobs.end ()) {
-                               json << ", ";
-                       }
-               }
-               json << "] }";
-               
-               if (json.str().empty ()) {
-                       json << "{ }";
-               }
-       }
-       
-       stringstream reply;
-       reply << "HTTP/1.1 200 OK\r\n"
-             << "Content-Length: " << json.str().length() << "\r\n"
-             << "Content-Type: application/json\r\n"
-                             << "\r\n"
-             << json.str () << "\r\n";
-       cout << "reply: " << json.str() << "\n";
-       boost::asio::write (*socket, boost::asio::buffer (reply.str().c_str(), reply.str().length()));
-}
diff --git a/src/lib/json_server.h b/src/lib/json_server.h
deleted file mode 100644 (file)
index 6230675..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-class JSONServer
-{
-public:
-       JSONServer (int port);
-
-private:
-       void run (int port);
-       void handle (boost::shared_ptr<boost::asio::ip::tcp::socket> socket);
-       void request (std::string url, boost::shared_ptr<boost::asio::ip::tcp::socket> socket);
-};
-
-       
index 16c740943ca89f382f27082ba70a935d987c484b..22412da4a3640b5313cd6d75cdb25422a4ee08f6 100644 (file)
@@ -40,7 +40,6 @@ using std::vector;
 using std::min;
 using std::max;
 using std::string;
-using std::stringstream;
 using std::pair;
 using boost::optional;
 using boost::shared_ptr;
index fbd7022322c5b0e9e02d8e94785baaa54e23c4c5..bb69636584167d12b19d358e99d5a25193394d76 100644 (file)
@@ -24,7 +24,6 @@
 #include "i18n.h"
 
 using std::string;
-using std::stringstream;
 using std::vector;
 
 vector<Ratio const *> Ratio::_ratios;
index 63784081356e9eb0fc4d81ea97d551a7078e224d..67a1fb8026a68325b768a86fa1808dd258345490 100644 (file)
@@ -40,7 +40,6 @@
 #define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_GENERAL);
 
 using std::string;
-using std::stringstream;
 using std::min;
 using boost::shared_ptr;
 
@@ -112,12 +111,6 @@ SCPDCPJob::name () const
        return _("Copy DCP to TMS");
 }
 
-string
-SCPDCPJob::json_name () const
-{
-       return N_("scp_dcp");
-}
-
 void
 SCPDCPJob::run ()
 {
@@ -217,12 +210,11 @@ string
 SCPDCPJob::status () const
 {
        boost::mutex::scoped_lock lm (_status_mutex);
-       stringstream s;
-       s << Job::status ();
+       string s = Job::status ();
        if (!_status.empty ()) {
-               s << N_("; ") << _status;
+               s += N_("; ") + _status;
        }
-       return s.str ();
+       return s;
 }
 
 void
index e3960d73b512dac54d25124be28740d15dfd67cf..bdc83af187f85a0091d31e107d554ee9dd07ef4c 100644 (file)
@@ -29,7 +29,6 @@ public:
        SCPDCPJob (boost::shared_ptr<const Film>);
 
        std::string name () const;
-       std::string json_name () const;
        void run ();
        std::string status () const;
 
index de03222725074b9a6a9fdfa670a463de0f88f396..541307f5acc8ace90d682b5b396046ddcdcbab2e 100644 (file)
@@ -52,12 +52,6 @@ SendKDMEmailJob::name () const
        return String::compose (_("Email KDMs for %1"), _film->name());
 }
 
-string
-SendKDMEmailJob::json_name () const
-{
-       return N_("send_kdm_email");
-}
-
 void
 SendKDMEmailJob::run ()
 {
index 084836715f865fe6a62b52eae1e7ac1536bd202f..af84a13af2b959c034e342c3dd9d2b56448c8a12 100644 (file)
@@ -36,7 +36,6 @@ public:
                );
 
        std::string name () const;
-       std::string json_name () const;
        void run ();
 
 private:
index 4a85fa18aa8935d0a2c0ff5670f504de012b439e..1a162b6544ad1ba6442acbfbdcaab87d52b4bd95 100644 (file)
@@ -54,12 +54,6 @@ TranscodeJob::name () const
        return String::compose (_("Transcode %1"), _film->name());
 }
 
-string
-TranscodeJob::json_name () const
-{
-       return N_("transcode");
-}
-
 void
 TranscodeJob::run ()
 {
index 6e3c1ead9314cc5af7bb2877f208c38ae4358fa3..9128206d29dc9c9e42460cafecfa4748f0a1c0db 100644 (file)
@@ -35,7 +35,6 @@ public:
        TranscodeJob (boost::shared_ptr<const Film> f);
        
        std::string name () const;
-       std::string json_name () const;
        void run ();
        std::string status () const;
 
index c594a64464729e4ae33287deb06c64f457f234f4..eda82f27729c6b810b6850679c0562eeadb24ba2 100644 (file)
@@ -60,7 +60,6 @@ using std::pair;
 using std::string;
 using std::list;
 using std::cout;
-using std::stringstream;
 using boost::shared_ptr;
 using boost::weak_ptr;
 using boost::dynamic_pointer_cast;
index f26529b8423b7763a6ab237c2feafe6e07dadf51..15f26c34f2dcc91cfeef95d19a142301eebd5e38 100644 (file)
@@ -54,7 +54,6 @@ sources = """
           job.cc
           job_manager.cc
           kdm.cc
-          json_server.cc
           log.cc
           magick_image_proxy.cc
           md5_digester.cc
index e67703b22fe34a69b544a34b660c74f693e39ca8..8c7f09ae77de6fd4e8344ca12f3a528617991a6a 100644 (file)
@@ -338,13 +338,12 @@ private:
 
        void file_changed (boost::filesystem::path f)
        {
-               stringstream s;
-               s << wx_to_std (_("DCP-o-matic"));
+               string s = wx_to_std (_("DCP-o-matic"));
                if (!f.empty ()) {
-                       s << " - " << f.string ();
+                       s += " - " + f.string ();
                }
                
-               SetTitle (std_to_wx (s.str()));
+               SetTitle (std_to_wx (s));
        }
        
        void file_new ()
index 7dd820b9571bc9becf931b176aabcd975e75d996..8c33b7d83a983f4917bf98ee413bf0cf7186d635 100644 (file)
@@ -33,7 +33,6 @@
 #include "lib/log.h"
 #include "lib/ui_signaller.h"
 #include "lib/server_finder.h"
-#include "lib/json_server.h"
 
 using std::string;
 using std::cerr;
@@ -53,7 +52,6 @@ help (string n)
             << "  -f, --flags        show flags passed to C++ compiler on build\n"
             << "  -n, --no-progress  do not print progress to stdout\n"
             << "  -r, --no-remote    do not use any remote servers\n"
-            << "  -j, --json <port>  run a JSON server on the specified port\n"
             << "  -k, --keep-going   keep running even when the job is complete\n"
             << "\n"
             << "<FILM> is the film directory.\n";
@@ -65,7 +63,6 @@ main (int argc, char* argv[])
        string film_dir;
        bool progress = true;
        bool no_remote = false;
-       int json_port = 0;
        bool keep_going = false;
 
        int option_index = 0;
@@ -77,12 +74,11 @@ main (int argc, char* argv[])
                        { "flags", no_argument, 0, 'f'},
                        { "no-progress", no_argument, 0, 'n'},
                        { "no-remote", no_argument, 0, 'r'},
-                       { "json", required_argument, 0, 'j' },
                        { "keep-going", no_argument, 0, 'k' },
                        { 0, 0, 0, 0 }
                };
 
-               int c = getopt_long (argc, argv, "vhdfnrj:k", long_options, &option_index);
+               int c = getopt_long (argc, argv, "vhdfnrk", long_options, &option_index);
 
                if (c == -1) {
                        break;
@@ -107,9 +103,6 @@ main (int argc, char* argv[])
                case 'r':
                        no_remote = true;
                        break;
-               case 'j':
-                       json_port = atoi (optarg);
-                       break;
                case 'k':
                        keep_going = true;
                        break;
@@ -130,10 +123,6 @@ main (int argc, char* argv[])
                ServerFinder::instance()->disable ();
        }
 
-       if (json_port) {
-               new JSONServer (json_port);
-       }
-
        cout << "DCP-o-matic " << dcpomatic_version << " git " << dcpomatic_git_commit;
        char buf[256];
        if (gethostname (buf, 256) == 0) {
@@ -151,9 +140,6 @@ main (int argc, char* argv[])
        }
 
        cout << "\nMaking DCP for " << film->name() << "\n";
-//     cout << "Content: " << film->content() << "\n";
-//     pair<string, string> const f = Filter::ffmpeg_strings (film->filters ());
-//     cout << "Filters: " << f.first << " " << f.second << "\n";
 
        film->make_dcp ();
 
index e5bb1896207fe396464624e7ca730093b8d217ab..a05a3bbc79ff58b73caecc48a70e1afb67bc0038 100644 (file)
@@ -27,7 +27,6 @@
 using std::list;
 using std::string;
 using std::vector;
-using std::stringstream;
 using std::cout;
 using boost::optional;
 using boost::algorithm::split;
index 86e1997e961ba31ad080b70bfe6fc6fbb7ac2de5..07cb0be6586b6485defff73b314ad2702fac87f5 100644 (file)
@@ -115,6 +115,16 @@ Timecode::get (int fps) const
        return t;
 }
 
+void
+Timecode::clear ()
+{
+       checked_set (_hours, "");
+       checked_set (_minutes, "");
+       checked_set (_seconds, "");
+       checked_set (_frames, "");
+       _fixed->SetLabel ("");
+}
+
 void
 Timecode::changed ()
 {
index b13e8c3c084b9c35514e805f59e752927fe46ae1..72b00ddeb4867065943d41b7ca41ad1295d632a8 100644 (file)
@@ -28,6 +28,7 @@ public:
 
        void set (DCPTime, int);
        DCPTime get (int) const;
+       void clear ();
 
        void set_editable (bool);
 
index 021ab6ab08405ecd646286937cd948ac82096d97..a0e1f8f8a4845b8ebc9c852202d89818b55f8f01 100644 (file)
@@ -27,6 +27,7 @@
 
 using std::cout;
 using std::string;
+using std::set;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using dcp::raw_convert;
@@ -78,67 +79,117 @@ void
 TimingPanel::film_content_changed (int property)
 {
        ContentList cl = _parent->selected ();
-       shared_ptr<Content> content;
-       if (cl.size() == 1) {
-               content = cl.front ();
-       }
-
        int const film_video_frame_rate = _parent->film()->video_frame_rate ();
+
+       /* Here we check to see if we have exactly one different value of various
+          properties, and fill the controls with that value if so.
+       */
        
        if (property == ContentProperty::POSITION) {
-               if (content) {
-                       _position->set (content->position (), film_video_frame_rate);
+
+               set<DCPTime> check;
+               for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
+                       check.insert ((*i)->position ());
+               }
+
+               if (check.size() == 1) {
+                       _position->set (cl.front()->position(), film_video_frame_rate);
                } else {
-                       _position->set (DCPTime () , 24);
+                       _position->clear ();
                }
+               
        } else if (
                property == ContentProperty::LENGTH ||
                property == VideoContentProperty::VIDEO_FRAME_RATE ||
                property == VideoContentProperty::VIDEO_FRAME_TYPE
                ) {
-               if (content) {
-                       _full_length->set (content->full_length (), film_video_frame_rate);
-                       _play_length->set (content->length_after_trim (), film_video_frame_rate);
+
+               set<DCPTime> check;
+               for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
+                       check.insert ((*i)->full_length ());
+               }
+               
+               if (check.size() == 1) {
+                       _full_length->set (cl.front()->full_length (), film_video_frame_rate);
                } else {
-                       _full_length->set (DCPTime (), 24);
-                       _play_length->set (DCPTime (), 24);
+                       _full_length->clear ();
                }
+
        } else if (property == ContentProperty::TRIM_START) {
-               if (content) {
-                       _trim_start->set (content->trim_start (), film_video_frame_rate);
-                       _play_length->set (content->length_after_trim (), film_video_frame_rate);
+
+               set<DCPTime> check;
+               for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
+                       check.insert ((*i)->trim_start ());
+               }
+               
+               if (check.size() == 1) {
+                       _trim_start->set (cl.front()->trim_start (), film_video_frame_rate);
                } else {
-                       _trim_start->set (DCPTime (), 24);
-                       _play_length->set (DCPTime (), 24);
+                       _trim_start->clear ();
                }
+               
        } else if (property == ContentProperty::TRIM_END) {
-               if (content) {
-                       _trim_end->set (content->trim_end (), film_video_frame_rate);
-                       _play_length->set (content->length_after_trim (), film_video_frame_rate);
+
+               set<DCPTime> check;
+               for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
+                       check.insert ((*i)->trim_end ());
+               }
+               
+               if (check.size() == 1) {
+                       _trim_end->set (cl.front()->trim_end (), film_video_frame_rate);
                } else {
-                       _trim_end->set (DCPTime (), 24);
-                       _play_length->set (DCPTime (), 24);
+                       _trim_end->clear ();
+               }
+       }
+
+       if (
+               property == ContentProperty::LENGTH ||
+               property == ContentProperty::TRIM_START ||
+               property == ContentProperty::TRIM_END ||
+               property == VideoContentProperty::VIDEO_FRAME_RATE ||
+               property == VideoContentProperty::VIDEO_FRAME_TYPE
+               ) {
+
+               set<DCPTime> check;
+               for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
+                       check.insert ((*i)->length_after_trim ());
+               }
+               
+               if (check.size() == 1) {
+                       _play_length->set (cl.front()->length_after_trim (), film_video_frame_rate);
+               } else {
+                       _play_length->clear ();
                }
        }
 
        if (property == VideoContentProperty::VIDEO_FRAME_RATE) {
-               if (content) {
-                       shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (content);
+               set<float> check;
+               shared_ptr<VideoContent> vc;
+               for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
+                       vc = dynamic_pointer_cast<VideoContent> (*i);
                        if (vc) {
-                               _video_frame_rate->SetValue (std_to_wx (raw_convert<string> (vc->video_frame_rate (), 5)));
-                       } else {
-                               _video_frame_rate->SetValue ("24");
+                               check.insert (vc->video_frame_rate ());
                        }
+               }
+               if (check.size() == 1) {
+                       _video_frame_rate->SetValue (std_to_wx (raw_convert<string> (vc->video_frame_rate (), 5)));
+                       _video_frame_rate->Enable (true);
                } else {
-                       _video_frame_rate->SetValue ("24");
+                       _video_frame_rate->SetValue ("");
+                       _video_frame_rate->Enable (false);
                }
        }
 
-       shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (content);
-       shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (content);
-       _full_length->set_editable (ic && ic->still ());
-       _play_length->set_editable (!ic || !ic->still ());
-       _video_frame_rate->Enable (vc);
+       bool have_still = false;
+       for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
+               shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (*i);
+               if (ic && ic->still ()) {
+                       have_still = true;
+               }
+       }
+
+       _full_length->set_editable (have_still);
+       _play_length->set_editable (!have_still);
        _set_video_frame_rate->Enable (false);
 }
 
@@ -146,8 +197,8 @@ void
 TimingPanel::position_changed ()
 {
        ContentList c = _parent->selected ();
-       if (c.size() == 1) {
-               c.front()->set_position (_position->get (_parent->film()->video_frame_rate ()));
+       for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
+               (*i)->set_position (_position->get (_parent->film()->video_frame_rate ()));
        }
 }
 
@@ -155,8 +206,8 @@ void
 TimingPanel::full_length_changed ()
 {
        ContentList c = _parent->selected ();
-       if (c.size() == 1) {
-               shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (c.front ());
+       for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
+               shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (*i);
                if (ic && ic->still ()) {
                        /* XXX: No effective FRC here... is this right? */
                        ic->set_video_length (ContentTime (_full_length->get (_parent->film()->video_frame_rate()), FrameRateChange (1, 1)));
@@ -168,8 +219,8 @@ void
 TimingPanel::trim_start_changed ()
 {
        ContentList c = _parent->selected ();
-       if (c.size() == 1) {
-               c.front()->set_trim_start (_trim_start->get (_parent->film()->video_frame_rate ()));
+       for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
+               (*i)->set_trim_start (_trim_start->get (_parent->film()->video_frame_rate ()));
        }
 }
 
@@ -178,8 +229,8 @@ void
 TimingPanel::trim_end_changed ()
 {
        ContentList c = _parent->selected ();
-       if (c.size() == 1) {
-               c.front()->set_trim_end (_trim_end->get (_parent->film()->video_frame_rate ()));
+       for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
+               (*i)->set_trim_end (_trim_end->get (_parent->film()->video_frame_rate ()));
        }
 }
 
@@ -187,8 +238,8 @@ void
 TimingPanel::play_length_changed ()
 {
        ContentList c = _parent->selected ();
-       if (c.size() == 1) {
-               c.front()->set_trim_end (c.front()->full_length() - _play_length->get (_parent->film()->video_frame_rate()) - c.front()->trim_start());
+       for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
+               (*i)->set_trim_end ((*i)->full_length() - _play_length->get (_parent->film()->video_frame_rate()) - (*i)->trim_start());
        }
 }
 
@@ -202,8 +253,8 @@ void
 TimingPanel::set_video_frame_rate ()
 {
        ContentList c = _parent->selected ();
-       if (c.size() == 1) {
-               shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (c.front ());
+       for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
+               shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (*i);
                if (vc) {
                        vc->set_video_frame_rate (raw_convert<float> (wx_to_std (_video_frame_rate->GetValue ())));
                }
@@ -214,16 +265,14 @@ TimingPanel::set_video_frame_rate ()
 void
 TimingPanel::content_selection_changed ()
 {
-       ContentList sel = _parent->selected ();
-       bool const single = sel.size() == 1;
-
-       /* Things that are only allowed with single selections */
-       _position->Enable (single);
-       _full_length->Enable (single);
-       _trim_start->Enable (single);
-       _trim_end->Enable (single);
-       _play_length->Enable (single);
-       _video_frame_rate->Enable (single);
+       bool const e = !_parent->selected().empty ();
+
+       _position->Enable (e);
+       _full_length->Enable (e);
+       _trim_start->Enable (e);
+       _trim_end->Enable (e);
+       _play_length->Enable (e);
+       _video_frame_rate->Enable (e);
        
        film_content_changed (ContentProperty::POSITION);
        film_content_changed (ContentProperty::LENGTH);
index f00edd8fff0f69c3168911694a22b906581fd567..cd831baed7cbc5b97324d97a1a603773d0ee0614 100644 (file)
@@ -332,7 +332,7 @@ VideoPanel::setup_description ()
        d << wxString::Format (_("Content frame rate %.4f\n"), vcs->video_frame_rate ());
        ++lines;
        FrameRateChange frc (vcs->video_frame_rate(), _parent->film()->video_frame_rate ());
-       d << std_to_wx (frc.description) << "\n";
+       d << std_to_wx (frc.description ()) << "\n";
        ++lines;
 
        for (int i = lines; i < 6; ++i) {
index 70f29b998933d355df2b793797ad36d38c9a0205..f0a544e50a9f57ed178fb4705696fb14ca810d9f 100644 (file)
@@ -31,7 +31,6 @@
 #include "test.h"
 
 using std::string;
-using std::stringstream;
 using std::list;
 using boost::shared_ptr;
 
index c1b66d4e01f38f36127c49087c79473cbdb20739..97a23b946a765eb7c758c41678960d3f0d69ea81 100644 (file)
@@ -58,10 +58,6 @@ public:
        string name () const {
                return "";
        }
-
-       string json_name () const {
-               return "";
-       }
 };
 
 BOOST_AUTO_TEST_CASE (job_manager_test)