New PortAudioDevices::GetPreferredBufferSize.
[jack2.git] / windows / portaudio / JackPortAudioDevices.h
blob0acb104be62db9e25303cedef57e0d3cacfcd3c2
1 /*
2 Copyright (C) 2008-2011 Romain Moret at Grame
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.
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.
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.
20 #ifndef __PortAudioDevices__
21 #define __PortAudioDevices__
23 #include <cstdio>
24 #include <string>
26 #include "portaudio.h"
27 #include "pa_asio.h"
29 /*!
30 \brief A PortAudio Devices manager.
33 class PortAudioDevices
35 private:
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)
42 public:
44 PortAudioDevices();
45 ~PortAudioDevices();
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);
64 #endif