diff options
author | Frank Elias <francois.elias@livio.io> | 2021-01-14 15:00:26 -0500 |
---|---|---|
committer | Frank Elias <francois.elias@livio.io> | 2021-01-14 15:00:26 -0500 |
commit | 8a79a854e40335914343233a805b35be52681f43 (patch) | |
tree | 309772086ca8a1f1b592d47d00db10ee6e52f55c | |
parent | 04548b2a664c883b2f961bfeceb4e6abc07bed65 (diff) | |
download | sdl_ios-feature/issue-1377-sdl-0244-custom-playback-rates-for-setMediaClockTimer.tar.gz |
-rw-r--r-- | SmartDeviceLink/public/SDLSetMediaClockTimer.h | 11 | ||||
-rw-r--r-- | SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m | 65 |
2 files changed, 70 insertions, 6 deletions
diff --git a/SmartDeviceLink/public/SDLSetMediaClockTimer.h b/SmartDeviceLink/public/SDLSetMediaClockTimer.h index d55a798d7..a87011a6e 100644 --- a/SmartDeviceLink/public/SDLSetMediaClockTimer.h +++ b/SmartDeviceLink/public/SDLSetMediaClockTimer.h @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN @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 + @param countRate set the media playback timer, if `nil`, will default to 1.0 @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:)); @@ -68,7 +68,7 @@ NS_ASSUME_NONNULL_BEGIN @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 + @param countRate set the media playback timer, if `nil`, will default to 1.0 @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:)); @@ -93,7 +93,7 @@ NS_ASSUME_NONNULL_BEGIN @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 + @param countRate set the media playback timer, if `nil`, will default to 1.0 @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:)); @@ -118,7 +118,7 @@ NS_ASSUME_NONNULL_BEGIN @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 + @param countRate set the media playback timer, if `nil`, will default to 1.0 @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:)); @@ -157,7 +157,6 @@ NS_ASSUME_NONNULL_BEGIN @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:"); /** @@ -165,7 +164,7 @@ NS_ASSUME_NONNULL_BEGIN @param playPauseIndicator An optional audio indicator to change the play/pause button @param countRate set the media playback timer - @return An object of SetMediaClockTimer + @return An object of SetMediaClockTimer, if `nil`, will default to 1.0 */ + (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 dafcb6ee5..7bf4956f9 100644 --- a/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/RequestSpecs/SDLSetMediaClockTimerSpec.m @@ -66,6 +66,19 @@ describe(@"SetMediaClocktimer Spec", ^ { }); it(@"should properly initialize with countUpFromStartTimeInterval:toEndTimeInterval:playPauseIndicator:", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countUpFromStartTimeInterval:testTime1Interval toEndTimeInterval:testTime2Interval playPauseIndicator:testIndicator]; +#pragma clang diagnostic pop + + 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(beNil()); + }); + + it(@"should properly initialize with countUpFromStartTimeInterval:toEndTimeInterval:playPauseIndicator:countRate:", ^{ SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countUpFromStartTimeInterval:testTime1Interval toEndTimeInterval:testTime2Interval playPauseIndicator:testIndicator countRate:@(testCountRate)]; expect(testRequest.startTime).to(equal(time1)); @@ -75,6 +88,19 @@ describe(@"SetMediaClocktimer Spec", ^ { expect(testRequest.countRate).to(equal(testCountRate)); }); + it(@"should properly initialize with countUpFromStartTime:toEndTime:playPauseIndicator:", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countUpFromStartTime:time1 toEndTime:time2 playPauseIndicator:testIndicator]; +#pragma clang diagnostic pop + + 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(beNil()); + }); + it(@"should properly initialize with countUpFromStartTime:toEndTime:playPauseIndicator:countRate:", ^{ SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countUpFromStartTime:time1 toEndTime:time2 playPauseIndicator:testIndicator countRate:@(testCountRate)]; @@ -85,6 +111,19 @@ describe(@"SetMediaClocktimer Spec", ^ { expect(testRequest.countRate).to(equal(testCountRate)); }); + it(@"should properly initialize with countDownFromStartTimeInterval:toEndTimeInterval:playPauseIndicator:", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countDownFromStartTimeInterval:testTime1Interval toEndTimeInterval:testTime2Interval playPauseIndicator:testIndicator]; +#pragma clang diagnostic pop + + 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(beNil()); + }); + it(@"should properly initialize with countDownFromStartTimeInterval:toEndTimeInterval:playPauseIndicator:countRate:", ^{ SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countDownFromStartTimeInterval:testTime1Interval toEndTimeInterval:testTime2Interval playPauseIndicator:testIndicator countRate:@(testCountRate)]; @@ -95,6 +134,19 @@ describe(@"SetMediaClocktimer Spec", ^ { expect(testRequest.countRate).to(equal(testCountRate)); }); + it(@"should properly initialize with countDownFromStartTime:toEndTime:playPauseIndicator:", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countDownFromStartTime:time1 toEndTime:time2 playPauseIndicator:testIndicator]; +#pragma clang diagnostic pop + + 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(beNil()); + }); + it(@"should properly initialize with countDownFromStartTime:toEndTime:playPauseIndicator:countRate:", ^{ SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer countDownFromStartTime:time1 toEndTime:time2 playPauseIndicator:testIndicator countRate:@(testCountRate)]; @@ -133,6 +185,19 @@ describe(@"SetMediaClocktimer Spec", ^ { }); it(@"should properly initialize with resumeWithPlayPauseIndicator:", ^{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer resumeWithPlayPauseIndicator:testIndicator]; +#pragma clang diagnostic pop + + expect(testRequest.startTime).to(beNil()); + expect(testRequest.endTime).to(beNil()); + expect(testRequest.updateMode).to(equal(SDLUpdateModeResume)); + expect(testRequest.audioStreamingIndicator).to(equal(testIndicator)); + expect(testRequest.countRate).to(beNil()); + }); + + it(@"should properly initialize with resumeWithPlayPauseIndicator:countRate:", ^{ SDLSetMediaClockTimer *testRequest = [SDLSetMediaClockTimer resumeWithPlayPauseIndicator:testIndicator countRate:@(testCountRate)]; expect(testRequest.startTime).to(beNil()); |