Skip to content

Commit

Permalink
🐧 Fixing compilation in Linux
Browse files Browse the repository at this point in the history
- Fixing the compilation problem introduced by the changes in https://
github.com/elieserdejesus/JamTaba/commit/
a9e4249
  • Loading branch information
elieserdejesus committed Dec 24, 2018
1 parent d54018c commit 30cbe74
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Standalone/audio/LinuxPortAudioDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using controller::MainController;

namespace audio {

PortAudioDriver::PortAudioDriver(MainController *mainController, int deviceIndex,
PortAudioDriver::PortAudioDriver(MainController *mainController, int deviceInputIndex, int deviceOutputIndex,
int firstInIndex, int lastInIndex, int firstOutIndex,
int lastOutIndex, int sampleRate, int bufferSize) :
AudioDriver(mainController),
Expand All @@ -17,12 +17,12 @@ PortAudioDriver::PortAudioDriver(MainController *mainController, int deviceIndex
Q_UNUSED(firstOutIndex)
Q_UNUSED(lastInIndex)
Q_UNUSED(lastOutIndex)
Q_UNUSED(deviceIndex)

// initialize portaudio using default devices
PaError error = Pa_Initialize();
if (error == paNoError) {
audioDeviceIndex = deviceIndex;// Pa_GetDefaultOutputDevice();
audioInputDeviceIndex = deviceInputIndex; // Pa_GetDefaultOutputDevice();
audioOutputDeviceIndex = deviceOutputIndex;
globalInputRange = ChannelRange(0, getMaxInputs());
globalOutputRange = ChannelRange(0, 2);// 2 channels for output

Expand All @@ -31,11 +31,11 @@ PortAudioDriver::PortAudioDriver(MainController *mainController, int deviceIndex
globalOutputRange.setToStereo();
if(!initPortAudio(sampleRate, bufferSize)){
qCritical() << "ERROR initializing portaudio:" << Pa_GetErrorText(error);
audioDeviceIndex = paNoDevice;
audioInputDeviceIndex = audioOutputDeviceIndex = paNoDevice;
}
} else {
qCritical() << "ERROR initializing portaudio:" << Pa_GetErrorText(error);
audioDeviceIndex = paNoDevice;
audioInputDeviceIndex = audioOutputDeviceIndex = paNoDevice;
}
}

Expand All @@ -61,15 +61,15 @@ QList<int> PortAudioDriver::getValidBufferSizes(int deviceIndex) const

QString PortAudioDriver::getOutputChannelName(const unsigned int index) const
{
const PaDeviceInfo *deviceInfo = Pa_GetDeviceInfo(audioDeviceIndex);
auto deviceInfo = Pa_GetDeviceInfo(audioOutputDeviceIndex);
if (index < (uint)deviceInfo->maxOutputChannels)
return "Out " + QString::number(index + 1);
return "error";
}

QString PortAudioDriver::getInputChannelName(const unsigned int index) const
{
const PaDeviceInfo *deviceInfo = Pa_GetDeviceInfo(audioDeviceIndex);
auto deviceInfo = Pa_GetDeviceInfo(audioInputDeviceIndex);
if (index < (uint)deviceInfo->maxInputChannels)
return "In " + QString::number(index + 1);
return "error";
Expand Down

0 comments on commit 30cbe74

Please sign in to comment.