AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
alexaClientSDK::acsdkAudioPlayer::ProgressTimer Class Reference

#include <ProgressTimer.h>

Classes

class  ContextInterface
 

Public Member Functions

 ProgressTimer ()
 
virtual ~ProgressTimer ()
 
void init (const std::shared_ptr< ContextInterface > &context, std::chrono::milliseconds delay, std::chrono::milliseconds interval, std::chrono::milliseconds offset=std::chrono::milliseconds::zero())
 
void start ()
 
void pause ()
 
void resume ()
 
void stop ()
 
void updateInterval (const std::chrono::milliseconds &newInterval)
 
void onProgress (std::chrono::milliseconds progress)
 

Static Public Member Functions

static std::chrono::milliseconds getNoDelay ()
 Static function member to get delay value for no ProgressReportDelayElapsed notifications.. More...
 
static std::chrono::milliseconds getNoInterval ()
 Static function member to get interval value for no ProgressReportIntervalElapsed notifications. More...
 

Friends

std::ostream & operator<< (std::ostream &stream, ProgressTimer::State state)
 Friend declaration to allow streaming State values. More...
 

Detailed Description

Provides callbacks when ProgressReportDelayElapsed and ProgressReportIntervalElapsed events should be sent to AVS.

Constructor & Destructor Documentation

◆ ProgressTimer()

alexaClientSDK::acsdkAudioPlayer::ProgressTimer::ProgressTimer ( )

Constructor.

◆ ~ProgressTimer()

virtual alexaClientSDK::acsdkAudioPlayer::ProgressTimer::~ProgressTimer ( )
virtual

Destructor.

Member Function Documentation

◆ getNoDelay()

static std::chrono::milliseconds alexaClientSDK::acsdkAudioPlayer::ProgressTimer::getNoDelay ( )
inlinestatic

Static function member to get delay value for no ProgressReportDelayElapsed notifications..

◆ getNoInterval()

static std::chrono::milliseconds alexaClientSDK::acsdkAudioPlayer::ProgressTimer::getNoInterval ( )
inlinestatic

Static function member to get interval value for no ProgressReportIntervalElapsed notifications.

◆ init()

void alexaClientSDK::acsdkAudioPlayer::ProgressTimer::init ( const std::shared_ptr< ContextInterface > &  context,
std::chrono::milliseconds  delay,
std::chrono::milliseconds  interval,
std::chrono::milliseconds  offset = std::chrono::milliseconds::zero() 
)

Initialize for sending notifications that it is time to send a progress report. init() must be called before start() (without an intervening stop()) for start() to deliver progress report callbacks.

Parameters
contextThe context within which to operate.
delayThe offset (in milliseconds from the start of the track) at which to send the ProgressReportDelayElapsed event. If delay is ProgressTimer::getNoDelay(), no ProgressReportDelayElapsed notifications will be sent.
intervalThe interval (in milliseconds from the start of the track) at which to send ProgressReportIntervalElapsed events. If interval is ProgressTimer::getNoInterval(), no ProgressReportIntervalElapsed notifications will be sent.
offsetThe offset (in milliseconds from the start of the track) at which playback of the track will start.

◆ onProgress()

void alexaClientSDK::acsdkAudioPlayer::ProgressTimer::onProgress ( std::chrono::milliseconds  progress)

Notification of the current progress.

Parameters
progressThe offset (in milliseconds from the start of the track) of playback.

◆ pause()

void alexaClientSDK::acsdkAudioPlayer::ProgressTimer::pause ( )

Pause sending notifications when it is time to send progress reports. pause() should be called after start() or resume() (without an intervening stop()) or it will do nothing.

◆ resume()

void alexaClientSDK::acsdkAudioPlayer::ProgressTimer::resume ( )

Resume sending notifications when it is time to send progress reports. resume() should be called after pause() (without an intervening stop()) otherwise it will do nothing.

◆ start()

void alexaClientSDK::acsdkAudioPlayer::ProgressTimer::start ( )

Start sending notifications when it is time to send progress reports. init() must be called before start() (without an intervening stop()) for start() to deliver progress report callbacks.

◆ stop()

void alexaClientSDK::acsdkAudioPlayer::ProgressTimer::stop ( )

Stop sending notifications when it is time to send progress reports. stop() can be called after init(), start(), pause(), and resume() to reset a ProgressTimer to it's pre init() state.

◆ updateInterval()

void alexaClientSDK::acsdkAudioPlayer::ProgressTimer::updateInterval ( const std::chrono::milliseconds &  newInterval)

Update interval to send ProgressReportIntervalElapsed events.

Parameters
newIntervalNew interval in milliseconds from the start of the track.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
ProgressTimer::State  state 
)
friend

Friend declaration to allow streaming State values.


The documentation for this class was generated from the following file:

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0