PySide6.QtMultimedia.QMediaTimeRange¶
- class QMediaTimeRange¶
QMediaTimeRange类表示一组零个或多个不连续的时间间隔。More_…概要¶
方法¶
def
__init__()def
addInterval()def
addTimeRange()def
clear()def
contains()def
earliestTime()def
intervals()def
isContinuous()def
isEmpty()def
latestTime()def
__ne__()def
__add__()def
__iadd__()def
__sub__()def
__isub__()def
__eq__()def
removeInterval()def
swap()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
earliestTime()、latestTime()、intervals()和isEmpty()方法用于获取当前时间范围的信息。addInterval()、removeInterval()和clear()方法用于修改当前的时间范围。在时间范围内添加或删除间隔时,可能会扩展、修剪、删除、合并或拆分范围内的现有间隔,以确保时间范围内的所有间隔保持独特且不相交。因此,从时间范围添加或删除的所有间隔必须是
normal。另请参阅
Interval- __init__()¶
构造一个空的时间范围。
- __init__(range)
- Parameters:
范围 –
QMediaTimeRange
通过复制另一个时间
范围来构造一个时间范围。- __init__(interval)
- Parameters:
interval –
Interval
构建一个包含初始间隔的时间范围,
interval。如果
interval不是normal,生成的时间范围将为空。另请参阅
- __init__(start, end)
- Parameters:
start – int
end – 整数
构建一个时间范围,包含从
start到end的初始区间,包括两端。如果间隔不是
normal,生成的时间范围将为空。另请参阅
将指定的
interval添加到时间范围中。添加不是
normal的间隔是无效的,并且将被忽略。如果指定的间隔与时间范围内的现有间隔相邻或重叠,这些间隔将被合并。
此操作需要线性时间。
另请参阅
- addInterval(start, end)
- Parameters:
start – int
end – 整数
这是一个重载函数。
将
start和end指定的间隔添加到时间范围中。另请参阅
- addTimeRange(range)¶
- Parameters:
范围 –
QMediaTimeRange
将
range中的每个间隔添加到此时间范围。相当于为
range中的每个间隔调用addInterval()。- clear()¶
从时间范围中移除所有间隔。
另请参阅
- contains(time)¶
- Parameters:
时间 – int
- Return type:
布尔
如果指定的
time在时间范围内,则返回true。- earliestTime()¶
- Return type:
整数
返回时间范围内的最早时间。
对于空的时间范围,此值等于零。
另请参阅
- intervals()¶
- Return type:
返回此时间范围覆盖的间隔列表。
- isContinuous()¶
- Return type:
布尔
如果时间范围由一个连续区间组成,则返回 true。也就是说,时间范围内有一个或更少的不连续区间。
- isEmpty()¶
- Return type:
布尔
如果时间范围内没有间隔,则返回true。
另请参阅
- latestTime()¶
- Return type:
整数
返回时间范围内的最新时间。
对于空的时间范围,此值等于零。
另请参阅
- __ne__(rhs)¶
- Parameters:
rhs –
QMediaTimeRange- Return type:
布尔
如果
lhs中的一个或多个区间不在rhs中,则返回true。- __add__(r2)¶
- Parameters:
r2 –
QMediaTimeRange- Return type:
返回一个包含
r1和r2之间并集的时间范围。- __iadd__(other)¶
- Parameters:
其他 –
QMediaTimeRange- Return type:
将
other中的每个间隔添加到时间范围并返回结果。- __iadd__(interval)
- Parameters:
interval –
Interval- Return type:
将指定的
interval添加到时间范围并返回结果。- __sub__(r2)¶
- Parameters:
r2 –
QMediaTimeRange- Return type:
返回一个时间范围,其中包含从
r1中减去r2的结果。- __isub__(other)¶
- Parameters:
其他 –
QMediaTimeRange- Return type:
从时间范围中移除
other中的每个间隔并返回结果。- __isub__(interval)
- Parameters:
interval –
Interval- Return type:
从时间范围中移除指定的
interval并返回结果。- __eq__(rhs)¶
- Parameters:
rhs –
QMediaTimeRange- Return type:
布尔
如果
lhs中的所有间隔都存在于rhs中,则返回true。从时间范围中移除指定的
interval。移除不是
normal的间隔是无效的,并且将被忽略。时间范围内的间隔将被修剪、分割或删除,以确保时间范围内的任何间隔都不包含目标间隔的任何部分。
此操作需要线性时间。
另请参阅
- removeInterval(start, end)
- Parameters:
start – int
end – 整数
这是一个重载函数。
从时间范围中移除由
start和end指定的间隔。另请参阅
- removeTimeRange(range)¶
- Parameters:
范围 –
QMediaTimeRange
从这个时间范围中移除
range中的每个间隔。相当于为
range中的每个间隔调用removeInterval()。- swap(other)¶
- Parameters:
其他 –
QMediaTimeRange
将当前实例与
other交换。- class Interval¶
概要¶
方法¶
def
__init__()def
contains()def
end()def
isNormal()def
normalized()def
__ne__()def
__eq__()def
start()def
translated()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
- __init__()¶
- __init__(start, end)
- Parameters:
start – int
end – 整数
使用指定的
start和end时间构造一个区间。- contains(time)¶
- Parameters:
时间 – int
- Return type:
布尔
如果时间间隔包含指定的
time,则返回true。也就是说,start()<= time <=end()。- end()¶
- Return type:
整数
返回间隔的结束时间。
另请参阅
- isNormal()¶
- Return type:
布尔
如果这个时间间隔是正常的,则返回true。一个正常的时间间隔满足
start()<=end()。另请参阅
返回此区间的规范化版本。
如果间隔的
start()时间大于end()时间,则返回的间隔将交换开始和结束时间。如果
lhs不完全等于rhs,则返回 true。如果
lhs完全等于rhs,则返回 true。- start()¶
- Return type:
整数
返回间隔的开始时间。
另请参阅
返回此时间间隔的副本,通过
offset值进行平移。时间间隔可以通过正偏移量向前移动,或通过负偏移量向后移动。