Jack2 1.9.12

JackPortAudioDevices.h
1 /*
2 Copyright (C) 2008-2011 Romain Moret at Grame
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __PortAudioDevices__
21 #define __PortAudioDevices__
22
23 #include <cstdio>
24 #include <string>
25
26 #include "portaudio.h"
27 #include "pa_asio.h"
28
33 class PortAudioDevices
34 {
35 private:
36
37 PaHostApiIndex fNumHostApi; //number of hosts
38 PaDeviceIndex fNumDevice; //number of devices
39 PaDeviceInfo** fDeviceInfo; //array of device info
40 std::string* fHostName; //array of host names (matched with host id's)
41
42 public:
43
44 PortAudioDevices();
45 ~PortAudioDevices();
46
47 PaDeviceIndex GetNumDevice();
48 PaDeviceInfo* GetDeviceInfo(PaDeviceIndex id);
49 std::string GetDeviceName(PaDeviceIndex id);
50 std::string GetHostFromDevice(PaDeviceInfo* device);
51 std::string GetHostFromDevice(PaDeviceIndex id);
52 std::string GetFullName(PaDeviceIndex id);
53 std::string GetFullName(std::string hostname, std::string devicename);
54 PaDeviceInfo* GetDeviceFromFullName(std::string fullname, PaDeviceIndex& id, bool isInput);
55 void PrintSupportedStandardSampleRates(const PaStreamParameters* inputParameters, const PaStreamParameters* outputParameters);
56 int GetInputDeviceFromName(const char* name, PaDeviceIndex& device, int& in_max);
57 int GetOutputDeviceFromName(const char* name, PaDeviceIndex& device, int& out_max);
58 int GetPreferredBufferSize(PaDeviceIndex id);
59 void DisplayDevicesNames();
60 bool IsDuplex(PaDeviceIndex id);
61
62 };
63
64 #endif
PaHostApiIndex
int PaHostApiIndex
Definition: portaudio.h:179
pa_asio.h
ASIO-specific PortAudio API extension header file.
PaDeviceInfo
Definition: portaudio.h:437
PaDeviceIndex
int PaDeviceIndex
Definition: portaudio.h:153
portaudio.h
The PortAudio API.
PaStreamParameters
Definition: portaudio.h:475
PortAudioDevices
A PortAudio Devices manager.
Definition: JackPortAudioDevices.h:33