Alexa Auto SDK  2.3.1
AudioPlayer.h
1 /*
2  * Copyright 2017-2020 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 AACE_ALEXA_AUDIO_PLAYER_H
17 #define AACE_ALEXA_AUDIO_PLAYER_H
18 
19 #include <AACE/Core/PlatformInterface.h>
20 #include "AlexaEngineInterfaces.h"
21 #include "PlayerActivity.h"
22 
25 namespace aace {
26 namespace alexa {
27 
41 protected:
42  AudioPlayer() = default;
43 
44 public:
49 
53  static const int64_t TIME_UNKNOWN = -1;
54 
55  virtual ~AudioPlayer();
56 
62  virtual void playerActivityChanged(PlayerActivity state) {
63  }
64 
73  int64_t getPlayerPosition();
74 
81  int64_t getPlayerDuration();
82 
89  void setEngineInterface(std::shared_ptr<aace::alexa::AudioPlayerEngineInterface> audioPlayerEngineInterface);
90 
91 private:
92  std::weak_ptr<aace::alexa::AudioPlayerEngineInterface> m_audioPlayerEngineInterface;
93 };
94 
95 } // namespace alexa
96 } // namespace aace
97 
98 #endif // AACE_ALEXA_AUDIO_PLAYER_H
int64_t getPlayerDuration()
Definition: AudioPlayer.cpp:31
int64_t getPlayerPosition()
Definition: AudioPlayer.cpp:23
PlayerActivity
Definition: PlayerActivity.h:36
Definition: AudioPlayer.h:40
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26
static const int64_t TIME_UNKNOWN
Definition: AudioPlayer.h:53
virtual void playerActivityChanged(PlayerActivity state)
Definition: AudioPlayer.h:62

Alexa Auto SDK 2.3.1 - Copyright 2017-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0