Alexa Auto SDK  2.3.0
AudioOutputProvider.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_AUDIO_AUDIO_OUTPUT_PROVIDER_H
17 #define AACE_AUDIO_AUDIO_OUTPUT_PROVIDER_H
18 
19 #include <AACE/Core/PlatformInterface.h>
20 #include "AudioOutput.h"
21 
24 namespace aace {
25 namespace audio {
26 
27 class AudioOutputProvider : public aace::core::PlatformInterface {
28 public:
29  enum class AudioOutputType { TTS, MUSIC, NOTIFICATION, ALARM, EARCON, COMMUNICATION, RINGTONE };
30 
31 protected:
32  AudioOutputProvider() = default;
33 
34 public:
35  virtual ~AudioOutputProvider();
36 
37  virtual std::shared_ptr<AudioOutput> openChannel(const std::string& name, AudioOutputType type) = 0;
38 };
39 
40 inline std::ostream& operator<<(std::ostream& stream, const AudioOutputProvider::AudioOutputType& audioOutputType) {
41  switch (audioOutputType) {
42  case AudioOutputProvider::AudioOutputType::TTS:
43  stream << "TTS";
44  break;
45  case AudioOutputProvider::AudioOutputType::MUSIC:
46  stream << "MUSIC";
47  break;
48  case AudioOutputProvider::AudioOutputType::NOTIFICATION:
49  stream << "NOTIFICATION";
50  break;
51  case AudioOutputProvider::AudioOutputType::ALARM:
52  stream << "ALARM";
53  break;
54  case AudioOutputProvider::AudioOutputType::EARCON:
55  stream << "EARCON";
56  break;
57  case AudioOutputProvider::AudioOutputType::COMMUNICATION:
58  stream << "COMMUNICATION";
59  break;
60  case AudioOutputProvider::AudioOutputType::RINGTONE:
61  stream << "RINGTONE";
62  break;
63  }
64  return stream;
65 }
66 
67 } // namespace audio
68 } // namespace aace
69 
70 #endif // AACE_AUDIO_AUDIO_OUTPUT_PROVIDER_H
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26

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