kopia lustrzana https://gitlab.com/eliggett/wfview
Support hotplug audio on QT6+
rodzic
a327b2690e
commit
436428b3a9
|
@ -31,7 +31,6 @@ void audioDevices::enumerate()
|
|||
inputs.clear();
|
||||
outputs.clear();
|
||||
|
||||
|
||||
switch (system)
|
||||
{
|
||||
case qtAudio:
|
||||
|
|
|
@ -89,7 +89,6 @@ signals:
|
|||
protected:
|
||||
private:
|
||||
|
||||
|
||||
audioType system;
|
||||
QFontMetrics fm;
|
||||
QString defaultInputDeviceName;
|
||||
|
|
20
wfmain.cpp
20
wfmain.cpp
|
@ -93,7 +93,10 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
|
|||
|
||||
loadSettings(); // Look for saved preferences
|
||||
|
||||
setAudioDevicesUI();
|
||||
audioDev = new audioDevices(prefs.audioSystem, QFontMetrics(ui->audioInputCombo->font()));
|
||||
connect(audioDev, SIGNAL(updated()), this, SLOT(setAudioDevicesUI()));
|
||||
audioDev->enumerate();
|
||||
//setAudioDevicesUI(); // no need to call this as it will be called by the updated() signal
|
||||
|
||||
setTuningSteps(); // TODO: Combine into preferences
|
||||
|
||||
|
@ -159,6 +162,7 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
|
|||
[&](int value) {
|
||||
QToolTip::showText(QCursor::pos(), QString("%1").arg(value*100/255), nullptr);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
wfmain::~wfmain()
|
||||
|
@ -6372,14 +6376,6 @@ void wfmain::on_radioStatusBtn_clicked()
|
|||
|
||||
void wfmain::setAudioDevicesUI()
|
||||
{
|
||||
|
||||
if (audioDev == Q_NULLPTR) {
|
||||
audioDev = new audioDevices(prefs.audioSystem, QFontMetrics(ui->audioInputCombo->font()));
|
||||
}
|
||||
|
||||
audioDev->setAudioType(prefs.audioSystem);
|
||||
audioDev->enumerate();
|
||||
|
||||
ui->audioInputCombo->blockSignals(true);
|
||||
ui->audioInputCombo->clear();
|
||||
ui->audioInputCombo->addItems(audioDev->getInputs());
|
||||
|
@ -6429,7 +6425,8 @@ void wfmain::setAudioDevicesUI()
|
|||
void wfmain::on_audioSystemCombo_currentIndexChanged(int value)
|
||||
{
|
||||
prefs.audioSystem = static_cast<audioType>(value);
|
||||
setAudioDevicesUI(); // Force all audio devices to update
|
||||
audioDev->setAudioType(prefs.audioSystem);
|
||||
audioDev->enumerate();
|
||||
ui->audioSystemServerCombo->blockSignals(true);
|
||||
ui->audioSystemServerCombo->setCurrentIndex(value);
|
||||
ui->audioSystemServerCombo->blockSignals(false);
|
||||
|
@ -6438,7 +6435,8 @@ void wfmain::on_audioSystemCombo_currentIndexChanged(int value)
|
|||
void wfmain::on_audioSystemServerCombo_currentIndexChanged(int value)
|
||||
{
|
||||
prefs.audioSystem = static_cast<audioType>(value);
|
||||
setAudioDevicesUI(); // Force all audio devices to update
|
||||
audioDev->setAudioType(prefs.audioSystem);
|
||||
audioDev->enumerate();
|
||||
ui->audioSystemCombo->blockSignals(true);
|
||||
ui->audioSystemCombo->setCurrentIndex(value);
|
||||
ui->audioSystemCombo->blockSignals(false);
|
||||
|
|
5
wfmain.h
5
wfmain.h
|
@ -203,6 +203,9 @@ signals:
|
|||
void setClusterSkimmerSpots(bool enable);
|
||||
void setFrequencyRange(double low, double high);
|
||||
|
||||
public slots:
|
||||
void setAudioDevicesUI();
|
||||
|
||||
private slots:
|
||||
void updateSizes(int tabIndex);
|
||||
void shortcutF1();
|
||||
|
@ -526,8 +529,6 @@ private slots:
|
|||
|
||||
void on_rigctldPortTxt_editingFinished();
|
||||
|
||||
void setAudioDevicesUI();
|
||||
|
||||
void on_tcpServerPortTxt_editingFinished();
|
||||
|
||||
void on_moreControlsBtn_clicked();
|
||||
|
|
|
@ -16,6 +16,7 @@ Global
|
|||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Debug|x64.Build.0 = Debug|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
|
@ -23,7 +24,6 @@ Global
|
|||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Release|x64.ActiveCfg = Release|x64
|
||||
{326108AD-FA9D-3AAF-8D3E-062C4DDC34E2}.Release|x64.Build.0 = Release|x64
|
||||
{00E054F8-A1D4-3ECA-A8D6-DFC8A68AFD56}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{00E054F8-A1D4-3ECA-A8D6-DFC8A68AFD56}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{00E054F8-A1D4-3ECA-A8D6-DFC8A68AFD56}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{00E054F8-A1D4-3ECA-A8D6-DFC8A68AFD56}.Debug|x64.Build.0 = Debug|x64
|
||||
{00E054F8-A1D4-3ECA-A8D6-DFC8A68AFD56}.Release|Win32.ActiveCfg = Release|Win32
|
||||
|
|
|
@ -95,6 +95,7 @@
|
|||
<TargetName>wfview</TargetName>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
|
||||
<OutDir>$(SolutionDir)wfview-debug\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>wfview-release\</OutDir>
|
||||
|
@ -107,7 +108,7 @@
|
|||
<TargetName>wfview</TargetName>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)wfview-release</OutDir>
|
||||
<OutDir>$(SolutionDir)wfview-release\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtInstall>msvc2019</QtInstall>
|
||||
|
@ -360,8 +361,8 @@ cmd /c copy /y ..\portaudio\msvc\x64\Debug\portaudio_x64.dll wfview-debug</Comma
|
|||
<LanguageStandard_C>stdc17</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\portaudio\msvc\X64\Debug\portaudio_x64.lib;..\qcustomplot\x64\qcustomplotd2.lib;..\opus\win32\VS2015\x64\Debug\opus.lib;$(QTDIR)\lib\Qt6Multimediad.lib;$(QTDIR)\lib\Qt6PrintSupportd.lib;$(QTDIR)\lib\Qt6Widgetsd.lib;$(QTDIR)\lib\Qt6Guid.lib;$(QTDIR)\lib\Qt6SerialPortd.lib;$(QTDIR)\lib\Qt6Networkd.lib;$(QTDIR)\lib\Qt6Cored.lib;$(QTDIR)\lib\Qt6EntryPointd.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\opus\win32\VS2015\x64\Debug;..\qcustomplot\x64;..\portaudio\msvc\X64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>..\portaudio\msvc\Win32\Debug\portaudio_x86.lib;..\qcustomplot\Win32\qcustomplotd2.lib;..\opus\win32\VS2015\Win32\Debug\opus.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\opus\win32\VS2015\Win32\Debug;..\qcustomplot\Win32;..\portaudio\msvc\Win32\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@ -380,8 +381,8 @@ cmd /c copy /y ..\portaudio\msvc\x64\Debug\portaudio_x64.dll wfview-debug</Comma
|
|||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;WFVIEW_VERSION=\"1.54\";BUILD_WFVIEW;__WINDOWS_WASAPI__;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_USE_LIBRARY;USE_SSE;USE_SSE2;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;EIGEN_MPL2_ONLY;EIGEN_DONT_VECTORIZE;EIGEN_VECTORIZE_SSE3;PREFIX=\"/usr/local\";GITSHORT=\"4574e2b\";HOST=\"wfview.org\";UNAME=\"build\";QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>cmd /c copy /y ..\qcustomplot\x64\qcustomplotd2.dll wfview-debug
|
||||
cmd /c copy /y ..\portaudio\msvc\x64\Debug\portaudio_x64.dll wfview-debug</Command>
|
||||
<Command>cmd /c copy /y ..\qcustomplot\Win32\qcustomplotd2.dll wfview-debug
|
||||
cmd /c copy /y ..\portaudio\msvc\Win32\Debug\portaudio_x86.dll wfview-debug</Command>
|
||||
<Message>Copy DLL files</Message>
|
||||
</PostBuildEvent>
|
||||
<QtMoc>
|
||||
|
|
Ładowanie…
Reference in New Issue