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.

63 lines
2.2KB

  1. /*
  2. Copyright (C) 2008 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 <iostream>
  18. #include <cstring>
  19. #include <cstdio>
  20. #include <string>
  21. #include <cstdlib>
  22. #include "portaudio.h"
  23. #include "pa_asio.h"
  24. /*!
  25. \brief A PortAudio Devices manager.
  26. */
  27. class PortAudioDevices
  28. {
  29. private:
  30. PaHostApiIndex fNumHostApi; //number of hosts
  31. PaDeviceIndex fNumDevice; //number of devices
  32. PaDeviceInfo** fDeviceInfo; //array of device info
  33. std::string* fHostName; //array of host names (matched with host id's)
  34. public:
  35. PortAudioDevices();
  36. ~PortAudioDevices();
  37. PaDeviceIndex GetNumDevice();
  38. PaDeviceInfo* GetDeviceInfo(PaDeviceIndex id);
  39. std::string GetDeviceName(PaDeviceIndex id);
  40. std::string GetHostFromDevice(PaDeviceInfo* device);
  41. std::string GetHostFromDevice(PaDeviceIndex id);
  42. std::string GetFullName(PaDeviceIndex id);
  43. std::string GetFullName(std::string hostname, std::string devicename);
  44. PaDeviceInfo* GetDeviceFromFullName(std::string fullname, PaDeviceIndex& id);
  45. void PrintSupportedStandardSampleRates(const PaStreamParameters* inputParameters, const PaStreamParameters* outputParameters);
  46. int GetInputDeviceFromName(const char* name, PaDeviceIndex& device, int& in_max);
  47. int GetOutputDeviceFromName(const char* name, PaDeviceIndex& device, int& out_max);
  48. void DisplayDevicesNames();
  49. bool IsDuplex ( PaDeviceIndex id );
  50. };
  51. #endif