AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AudioPlayerObserverInterface.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_ACSDKAUDIOPLAYERINTERFACES_INCLUDE_ACSDKAUDIOPLAYERINTERFACES_AUDIOPLAYEROBSERVERINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_ACSDKAUDIOPLAYERINTERFACES_INCLUDE_ACSDKAUDIOPLAYERINTERFACES_AUDIOPLAYEROBSERVERINTERFACE_H_
18 
19 #include <chrono>
20 #include <string>
21 
24 
25 namespace alexaClientSDK {
26 namespace acsdkAudioPlayerInterfaces {
27 
32 public:
36  virtual ~AudioPlayerObserverInterface() = default;
37 
39  struct Context {
42 
44  std::chrono::milliseconds offset;
45 
48 
51 
54 
56  std::chrono::milliseconds startOffset;
57 
59  std::chrono::milliseconds endOffset;
60  };
61 
63  enum class SeekStatus {
65  SEEK_START,
67  SEEK_COMPLETE,
68  };
69 
76  virtual void onPlayerActivityChanged(avsCommon::avs::PlayerActivity state, const Context& context) = 0;
77 
84  virtual void onSeekActivity(const SeekStatus seekStatus, const Context& context);
85 };
86 
87 inline void AudioPlayerObserverInterface::onSeekActivity(const SeekStatus seekStatus, const Context& context){};
88 
89 } // namespace acsdkAudioPlayerInterfaces
90 } // namespace alexaClientSDK
91 
92 #endif // ALEXA_CLIENT_SDK_ACSDKAUDIOPLAYERINTERFACES_INCLUDE_ACSDKAUDIOPLAYERINTERFACES_AUDIOPLAYEROBSERVERINTERFACE_H_
virtual void onSeekActivity(const SeekStatus seekStatus, const Context &context)
Definition: AudioPlayerObserverInterface.h:87
::std::string string
Definition: gtest-port.h:1097
The context of the AudioPlayer when the observer is notified of the PlayerActivity state change...
Definition: AudioPlayerObserverInterface.h:39
std::string audioItemId
The ID of the AudioItem that the @ AudioPlayer is handling.
Definition: AudioPlayerObserverInterface.h:41
std::string trackPlaylistType
Track Playlist Type of the AudioItem.
Definition: AudioPlayerObserverInterface.h:53
std::chrono::milliseconds endOffset
The end offset in millisecond for the AudioItem in Play directive.
Definition: AudioPlayerObserverInterface.h:59
avsCommon::avs::PlayRequestor playRequestor
The PlayRequestor object in Play directive.
Definition: AudioPlayerObserverInterface.h:47
std::chrono::milliseconds startOffset
The start offset in millisecond for the AudioItem in Play directive.
Definition: AudioPlayerObserverInterface.h:56
virtual void onPlayerActivityChanged(avsCommon::avs::PlayerActivity state, const Context &context)=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: PlayRequestor.h:29
PlayerActivity
Identifies the player state.
Definition: PlayerActivity.h:27
std::chrono::milliseconds offset
The offset in millisecond from the start of the AudioItem.
Definition: AudioPlayerObserverInterface.h:44
SeekStatus
Enum representing Seek activities.
Definition: AudioPlayerObserverInterface.h:63
std::string trackProtectionName
Track protection name of the AudioItem.
Definition: AudioPlayerObserverInterface.h:50

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