PySide6.QtMultimedia.QMediaTimeRange¶
- class QMediaTimeRange¶
- The - QMediaTimeRangeclass represents a set of zero or more disjoint time intervals. More_…- Synopsis¶- Methods¶- 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()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- 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 - Interval- __init__()¶
 - Constructs an empty time range. - __init__(range)
- Parameters:
- range – - QMediaTimeRange
 
 - Constructs a time range by copying another time - range.- __init__(interval)
- Parameters:
- interval – - Interval
 
 - Constructs a time range that contains an initial interval, - interval.- If - intervalis not- normal, the resulting time range will be empty.- See also - __init__(start, end)
- Parameters:
- start – int 
- end – int 
 
 
 - Constructs a time range that contains an initial interval from - startto- endinclusive.- If the interval is not - normal, the resulting time range will be empty.- See also - Adds the specified - intervalto the time range.- Adding intervals which are not - normalis invalid, and will be ignored.- If the specified interval is adjacent to, or overlaps existing intervals within the time range, these intervals will be merged. - This operation takes linear time. - See also - addInterval(start, end)
- Parameters:
- start – int 
- end – int 
 
 
 - This is an overloaded function. - Adds the interval specified by - startand- endto the time range.- See also - addTimeRange(range)¶
- Parameters:
- range – - QMediaTimeRange
 
 - Adds each of the intervals in - rangeto this time range.- Equivalent to calling - addInterval()for each interval in- range.- clear()¶
 - Removes all intervals from the time range. - See also - contains(time)¶
- Parameters:
- time – int 
- Return type:
- bool 
 
 - Returns true if the specified - timelies within the time range.- earliestTime()¶
- Return type:
- int 
 
 - Returns the earliest time within the time range. - For empty time ranges, this value is equal to zero. - See also - intervals()¶
- Return type:
- .list of QMediaTimeRange.Interval 
 
 - Returns the list of intervals covered by this time range. - isContinuous()¶
- Return type:
- bool 
 
 - Returns true if the time range consists of a continuous interval. That is, there is one or fewer disjoint intervals within the time range. - isEmpty()¶
- Return type:
- bool 
 
 - Returns true if there are no intervals within the time range. - See also - latestTime()¶
- Return type:
- int 
 
 - Returns the latest time within the time range. - For empty time ranges, this value is equal to zero. - See also - __ne__(rhs)¶
- Parameters:
- rhs – - QMediaTimeRange
- Return type:
- bool 
 
 - Returns true if one or more intervals in - lhsare not present in- rhs.- __add__(r2)¶
- Parameters:
- r2 – - QMediaTimeRange
- Return type:
 
 - Returns a time range containing the union between - r1and- r2.- __iadd__(other)¶
- Parameters:
- other – - QMediaTimeRange
- Return type:
 
 - Adds each interval in - otherto the time range and returns the result.- __iadd__(interval)
- Parameters:
- interval – - Interval
- Return type:
 
 - Adds the specified - intervalto the time range and returns the result.- __sub__(r2)¶
- Parameters:
- r2 – - QMediaTimeRange
- Return type:
 
 - Returns a time range containing - r2subtracted from- r1.- __isub__(other)¶
- Parameters:
- other – - QMediaTimeRange
- Return type:
 
 - Removes each interval in - otherfrom the time range and returns the result.- __isub__(interval)
- Parameters:
- interval – - Interval
- Return type:
 
 - Removes the specified - intervalfrom the time range and returns the result.- __eq__(rhs)¶
- Parameters:
- rhs – - QMediaTimeRange
- Return type:
- bool 
 
 - Returns true if all intervals in - lhsare present in- rhs.- Removes the specified - intervalfrom the time range.- Removing intervals which are not - normalis invalid, and will be ignored.- Intervals within the time range will be trimmed, split or deleted such that no intervals within the time range include any part of the target interval. - This operation takes linear time. - See also - removeInterval(start, end)
- Parameters:
- start – int 
- end – int 
 
 
 - This is an overloaded function. - Removes the interval specified by - startand- endfrom the time range.- See also - removeTimeRange(range)¶
- Parameters:
- range – - QMediaTimeRange
 
 - Removes each of the intervals in - rangefrom this time range.- Equivalent to calling - removeInterval()for each interval in- range.- swap(other)¶
- Parameters:
- other – - QMediaTimeRange
 
 - Swaps the current instance with the - other.- class Interval¶
- Synopsis¶- Methods¶- def - __init__()
- def - contains()
- def - end()
- def - isNormal()
- def - normalized()
- def - __ne__()
- def - __eq__()
- def - start()
- def - translated()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- __init__()¶
 - __init__(start, end)
- Parameters:
- start – int 
- end – int 
 
 
 - Constructs an interval with the specified - startand- endtimes.- contains(time)¶
- Parameters:
- time – int 
- Return type:
- bool 
 
 - Returns true if the time interval contains the specified - time. That is,- start()<= time <=- end().- end()¶
- Return type:
- int 
 
 - Returns the end time of the interval. - See also - isNormal()¶
- Return type:
- bool 
 
 - Returns true if this time interval is normal. A normal time interval has - start()<=- end().- See also - 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.- Returns true if - lhsis not exactly equal to- rhs.- Returns true if - lhsis exactly equal to- rhs.- start()¶
- Return type:
- int 
 
 - Returns the start time of the interval. - See also - 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.