}
Screen::Screen (cxml::ConstNodePtr node)
+ : name (node->string_child ("name"))
{
- name = node->string_child ("Name");
if (node->optional_string_child ("Certificate")) {
certificate = dcp::Certificate (node->string_child ("Certificate"));
}
PresetColourConversion::PresetColourConversion (cxml::NodePtr node, int version)
: conversion (node, version)
+ , name (node->string_child ("Name"))
{
- name = node->string_child ("Name");
+
}
void
public:
ContentVideo ()
: eyes (EYES_BOTH)
+ , part (PART_WHOLE)
{}
ContentVideo (boost::shared_ptr<const ImageProxy> i, Eyes e, Part p, VideoFrame f)
{
public:
/** @param w Error message */
- StringError (std::string w) {
- _what = w;
- }
+ StringError (std::string w)
+ : _what (w)
+ {}
virtual ~StringError () throw () {}
#include <libxml++/libxml++.h>
Font::Font (cxml::NodePtr node)
+ : id (node->string_child ("Id"))
+ , file (node->optional_string_child ("File"))
{
- id = node->string_child ("Id");
- file = node->optional_string_child ("File");
+
}
void
boost::filesystem::path path = content->path(0).string ();
if (valid_j2k_file (path)) {
boost::uintmax_t size = boost::filesystem::file_size (path);
- uint8_t* buffer = new uint8_t[size];
FILE* f = fopen_boost (path, "r");
if (!f) {
throw FileError ("Could not open file for reading", path);
}
+ uint8_t* buffer = new uint8_t[size];
fread (buffer, 1, size, f);
fclose (f);
try {
using dcp::raw_convert;
ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node)
-{
- content_version = node->number_child<int> ("ContentVersion");
- audio_language = node->string_child ("AudioLanguage");
- subtitle_language = node->string_child ("SubtitleLanguage");
- territory = node->string_child ("Territory");
- rating = node->string_child ("Rating");
- studio = node->string_child ("Studio");
- facility = node->string_child ("Facility");
- package_type = node->string_child ("PackageType");
-
+ : content_version (node->number_child<int> ("ContentVersion"))
+ , audio_language (node->string_child ("AudioLanguage"))
+ , subtitle_language (node->string_child ("SubtitleLanguage"))
+ , territory (node->string_child ("Territory"))
+ , rating (node->string_child ("Rating"))
+ , studio (node->string_child ("Studio"))
+ , facility (node->string_child ("Facility"))
+ , package_type (node->string_child ("PackageType"))
/* This stuff was added later */
- temp_version = node->optional_bool_child ("TempVersion").get_value_or (false);
- pre_release = node->optional_bool_child ("PreRelease").get_value_or (false);
- red_band = node->optional_bool_child ("RedBand").get_value_or (false);
- chain = node->optional_string_child ("Chain").get_value_or ("");
- two_d_version_of_three_d = node->optional_bool_child ("TwoDVersionOfThreeD").get_value_or (false);
- mastered_luminance = node->optional_string_child ("MasteredLuminance").get_value_or ("");
+ , temp_version (node->optional_bool_child ("TempVersion").get_value_or (false))
+ , pre_release (node->optional_bool_child ("PreRelease").get_value_or (false))
+ , red_band (node->optional_bool_child ("RedBand").get_value_or (false))
+ , chain (node->optional_string_child ("Chain").get_value_or (""))
+ , two_d_version_of_three_d (node->optional_bool_child ("TwoDVersionOfThreeD").get_value_or (false))
+ , mastered_luminance (node->optional_string_child ("MasteredLuminance").get_value_or (""))
+{
+
}
void
root->add_child("TwoDVersionOfThreeD")->add_child_text (two_d_version_of_three_d ? "1" : "0");
root->add_child("MasteredLuminance")->add_child_text (mastered_luminance);
}
-
-void
-ISDCFMetadata::read_old_metadata (string k, string v)
-{
- if (k == N_("audio_language")) {
- audio_language = v;
- } else if (k == N_("subtitle_language")) {
- subtitle_language = v;
- } else if (k == N_("territory")) {
- territory = v;
- } else if (k == N_("rating")) {
- rating = v;
- } else if (k == N_("studio")) {
- studio = v;
- } else if (k == N_("facility")) {
- facility = v;
- } else if (k == N_("package_type")) {
- package_type = v;
- }
-}
_sequencing_video = true;
- ContentList cl = _content;
DCPTime next_left;
DCPTime next_right;
for (ContentList::iterator i = _content.begin(); i != _content.end(); ++i) {
struct update_checker_test;
/** Class to check for the existance of an update for DCP-o-matic on a remote server */
-class UpdateChecker
+class UpdateChecker : public boost::noncopyable
{
public:
UpdateChecker ();
void
terminate ()
{
- static bool tried_throw = false;
-
try {
+ static bool tried_throw = false;
// try once to re-throw currently active exception
if (!tried_throw) {
tried_throw = true;
return crop().apply (video_size_after_3d_split ());
}
-/** @param t A time offset from the start of this piece of content.
- * @return Corresponding time with respect to the content.
- */
-ContentTime
-VideoContent::dcp_time_to_content_time (DCPTime t) const
-{
- shared_ptr<const Film> film = _film.lock ();
- DCPOMATIC_ASSERT (film);
- return ContentTime (t, FrameRateChange (video_frame_rate(), film->video_frame_rate()));
-}
-
void
VideoContent::scale_and_crop_to_fit_width ()
{
try {
server.run (num_threads);
- } catch (boost::system::system_error e) {
+ } catch (boost::system::system_error& e) {
if (e.code() == boost::system::errc::address_in_use) {
cerr << argv[0] << ": address already in use. Is another DCP-o-matic server instance already running?\n";
exit (EXIT_FAILURE);
p += pow (*j, 2);
}
- if (smoothing.size() > 0) {
+ if (!smoothing.empty ()) {
p = sqrt (p / smoothing.size ());
}
class Film;
-class ContentMenu
+class ContentMenu : public boost::noncopyable
{
public:
ContentMenu (wxWindow* p);
class ContentSubPanel;
class Film;
-class ContentPanel
+class ContentPanel : public boost::noncopyable
{
public:
ContentPanel (wxNotebook *, boost::shared_ptr<Film>);
* @param V Data type of state as used by the view.
*/
template <class S, class T, typename U, typename V>
-class ContentWidget
+class ContentWidget : public boost::noncopyable
{
public:
/** @param parent Parent window.
*/
#include <boost/shared_ptr.hpp>
+#include <boost/noncopyable.hpp>
class wxNotebook;
class wxPanel;
class Film;
-class DCPPanel
+class DCPPanel : public boost::noncopyable
{
public:
DCPPanel (wxNotebook *, boost::shared_ptr<Film>);
using boost::shared_ptr;
using boost::weak_ptr;
-class JobRecord
+class JobRecord : public boost::noncopyable
{
public:
JobRecord (shared_ptr<Job> job, wxScrolledWindow* window, wxPanel* panel, wxFlexGridSizer* table)
{
Resampler resamp (from, to, 1);
- int total_out = 0;
-
/* 3 hours */
int64_t const N = int64_t (from) * 60 * 60 * 3;
shared_ptr<AudioBuffers> a (new AudioBuffers (1, 1000));
a->make_silent ();
shared_ptr<const AudioBuffers> r = resamp.run (a);
- total_out += r->frames ();
}
}