Platforms to show: All Mac Windows Linux Cross-Platform
Back to CMTimeMBS class.
CMTimeMBS.AbsoluteValue as CMTimeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Same as the argument time, with sign inverted if negative.
CMTimeMBS.Add(other as CMTimeMBS) as CMTimeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
self: CMTime to be added.
other: Another CMTime to be added.
Returns the sum of the two CMTimes (addend1 + addend2).
If the operands both have the same timescale, the timescale of the result will be the same as the operands' timescale. If the operands have different timescales, the timescale of the result will be the least common multiple of the operands' timescales. If that LCM timescale is greater than kCMTimeMaxTimescale, the result timescale will be kCMTimeMaxTimescale, and default rounding will be applied when converting the result to this timescale. If the result value overflows, the result timescale will be repeatedly halved until the result value no longer overflows. Again, default rounding will be applied when converting the result to this timescale. If the result value still overflows when timescale == 1, then the result will be either positive or negative infinity, depending on the direction of the overflow.
If any rounding occurs for any reason, the result's kCMTimeFlags_HasBeenRounded flag will be set. This flag will also be set if either of the operands has kCMTimeFlags_HasBeenRounded set. If either of the operands is invalid, the result will be invalid. If the operands are valid, but just one operand is infinite, the result will be similarly infinite. If the operands are valid, and both are infinite, the results will be as follows:
+infinity + +infinity == +infinity
-infinity + -infinity == -infinity
+infinity + -infinity == invalid
-infinity + +infinity == invalid
If the operands are valid, not infinite, and either or both is indefinite, the result will be indefinite. If the two operands are numeric (i.e.. valid, not infinite, not indefinite), but have different nonzero epochs, the result will be invalid. If they have the same nonzero epoch, the result will have epoch zero (a duration). Times in different epochs cannot be added or subtracted, because epoch length is unknown. Times in epoch zero are considered to be durations and can be added to times in other epochs. Times in different epochs can be compared, however, because numerically greater epochs always occur after numerically lesser epochs.
CMTimeMBS.Compare(other as CMTimeMBS) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
self: First CMTime in comparison.
other: Second CMTime in comparison.
Returns the numerical relationship of the two CMTimes.
-1 is returned if time1 is less than time2.
1 is returned if time1 is greater than time2.
0 is returned if time1 and time2 are equal.
If the two CMTimes are numeric (i.e.. not invalid, infinite, or indefinite), and have different epochs, it is considered that times in numerically larger epochs are always greater than times in numerically smaller epochs. Since this routine will be used to sort lists by time, it needs to give all values (even invalid and indefinite ones) a strict ordering to guarantee that sort algorithms terminate safely. The order chosen is somewhat arbitrary: -infinity < all finite values < indefinite < +infinity < invalid
Invalid CMTimes are considered to be equal to other invalid CMTimes, and greater than any other CMTime. Positive infinity is considered to be less than any invalid CMTime, equal to itself, and greater than any other CMTime. An indefinite CMTime is considered to be less than any invalid CMTime, less than positive infinity, equal to itself, and greater than any other CMTime. Negative infinity is considered to be equal to itself, and less than any other CMTime.
CMTimeMBS.Constructor(Value as Int64, Timescale as Integer, Flags as Integer = 1, Epoch as Int64 = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CMTimeMBS.ConvertScale(newTimescale as Integer, RoundingMethod as Integer = 1) as CMTimeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
self: Source CMTime.
newTimescale: The timescale to which the source CMTime is converted.
RoundingMethod: The requested rounding method.
Returns the converted CMTime.
If the value needs to be rounded, the kCMTimeFlags_HasBeenRounded flag will be set. See constants for a discussion of the various rounding methods available. If the source time is non-numeric (i.e.. infinite, indefinite, invalid), the result will be similarly non-numeric.
CMTimeMBS.Description as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CMTimeMBS.Multiply(multiplier as Integer) as CMTimeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
self: The CMTime that will be multiplied.
multiplier: A 32-bit integer. CMTime time and multiplier will be multiplied.
Returns the product of the CMTime and the 32-bit integer.
The result will have the same timescale as the CMTime operand. If the result value overflows, the result timescale will be repeatedly halved until the result value no longer overflows. Again, default rounding will be applied when converting the result to this timescale. If the result value still overflows when timescale == 1, then the result will be either positive or negative infinity, depending on the direction of the overflow. If any rounding occurs for any reason, the result's kCMTimeFlags_HasBeenRounded flag will be set. This flag will also be set if the CMTime operand has kCMTimeFlags_HasBeenRounded set. If the CMTime operand is invalid, the result will be invalid. If the CMTime operand is valid, but infinite, the result will be infinite, and of an appropriate sign, give the signs of both operands. If the CMTime operand is valid, but indefinite, the result will be indefinite.
CMTimeMBS.MultiplyByFloat(multiplier as Double) as CMTimeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
time: The CMTime that will be multiplied.
multiplier: A 64-bit float. CMTime time and multiplier will be multiplied.
Returns the product of the CMTime and the 64-bit float.
The result will initially have the same timescale as the CMTime operand. If the result timescale is less than 65536, it will be repeatedly doubled until it is at least 65536. If the result value overflows, the result timescale will be repeatedly halved until the result value no longer overflows. Again, default rounding will be applied when converting the result to this timescale. If the result value still overflows when timescale == 1, then the result will be either positive or negative infinity, depending on the direction of the overflow. If any rounding occurs for any reason, the result's kCMTimeFlags_HasBeenRounded flag will be set. This flag will also be set if the CMTime operand has kCMTimeFlags_HasBeenRounded set. If the CMTime operand is invalid, the result will be invalid. If the CMTime operand is valid, but infinite, the result will be infinite, and of an appropriate sign, given the signs of both operands. If the CMTime operand is valid, but indefinite, the result will be indefinite.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CMTimeMBS.Subtract(other as CMTimeMBS) as CMTimeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
self: The CMTime from which the subtrahend will be subtracted.
other: The CMTime that will be subtracted from the minuend.
Returns the difference of the two CMTimes (minuend - subtrahend).
If the operands both have the same timescale, the timescale of the result will be the same as the operands' timescale. If the operands have different timescales, the timescale of the result will be the least common multiple of the operands' timescales. If that LCM timescale is greater than kCMTimeMaxTimescale, the result timescale will be kCMTimeMaxTimescale, and default rounding will be applied when converting the result to this timescale.
If the result value overflows, the result timescale will be repeatedly halved until the result value no longer overflows. Again, default rounding will be applied when converting the result to this timescale. If the result value still overflows when timescale = 1, then the result will be either positive or negative infinity, depending on the direction of the overflow.
If any rounding occurs for any reason, the result's kCMTimeFlags_HasBeenRounded flag will be set. This flag will also be set if either of the operands has kCMTimeFlags_HasBeenRounded set. If either of the operands is invalid, the result will be invalid. If the operands are valid, but just one operand is infinite, the result will be similarly infinite. If the operands are valid, and both are infinite, the results will be as follows:
+infinity - +infinity == invalid
-infinity - -infinity == invalid
+infinity - -infinity == +infinity
-infinity - +infinity == -infinity
If the operands are valid, not infinite, and either or both is indefinite, the result will be indefinite. If the two operands are numeric (i.e.. valid, not infinite, not indefinite), but have different nonzero epochs, the result will be invalid. If they have the same nonzero epoch, the result will have epoch zero (a duration). Times in different epochs cannot be added or subtracted, because epoch length is unknown. Times in epoch zero are considered to be durations and can be subtracted from times in other epochs. Times in different epochs can be compared, however, because numerically greater epochs always occur after numerically lesser epochs.
The items on this page are in the following plugins: MBS AVFoundation Plugin.