Alexa Auto SDK  2.0.0
AudioPlayer.h
1 /*
2  * Copyright 2017-2019 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 <iostream>
20 
21 #include <AACE/Core/PlatformInterface.h>
22 
25 namespace aace {
26 namespace alexa {
27 
41 protected:
42  AudioPlayer() = default;
43 
44 public:
45  virtual ~AudioPlayer();
46 
50  enum class PlayerActivity {
51 
55  IDLE,
56 
60  PLAYING,
61 
65  STOPPED,
66 
70  PAUSED,
71 
76 
80  FINISHED
81  };
82 
88  virtual void playerActivityChanged( PlayerActivity state ) {}
89 };
90 
91 inline std::ostream& operator<<(std::ostream& stream, const AudioPlayer::PlayerActivity& state) {
92  switch (state) {
94  stream << "IDLE";
95  break;
97  stream << "PLAYING";
98  break;
100  stream << "STOPPED";
101  break;
103  stream << "PAUSED";
104  break;
106  stream << "BUFFER_UNDERRUN";
107  break;
109  stream << "FINISHED";
110  break;
111  }
112  return stream;
113 }
114 
115 } // aace::alexa
116 } // aace
117 
118 #endif // AACE_ALEXA_AUDIO_PLAYER_H
PlayerActivity
Definition: AudioPlayer.h:50
Definition: AudioPlayer.h:40
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26
virtual void playerActivityChanged(PlayerActivity state)
Definition: AudioPlayer.h:88

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