QMediaTimeRange Class

The QMediaTimeRange class represents a set of zero or more disjoint time intervals. More...

Header: #include <QMediaTimeRange>
qmake: QT += multimedia

Note: All functions in this class are reentrant.

Public Functions

QMediaTimeRange()
QMediaTimeRange(qint64 start, qint64 end)
QMediaTimeRange(const QMediaTimeInterval &)
QMediaTimeRange(const QMediaTimeRange &range)
~QMediaTimeRange()
void addInterval(qint64 start, qint64 end)
void addInterval(const QMediaTimeInterval &interval)
void addTimeRange(const QMediaTimeRange &range)
void clear()
bool contains(qint64 time) const
qint64 earliestTime() const
QList<QMediaTimeInterval> intervals() const
bool isContinuous() const
bool isEmpty() const
qint64 latestTime() const
void removeInterval(qint64 start, qint64 end)
void removeInterval(const QMediaTimeInterval &interval)
void removeTimeRange(const QMediaTimeRange &range)
QMediaTimeRange &operator+=(const QMediaTimeRange &other)
QMediaTimeRange &operator+=(const QMediaTimeInterval &interval)
QMediaTimeRange &operator-=(const QMediaTimeRange &other)
QMediaTimeRange &operator-=(const QMediaTimeInterval &interval)
QMediaTimeRange &operator=(const QMediaTimeRange &other)
QMediaTimeRange &operator=(const QMediaTimeInterval &interval)
bool operator!=(const QMediaTimeInterval &a, const QMediaTimeInterval &b)
bool operator!=(const QMediaTimeRange &a, const QMediaTimeRange &b)
QMediaTimeRange operator+(const QMediaTimeRange &r1, const QMediaTimeRange &r2)
QMediaTimeRange operator-(const QMediaTimeRange &r1, const QMediaTimeRange &r2)
bool operator==(const QMediaTimeInterval &a, const QMediaTimeInterval &b)
bool operator==(const QMediaTimeRange &a, const QMediaTimeRange &b)

Detailed Description

The QMediaTimeRange class represents a set of zero or more disjoint time intervals.

The earliestTime(), latestTime(), intervals() and isEmpty() methods are used to get information about the current time range.

The addInterval(), removeInterval() and clear() methods are used to modify the current time range.

When adding or removing intervals from the time range, existing intervals within the range may be expanded, trimmed, deleted, merged or split to ensure that all intervals within the time range remain distinct and disjoint. As a consequence, all intervals added or removed from a time range must be normal.

See also QMediaTimeInterval.

Member Function Documentation

QMediaTimeRange::QMediaTimeRange()

Default constructs an instance of QMediaTimeRange.

QMediaTimeRange::QMediaTimeRange(qint64 start, qint64 end)

Default constructs an instance of QMediaTimeRange.

QMediaTimeRange::QMediaTimeRange(const QMediaTimeInterval &)

Default constructs an instance of QMediaTimeRange.

QMediaTimeRange::QMediaTimeRange(const QMediaTimeRange &range)

Default constructs an instance of QMediaTimeRange.

QMediaTimeRange::~QMediaTimeRange()

Destroys the instance of QMediaTimeRange.

void QMediaTimeRange::addInterval(qint64 start, qint64 end)

void QMediaTimeRange::addInterval(const QMediaTimeInterval &interval)

void QMediaTimeRange::addTimeRange(const QMediaTimeRange &range)

Adds each of the intervals in range to this time range.

Equivalent to calling addInterval() for each interval in range.

void QMediaTimeRange::clear()

bool QMediaTimeRange::contains(qint64 time) const

qint64 QMediaTimeRange::earliestTime() const

QList<QMediaTimeInterval> QMediaTimeRange::intervals() const

bool QMediaTimeRange::isContinuous() const

bool QMediaTimeRange::isEmpty() const

qint64 QMediaTimeRange::latestTime() const

void QMediaTimeRange::removeInterval(qint64 start, qint64 end)

void QMediaTimeRange::removeInterval(const QMediaTimeInterval &interval)

void QMediaTimeRange::removeTimeRange(const QMediaTimeRange &range)

Removes each of the intervals in range from this time range.

Equivalent to calling removeInterval() for each interval in range.

QMediaTimeRange &QMediaTimeRange::operator+=(const QMediaTimeRange &other)

Adds each interval in other to the time range and returns the result.

QMediaTimeRange &QMediaTimeRange::operator+=(const QMediaTimeInterval &interval)

Adds the specified interval to the time range and returns the result.

QMediaTimeRange &QMediaTimeRange::operator-=(const QMediaTimeRange &other)

Removes each interval in other from the time range and returns the result.

QMediaTimeRange &QMediaTimeRange::operator-=(const QMediaTimeInterval &interval)

Removes the specified interval from the time range and returns the result.

QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeRange &other)

Takes a copy of the other time range and returns itself.

QMediaTimeRange &QMediaTimeRange::operator=(const QMediaTimeInterval &interval)

Sets the time range to a single continuous interval, interval.

Related Non-Members

bool operator!=(const QMediaTimeInterval &a, const QMediaTimeInterval &b)

Returns true if a is not exactly equal to b.

bool operator!=(const QMediaTimeRange &a, const QMediaTimeRange &b)

Returns true if one or more intervals in a are not present in b.

QMediaTimeRange operator+(const QMediaTimeRange &r1, const QMediaTimeRange &r2)

Returns a time range containing the union between r1 and r2.

QMediaTimeRange operator-(const QMediaTimeRange &r1, const QMediaTimeRange &r2)

Returns a time range containing r2 subtracted from r1.

bool operator==(const QMediaTimeInterval &a, const QMediaTimeInterval &b)

Returns true if a is exactly equal to b.

bool operator==(const QMediaTimeRange &a, const QMediaTimeRange &b)

Returns true if all intervals in a are present in b.