set (double (frame) / frames_per_second, tcr_);
}
+/** Construct a Time with a timecode rate of 24 and using the supplied
+ * number of seconds.
+ *
+ * @param seconds A number of seconds.
+ */
Time::Time (double seconds)
{
set (seconds, 24);
}
+/** Construct a Time with specified timecode rate and using the supplied
+ * number of seconds.
+ *
+ * @param seconds A number of seconds.
+ * @param tcr_ Timecode rate to use.
+ */
void
Time::set (double seconds, int tcr_)
{
}
}
-/** @param time String of the form HH:MM:SS:EE */
+/** @param time String of the form HH:MM:SS:EE[E] */
Time::Time (string time, int tcr_)
: tcr (tcr_)
{
return str.str ();
}
+/** @param tcr_ Timecode rate with which the return value should be counted.
+ * @return the total number of editable units that this time consists of at the specified timecode rate.
+ * For example, as_editable_units (24) returns the total time in frames at 24fps.
+ */
int64_t
Time::as_editable_units (int tcr_) const
{
return (int64_t(e) * float (tcr_ / tcr)) + int64_t(s) * tcr_ + int64_t(m) * 60 * tcr_ + int64_t(h) * 60 * 60 * tcr_;
}
+/** @return the total number of seconds that this time consists of */
double
Time::as_seconds () const
{
return h * 3600 + m * 60 + s + double(e) / tcr;
}
+/** @param tcr_ New timecode rate.
+ * @return A new Time which is this time at the spcified new timecode rate.
+ */
Time
Time::rebase (int tcr_) const
{
/** @class Time
* @brief A representation of time within a DCP.
*/
-
class Time
{
public:
+ /** Construct a zero Time */
Time () : h (0), m (0), s (0), e (0), tcr (1) {}
/** Construct a Time from a frame index (starting from 0),
*/
+/** @file src/interop_subtitle_asset.h
+ * @brief InteropSubtitleAsset class.
+ */
+
#include "subtitle_asset.h"
#include <boost/filesystem.hpp>
class InteropLoadFontNode;
+/** @class InteropSubtitleAsset
+ * @brief A set of subtitles to be read and/or written in the Inter-Op format.
+ *
+ * Inter-Op subtitles are sometimes known as CineCanvas.
+ */
class InteropSubtitleAsset : public SubtitleAsset
{
public:
Glib::ustring xml_as_string () const;
void write (boost::filesystem::path path) const;
+ /** Set the reel number or sub-element identifier
+ * of these subtitles.
+ * @param n New reel number.
+ */
void set_reel_number (std::string n) {
_reel_number = n;
}
+ /** Set the language tag of these subtitles.
+ * @param l New language.
+ */
void set_language (std::string l) {
_language = l;
}
+ /** @return title of the movie that the subtitles are for */
void set_movie_title (std::string m) {
_movie_title = m;
}
+ /** @return reel number or sub-element of a programme that
+ * these subtitles refer to.
+ */
std::string reel_number () const {
return _reel_number;
}
-
+
+ /** @return language used in the subtitles */
std::string language () const {
return _language;
}
+ /** @return movie title that these subtitles are for */
std::string movie_title () const {
return _movie_title;
}
namespace dcp {
/** @class ReelSoundAsset
- * @brief Part of a Reel's description which refers to a sound MXF.
+ * @brief Part of a Reel's description which refers to a sound asset.
*/
class ReelSoundAsset : public ReelAsset, public ReelMXF
{
/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2015 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
class StereoPictureAsset;
/** @class ReelStereoPictureAsset
- * @brief Part of a Reel's description which refers to a stereoscopic picture MXF.
+ * @brief Part of a Reel's description which refers to a stereoscopic picture asset.
*/
class ReelStereoPictureAsset : public ReelPictureAsset
{
*/
+/** @file src/smpte_subtitle_asset.cc
+ * @brief SMPTESubtitleAsset class.
+ */
+
#include "smpte_subtitle_asset.h"
#include "smpte_load_font_node.h"
#include "font_node.h"
using boost::is_any_of;
using namespace dcp;
+/** Construct a SMPTESubtitleAsset by reading an XML or MXF file.
+ * @param file Filename.
+ * @param mxf true if file is an MXF, false if it is XML.
+ */
SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file, bool mxf)
: SubtitleAsset (file)
{
ASDCP::WriterInfo info;
reader.FillWriterInfo (info);
-
- char buffer[64];
- Kumu::bin2UUIDhex (info.AssetUUID, ASDCP::UUIDlen, buffer, sizeof (buffer));
- _id = buffer;
+ _id = read_writer_info (info);
} else {
xml->read_file (file);
_id = xml->string_child("Id").substr (9);
*/
+/** @file src/smpte_subtitle_asset.h
+ * @brief SMPTESubtitleAsset class.
+ */
+
#include "subtitle_asset.h"
#include "local_time.h"
#include "mxf.h"
class SMPTELoadFontNode;
+/** @class SMPTESubtitleAsset
+ * @brief A set of subtitles to be read and/or written in the SMPTE format.
+ */
class SMPTESubtitleAsset : public SubtitleAsset, public MXF
{
public:
Glib::ustring xml_as_string () const;
void write (boost::filesystem::path path) const;
- /** @return language, if one was specified */
+ /** @return title of the film that these subtitles are for,
+ * to be presented to the user.
+ */
+ std::string content_title_text () const {
+ return _content_title_text;
+ }
+
+ /** @return language as a xs:language, if one was specified */
boost::optional<std::string> language () const {
return _language;
}
+
+ /** @return annotation text, to be presented to the user */
+ boost::optional<std::string> annotation_text () const {
+ return _annotation_text;
+ }
+
+ /** @return file creation time and date */
+ LocalTime issue_date () const {
+ return _issue_date;
+ }
+
+ Fraction edit_rate () const {
+ return _edit_rate;
+ }
+
+ /** @return subdivision of 1 second that is used for subtitle times;
+ * e.g. a time_code_rate of 250 means that a subtitle time of 0:0:0:001
+ * represents 4ms.
+ */
+ int time_code_rate () const {
+ return _time_code_rate;
+ }
+
+ boost::optional<Time> start_time () const {
+ return _start_time;
+ }
static bool valid_mxf (boost::filesystem::path);
private:
std::string _content_title_text;
+ boost::optional<std::string> _language;
boost::optional<std::string> _annotation_text;
LocalTime _issue_date;
boost::optional<int> _reel_number;
- boost::optional<std::string> _language;
Fraction _edit_rate;
int _time_code_rate;
boost::optional<Time> _start_time;
namespace dcp {
/** @class SoundFrame
- * @brief One ‘frame’ of sound data from a MXF.
+ * @brief One ‘frame’ of sound data from a SoundAsset.
*/
class SoundFrame : public boost::noncopyable
{