このページでは

QMediaTimeRange::Interval Struct

struct QMediaTimeRange::Interval

QMediaTimeRange::Interval クラスは、整数精度の時間間隔を表します。詳細...

パブリック関数

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」も参照してください 。

メンバ関数のドキュメント

[constexpr noexcept default] Interval::Interval()

Interval のインスタンスをデフォルトコンストラクタで生成します。

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

指定されたstart およびend の時間に基づいて、区間を構築します。

[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)

lhs がrhs と完全に一致しない場合、trueを返します。

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

lhs がrhs と完全に一致する場合、trueを返します。

© 2026 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.