X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fcontent.cc;h=49ab944be54c79c3d478469ad09762a9555768fe;hb=48bfa4b2040d2bacd6befdab6c12b2ee3e9be5a1;hp=578dafd675807fa8a13e8b9ef0a4852638ee6b82;hpb=237a0052c60af768f4d62b00321932918b7ba4d9;p=dcpomatic.git diff --git a/src/lib/content.cc b/src/lib/content.cc index 578dafd67..49ab944be 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -1,76 +1,543 @@ -/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ - /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2021 Carl Hetherington + + This file is part of DCP-o-matic. - This program is free software; you can redistribute it and/or modify + DCP-o-matic 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, + DCP-o-matic 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. + along with DCP-o-matic. If not, see . */ -#include -#include -#include + +/** @file src/lib/content.cc + * @brief Content class. + */ + + #include "content.h" +#include "change_signaller.h" #include "util.h" +#include "content_factory.h" +#include "video_content.h" +#include "audio_content.h" +#include "text_content.h" +#include "exceptions.h" +#include "film.h" +#include "job.h" +#include "compose.hpp" +#include +#include +#include +#include +#include +#include + +#include "i18n.h" + +using std::cout; +using std::list; +using std::make_shared; +using std::max; +using std::pair; +using std::shared_ptr; using std::string; -using boost::shared_ptr; -using boost::lexical_cast; +using std::vector; +using boost::optional; +using dcp::locale_convert; +using dcp::raw_convert; +using namespace dcpomatic; + + +int const ContentProperty::PATH = 400; +int const ContentProperty::POSITION = 401; +int const ContentProperty::LENGTH = 402; +int const ContentProperty::TRIM_START = 403; +int const ContentProperty::TRIM_END = 404; +int const ContentProperty::VIDEO_FRAME_RATE = 405; -Content::Content (boost::filesystem::path f) - : _file (f) - , _time (0) + +Content::Content () + : _change_signals_frequent (false) { } -Content::Content (shared_ptr node) + +Content::Content (DCPTime p) + : _position (p) + , _change_signals_frequent (false) { - _file = node->string_child ("File"); - _digest = node->string_child ("Digest"); - _time = node->number_child