Browse Source

Correct JackPortAudioDriver::Open : special case for ASIO drivers.

tags/1.9.9.5
Stephane Letz 13 years ago
parent
commit
b2d3e88904
3 changed files with 13 additions and 4 deletions
  1. +8
    -0
      windows/portaudio/JackPortAudioDevices.cpp
  2. +1
    -0
      windows/portaudio/JackPortAudioDevices.h
  3. +4
    -4
      windows/portaudio/JackPortAudioDriver.cpp

+ 8
- 0
windows/portaudio/JackPortAudioDevices.cpp View File

@@ -315,3 +315,11 @@ bool PortAudioDevices::IsDuplex(PaDeviceIndex id)
return false;
}

bool PortAudioDevices::IsASIO(PaDeviceIndex id)
{
#ifdef WIN32
return (Pa_GetHostApiInfo(fDeviceInfo[id]->hostApi)->type == paASIO);
#else
return false;
#endif
}

+ 1
- 0
windows/portaudio/JackPortAudioDevices.h View File

@@ -58,6 +58,7 @@ class PortAudioDevices
int GetPreferredBufferSize(PaDeviceIndex id);
void DisplayDevicesNames();
bool IsDuplex(PaDeviceIndex id);
bool IsASIO(PaDeviceIndex id);

};



+ 4
- 4
windows/portaudio/JackPortAudioDriver.cpp View File

@@ -98,15 +98,15 @@ PaError JackPortAudioDriver::OpenStream(jack_nframes_t buffer_size)
inputParameters.channelCount = fCaptureChannels;
inputParameters.sampleFormat = paFloat32 | paNonInterleaved; // 32 bit floating point output
inputParameters.suggestedLatency = (fInputDevice != paNoDevice) // TODO: check how to setup this on ASIO
? Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency
? (fPaDevices->IsASIO(fInputDevice) ? 0 : Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency)
: 0;
inputParameters.hostApiSpecificStreamInfo = NULL;

outputParameters.device = fOutputDevice;
outputParameters.channelCount = fPlaybackChannels;
outputParameters.sampleFormat = paFloat32 | paNonInterleaved; // 32 bit floating point output
outputParameters.suggestedLatency = (fOutputDevice != paNoDevice) // TODO: check how to setup this on ASIO
? Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency
outputParameters.sampleFormat = paFloat32 | paNonInterleaved; // 32 bit floating point output
outputParameters.suggestedLatency = (fOutputDevice != paNoDevice) // TODO: check how to setup this on ASIO
? (fPaDevices->IsASIO(fOutputDevice) ? 0 : Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency)
: 0;
outputParameters.hostApiSpecificStreamInfo = NULL;



Loading…
Cancel
Save