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.

130 lines
3.5KB

  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. ///AudioUnitRender(fAUHAL, ioActionFlags, inTimeStamp, 1, inNumberFrames, fJackInputData);
  36. return noErr;
  37. }
  38. OSStatus JackCoreAudioIOAdapter::GetDeviceIDFromUID(const char* UID, AudioDeviceID* id)
  39. {
  40. /*
  41. UInt32 size = sizeof(AudioValueTranslation);
  42. CFStringRef inIUD = CFStringCreateWithCString(NULL, UID, CFStringGetSystemEncoding());
  43. AudioValueTranslation value = { &inIUD, sizeof(CFStringRef), id, sizeof(AudioDeviceID) };
  44. if (inIUD == NULL) {
  45. return kAudioHardwareUnspecifiedError;
  46. } else {
  47. OSStatus res = AudioHardwareGetProperty(kAudioHardwarePropertyDeviceForUID, &size, &value);
  48. CFRelease(inIUD);
  49. jack_log("get_device_id_from_uid %s %ld ", UID, *id);
  50. return (*id == kAudioDeviceUnknown) ? kAudioHardwareBadDeviceError : res;
  51. }
  52. */
  53. return noErr;
  54. }
  55. OSStatus JackCoreAudioIOAdapter::GetDefaultDevice(AudioDeviceID* id)
  56. {
  57. return noErr;
  58. }
  59. OSStatus JackCoreAudioIOAdapter::GetDefaultInputDevice(AudioDeviceID* id)
  60. {
  61. return noErr;
  62. }
  63. OSStatus JackCoreAudioIOAdapter::GetDefaultOutputDevice(AudioDeviceID* id)
  64. {
  65. return noErr;
  66. }
  67. OSStatus JackCoreAudioIOAdapter::GetDeviceNameFromID(AudioDeviceID id, char* name)
  68. {
  69. return noErr;
  70. }
  71. OSStatus JackCoreAudioIOAdapter::GetTotalChannels(AudioDeviceID device, int* channelCount, bool isInput)
  72. {
  73. return noErr;
  74. }
  75. // Setup
  76. int JackCoreAudioIOAdapter::SetupDevices(const char* capture_driver_uid,
  77. const char* playback_driver_uid,
  78. char* capture_driver_name,
  79. char* playback_driver_name)
  80. {
  81. return 0;
  82. }
  83. int JackCoreAudioIOAdapter::SetupChannels(bool capturing,
  84. bool playing,
  85. int& inchannels,
  86. int& outchannels,
  87. int& in_nChannels,
  88. int& out_nChannels,
  89. bool strict)
  90. {
  91. return 0;
  92. }
  93. int JackCoreAudioIOAdapter::SetupBufferSizeAndSampleRate(jack_nframes_t nframes, jack_nframes_t samplerate)
  94. {
  95. return 0;
  96. }
  97. int JackCoreAudioIOAdapter::Open()
  98. {
  99. }
  100. int JackCoreAudioIOAdapter::Close()
  101. {
  102. }
  103. }