mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 15:25:35 +08:00
[experimental, audio] try to avoid taskbar MIC flickering
* sometimes the MIC icon in the windows task bar is flickering (on/off) * this workaround tries to avoid this
This commit is contained in:
committed by
Mat Sutcliffe
parent
b9c6541a55
commit
1266ca53ce
@@ -8,10 +8,13 @@
|
||||
|
||||
#include "audioutilities.h"
|
||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||
#include "blackconfig/buildconfig.h"
|
||||
|
||||
#include <QStringBuilder>
|
||||
#include <QAudioInput>
|
||||
#include <QAudioOutput>
|
||||
|
||||
using namespace BlackConfig;
|
||||
using namespace BlackMisc::Audio;
|
||||
|
||||
namespace BlackSound
|
||||
@@ -245,4 +248,10 @@ namespace BlackSound
|
||||
return static_cast<qreal>(normalize0to100(in));
|
||||
}
|
||||
|
||||
void occupyAudioInputDevice()
|
||||
{
|
||||
if (!CBuildConfig::isRunningOnWindows10()) { return; }
|
||||
static const QAudioInput input(QAudioDeviceInfo::defaultInputDevice());
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace BlackSound
|
||||
BLACKSOUND_EXPORT qreal normalize0to100qr(double in);
|
||||
//! @}
|
||||
|
||||
//! Open a input device
|
||||
BLACKSOUND_EXPORT void occupyAudioInputDevice();
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "blackcore/webdataservices.h"
|
||||
#include "blackcore/context/contextnetwork.h"
|
||||
#include "blackcore/context/contextsimulator.h"
|
||||
#include "blacksound/audioutilities.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
#include "blackmisc/loghandler.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
@@ -72,9 +73,11 @@ void SwiftGuiStd::init()
|
||||
m_mwaStatusBar = &m_statusBar;
|
||||
m_mwaOverlayFrame = ui->fr_CentralFrameInside;
|
||||
m_mwaLogComponent = ui->comp_MainInfoArea->getLogComponent();
|
||||
|
||||
sGui->initMainApplicationWidget(this);
|
||||
|
||||
// experimental: avoid mic flickering
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild()) { BlackSound::occupyAudioInputDevice(); }
|
||||
|
||||
// log messages
|
||||
m_logSubscriber.changeSubscription(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user