mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +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 "audioutilities.h"
|
||||||
#include "blackmisc/audio/audiodeviceinfolist.h"
|
#include "blackmisc/audio/audiodeviceinfolist.h"
|
||||||
|
#include "blackconfig/buildconfig.h"
|
||||||
|
|
||||||
#include <QStringBuilder>
|
#include <QStringBuilder>
|
||||||
#include <QAudioInput>
|
#include <QAudioInput>
|
||||||
#include <QAudioOutput>
|
#include <QAudioOutput>
|
||||||
|
|
||||||
|
using namespace BlackConfig;
|
||||||
using namespace BlackMisc::Audio;
|
using namespace BlackMisc::Audio;
|
||||||
|
|
||||||
namespace BlackSound
|
namespace BlackSound
|
||||||
@@ -245,4 +248,10 @@ namespace BlackSound
|
|||||||
return static_cast<qreal>(normalize0to100(in));
|
return static_cast<qreal>(normalize0to100(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void occupyAudioInputDevice()
|
||||||
|
{
|
||||||
|
if (!CBuildConfig::isRunningOnWindows10()) { return; }
|
||||||
|
static const QAudioInput input(QAudioDeviceInfo::defaultInputDevice());
|
||||||
|
}
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ namespace BlackSound
|
|||||||
BLACKSOUND_EXPORT qreal normalize0to100qr(double in);
|
BLACKSOUND_EXPORT qreal normalize0to100qr(double in);
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
//! Open a input device
|
||||||
|
BLACKSOUND_EXPORT void occupyAudioInputDevice();
|
||||||
} // ns
|
} // ns
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "blackcore/webdataservices.h"
|
#include "blackcore/webdataservices.h"
|
||||||
#include "blackcore/context/contextnetwork.h"
|
#include "blackcore/context/contextnetwork.h"
|
||||||
#include "blackcore/context/contextsimulator.h"
|
#include "blackcore/context/contextsimulator.h"
|
||||||
|
#include "blacksound/audioutilities.h"
|
||||||
#include "blackmisc/network/networkutils.h"
|
#include "blackmisc/network/networkutils.h"
|
||||||
#include "blackmisc/loghandler.h"
|
#include "blackmisc/loghandler.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
@@ -72,9 +73,11 @@ void SwiftGuiStd::init()
|
|||||||
m_mwaStatusBar = &m_statusBar;
|
m_mwaStatusBar = &m_statusBar;
|
||||||
m_mwaOverlayFrame = ui->fr_CentralFrameInside;
|
m_mwaOverlayFrame = ui->fr_CentralFrameInside;
|
||||||
m_mwaLogComponent = ui->comp_MainInfoArea->getLogComponent();
|
m_mwaLogComponent = ui->comp_MainInfoArea->getLogComponent();
|
||||||
|
|
||||||
sGui->initMainApplicationWidget(this);
|
sGui->initMainApplicationWidget(this);
|
||||||
|
|
||||||
|
// experimental: avoid mic flickering
|
||||||
|
if (CBuildConfig::isLocalDeveloperDebugBuild()) { BlackSound::occupyAudioInputDevice(); }
|
||||||
|
|
||||||
// log messages
|
// log messages
|
||||||
m_logSubscriber.changeSubscription(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo));
|
m_logSubscriber.changeSubscription(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user