QMediaTimeRange::Interval Struct

struct QMediaTimeRange::Interval

QMediaTimeRange::Interval 表示精度为整数的时间间隔。更多

公共函数

Interval(qint64 start, qint64 end)
bool contains(qint64 time) const
qint64 end() const
bool isNormal() const
QMediaTimeRange::Interval normalized() const
qint64 start() const
QMediaTimeRange::Interval translated(qint64 offset) const
bool operator!=(QMediaTimeRange::Interval lhs, QMediaTimeRange::Interval rhs)
bool operator==(QMediaTimeRange::Interval lhs, QMediaTimeRange::Interval rhs)

详细描述

时间间隔由包含start() 和end() 的时间指定。这些时间必须在构造函数中设置,因为这是一个不可变的类。该类所代表的具体时间单位尚未定义--它适用于任何可以用有符号 64 位整数表示的时间。

isNormal() 方法确定时间间隔是否正常(正常时间间隔为start() <=end() )。正常时间间隔可以通过调用normalized() 方法从异常时间间隔接收。

contains() 方法确定指定时间是否在时间间隔内。

translated() 方法返回的时间间隔已按指定偏移量向前或向后平移。

另请参阅 QMediaTimeRange

成员函数文档

[explicit constexpr noexcept] Interval::Interval(qint64 start, qint64 end)

用指定的startend 时间构造一个区间。

[constexpr noexcept] bool Interval::contains(qint64 time) const

如果时间间隔包含指定的time ,则返回 true。也就是说,start() <= time <=end() 。

[constexpr noexcept] qint64 Interval::end() const

返回时间间隔的结束时间。

另请参阅 start()。

[constexpr noexcept] bool Interval::isNormal() const

如果该时间间隔正常,则返回 true。正常时间间隔为start() <=end()。

另请参阅 normalized()。

[constexpr] QMediaTimeRange::Interval Interval::normalized() const

返回该时间间隔的标准化版本。

如果时间间隔的start() 时间大于end() 时间,则返回的时间间隔的开始时间和结束时间对调。

[constexpr noexcept] qint64 Interval::start() const

返回时间间隔的开始时间。

另请参阅 end()。

[constexpr] QMediaTimeRange::Interval Interval::translated(qint64 offset) const

返回该时间间隔的副本,其转换值为offset 。时间间隔可以通过正偏移向前移动,也可以通过负偏移向后移动。

相关非会员

[constexpr noexcept] bool operator!=(QMediaTimeRange::Interval lhs, QMediaTimeRange::Interval rhs)

如果lhsrhs 不完全相等,则返回 true。

[constexpr noexcept] bool operator==(QMediaTimeRange::Interval lhs, QMediaTimeRange::Interval rhs)

如果lhsrhs 完全相等,则返回 true。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.