Browse Source

Update JackCoreAudioDriver and JackCoreAudioAdapter with more recent API.

tags/1.9.9.5
Stephane Letz 13 years ago
parent
commit
7920fe9d11
2 changed files with 46 additions and 16 deletions
  1. +23
    -8
      macosx/coreaudio/JackCoreAudioAdapter.cpp
  2. +23
    -8
      macosx/coreaudio/JackCoreAudioDriver.cpp

+ 23
- 8
macosx/coreaudio/JackCoreAudioAdapter.cpp View File

@@ -908,16 +908,31 @@ int JackCoreAudioAdapter::OpenAUHAL(bool capturing,
}

// AUHAL
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);
SInt32 major;
SInt32 minor;
Gestalt(gestaltSystemVersionMajor, &major);
Gestalt(gestaltSystemVersionMinor, &minor);

err1 = OpenAComponent(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
goto error;
if (major == 10 && minor >= 6) {
AudioComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
AudioComponent HALOutput = AudioComponentFindNext(NULL, &cd);
err1 = AudioComponentInstanceNew(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling AudioComponentInstanceNew");
printError(err1);
goto error;
}
} else {
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);
err1 = OpenAComponent(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
goto error;
}
}

err1 = AudioUnitInitialize(fAUHAL);
if (err1 != noErr) {
jack_error("Cannot initialize AUHAL unit");


+ 23
- 8
macosx/coreaudio/JackCoreAudioDriver.cpp View File

@@ -1616,14 +1616,29 @@ int JackCoreAudioDriver::OpenAUHAL(bool capturing,
}

// AUHAL
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);

err1 = OpenAComponent(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
goto error;
SInt32 major;
SInt32 minor;
Gestalt(gestaltSystemVersionMajor, &major);
Gestalt(gestaltSystemVersionMinor, &minor);
if (major == 10 && minor >= 6) {
AudioComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
AudioComponent HALOutput = AudioComponentFindNext(NULL, &cd);
err1 = AudioComponentInstanceNew(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling AudioComponentInstanceNew");
printError(err1);
goto error;
}
} else {
ComponentDescription cd = {kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple, 0, 0};
Component HALOutput = FindNextComponent(NULL, &cd);
err1 = OpenAComponent(HALOutput, &fAUHAL);
if (err1 != noErr) {
jack_error("Error calling OpenAComponent");
printError(err1);
goto error;
}
}

err1 = AudioUnitInitialize(fAUHAL);


Loading…
Cancel
Save