QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlRangeList Class Reference

A class which extends a list of QtlRange. More...

Inheritance diagram for QtlRangeList:

Public Types

typedef QList< QtlRangeSuperClass
 Redefine the superclass type. More...
 

Public Member Functions

 QtlRangeList ()
 Default constructor. More...
 
 QtlRangeList (const SuperClass &other)
 Copy constructor. More...
 
 QtlRangeList (const QtlRange &e)
 Constructor from one initial element. More...
 
 QtlRangeList (std::initializer_list< QtlRange > args)
 Constructor from a variadic list of elements. More...
 
QtlRangeListadd (qint64 offset)
 Add a given offset to first and last value of all elements in the list. More...
 
QtlRangeListclip (const QtlRange &range)
 Remove values outside the given range. More...
 
QtlRange enclosing () const
 Get the enclosing range. More...
 
qint64 first () const
 Get the lowest value in all ranges. More...
 
qint64 last () const
 Get the highest value in all ranges. More...
 
QtlRangeListmerge (Qtl::MergeRangeFlags flags=Qtl::AdjacentOnly)
 Merge all overlapping or adjacent segments. More...
 
QtlRangeListscale (qint64 factor)
 Scale all ranges in the list by a given factor. More...
 
QtlRangeListsort ()
 Sort the list. More...
 
QString toString (const QString &separator=" ") const
 Convert the list of ranges to a string. More...
 
quint64 totalValueCount () const
 Get the total number of values in all ranges. More...
 

Detailed Description

A class which extends a list of QtlRange.

Member Typedef Documentation

◆ SuperClass

Redefine the superclass type.

Constructor & Destructor Documentation

◆ QtlRangeList() [1/4]

QtlRangeList::QtlRangeList ( )
inline

Default constructor.

◆ QtlRangeList() [2/4]

QtlRangeList::QtlRangeList ( const SuperClass other)
inline

Copy constructor.

Parameters
[in]otherOther instance to copy.

◆ QtlRangeList() [3/4]

QtlRangeList::QtlRangeList ( const QtlRange e)
inline

Constructor from one initial element.

Parameters
[in]eInitial element.

◆ QtlRangeList() [4/4]

QtlRangeList::QtlRangeList ( std::initializer_list< QtlRange args)
inline

Constructor from a variadic list of elements.

This constructor is only enabled if the compiler supports C++11 initializer lists

Parameters
[in]argsList of initial elements.

Member Function Documentation

◆ totalValueCount()

quint64 QtlRangeList::totalValueCount ( ) const

Get the total number of values in all ranges.

Returns
The number of values in all ranges.

◆ first()

qint64 QtlRangeList::first ( ) const

Get the lowest value in all ranges.

Returns
The lowest value in all ranges or 0 if the list is empty.

◆ last()

qint64 QtlRangeList::last ( ) const

Get the highest value in all ranges.

Returns
The highest value in all ranges or -1 if the list is empty.

◆ enclosing()

QtlRange QtlRangeList::enclosing ( ) const

Get the enclosing range.

Returns
The enclosing range, from first() to last().

◆ add()

QtlRangeList & QtlRangeList::add ( qint64  offset)

Add a given offset to first and last value of all elements in the list.

There is no overflow, the ranges are bounded by qint64.

Parameters
[in]offsetValue to add.
Returns
A reference to this object.

◆ scale()

QtlRangeList & QtlRangeList::scale ( qint64  factor)

Scale all ranges in the list by a given factor.

Parameters
[in]factorScale factor.
Returns
A reference to this object.

◆ sort()

QtlRangeList& QtlRangeList::sort ( )
inline

Sort the list.

Returns
A reference to this object.

◆ merge()

QtlRangeList & QtlRangeList::merge ( Qtl::MergeRangeFlags  flags = Qtl::AdjacentOnly)

Merge all overlapping or adjacent segments.

Parameters
[in]flagsMerge options.
Returns
A reference to this object.
See also
Qtl::MergeFlags

◆ clip()

QtlRangeList & QtlRangeList::clip ( const QtlRange range)

Remove values outside the given range.

Parameters
[in]rangeLimit the values within that range.
Returns
A reference to this object.

◆ toString()

QString QtlRangeList::toString ( const QString &  separator = " ") const

Convert the list of ranges to a string.

Parameters
[in]separatorA string to insert between ranges.
Returns
A string in format "[first, last]<sep>[first, last]<sep>...".

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