Tawara
0.1.0
|
The Cues element provides a list of indexes into the blocks for specific timecodes. More...
#include <tawara/cues.h>
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_type & | at (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_type & | operator[] (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... | |
![]() | |
MasterElement (uint32_t id, bool crc=false) | |
Create a new MasterElement. More... | |
virtual | ~MasterElement () |
Destructor. More... | |
![]() | |
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... | |
![]() | |
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_ |
![]() | |
tawara::ids::ID | id_ |
std::streampos | offset_ |
Friends | |
bool | operator== (Cues const &lhs, Cues const &rhs) |
Equality operator. More... | |
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.
typedef storage_type_::const_iterator tawara::Cues::const_iterator |
typedef storage_type_::const_reference tawara::Cues::const_reference |
typedef storage_type_::const_reverse_iterator tawara::Cues::const_reverse_iterator |
typedef storage_type_::iterator tawara::Cues::iterator |
typedef uint64_t tawara::Cues::key_type |
typedef CuePoint tawara::Cues::mapped_type |
typedef storage_type_::reference tawara::Cues::reference |
typedef storage_type_::reverse_iterator tawara::Cues::reverse_iterator |
typedef storage_type_::size_type tawara::Cues::size_type |
|
protected |
typedef storage_type_::value_type tawara::Cues::value_type |
tawara::Cues::Cues | ( | ) |
Constructor.
|
inline |
|
inline |
|
inline |
|
inline |
|
protectedvirtual |
Get the size of the body of this element.
Implements tawara::Element.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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.
[in] | value | The CuePoint to insert. Its timecode will be used as the key. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protectedvirtual |
Element body loading.
Implements tawara::Element.
|
inline |
|
inline |
|
inline |
|
protectedvirtual |
Element body writing.
Implements tawara::Element.
|
protected |