" --twok make a 2K DCP instead of choosing a resolution based on the content\n"
" --fourk make a 4K DCP instead of choosing a resolution based on the content\n"
" -o, --output <dir> output directory\n"
+ " --twod make a 2D DCP\n"
" --threed make a 3D DCP\n"
" --j2k-bandwidth <Mbit/s> J2K bandwidth in Mbit/s\n"
" --left-eye next piece of content is for the left eye\n"
_encrypt = claimed = true;
} else if (a == "--no-use-isdcf-name") {
_no_use_isdcf_name = claimed = true;
+ } else if (a == "--twod") {
+ _twod = claimed = true;
} else if (a == "--threed") {
_threed = claimed = true;
} else if (a == "--left-eye") {
_standard = dcp::Standard::INTEROP;
}
+ if (_twod && _threed) {
+ error = String::compose("%1: specify one of --twod or --threed, not both", argv[0]);
+ }
+
if (content.empty()) {
error = String::compose("%1: no content specified", argv[0]);
return;
film->set_interop(_standard == dcp::Standard::INTEROP);
film->set_use_isdcf_name(!_no_use_isdcf_name);
film->set_encrypted(_encrypt);
- film->set_three_d(_threed);
+ if (_twod) {
+ film->set_three_d(false);
+ } else if (_threed) {
+ film->set_three_d(true);
+ }
if (_twok) {
film->set_resolution(Resolution::TWO_K);
}
*/
+
+#include "lib/config.h"
#include "lib/create_cli.h"
+#include "lib/film.h"
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
#include "test.h"
#include <boost/algorithm/string/predicate.hpp>
#include <iostream>
+
using std::string;
+
static CreateCLI
run (string cmd)
{
cc = run ("dcpomatic2_create x --standard SMPTEX");
BOOST_CHECK (cc.error);
+ cc = run("dcpomatic2_create x --twod");
+ BOOST_CHECK(cc._twod);
+
+ cc = run("dcpomatic2_create x --threed");
+ BOOST_CHECK(cc._threed);
+
+ cc = run("dcpomatic2_create x --twod --threed");
+ BOOST_CHECK(cc.error);
+
cc = run ("dcpomatic2_create x --config foo/bar");
BOOST_CHECK (!cc.error);
BOOST_REQUIRE (cc.config_dir);
BOOST_CHECK(!cc.still_length);
BOOST_CHECK(cc.error);
}
+
+
+BOOST_AUTO_TEST_CASE(create_cli_template_test)
+{
+ ConfigRestorer cr;
+
+ Config::override_path = "test/data";
+
+ auto cc = run("dcpomatic2_create test/data/flat_red.png --template 2d");
+ auto film = cc.make_film();
+ BOOST_CHECK(!film->three_d());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template 2d --threed");
+ film = cc.make_film();
+ BOOST_CHECK(film->three_d());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template 3d");
+ film = cc.make_film();
+ BOOST_CHECK(film->three_d());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template 3d --twod");
+ film = cc.make_film();
+ BOOST_CHECK(!film->three_d());
+}
+