-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/media skip indicators #2703
feature/media skip indicators #2703
Conversation
This PR contains major changes in MIBILE_API and HMI_API. Competitive systems have the ability to show time skip buttons for podcast and audio book media that desire them. These kinds of buttons reduce confusion with the driver by showing them what will be happening when they skip forward and back. Current systems can only show a skip track button, which works for music, but less so for podcasts and audio books. Added a new type SeekIndicatorType, that can be in two states: TRACK or TIME. Added a new type SeekStreamingIndicator, that contains SeekIndicatorType. If SeekIndicatorType exists in TIME state, it has to contains 'seekTime' parameter with count of time to seek audio stream. Added new parameters to SetMediaClockTimer request: forwardSeekIndicator and backSeekIndicator as SeekStreamingIndicator type.
MessageSharedPtr msg = CreateMsgParams(); | ||
mobile_apis::SeekIndicatorType::eType seek_indicator_type = | ||
mobile_apis::SeekIndicatorType::TIME; | ||
std::uint32_t seek_time = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For magic numbers it's better to use const. And please use u
postfix to avoid implicit conversion
static_cast<mobile_apis::SeekIndicatorType::eType>( | ||
(*msg)[am::strings::msg_params][am::strings::forward_seek_indicator] | ||
.asInt())); | ||
auto msg_params = (*msg)[am::strings::msg_params]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to move this line before first usage of (*msg)[am::strings::msg_params]
EXPECT_EQ( | ||
seek_indicator_type, | ||
static_cast<mobile_apis::SeekIndicatorType::eType>( | ||
(*msg)[am::strings::msg_params][am::strings::forward_seek_indicator] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, check the existing of key (using assert) before this expectation
Fixes #2625
This PR is ready for review.
Risk
This PR makes major API changes.
Testing Plan
Covered by Unit tests.
Summary
Competitive systems have the ability to show time skip buttons for podcast and audio book media that desire them. These kinds of buttons reduce confusion with the driver by showing them what will be happening when they skip forward and back. Current systems can only show a skip track button, which works for music, but less so for podcasts and audio books.
Added a new type SeekIndicatorType, that can be in two states: TRACK or TIME.
Added a new type SeekStreamingIndicator, that contains SeekIndicatorType. If SeekIndicatorType exists in TIME state, it has to contains 'seekTime' parameter with count of time to seek audio stream.
Added new parameters to SetMediaClockTimer request: forwardSeekIndicator and backSeekIndicator as SeekStreamingIndicator type.
Tasks Remaining:
CLA