Tide 0.1.0
Public Member Functions | Protected Member Functions | Protected Attributes

tide::SegmentInfo Class Reference

The SegmentInfo element, containing the meta-data for a segment. More...

#include <tide/segment_info.h>

Inheritance diagram for tide::SegmentInfo:
Inheritance graph
[legend]
Collaboration diagram for tide::SegmentInfo:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SegmentInfo ()
 Create a new segment info element.
virtual ~SegmentInfo ()
 Destructor.
std::vector< char > uid () const
 Get the UID of this segment.
void uid (std::vector< char > const &uid)
 Set the UID of this segment.
std::string filename () const
 Get the segment's file name.
void filename (std::string const &filename)
 Set the segment's file name.
std::vector< char > prev_uid () const
 Get the previous segment's UID.
void prev_uid (std::vector< char > const &uid)
 Set the previous segment's UID.
std::string prev_filename () const
 Get the previous segment's file name.
void prev_filename (std::string const &filename)
 Set the previous segment's file name.
std::vector< char > next_uid () const
 Get the next segment's UID.
void next_uid (std::vector< char > const &uid)
 Set the next segment's UID.
std::string next_filename () const
 Get the next segment's file name.
void next_filename (std::string const &filename)
 Set the next segment's file name.
std::vector< char > segment_family () const
 Get the segment's family UID.
void segment_family (std::vector< char > const &segment_family)
 Set the segment's family UID.
uint64_t timecode_scale () const
 Get the timecode scale.
void timecode_scale (uint64_t scale)
 Set the timecode scale.
double duration () const
 Get the segment's duration.
void duration (double duration)
 Set the segment's duration.
int64_t date () const
 Get the segment's date.
void date (int64_t date)
 Set the segment's date.
std::string title () const
 Get the segment's title.
void title (std::string const &title)
 Set the segment's title.
std::string muxing_app () const
 Get the name of the muxing application/library.
void muxing_app (std::string const &muxing_app)
 Set the name of the muxing application/library.
std::string writing_app () const
 Get the name of the writing application.
void writing_app (std::string const &writing_app)
 Set the name of the writing application.
virtual std::streamsize write_body (std::ostream &output)
 Element body writing.

Protected Member Functions

virtual std::streamsize body_size () const
 Get the size of the body of this element.
virtual std::streamsize read_body (std::istream &input, std::streamsize size)
 Element body loading.
void reset ()
 Resets all child elements to clean values.

Protected Attributes

BinaryElement uid_
bool have_uid_
StringElement seg_fn_
bool have_seg_fn_
BinaryElement prev_uid_
bool have_prev_uid_
StringElement prev_fn_
bool have_prev_fn_
BinaryElement next_uid_
bool have_next_uid_
StringElement next_fn_
bool have_next_fn_
BinaryElement seg_fam_
bool have_seg_fam_
UIntElement tc_scale_
FloatElement duration_
bool have_duration_
DateElement date_
bool have_date_
StringElement title_
bool have_title_
StringElement muxer_
bool have_muxer_
StringElement writer_
bool have_writer_

Detailed Description

The SegmentInfo element, containing the meta-data for a segment.

The SegmentInfo element provides the important meta-data about a segment in a Tide document, such as the title, date, timecode scale and links to other segments.

Some values in the SegmentInfo cannot be written until after the segment's data is known:

The segment's UID will be generated automatically. It can be retrieved as a binary blob for use in other segments.

Most values in the SegmentInfo element are not required. For a list of which values will not be written to the file unless set, see the Tide format specification.

Definition at line 70 of file segment_info.h.


Constructor & Destructor Documentation

tide::SegmentInfo::SegmentInfo ( )

Create a new segment info element.

virtual tide::SegmentInfo::~SegmentInfo ( ) [inline, virtual]

Destructor.

Definition at line 77 of file segment_info.h.


Member Function Documentation

virtual std::streamsize tide::SegmentInfo::body_size ( ) const [protected, virtual]

Get the size of the body of this element.

Implements tide::Element.

void tide::SegmentInfo::date ( int64_t  date)

Set the segment's date.

int64_t tide::SegmentInfo::date ( ) const [inline]

Get the segment's date.

The segment's date is given in UTC as the number of seconds since 2001-01-01T00:00:00,0 UTC. They are signed, allowing dates before the origin.

Definition at line 200 of file segment_info.h.

void tide::SegmentInfo::duration ( double  duration)

Set the segment's duration.

double tide::SegmentInfo::duration ( ) const [inline]

Get the segment's duration.

The segment's duration is the time range of the data contained in it, in the units defined by the TimecodeScale value.

Typically, this value won't be known until the segment is complete. File writing may therefore require that the SegmentInfo is written twice, with the second write over-writing the first and containing the final values.

Definition at line 190 of file segment_info.h.

std::string tide::SegmentInfo::filename ( ) const [inline]

Get the segment's file name.

Definition at line 94 of file segment_info.h.

void tide::SegmentInfo::filename ( std::string const &  filename)

Set the segment's file name.

Setting this value to an empty string will clear any existing file name, resulting in the element not being written to the file.

std::string tide::SegmentInfo::muxing_app ( ) const [inline]

Get the name of the muxing application/library.

Definition at line 218 of file segment_info.h.

void tide::SegmentInfo::muxing_app ( std::string const &  muxing_app)

Set the name of the muxing application/library.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.

std::string tide::SegmentInfo::next_filename ( ) const [inline]

Get the next segment's file name.

Definition at line 149 of file segment_info.h.

void tide::SegmentInfo::next_filename ( std::string const &  filename)

Set the next segment's file name.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.

std::vector<char> tide::SegmentInfo::next_uid ( ) const [inline]

Get the next segment's UID.

Segments can be linked together into a chain by specifying next and previous segment UIDs. Specifying file names as well helps speed up the search for linked segments.

Linked segments can be treated as a single document. This is typically used for replay, allowing multiple segments to be played back, in time order as determined by their DateUTC values, as though they were a single file.

Definition at line 141 of file segment_info.h.

void tide::SegmentInfo::next_uid ( std::vector< char > const &  uid)

Set the next segment's UID.

Setting this value to an empty buffer will clear any existing value, resulting in the element not being written to the file.

void tide::SegmentInfo::prev_filename ( std::string const &  filename)

Set the previous segment's file name.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.

std::string tide::SegmentInfo::prev_filename ( ) const [inline]

Get the previous segment's file name.

Setting this value to an empty buffer will clear any existing value, resulting in the element not being written to the file.

Definition at line 122 of file segment_info.h.

std::vector<char> tide::SegmentInfo::prev_uid ( ) const [inline]

Get the previous segment's UID.

Segments can be linked together into a chain by specifying next and previous segment UIDs. Specifying file names as well helps speed up the search for linked segments.

Linked segments can be treated as a single document. This is typically used for replay, allowing multiple segments to be played back, in time order as determined by their DateUTC values, as though they were a single file.

Definition at line 114 of file segment_info.h.

void tide::SegmentInfo::prev_uid ( std::vector< char > const &  uid)

Set the previous segment's UID.

virtual std::streamsize tide::SegmentInfo::read_body ( std::istream &  input,
std::streamsize  size 
) [protected, virtual]

Element body loading.

Implements tide::Element.

void tide::SegmentInfo::reset ( ) [protected]

Resets all child elements to clean values.

void tide::SegmentInfo::segment_family ( std::vector< char > const &  segment_family)

Set the segment's family UID.

Setting this value to an empty buffer will clear any existing value, resulting in the element not being written to the file.

std::vector<char> tide::SegmentInfo::segment_family ( ) const [inline]

Get the segment's family UID.

Definition at line 158 of file segment_info.h.

void tide::SegmentInfo::timecode_scale ( uint64_t  scale)

Set the timecode scale.

uint64_t tide::SegmentInfo::timecode_scale ( ) const [inline]

Get the timecode scale.

The timecode scale, a value in nanoseconds, defines the units of all timecodes in the clusters in this segment. For example, if a value of 1,000,000ns is used, all timecodes in the clusters in this segment will be measured in milliseconds.

Set this value to zero to reset it to the default.

Definition at line 176 of file segment_info.h.

void tide::SegmentInfo::title ( std::string const &  title)

Set the segment's title.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.

std::string tide::SegmentInfo::title ( ) const [inline]

Get the segment's title.

This string gives a (usually) human-readable title for the segment.

Definition at line 209 of file segment_info.h.

std::vector<char> tide::SegmentInfo::uid ( ) const [inline]

Get the UID of this segment.

The segment's UID uniquely identifies it amongst other elements. Although it is not a required value, it is strongly recommended that it be set.

Definition at line 85 of file segment_info.h.

void tide::SegmentInfo::uid ( std::vector< char > const &  uid)

Set the UID of this segment.

Setting this value to an empty buffer will clear any existing value, resulting in the element not being written to the file.

virtual std::streamsize tide::SegmentInfo::write_body ( std::ostream &  output) [virtual]

Element body writing.

Implements tide::Element.

std::string tide::SegmentInfo::writing_app ( ) const [inline]

Get the name of the writing application.

Definition at line 227 of file segment_info.h.

void tide::SegmentInfo::writing_app ( std::string const &  writing_app)

Set the name of the writing application.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.


Member Data Documentation

Definition at line 257 of file segment_info.h.

Definition at line 255 of file segment_info.h.

Definition at line 258 of file segment_info.h.

Definition at line 256 of file segment_info.h.

Definition at line 262 of file segment_info.h.

Definition at line 250 of file segment_info.h.

Definition at line 248 of file segment_info.h.

Definition at line 246 of file segment_info.h.

Definition at line 244 of file segment_info.h.

Definition at line 252 of file segment_info.h.

Definition at line 242 of file segment_info.h.

Definition at line 260 of file segment_info.h.

bool tide::SegmentInfo::have_uid_ [protected]

Definition at line 240 of file segment_info.h.

Definition at line 264 of file segment_info.h.

Definition at line 261 of file segment_info.h.

Definition at line 249 of file segment_info.h.

Definition at line 247 of file segment_info.h.

Definition at line 245 of file segment_info.h.

Definition at line 243 of file segment_info.h.

Definition at line 251 of file segment_info.h.

Definition at line 241 of file segment_info.h.

Definition at line 254 of file segment_info.h.

Definition at line 259 of file segment_info.h.

Definition at line 239 of file segment_info.h.

Definition at line 263 of file segment_info.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines