Skip to content
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

Conversation

IGapchuk
Copy link
Contributor

@IGapchuk IGapchuk commented Oct 18, 2018

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:

  • [Unit test]

CLA

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.
@IGapchuk IGapchuk changed the base branch from master to feature/media_skip_indicators October 18, 2018 09:23
@IGapchuk IGapchuk changed the title Feature/media skip indicators feature/media skip indicators Oct 18, 2018
MessageSharedPtr msg = CreateMsgParams();
mobile_apis::SeekIndicatorType::eType seek_indicator_type =
mobile_apis::SeekIndicatorType::TIME;
std::uint32_t seek_time = 10;
Copy link
Contributor

@APipko APipko Oct 22, 2018

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];
Copy link
Contributor

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]
Copy link
Contributor

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

@IGapchuk IGapchuk merged commit 52669e3 into smartdevicelink:feature/media_skip_indicators Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants