Tawara  0.1.0
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
tawara::CuePoint Class Reference

A CuePoint is an index from a timecode to one or more cluster/block positions. More...

#include <tawara/cues.h>

Inheritance diagram for tawara::CuePoint:
Inheritance graph
[legend]
Collaboration diagram for tawara::CuePoint:
Collaboration graph
[legend]

Public Types

typedef storage_type_::value_type value_type
 The value type of this container. More...
 
typedef storage_type_::size_type size_type
 The size type of this container. More...
 
typedef storage_type_::reference reference
 The reference type. More...
 
typedef
storage_type_::const_reference 
const_reference
 The constant reference type. More...
 
typedef storage_type_::iterator iterator
 The random access iterator type. More...
 
typedef
storage_type_::const_iterator 
const_iterator
 The constant random access iterator type. More...
 
typedef
storage_type_::reverse_iterator 
reverse_iterator
 The reversed random access iterator type. More...
 
typedef
storage_type_::const_reverse_iterator 
const_reverse_iterator
 The constant reversed random access iterator type. More...
 
typedef boost::shared_ptr
< CuePoint
Ptr
 The pointer to this type. More...
 

Public Member Functions

 CuePoint ()
 Constructor. More...
 
 CuePoint (uint64_t timecode)
 Constructor. More...
 
uint64_t timecode () const
 Get the timecode of this cue point. More...
 
void timecode (uint64_t timecode)
 Set the timecode. More...
 
virtual value_typeat (size_type pos)
 Get the CueTracksPosition at the given position, with bounds checking. More...
 
virtual value_type const & at (size_type pos) const
 Get the CueTracksPosition at the given position, with bounds checking. More...
 
virtual value_typeoperator[] (size_type pos)
 Get a reference to a CueTracksPosition. More...
 
virtual value_type const & operator[] (size_type pos) const
 Get a reference to a CueTracksPosition. More...
 
virtual iterator begin ()
 Get an iterator to the first cue. More...
 
virtual const_iterator begin () const
 Get an iterator to the first cue. More...
 
virtual iterator end ()
 Get an iterator to the position past the last cue. More...
 
virtual const_iterator end () const
 Get an iterator to the position past the last cue. More...
 
virtual reverse_iterator rbegin ()
 Get a reverse iterator to the last cue. More...
 
virtual const_reverse_iterator rbegin () const
 Get a reverse iterator to the last cue. More...
 
virtual reverse_iterator rend ()
 Get a reverse iterator to the position before the first cue. More...
 
virtual const_reverse_iterator rend () const
 Get a reverse iterator to the position before the first cue. More...
 
virtual bool empty () const
 Check if there are no cue positions. More...
 
virtual size_type count () const
 Get the number of cue positions. More...
 
virtual size_type max_count () const
 Get the maximum number of cue positions. More...
 
virtual void clear ()
 Remove all cue positions. More...
 
virtual void erase (iterator position)
 Erase the CueTrackPosition at the specified iterator. More...
 
virtual void erase (iterator first, iterator last)
 Erase a range of CueTrackPosition. More...
 
virtual void push_back (value_type const &value)
 Add a CueTrackPosition. More...
 
virtual void resize (size_type count)
 Resizes the vector. More...
 
virtual void swap (CuePoint &other)
 Swaps the contents of this CuePoint element with another. More...
 
- Public Member Functions inherited from tawara::MasterElement
 MasterElement (uint32_t id, bool crc=false)
 Create a new MasterElement. More...
 
virtual ~MasterElement ()
 Destructor. More...
 
- Public Member Functions inherited from tawara::Element
 Element (tawara::ids::ID id)
 Create a new Element. More...
 
virtual ~Element ()
 Destructor. More...
 
uint32_t id () const
 Get the element's ID. More...
 
std::streampos offset () const
 Get the element's offset in the byte stream. More...
 
virtual std::streamsize size () const
 Get the total size of the element. More...
 
virtual std::streamsize write (std::ostream &output)
 Element writing. More...
 
virtual std::streamsize read (std::istream &input)
 Element reading. More...
 

Protected Types

typedef std::vector
< CueTrackPosition
storage_type_
 The storage type. More...
 

Protected Member Functions

virtual std::streamsize body_size () const
 Get the size of the body of this element. More...
 
virtual std::streamsize write_body (std::ostream &output)
 Element body writing. More...
 
virtual std::streamsize read_body (std::istream &input, std::streamsize size)
 Element body loading. More...
 
- Protected Member Functions inherited from tawara::Element
std::streamsize write_id (std::ostream &output)
 Element ID writing. More...
 
virtual std::streamsize write_size (std::ostream &output)
 Element size writing. More...
 

Protected Attributes

UIntElement timecode_
 
storage_type_ positions_
 
- Protected Attributes inherited from tawara::Element
tawara::ids::ID id_
 
std::streampos offset_
 

Friends

bool operator== (CuePoint const &lhs, CuePoint const &rhs)
 Equality operator. More...
 

Detailed Description

A CuePoint is an index from a timecode to one or more cluster/block positions.

The CuePoint element stores the index for a single timecode, providing the location in the segment of the relevant cluster (and, often, block) that corresponds to that timecode for each track active at that timecode. The track positions are accessible through a map interface.

A CuePoint must contain at least one track position before it can be written to a segment.

Definition at line 166 of file cues.h.

Member Typedef Documentation

typedef storage_type_::const_iterator tawara::CuePoint::const_iterator

The constant random access iterator type.

Definition at line 184 of file cues.h.

typedef storage_type_::const_reference tawara::CuePoint::const_reference

The constant reference type.

Definition at line 180 of file cues.h.

typedef storage_type_::const_reverse_iterator tawara::CuePoint::const_reverse_iterator

The constant reversed random access iterator type.

Definition at line 189 of file cues.h.

typedef storage_type_::iterator tawara::CuePoint::iterator

The random access iterator type.

Definition at line 182 of file cues.h.

typedef boost::shared_ptr<CuePoint> tawara::CuePoint::Ptr

The pointer to this type.

Definition at line 191 of file cues.h.

typedef storage_type_::reference tawara::CuePoint::reference

The reference type.

Definition at line 178 of file cues.h.

typedef storage_type_::reverse_iterator tawara::CuePoint::reverse_iterator

The reversed random access iterator type.

Definition at line 186 of file cues.h.

typedef storage_type_::size_type tawara::CuePoint::size_type

The size type of this container.

Definition at line 176 of file cues.h.

typedef std::vector<CueTrackPosition> tawara::CuePoint::storage_type_
protected

The storage type.

Definition at line 171 of file cues.h.

typedef storage_type_::value_type tawara::CuePoint::value_type

The value type of this container.

Definition at line 174 of file cues.h.

Constructor & Destructor Documentation

tawara::CuePoint::CuePoint ( )

Constructor.

tawara::CuePoint::CuePoint ( uint64_t  timecode)

Constructor.

Parameters
[in]timecodeThe timecode of the cue point.

Member Function Documentation

virtual value_type& tawara::CuePoint::at ( size_type  pos)
inlinevirtual

Get the CueTracksPosition at the given position, with bounds checking.

Returns
A reference to the specified CueTracksPosition.
Exceptions
std::out_of_rangeif the position is invalid.

Definition at line 217 of file cues.h.

virtual value_type const& tawara::CuePoint::at ( size_type  pos) const
inlinevirtual

Get the CueTracksPosition at the given position, with bounds checking.

Returns
A reference to the specified CueTracksPosition.
Exceptions
std::out_of_rangeif the position is invalid.

Definition at line 225 of file cues.h.

virtual iterator tawara::CuePoint::begin ( )
inlinevirtual

Get an iterator to the first cue.

Definition at line 240 of file cues.h.

virtual const_iterator tawara::CuePoint::begin ( ) const
inlinevirtual

Get an iterator to the first cue.

Definition at line 242 of file cues.h.

virtual std::streamsize tawara::CuePoint::body_size ( ) const
protectedvirtual

Get the size of the body of this element.

Implements tawara::Element.

virtual void tawara::CuePoint::clear ( )
inlinevirtual

Remove all cue positions.

Definition at line 275 of file cues.h.

virtual size_type tawara::CuePoint::count ( ) const
inlinevirtual

Get the number of cue positions.

Definition at line 269 of file cues.h.

virtual bool tawara::CuePoint::empty ( ) const
inlinevirtual

Check if there are no cue positions.

An empty CuePoint element may not occur in a Tawara file. If this returns true, an error will occur when write() is called.

Definition at line 267 of file cues.h.

virtual iterator tawara::CuePoint::end ( )
inlinevirtual

Get an iterator to the position past the last cue.

Definition at line 244 of file cues.h.

virtual const_iterator tawara::CuePoint::end ( ) const
inlinevirtual

Get an iterator to the position past the last cue.

Definition at line 246 of file cues.h.

virtual void tawara::CuePoint::erase ( iterator  position)
inlinevirtual

Erase the CueTrackPosition at the specified iterator.

Parameters
[in]positionThe position to erase at.

Definition at line 281 of file cues.h.

virtual void tawara::CuePoint::erase ( iterator  first,
iterator  last 
)
inlinevirtual

Erase a range of CueTrackPosition.

Parameters
[in]firstThe start of the range.
[in]lastThe end of the range.

Definition at line 288 of file cues.h.

virtual size_type tawara::CuePoint::max_count ( ) const
inlinevirtual

Get the maximum number of cue positions.

Definition at line 271 of file cues.h.

virtual value_type& tawara::CuePoint::operator[] ( size_type  pos)
inlinevirtual

Get a reference to a CueTracksPosition.

No bounds checking is performed.

Definition at line 231 of file cues.h.

virtual value_type const& tawara::CuePoint::operator[] ( size_type  pos) const
inlinevirtual

Get a reference to a CueTracksPosition.

No bounds checking is performed.

Definition at line 236 of file cues.h.

virtual void tawara::CuePoint::push_back ( value_type const &  value)
inlinevirtual

Add a CueTrackPosition.

Definition at line 292 of file cues.h.

virtual reverse_iterator tawara::CuePoint::rbegin ( )
inlinevirtual

Get a reverse iterator to the last cue.

Definition at line 248 of file cues.h.

virtual const_reverse_iterator tawara::CuePoint::rbegin ( ) const
inlinevirtual

Get a reverse iterator to the last cue.

Definition at line 250 of file cues.h.

virtual std::streamsize tawara::CuePoint::read_body ( std::istream &  input,
std::streamsize  size 
)
protectedvirtual

Element body loading.

Exceptions
DuplicateTimecodeif a CuePoint is read for a timecode that already exists in the map.

Implements tawara::Element.

virtual reverse_iterator tawara::CuePoint::rend ( )
inlinevirtual

Get a reverse iterator to the position before the first cue.

Definition at line 255 of file cues.h.

virtual const_reverse_iterator tawara::CuePoint::rend ( ) const
inlinevirtual

Get a reverse iterator to the position before the first cue.

Definition at line 259 of file cues.h.

virtual void tawara::CuePoint::resize ( size_type  count)
inlinevirtual

Resizes the vector.

Definition at line 296 of file cues.h.

virtual void tawara::CuePoint::swap ( CuePoint other)
inlinevirtual

Swaps the contents of this CuePoint element with another.

Parameters
[in]otherThe other CuePoint element

Definition at line 303 of file cues.h.

uint64_t tawara::CuePoint::timecode ( ) const
inline

Get the timecode of this cue point.

The cue point's timecode is used when searching for the closest cue point to the desired time.

Definition at line 207 of file cues.h.

void tawara::CuePoint::timecode ( uint64_t  timecode)
inline

Set the timecode.

Definition at line 209 of file cues.h.

virtual std::streamsize tawara::CuePoint::write_body ( std::ostream &  output)
protectedvirtual

Element body writing.

Implements tawara::Element.

Friends And Related Function Documentation

bool operator== ( CuePoint const &  lhs,
CuePoint const &  rhs 
)
friend

Equality operator.

Member Data Documentation

storage_type_ tawara::CuePoint::positions_
protected

Definition at line 311 of file cues.h.

UIntElement tawara::CuePoint::timecode_
protected

Definition at line 310 of file cues.h.


The documentation for this class was generated from the following file: