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

The Cues element provides a list of indexes into the blocks for specific timecodes. More...

#include <tawara/cues.h>

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

Public Types

typedef uint64_t key_type
 The key type (Key) of this container. More...
 
typedef CuePoint mapped_type
 The mapped type (T) of this container. More...
 
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...
 

Public Member Functions

 Cues ()
 Constructor. More...
 
mapped_typeat (key_type const &pos)
 Get the CuePoint with the given timecode. More...
 
mapped_type const & at (key_type const &pos) const
 Get the CuePoint with the given timecode. More...
 
mapped_typeoperator[] (key_type const &key)
 Gets a reference to the CuePoint with the given timecode, without range checking. More...
 
mapped_type const & operator[] (key_type const &key) const
 Gets a reference to the CuePoint with the given timecode, without range checking. More...
 
iterator begin ()
 Get an iterator to the first CuePoint. More...
 
const_iterator begin () const
 Get an iterator to the first CuePoint. More...
 
iterator end ()
 Get an iterator to the position past the last CuePoint. More...
 
const_iterator end () const
 Get an iterator to the position past the last CuePoint. More...
 
reverse_iterator rbegin ()
 Get a reverse iterator to the last CuePoint. More...
 
const_reverse_iterator rbegin () const
 Get a reverse iterator to the last CuePoint. More...
 
reverse_iterator rend ()
 Get a reverse iterator to the position before the first CuePoint. More...
 
const_reverse_iterator rend () const
 Get a reverse iterator to the position before the first CuePoint. More...
 
bool empty () const
 Check if there are no CuePoints. More...
 
size_type count () const
 Get the number of CuePoints. More...
 
size_type max_count () const
 Get the maximum number of CuePoints. More...
 
void clear ()
 Remove all CuePoints. More...
 
std::pair< iterator, bool > insert (mapped_type const &value)
 Insert a new CuePoint. More...
 
void insert (const_iterator first, const_iterator last)
 Insert a range of CuePoints. More...
 
void erase (iterator position)
 Erase the CuePoint at the specified iterator. More...
 
void erase (iterator first, iterator last)
 Erase a range of CuePoints. More...
 
size_type erase (key_type const &number)
 Erase the CuePoint with the given timecode. More...
 
void swap (Cues &other)
 Swaps the contents of this Cues element with another. More...
 
iterator find (key_type const &number)
 Search for the CuePoint with the given timecode. More...
 
const_iterator find (key_type const &number) const
 Search for the CuePoint with the given timecode. 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::map< key_type,
mapped_type
storage_type_
 The type of the internal storage. 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

storage_type_ cues_
 
- Protected Attributes inherited from tawara::Element
tawara::ids::ID id_
 
std::streampos offset_
 

Friends

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

Detailed Description

The Cues element provides a list of indexes into the blocks for specific timecodes.

The Cues element stores a list of CuePoints, each of which is a timecode and the positions of clusters and/or blocks that correspond to that timecode (typically one for each track active at that timecode). The resolution of cues (i.e. how far apart they are in time) is left up to the writer of the Tawara file. Generally, at a minimum, one cue point should exist for the start of each cluster in the segment. Another approach is one cue point per set time interval.

The cue points are accessible through a map interface, with the timecode used as the key.

The Cues must contain at least one CuePoint before it can be written to a segment.

Definition at line 353 of file cues.h.

Member Typedef Documentation

typedef storage_type_::const_iterator tawara::Cues::const_iterator

The constant random access iterator type.

Definition at line 381 of file cues.h.

typedef storage_type_::const_reference tawara::Cues::const_reference

The constant reference type.

Definition at line 377 of file cues.h.

typedef storage_type_::const_reverse_iterator tawara::Cues::const_reverse_iterator

The constant reversed random access iterator type.

Definition at line 386 of file cues.h.

typedef storage_type_::iterator tawara::Cues::iterator

The random access iterator type.

Definition at line 379 of file cues.h.

typedef uint64_t tawara::Cues::key_type

The key type (Key) of this container.

Definition at line 358 of file cues.h.

The mapped type (T) of this container.

Definition at line 360 of file cues.h.

typedef storage_type_::reference tawara::Cues::reference

The reference type.

Definition at line 375 of file cues.h.

typedef storage_type_::reverse_iterator tawara::Cues::reverse_iterator

The reversed random access iterator type.

Definition at line 383 of file cues.h.

typedef storage_type_::size_type tawara::Cues::size_type

The size type of this container.

Definition at line 373 of file cues.h.

typedef std::map<key_type, mapped_type> tawara::Cues::storage_type_
protected

The type of the internal storage.

Definition at line 364 of file cues.h.

typedef storage_type_::value_type tawara::Cues::value_type

The value type of this container.

Definition at line 371 of file cues.h.

Constructor & Destructor Documentation

tawara::Cues::Cues ( )

Constructor.

Member Function Documentation

mapped_type& tawara::Cues::at ( key_type const &  pos)
inline

Get the CuePoint with the given timecode.

Returns
A reference to the specified CuePoint.
Exceptions
std::out_of_rangeif the timecode is invalid.

Definition at line 393 of file cues.h.

mapped_type const& tawara::Cues::at ( key_type const &  pos) const
inline

Get the CuePoint with the given timecode.

Returns
A reference to the specified CuePoint.
Exceptions
std::out_of_rangeif the timecode is invalid.

Definition at line 400 of file cues.h.

iterator tawara::Cues::begin ( )
inline

Get an iterator to the first CuePoint.

Definition at line 419 of file cues.h.

const_iterator tawara::Cues::begin ( ) const
inline

Get an iterator to the first CuePoint.

Definition at line 421 of file cues.h.

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

Get the size of the body of this element.

Implements tawara::Element.

void tawara::Cues::clear ( )
inline

Remove all CuePoints.

Definition at line 447 of file cues.h.

size_type tawara::Cues::count ( ) const
inline

Get the number of CuePoints.

Definition at line 442 of file cues.h.

bool tawara::Cues::empty ( ) const
inline

Check if there are no CuePoints.

Definition at line 440 of file cues.h.

iterator tawara::Cues::end ( )
inline

Get an iterator to the position past the last CuePoint.

Definition at line 423 of file cues.h.

const_iterator tawara::Cues::end ( ) const
inline

Get an iterator to the position past the last CuePoint.

Definition at line 425 of file cues.h.

void tawara::Cues::erase ( iterator  position)
inline

Erase the CuePoint at the specified iterator.

Parameters
[in]positionThe position to erase at.

Definition at line 474 of file cues.h.

void tawara::Cues::erase ( iterator  first,
iterator  last 
)
inline

Erase a range of CuePoints.

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

Definition at line 481 of file cues.h.

size_type tawara::Cues::erase ( key_type const &  number)
inline

Erase the CuePoint with the given timecode.

Parameters
[in]numberThe timecode to erase.
Returns
The number of CuePoints erased.

Definition at line 488 of file cues.h.

iterator tawara::Cues::find ( key_type const &  number)
inline

Search for the CuePoint with the given timecode.

Parameters
[in]numberThe timecode to search for.
Returns
An iterator to the matching CuePoint, or end() if there is no CuePoint with that number.

Definition at line 502 of file cues.h.

const_iterator tawara::Cues::find ( key_type const &  number) const
inline

Search for the CuePoint with the given timecode.

Parameters
[in]numberThe timecode to search for.
Returns
An iterator to the matching CuePoint, or end() if there is no CuePoint with that number.

Definition at line 510 of file cues.h.

std::pair<iterator, bool> tawara::Cues::insert ( mapped_type const &  value)
inline

Insert a new CuePoint.

If a CuePoint already exists with the same track number, the new one will not replace it, and the return code will indicate that no insertion took place.

Parameters
[in]valueThe CuePoint to insert. Its timecode will be used as the key.
Returns
A pair of the iterator at the position where the CuePoint was added (or blocked) and a boolean indicating if the insertion took place.

Definition at line 461 of file cues.h.

void tawara::Cues::insert ( const_iterator  first,
const_iterator  last 
)
inline

Insert a range of CuePoints.

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

Definition at line 468 of file cues.h.

size_type tawara::Cues::max_count ( ) const
inline

Get the maximum number of CuePoints.

Definition at line 444 of file cues.h.

mapped_type& tawara::Cues::operator[] ( key_type const &  key)
inline

Gets a reference to the CuePoint with the given timecode, without range checking.

Returns
A reference to a CuePoint with the given timecode.

Definition at line 408 of file cues.h.

mapped_type const& tawara::Cues::operator[] ( key_type const &  key) const
inline

Gets a reference to the CuePoint with the given timecode, without range checking.

Returns
A reference to a CuePoint with the given timecode.

Definition at line 415 of file cues.h.

reverse_iterator tawara::Cues::rbegin ( )
inline

Get a reverse iterator to the last CuePoint.

Definition at line 427 of file cues.h.

const_reverse_iterator tawara::Cues::rbegin ( ) const
inline

Get a reverse iterator to the last CuePoint.

Definition at line 429 of file cues.h.

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

Element body loading.

Implements tawara::Element.

reverse_iterator tawara::Cues::rend ( )
inline

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

Definition at line 433 of file cues.h.

const_reverse_iterator tawara::Cues::rend ( ) const
inline

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

Definition at line 437 of file cues.h.

void tawara::Cues::swap ( Cues other)
inline

Swaps the contents of this Cues element with another.

Parameters
[in]otherThe other Cues element to swap with.

Definition at line 494 of file cues.h.

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

Element body writing.

Implements tawara::Element.

Friends And Related Function Documentation

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

Equality operator.

Member Data Documentation

storage_type_ tawara::Cues::cues_
protected

Definition at line 517 of file cues.h.


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