openshot-audio  0.1.6
juce_AudioIODeviceType.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_AUDIOIODEVICETYPE_H_INCLUDED
26 #define JUCE_AUDIOIODEVICETYPE_H_INCLUDED
27 
28 
29 //==============================================================================
63 {
64 public:
65  //==============================================================================
70  const String& getTypeName() const noexcept { return typeName; }
71 
72  //==============================================================================
78  virtual void scanForDevices() = 0;
79 
88  virtual StringArray getDeviceNames (bool wantInputNames = false) const = 0;
89 
97  virtual int getDefaultDeviceIndex (bool forInput) const = 0;
98 
103  virtual int getIndexOfDevice (AudioIODevice* device, bool asInput) const = 0;
104 
107  virtual bool hasSeparateInputsAndOutputs() const = 0;
108 
114  virtual AudioIODevice* createDevice (const String& outputDeviceName,
115  const String& inputDeviceName) = 0;
116 
117  //==============================================================================
127  class Listener
128  {
129  public:
130  virtual ~Listener() {}
131 
133  virtual void audioDeviceListChanged() = 0;
134  };
135 
139  void addListener (Listener* listener);
140 
142  void removeListener (Listener* listener);
143 
144  //==============================================================================
146  virtual ~AudioIODeviceType();
147 
148  //==============================================================================
150  static AudioIODeviceType* createAudioIODeviceType_CoreAudio();
152  static AudioIODeviceType* createAudioIODeviceType_iOSAudio();
154  static AudioIODeviceType* createAudioIODeviceType_WASAPI (bool exclusiveMode);
156  static AudioIODeviceType* createAudioIODeviceType_DirectSound();
158  static AudioIODeviceType* createAudioIODeviceType_ASIO();
160  static AudioIODeviceType* createAudioIODeviceType_ALSA();
162  static AudioIODeviceType* createAudioIODeviceType_JACK();
164  static AudioIODeviceType* createAudioIODeviceType_Android();
166  static AudioIODeviceType* createAudioIODeviceType_OpenSLES();
167 
168 protected:
169  explicit AudioIODeviceType (const String& typeName);
170 
172  void callDeviceChangeListeners();
173 
174 private:
175  String typeName;
176  ListenerList<Listener> listeners;
177 
179 };
180 
181 
182 #endif // JUCE_AUDIOIODEVICETYPE_H_INCLUDED
#define noexcept
Definition: juce_CompilerSupport.h:141
const String & getTypeName() const noexcept
Definition: juce_AudioIODeviceType.h:70
Definition: juce_String.h:43
#define JUCE_API
Definition: juce_StandardHeader.h:139
#define const
Definition: juce_ListenerList.h:69
Definition: juce_StringArray.h:39
Definition: juce_AudioIODeviceType.h:62
#define JUCE_DECLARE_NON_COPYABLE(className)
Definition: juce_PlatformDefs.h:191
virtual ~Listener()
Definition: juce_AudioIODeviceType.h:130
Definition: juce_AudioIODevice.h:132
Definition: juce_AudioIODeviceType.h:127