@@ -174,79 +174,79 @@ extension Timecode {
174
174
/// Add a duration to the current timecode and return a new instance.
175
175
///
176
176
/// - Throws: ``ValidationError``
177
- public mutating func adding( _ other: TimecodeSourceValue ) throws -> Timecode {
177
+ public func adding( _ other: TimecodeSourceValue ) throws -> Timecode {
178
178
let otherTC = try Timecode ( other, using: properties)
179
179
return try adding ( otherTC)
180
180
}
181
181
182
182
/// Add a duration to the current timecode and return a new instance.
183
183
///
184
184
/// - Throws: ``ValidationError``
185
- public mutating func adding( _ other: FormattedTimecodeSourceValue ) throws -> Timecode {
185
+ public func adding( _ other: FormattedTimecodeSourceValue ) throws -> Timecode {
186
186
let otherTC = try Timecode ( other, using: properties)
187
187
return try adding ( otherTC)
188
188
}
189
189
190
190
/// Add a duration to the current timecode and return a new instance.
191
191
///
192
192
/// - Throws: ``ValidationError``
193
- public mutating func adding( _ other: RichTimecodeSourceValue ) throws -> Timecode {
193
+ public func adding( _ other: RichTimecodeSourceValue ) throws -> Timecode {
194
194
let otherTC = try Timecode ( other)
195
195
return try adding ( otherTC)
196
196
}
197
197
198
198
/// Add a duration to the current timecode and return a new instance.
199
199
///
200
200
/// - Throws: ``ValidationError``
201
- public mutating func adding( _ other: GuaranteedTimecodeSourceValue ) throws -> Timecode {
201
+ public func adding( _ other: GuaranteedTimecodeSourceValue ) throws -> Timecode {
202
202
let otherTC = Timecode ( other, using: properties)
203
203
return try adding ( otherTC)
204
204
}
205
205
206
206
/// Add a duration to the current timecode and return a new instance.
207
207
///
208
208
/// - Throws: ``ValidationError``
209
- public mutating func adding( _ other: GuaranteedRichTimecodeSourceValue ) throws -> Timecode {
209
+ public func adding( _ other: GuaranteedRichTimecodeSourceValue ) throws -> Timecode {
210
210
let otherTC = Timecode ( other)
211
211
return try adding ( otherTC)
212
212
}
213
213
214
214
/// Add a duration to the current timecode and return a new instance.
215
215
///
216
216
/// - Throws: ``ValidationError``
217
- public mutating func adding( _ other: TimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
217
+ public func adding( _ other: TimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
218
218
let otherTC = try Timecode ( other, using: properties)
219
219
return try adding ( otherTC, by: validation)
220
220
}
221
221
222
222
/// Add a duration to the current timecode and return a new instance.
223
223
///
224
224
/// - Throws: ``ValidationError``
225
- public mutating func adding( _ other: FormattedTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
225
+ public func adding( _ other: FormattedTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
226
226
let otherTC = try Timecode ( other, using: properties)
227
227
return try adding ( otherTC, by: validation)
228
228
}
229
229
230
230
/// Add a duration to the current timecode and return a new instance.
231
231
///
232
232
/// - Throws: ``ValidationError``
233
- public mutating func adding( _ other: RichTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
233
+ public func adding( _ other: RichTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
234
234
let otherTC = try Timecode ( other)
235
235
return try adding ( otherTC, by: validation)
236
236
}
237
237
238
238
/// Add a duration to the current timecode and return a new instance.
239
239
///
240
240
/// - Throws: ``ValidationError``
241
- public mutating func adding( _ other: GuaranteedTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
241
+ public func adding( _ other: GuaranteedTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
242
242
let otherTC = Timecode ( other, using: properties)
243
243
return try adding ( otherTC, by: validation)
244
244
}
245
245
246
246
/// Add a duration to the current timecode and return a new instance.
247
247
///
248
248
/// - Throws: ``ValidationError``
249
- public mutating func adding( _ other: GuaranteedRichTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
249
+ public func adding( _ other: GuaranteedRichTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
250
250
let otherTC = Timecode ( other)
251
251
return try adding ( otherTC, by: validation)
252
252
}
@@ -440,79 +440,79 @@ extension Timecode {
440
440
/// Subtract a duration from the current timecode and return a new instance.
441
441
///
442
442
/// - Throws: ``ValidationError``
443
- public mutating func subtracting( _ other: TimecodeSourceValue ) throws -> Timecode {
443
+ public func subtracting( _ other: TimecodeSourceValue ) throws -> Timecode {
444
444
let otherTC = try Timecode ( other, using: properties)
445
445
return try subtracting ( otherTC)
446
446
}
447
447
448
448
/// Subtract a duration from the current timecode and return a new instance.
449
449
///
450
450
/// - Throws: ``ValidationError``
451
- public mutating func subtracting( _ other: FormattedTimecodeSourceValue ) throws -> Timecode {
451
+ public func subtracting( _ other: FormattedTimecodeSourceValue ) throws -> Timecode {
452
452
let otherTC = try Timecode ( other, using: properties)
453
453
return try subtracting ( otherTC)
454
454
}
455
455
456
456
/// Subtract a duration from the current timecode and return a new instance.
457
457
///
458
458
/// - Throws: ``ValidationError``
459
- public mutating func subtracting( _ other: RichTimecodeSourceValue ) throws -> Timecode {
459
+ public func subtracting( _ other: RichTimecodeSourceValue ) throws -> Timecode {
460
460
let otherTC = try Timecode ( other)
461
461
return try subtracting ( otherTC)
462
462
}
463
463
464
464
/// Subtract a duration from the current timecode and return a new instance.
465
465
///
466
466
/// - Throws: ``ValidationError``
467
- public mutating func subtracting( _ other: GuaranteedTimecodeSourceValue ) throws -> Timecode {
467
+ public func subtracting( _ other: GuaranteedTimecodeSourceValue ) throws -> Timecode {
468
468
let otherTC = Timecode ( other, using: properties)
469
469
return try subtracting ( otherTC)
470
470
}
471
471
472
472
/// Subtract a duration from the current timecode and return a new instance.
473
473
///
474
474
/// - Throws: ``ValidationError``
475
- public mutating func subtracting( _ other: GuaranteedRichTimecodeSourceValue ) throws -> Timecode {
475
+ public func subtracting( _ other: GuaranteedRichTimecodeSourceValue ) throws -> Timecode {
476
476
let otherTC = Timecode ( other)
477
477
return try subtracting ( otherTC)
478
478
}
479
479
480
480
/// Subtract a duration from the current timecode and return a new instance.
481
481
///
482
482
/// - Throws: ``ValidationError``
483
- public mutating func subtracting( _ other: TimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
483
+ public func subtracting( _ other: TimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
484
484
let otherTC = try Timecode ( other, using: properties)
485
485
return try subtracting ( otherTC, by: validation)
486
486
}
487
487
488
488
/// Subtract a duration from the current timecode and return a new instance.
489
489
///
490
490
/// - Throws: ``ValidationError``
491
- public mutating func subtracting( _ other: FormattedTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
491
+ public func subtracting( _ other: FormattedTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
492
492
let otherTC = try Timecode ( other, using: properties)
493
493
return try subtracting ( otherTC, by: validation)
494
494
}
495
495
496
496
/// Subtract a duration from the current timecode and return a new instance.
497
497
///
498
498
/// - Throws: ``ValidationError``
499
- public mutating func subtracting( _ other: RichTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
499
+ public func subtracting( _ other: RichTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
500
500
let otherTC = try Timecode ( other)
501
501
return try subtracting ( otherTC, by: validation)
502
502
}
503
503
504
504
/// Subtract a duration from the current timecode and return a new instance.
505
505
///
506
506
/// - Throws: ``ValidationError``
507
- public mutating func subtracting( _ other: GuaranteedTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
507
+ public func subtracting( _ other: GuaranteedTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
508
508
let otherTC = Timecode ( other, using: properties)
509
509
return try subtracting ( otherTC, by: validation)
510
510
}
511
511
512
512
/// Subtract a duration from the current timecode and return a new instance.
513
513
///
514
514
/// - Throws: ``ValidationError``
515
- public mutating func subtracting( _ other: GuaranteedRichTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
515
+ public func subtracting( _ other: GuaranteedRichTimecodeSourceValue , by validation: ValidationRule ) throws -> Timecode {
516
516
let otherTC = Timecode ( other)
517
517
return try subtracting ( otherTC, by: validation)
518
518
}
@@ -664,13 +664,13 @@ extension Timecode {
664
664
// MARK: - Offset / TimecodeInterval
665
665
666
666
/// Offsets the current timecode by a delta amount.
667
- /// Wraps around the clock if needed, as set by the `upperLimit` property.
667
+ /// Wraps around the clock if needed, as set by the `` upperLimit` ` property.
668
668
public mutating func offset( by interval: TimecodeInterval ) {
669
669
self = interval. timecode ( offsetting: self )
670
670
}
671
671
672
672
/// Returns the timecode offset by a delta amount.
673
- /// Wraps around the clock if needed, as set by the `upperLimit` property.
673
+ /// Wraps around the clock if needed, as set by the `` upperLimit` ` property.
674
674
public func offsetting( by interval: TimecodeInterval ) -> Timecode {
675
675
interval. timecode ( offsetting: self )
676
676
}
@@ -682,24 +682,21 @@ extension Timecode {
682
682
} else {
683
683
guard let otherConverted = try ? other. converted ( to: frameRate) else {
684
684
assertionFailure ( " Could not convert other Timecode to self Timecode frameRate. " )
685
- return . init(
686
- Timecode . Components. zero
687
- . timecode ( using: properties, by: . allowingInvalid)
688
- )
685
+ return . init( Timecode ( . zero, using: properties) )
689
686
}
690
687
691
688
return _offset ( to: otherConverted. components)
692
689
}
693
690
}
694
691
695
- /// Constructs a new `TimecodeInterval` instance from `self`.
692
+ /// Constructs a new `` TimecodeInterval` ` instance from `self`.
696
693
public func asInterval( _ sign: FloatingPointSign = . plus) -> TimecodeInterval {
697
694
TimecodeInterval ( self , sign)
698
695
}
699
696
700
697
// MARK: - Convenience Attributes
701
698
702
- /// Returns `true` if timecode including subframes is zero (00:00:00:00.00).
699
+ /// Returns `true` if timecode ( including subframes) is zero (00:00:00:00.00).
703
700
public var isZero : Bool {
704
701
frameCount. isZero
705
702
}
0 commit comments