|
|
|
@ -16,6 +16,7 @@
@@ -16,6 +16,7 @@
|
|
|
|
|
|
|
|
|
|
#include "avform.h" |
|
|
|
|
#include "ui_avsettings.h" |
|
|
|
|
#include "src/misc/settings.h" |
|
|
|
|
|
|
|
|
|
#if defined(__APPLE__) && defined(__MACH__) |
|
|
|
|
#include <OpenAL/al.h> |
|
|
|
@ -36,6 +37,10 @@ AVForm::AVForm() :
@@ -36,6 +37,10 @@ AVForm::AVForm() :
|
|
|
|
|
|
|
|
|
|
connect(Camera::getInstance(), &Camera::propProbingFinished, this, &AVForm::onPropProbingFinished); |
|
|
|
|
connect(Camera::getInstance(), &Camera::resolutionProbingFinished, this, &AVForm::onResProbingFinished); |
|
|
|
|
|
|
|
|
|
auto qcomboboxIndexChanged = (void(QComboBox::*)(const QString&)) &QComboBox::currentIndexChanged; |
|
|
|
|
connect(bodyUI->inDevCombobox, qcomboboxIndexChanged, this, &AVForm::onInDevChanged); |
|
|
|
|
connect(bodyUI->outDevCombobox, qcomboboxIndexChanged, this, &AVForm::onOutDevChanged); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
AVForm::~AVForm() |
|
|
|
@ -117,20 +122,35 @@ void AVForm::hideEvent(QHideEvent *)
@@ -117,20 +122,35 @@ void AVForm::hideEvent(QHideEvent *)
|
|
|
|
|
|
|
|
|
|
void AVForm::getAudioInDevices() |
|
|
|
|
{ |
|
|
|
|
QString settingsInDev = Settings::getInstance().getInDev(); |
|
|
|
|
bool inDevFound = false; |
|
|
|
|
bodyUI->inDevCombobox->clear(); |
|
|
|
|
const ALchar *pDeviceList = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER); |
|
|
|
|
if (pDeviceList) |
|
|
|
|
{ |
|
|
|
|
while (*pDeviceList) |
|
|
|
|
{ |
|
|
|
|
int len = strlen(pDeviceList); |
|
|
|
|
bodyUI->inDevCombobox->addItem(QString::fromLocal8Bit(pDeviceList,len)); |
|
|
|
|
QString inDev = QString::fromLocal8Bit(pDeviceList,len); |
|
|
|
|
bodyUI->inDevCombobox->addItem(inDev); |
|
|
|
|
if (settingsInDev == inDev) |
|
|
|
|
{ |
|
|
|
|
bodyUI->inDevCombobox->setCurrentIndex(bodyUI->inDevCombobox->count()-1); |
|
|
|
|
inDevFound = true; |
|
|
|
|
} |
|
|
|
|
pDeviceList += len+1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!inDevFound) |
|
|
|
|
Settings::getInstance().setInDev(bodyUI->inDevCombobox->itemText(0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AVForm::getAudioOutDevices() |
|
|
|
|
{ |
|
|
|
|
QString settingsOutDev = Settings::getInstance().getOutDev(); |
|
|
|
|
bool outDevFound = false; |
|
|
|
|
bodyUI->outDevCombobox->clear(); |
|
|
|
|
const ALchar *pDeviceList; |
|
|
|
|
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") != AL_FALSE) |
|
|
|
|
pDeviceList = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER); |
|
|
|
@ -141,8 +161,27 @@ void AVForm::getAudioOutDevices()
@@ -141,8 +161,27 @@ void AVForm::getAudioOutDevices()
|
|
|
|
|
while (*pDeviceList) |
|
|
|
|
{ |
|
|
|
|
int len = strlen(pDeviceList); |
|
|
|
|
bodyUI->outDevCombobox->addItem(QString::fromLocal8Bit(pDeviceList,len)); |
|
|
|
|
QString outDev = QString::fromLocal8Bit(pDeviceList,len); |
|
|
|
|
bodyUI->outDevCombobox->addItem(outDev); |
|
|
|
|
if (settingsOutDev == outDev) |
|
|
|
|
{ |
|
|
|
|
bodyUI->outDevCombobox->setCurrentIndex(bodyUI->outDevCombobox->count()-1); |
|
|
|
|
outDevFound = true; |
|
|
|
|
} |
|
|
|
|
pDeviceList += len+1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!outDevFound) |
|
|
|
|
Settings::getInstance().setOutDev(bodyUI->outDevCombobox->itemText(0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AVForm::onInDevChanged(const QString &deviceDescriptor) |
|
|
|
|
{ |
|
|
|
|
Settings::getInstance().setInDev(deviceDescriptor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AVForm::onOutDevChanged(const QString& deviceDescriptor) |
|
|
|
|
{ |
|
|
|
|
Settings::getInstance().setOutDev(deviceDescriptor); |
|
|
|
|
} |
|
|
|
|