jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.1KB

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