Alexa Auto SDK  2.0.0
AudioOutputProvider.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_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 {
30  TTS,
31  MUSIC,
32  NOTIFICATION,
33  ALARM,
34  EARCON,
35  COMMUNICATION,
36  RINGTONE
37  };
38 
39 protected:
40  AudioOutputProvider() = default;
41 
42 public:
43  virtual ~AudioOutputProvider();
44 
45  virtual std::shared_ptr<AudioOutput> openChannel( const std::string& name, AudioOutputType type ) = 0;
46 };
47 
48 inline std::ostream& operator<<(std::ostream& stream, const AudioOutputProvider::AudioOutputType& audioOutputType) {
49  switch (audioOutputType) {
50  case AudioOutputProvider::AudioOutputType::TTS:
51  stream << "TTS";
52  break;
53  case AudioOutputProvider::AudioOutputType::MUSIC:
54  stream << "MUSIC";
55  break;
56  case AudioOutputProvider::AudioOutputType::NOTIFICATION:
57  stream << "NOTIFICATION";
58  break;
59  case AudioOutputProvider::AudioOutputType::ALARM:
60  stream << "ALARM";
61  break;
62  case AudioOutputProvider::AudioOutputType::EARCON:
63  stream << "EARCON";
64  break;
65  case AudioOutputProvider::AudioOutputType::COMMUNICATION:
66  stream << "COMMUNICATION";
67  break;
68  case AudioOutputProvider::AudioOutputType::RINGTONE:
69  stream << "RINGTONE";
70  break;
71  }
72  return stream;
73 }
74 
75 } // aace::audio
76 } // aace
77 
78 #endif // AACE_AUDIO_AUDIO_OUTPUT_PROVIDER_H
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26

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