diff options
author | Frank Elias <francois.elias@livio.io> | 2021-01-13 08:57:57 -0500 |
---|---|---|
committer | Frank Elias <francois.elias@livio.io> | 2021-01-13 08:57:57 -0500 |
commit | 04548b2a664c883b2f961bfeceb4e6abc07bed65 (patch) | |
tree | 16ff75ac5e43d2de7085dd1ee44ef367d6cb081d | |
parent | ead1f6dbf9686e436f3b8e7e73425a175d1e01f1 (diff) | |
download | sdl_ios-04548b2a664c883b2f961bfeceb4e6abc07bed65.tar.gz |
Comments review
-rw-r--r-- | SmartDeviceLink/public/SDLSetMediaClockTimer.h | 51 | ||||
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m | 13 |
2 files changed, 60 insertions, 4 deletions
diff --git a/SmartDeviceLink/public/SDLSetMediaClockTimer.h b/SmartDeviceLink/public/SDLSetMediaClockTimer.h index 001e16fbb..d55a798d7 100644 --- a/SmartDeviceLink/public/SDLSetMediaClockTimer.h +++ b/SmartDeviceLink/public/SDLSetMediaClockTimer.h @@ -35,6 +35,17 @@ NS_ASSUME_NONNULL_BEGIN */ + (instancetype)countUpFromStartTimeInterval:(NSTimeInterval)startTime toEndTimeInterval:(NSTimeInterval)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator NS_SWIFT_NAME(countUp(from:to:playPauseIndicator:)) __deprecated_msg("Use countUpFromStartTimeInterval:toEndTimeInterval:playPauseIndicator:countRate: instead"); +/** + Create a media clock timer that counts up, e.g from 0:00 to 4:18. + + This will fail if startTime is greater than endTime + + @param startTime The start time interval, e.g. (0) 0:00 + @param endTime The end time interval, e.g. (258) 4:18 + @param playPauseIndicator An optional audio indicator to change the play/pause button + @param countRate set the media playback timer + @return An object of SetMediaClockTimer + */ + (instancetype)countUpFromStartTimeInterval:(NSTimeInterval)startTime toEndTimeInterval:(NSTimeInterval)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator countRate:(nullable NSNumber<SDLFloat> *)countRate NS_SWIFT_NAME(countUp(from:to:playPauseIndicator:countRate:)); /** @@ -49,6 +60,17 @@ NS_ASSUME_NONNULL_BEGIN */ + (instancetype)countUpFromStartTime:(SDLStartTime *)startTime toEndTime:(SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator NS_SWIFT_NAME(countUp(from:to:playPauseIndicator:)) __deprecated_msg("Use countUpFromStartTime:toEndTime:playPauseIndicator:countRate: instead"); +/** + Create a media clock timer that counts up, e.g from 0:00 to 4:18. + + This will fail if startTime is greater than endTime + + @param startTime The start time interval, e.g. 0:00 + @param endTime The end time interval, e.g. 4:18 + @param playPauseIndicator An optional audio indicator to change the play/pause button + @param countRate set the media playback timer + @return An object of SetMediaClockTimer + */ + (instancetype)countUpFromStartTime:(SDLStartTime *)startTime toEndTime:(SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator countRate:(nullable NSNumber<SDLFloat> *)countRate NS_SWIFT_NAME(countUp(from:to:playPauseIndicator:countRate:)); /** @@ -63,6 +85,17 @@ NS_ASSUME_NONNULL_BEGIN */ + (instancetype)countDownFromStartTimeInterval:(NSTimeInterval)startTime toEndTimeInterval:(NSTimeInterval)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator NS_SWIFT_NAME(countDown(from:to:playPauseIndicator:)) __deprecated_msg("Use countDownFromStartTimeInterval:toEndTimeInterval:playPauseIndicator:countRate: instead"); +/** + Create a media clock timer that counts down, e.g. from 4:18 to 0:00 + + This will fail if endTime is greater than startTime + + @param startTime The start time interval, e.g. (258) 4:18 + @param endTime The end time interval, e.g. (0) 0:00 + @param playPauseIndicator An optional audio indicator to change the play/pause button + @param countRate set the media playback timer + @return An object of SetMediaClockTimer + */ + (instancetype)countDownFromStartTimeInterval:(NSTimeInterval)startTime toEndTimeInterval:(NSTimeInterval)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator countRate:(nullable NSNumber<SDLFloat> *)countRate NS_SWIFT_NAME(countDown(from:to:playPauseIndicator:countRate:)); /** @@ -77,6 +110,17 @@ NS_ASSUME_NONNULL_BEGIN */ + (instancetype)countDownFromStartTime:(SDLStartTime *)startTime toEndTime:(SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator NS_SWIFT_NAME(countDown(from:to:playPauseIndicator:)) __deprecated_msg("Use countDownFromStartTime:toEndTime:playPauseIndicator:countRate: instead"); +/** + Create a media clock timer that counts down, e.g. from 4:18 to 0:00 + + This will fail if endTime is greater than startTime + + @param startTime The start time interval, e.g. 4:18 + @param endTime The end time interval, e.g. 0:00 + @param playPauseIndicator An optional audio indicator to change the play/pause button + @param countRate set the media playback timer + @return An object of SetMediaClockTimer + */ + (instancetype)countDownFromStartTime:(SDLStartTime *)startTime toEndTime:(SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator countRate:(nullable NSNumber<SDLFloat> *)countRate NS_SWIFT_NAME(countDown(from:to:playPauseIndicator:countRate:)); /** @@ -107,6 +151,12 @@ NS_ASSUME_NONNULL_BEGIN */ + (instancetype)updatePauseWithNewStartTime:(SDLStartTime *)startTime endTime:(SDLStartTime *)endTime playPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator NS_SWIFT_NAME(pause(newStart:newEnd:playPauseIndicator:)); +/** + Resume a paused media clock timer. It resumes at the same time at which it was paused. + + @param playPauseIndicator An optional audio indicator to change the play/pause button + @return An object of SetMediaClockTimer + */ + (instancetype)resumeWithPlayPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator NS_SWIFT_NAME(resume(playPauseIndicator:)) __deprecated_msg("Use resumeWithPlayPauseIndicator:playPauseIndicator:countRate:"); @@ -114,6 +164,7 @@ NS_ASSUME_NONNULL_BEGIN Resume a paused media clock timer. It resumes at the same time at which it was paused. @param playPauseIndicator An optional audio indicator to change the play/pause button + @param countRate set the media playback timer @return An object of SetMediaClockTimer */ + (instancetype)resumeWithPlayPauseIndicator:(nullable SDLAudioStreamingIndicator)playPauseIndicator countRate:(nullable NSNumber<SDLFloat> *)countRate NS_SWIFT_NAME(resume(playPauseIndicator:countRate:)); diff --git a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m index 0cbdb5d9b..dafcb6ee5 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m @@ -66,39 +66,43 @@ describe(@"SetMediaClocktimer Spec", ^ { }); it(@"should properly initialize with countUpFromStartTimeInterval:toEndTimeInterval:playPauseIndicator:", ^{ - SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countUpFromStartTimeInterval:testTime1Interval toEndTimeInterval:testTime2Interval playPauseIndicator:testIndicator countRate:nil]; + SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countUpFromStartTimeInterval:testTime1Interval toEndTimeInterval:testTime2Interval playPauseIndicator:testIndicator countRate:@(testCountRate)]; expect(testRequest.startTime).to(equal(time1)); expect(testRequest.endTime).to(equal(time2)); expect(testRequest.updateMode).to(equal(SDLUpdateModeCountUp)); expect(testRequest.audioStreamingIndicator).to(equal(testIndicator)); + expect(testRequest.countRate).to(equal(testCountRate)); }); it(@"should properly initialize with countUpFromStartTime:toEndTime:playPauseIndicator:countRate:", ^{ - SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countUpFromStartTime:time1 toEndTime:time2 playPauseIndicator:testIndicator countRate:nil]; + SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countUpFromStartTime:time1 toEndTime:time2 playPauseIndicator:testIndicator countRate:@(testCountRate)]; expect(testRequest.startTime).to(equal(time1)); expect(testRequest.endTime).to(equal(time2)); expect(testRequest.updateMode).to(equal(SDLUpdateModeCountUp)); expect(testRequest.audioStreamingIndicator).to(equal(testIndicator)); + expect(testRequest.countRate).to(equal(testCountRate)); }); it(@"should properly initialize with countDownFromStartTimeInterval:toEndTimeInterval:playPauseIndicator:countRate:", ^{ - SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countDownFromStartTimeInterval:testTime1Interval toEndTimeInterval:testTime2Interval playPauseIndicator:testIndicator countRate:nil]; + SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countDownFromStartTimeInterval:testTime1Interval toEndTimeInterval:testTime2Interval playPauseIndicator:testIndicator countRate:@(testCountRate)]; expect(testRequest.startTime).to(equal(time1)); expect(testRequest.endTime).to(equal(time2)); expect(testRequest.updateMode).to(equal(SDLUpdateModeCountDown)); expect(testRequest.audioStreamingIndicator).to(equal(testIndicator)); + expect(testRequest.countRate).to(equal(testCountRate)); }); it(@"should properly initialize with countDownFromStartTime:toEndTime:playPauseIndicator:countRate:", ^{ - SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countDownFromStartTime:time1 toEndTime:time2 playPauseIndicator:testIndicator countRate:nil]; + SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countDownFromStartTime:time1 toEndTime:time2 playPauseIndicator:testIndicator countRate:@(testCountRate)]; expect(testRequest.startTime).to(equal(time1)); expect(testRequest.endTime).to(equal(time2)); expect(testRequest.updateMode).to(equal(SDLUpdateModeCountDown)); expect(testRequest.audioStreamingIndicator).to(equal(testIndicator)); + expect(testRequest.countRate).to(equal(testCountRate)); }); it(@"should properly initialize with pauseWithPlayPauseIndicator:", ^{ @@ -135,6 +139,7 @@ describe(@"SetMediaClocktimer Spec", ^ { expect(testRequest.endTime).to(beNil()); expect(testRequest.updateMode).to(equal(SDLUpdateModeResume)); expect(testRequest.audioStreamingIndicator).to(equal(testIndicator)); + expect(testRequest.countRate).to(equal(testCountRate)); }); it(@"should properly initialize with clearWithPlayPauseIndicator:", ^{ |