+static void
+print_dump (shared_ptr<Film> film)
+{
+ cout << film->dcp_name (true) << "\n"
+ << film->container()->nickname() << " at " << ((film->resolution() == RESOLUTION_2K) ? "2K" : "4K") << "\n"
+ << (film->j2k_bandwidth() / 1000000) << "Mbit/s" << "\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";
+
+ BOOST_FOREACH (shared_ptr<Content> c, film->content ()) {
+ cout << "\n"
+ << c->path(0) << "\n"
+ << "\tat " << c->position().seconds ()
+ << " length " << c->full_length().seconds ()
+ << " start trim " << c->trim_start().seconds ()
+ << " end trim " << c->trim_end().seconds () << "\n";
+
+ if (c->video) {
+ cout << "\t" << c->video->size().width << "x" << c->video->size().height << "\n"
+ << "\t" << c->active_video_frame_rate() << "fps\n"
+ << "\tcrop left " << c->video->left_crop()
+ << " right " << c->video->right_crop()
+ << " top " << c->video->top_crop()
+ << " bottom " << c->video->bottom_crop() << "\n"
+ << "\tscale " << c->video->scale().name() << "\n";
+ if (c->video->colour_conversion()) {
+ if (c->video->colour_conversion().get().preset()) {
+ cout << "\tcolour conversion "
+ << PresetColourConversion::all()[c->video->colour_conversion().get().preset().get()].name
+ << "\n";
+ } else {
+ cout << "\tcustom colour conversion\n";
+ }
+ } else {
+ cout << "\tno colour conversion\n";
+ }
+
+ }
+
+ if (c->audio) {
+ cout << "\t" << c->audio->delay() << " delay\n"
+ << "\t" << c->audio->gain() << " gain\n";
+ }
+ }
+}
+
+static void
+show_servers ()
+{
+ while (true) {
+ int N = 0;
+ list<EncodeServerDescription> servers = EncodeServerFinder::instance()->servers ();
+
+ if (Config::instance()->use_any_servers ()) {
+ if (servers.empty ()) {
+ cout << "No encoding servers found.\n";
+ ++N;
+ } else {
+ cout << std::left << setw(24) << "Host" << " Threads\n";
+ ++N;
+ BOOST_FOREACH (EncodeServerDescription const & i, servers) {
+ cout << std::left << setw(24) << i.host_name() << " " << i.threads() << "\n";
+ ++N;
+ }
+ }
+ } else {
+ vector<string> configured_servers = Config::instance()->servers();
+ if (configured_servers.empty()) {
+ cout << "No configured servers, and DCP-o-matic is not set to search for any server.\n";
+ ++N;
+ } else {
+ cout << std::left << setw(24) << "Host" << " Status Threads\n";
+ ++N;
+ BOOST_FOREACH (string const & i, Config::instance()->servers()) {
+ cout << std::left << setw(24) << i << " ";
+ optional<int> threads;
+ BOOST_FOREACH (EncodeServerDescription const & j, servers) {
+ if (i == j.host_name()) {
+ threads = j.threads();
+ }
+ }
+ if (static_cast<bool>(threads)) {
+ cout << "UP " << threads.get() << "\n";
+ } else {
+ cout << "DOWN\n";
+ }
+ ++N;
+ }
+ }
+ }
+
+
+ dcpomatic_sleep (1);
+
+ for (int i = 0; i < N; ++i) {
+ cout << "\033[1A\033[2K";
+ }
+ }
+}
+
+