mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-01-28 22:01:50 +00:00
[Linux] Fix noise control mode cycling
This commit is contained in:
committed by
Tim Gromeyer
parent
3023c706bf
commit
2e782ba051
@@ -226,7 +226,7 @@ signals:
|
||||
private:
|
||||
QString m_batteryStatus;
|
||||
QString m_earDetectionStatus;
|
||||
NoiseControlMode m_noiseControlMode = NoiseControlMode::Off;
|
||||
NoiseControlMode m_noiseControlMode = NoiseControlMode::Transparency;
|
||||
bool m_conversationalAwareness = false;
|
||||
int m_adaptiveNoiseLevel = 50;
|
||||
QString m_deviceName;
|
||||
|
||||
@@ -167,6 +167,11 @@ public slots:
|
||||
|
||||
void setNoiseControlMode(NoiseControlMode mode)
|
||||
{
|
||||
if (m_deviceInfo->noiseControlMode() == mode)
|
||||
{
|
||||
LOG_INFO("Noise control mode is already set to: " << static_cast<int>(mode));
|
||||
return;
|
||||
}
|
||||
LOG_INFO("Setting noise control mode to: " << mode);
|
||||
QByteArray packet = AirPodsPackets::NoiseControl::getPacketForMode(mode);
|
||||
writePacketToSocket(packet, "Noise control mode packet written: ");
|
||||
@@ -578,7 +583,6 @@ private slots:
|
||||
{
|
||||
if (auto value = AirPodsPackets::NoiseControl::parseMode(data))
|
||||
{
|
||||
LOG_INFO("Received noise control mode: " << value.value());
|
||||
m_deviceInfo->setNoiseControlMode(value.value());
|
||||
LOG_INFO("Noise control mode received: " << m_deviceInfo->noiseControlMode());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user