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.

119 lines
3.4KB

  1. /*
  2. Copyright (C) 2008 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. #include "JackCoreAudioIOAdapter.h"
  16. #include "JackError.h"
  17. namespace Jack
  18. {
  19. OSStatus JackCoreAudioIOAdapter::Render(void *inRefCon,
  20. AudioUnitRenderActionFlags *ioActionFlags,
  21. const AudioTimeStamp *inTimeStamp,
  22. UInt32 inBusNumber,
  23. UInt32 inNumberFrames,
  24. AudioBufferList *ioData)
  25. {
  26. JackCoreAudioIOAdapter* driver = static_cast<JackCoreAudioIOAdapter*>(inRefCon);
  27. /*
  28. driver->fActionFags = ioActionFlags;
  29. driver->fCurrentTime = (AudioTimeStamp *)inTimeStamp;
  30. driver->fDriverOutputData = ioData;
  31. driver->CycleTakeBeginTime();
  32. return driver->Process();
  33. AudioUnitRender(fAUHAL, fActionFags, fCurrentTime, 1, fEngineControl->fBufferSize, fJackInputData);
  34. */
  35. return noErr;
  36. }
  37. OSStatus JackCoreAudioIOAdapter::GetDeviceIDFromUID(const char* UID, AudioDeviceID* id)
  38. {
  39. /*
  40. UInt32 size = sizeof(AudioValueTranslation);
  41. CFStringRef inIUD = CFStringCreateWithCString(NULL, UID, CFStringGetSystemEncoding());
  42. AudioValueTranslation value = { &inIUD, sizeof(CFStringRef), id, sizeof(AudioDeviceID) };
  43. if (inIUD == NULL) {
  44. return kAudioHardwareUnspecifiedError;
  45. } else {
  46. OSStatus res = AudioHardwareGetProperty(kAudioHardwarePropertyDeviceForUID, &size, &value);
  47. CFRelease(inIUD);
  48. jack_log("get_device_id_from_uid %s %ld ", UID, *id);
  49. return (*id == kAudioDeviceUnknown) ? kAudioHardwareBadDeviceError : res;
  50. }
  51. */
  52. return noErr;
  53. }
  54. OSStatus JackCoreAudioIOAdapter::GetDefaultDevice(AudioDeviceID* id)
  55. {
  56. return noErr;
  57. }
  58. OSStatus JackCoreAudioIOAdapter::GetDefaultInputDevice(AudioDeviceID* id)
  59. {
  60. return noErr;
  61. }
  62. OSStatus JackCoreAudioIOAdapter::GetDefaultOutputDevice(AudioDeviceID* id)
  63. {
  64. return noErr;
  65. }
  66. OSStatus JackCoreAudioIOAdapter::GetDeviceNameFromID(AudioDeviceID id, char* name)
  67. {
  68. return noErr;
  69. }
  70. OSStatus JackCoreAudioIOAdapter::GetTotalChannels(AudioDeviceID device, int* channelCount, bool isInput)
  71. {
  72. return noErr;
  73. }
  74. // Setup
  75. int JackCoreAudioIOAdapter::SetupDevices(const char* capture_driver_uid,
  76. const char* playback_driver_uid,
  77. char* capture_driver_name,
  78. char* playback_driver_name)
  79. {
  80. return 0;
  81. }
  82. int JackCoreAudioIOAdapter::SetupChannels(bool capturing,
  83. bool playing,
  84. int& inchannels,
  85. int& outchannels,
  86. int& in_nChannels,
  87. int& out_nChannels,
  88. bool strict)
  89. {
  90. return 0;
  91. }
  92. int JackCoreAudioIOAdapter::SetupBufferSizeAndSampleRate(jack_nframes_t nframes, jack_nframes_t samplerate)
  93. {
  94. return 0;
  95. }
  96. }