mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-02-02 08:09:14 +00:00
[Linux] New ear detection implementation (#145)
* New ear detection implementation * [Linux] Improved case battery detection when not connected
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "mediacontroller.h"
|
||||
#include "logger.h"
|
||||
#include "eardetection.hpp"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QProcess>
|
||||
@@ -38,7 +39,7 @@ void MediaController::initializeMprisInterface() {
|
||||
}
|
||||
}
|
||||
|
||||
void MediaController::handleEarDetection(const QString &status)
|
||||
void MediaController::handleEarDetection(EarDetection *earDetection)
|
||||
{
|
||||
if (earDetectionBehavior == Disabled)
|
||||
{
|
||||
@@ -46,15 +47,8 @@ void MediaController::handleEarDetection(const QString &status)
|
||||
return;
|
||||
}
|
||||
|
||||
bool primaryInEar = false;
|
||||
bool secondaryInEar = false;
|
||||
|
||||
QStringList parts = status.split(", ");
|
||||
if (parts.size() == 2)
|
||||
{
|
||||
primaryInEar = parts[0].contains("In Ear");
|
||||
secondaryInEar = parts[1].contains("In Ear");
|
||||
}
|
||||
bool primaryInEar = earDetection->isPrimaryInEar();
|
||||
bool secondaryInEar = earDetection->isSecondaryInEar();
|
||||
|
||||
LOG_DEBUG("Ear detection status: primaryInEar="
|
||||
<< primaryInEar << ", secondaryInEar=" << secondaryInEar
|
||||
|
||||
Reference in New Issue
Block a user