Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QMediaTimeRange::Interval Class Reference

The QMediaTimeRange::Interval class represents a time interval with integer precision. More...

#include <qmediatimerange.h>

+ Collaboration diagram for QMediaTimeRange::Interval:

Public Member Functions

constexpr Interval () noexcept=default
 
constexpr Interval (qint64 start, qint64 end) noexcept
 Constructs an interval with the specified start and end times.
 
constexpr qint64 start () const noexcept
 Returns the start time of the interval.
 
constexpr qint64 end () const noexcept
 Returns the end time of the interval.
 
constexpr bool contains (qint64 time) const noexcept
 Returns true if the time interval contains the specified time.
 
constexpr bool isNormal () const noexcept
 Returns true if this time interval is normal.
 
constexpr Interval normalized () const
 Returns a normalized version of this interval.
 
constexpr Interval translated (qint64 offset) const
 Returns a copy of this time interval, translated by a value of offset.
 

Friends

class QMediaTimeRangePrivate
 
constexpr bool operator== (Interval lhs, Interval rhs) noexcept
 Returns true if lhs is exactly equal to rhs.
 
constexpr bool operator!= (Interval lhs, Interval rhs) noexcept
 Returns true if lhs is not exactly equal to rhs.
 

Detailed Description

The QMediaTimeRange::Interval class represents a time interval with integer precision.

\inmodule QtMultimedia

An interval is specified by an inclusive start() and end() time. These must be set in the constructor, as this is an immutable class. The specific units of time represented by the class have not been defined - it is suitable for any times which can be represented by a signed 64 bit integer.

The isNormal() method determines if a time interval is normal (a normal time interval has start() <= end()). A normal interval can be received from an abnormal interval by calling the normalized() method.

The contains() method determines if a specified time lies within the time interval.

The translated() method returns a time interval which has been translated forwards or backwards through time by a specified offset.

See also
QMediaTimeRange

Definition at line 22 of file qmediatimerange.h.

Constructor & Destructor Documentation

◆ Interval() [1/2]

constexpr QMediaTimeRange::Interval::Interval ( )
constexprdefaultnoexcept

◆ Interval() [2/2]

QMediaTimeRange::Interval::Interval ( qint64 start,
qint64 end )
inlineexplicitconstexprnoexcept

Constructs an interval with the specified start and end times.

Definition at line 25 of file qmediatimerange.h.

Member Function Documentation

◆ contains()

QMediaTimeRange::Interval::contains ( qint64 time) const
inlineconstexprnoexcept

Returns true if the time interval contains the specified time.

That is, start() <= time <= end().

Definition at line 32 of file qmediatimerange.h.

References time.

◆ end()

QMediaTimeRange::Interval::end ( ) const
inlineconstexprnoexcept

Returns the end time of the interval.

See also
start()

Definition at line 30 of file qmediatimerange.h.

Referenced by operator<<().

+ Here is the caller graph for this function:

◆ isNormal()

QMediaTimeRange::Interval::isNormal ( ) const
inlineconstexprnoexcept

Returns true if this time interval is normal.

A normal time interval has start() <= end().

See also
normalized()

Definition at line 38 of file qmediatimerange.h.

Referenced by QMediaTimeRangePrivate::QMediaTimeRangePrivate(), QMediaTimeRangePrivate::addInterval(), and QMediaTimeRangePrivate::removeInterval().

+ Here is the caller graph for this function:

◆ normalized()

QMediaTimeRange::Interval::normalized ( ) const
inlineconstexpr

Returns a normalized version of this interval.

If the start() time of the interval is greater than the end() time, then the returned interval has the start and end times swapped.

Definition at line 39 of file qmediatimerange.h.

References Interval.

◆ start()

QMediaTimeRange::Interval::start ( ) const
inlineconstexprnoexcept

Returns the start time of the interval.

See also
end()

Definition at line 29 of file qmediatimerange.h.

Referenced by operator<<().

+ Here is the caller graph for this function:

◆ translated()

QMediaTimeRange::Interval::translated ( qint64 offset) const
inlineconstexpr

Returns a copy of this time interval, translated by a value of offset.

An interval can be moved forward through time with a positive offset, or backward through time with a negative offset.

Definition at line 43 of file qmediatimerange.h.

References Interval.

Friends And Related Symbol Documentation

◆ operator!=

bool QMediaTimeRange::Interval::operator!= ( QMediaTimeRange::Interval lhs,
QMediaTimeRange::Interval rhs )
friend

Returns true if lhs is not exactly equal to rhs.

Definition at line 52 of file qmediatimerange.h.

◆ operator==

bool QMediaTimeRange::Interval::operator== ( QMediaTimeRange::Interval lhs,
QMediaTimeRange::Interval rhs )
friend

Returns true if lhs is exactly equal to rhs.

Definition at line 48 of file qmediatimerange.h.

◆ QMediaTimeRangePrivate

friend class QMediaTimeRangePrivate
friend

Definition at line 58 of file qmediatimerange.h.


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