mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-02-22 17:04:28 +00:00
[Linux] Allow setting ear detection behaviour
This commit is contained in:
committed by
Tim Gromeyer
parent
c2db0afdf1
commit
0846c3eb48
@@ -6,14 +6,28 @@
|
||||
|
||||
class QProcess;
|
||||
|
||||
class MediaController : public QObject {
|
||||
class MediaController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum MediaState { Playing, Paused, Stopped };
|
||||
enum MediaState
|
||||
{
|
||||
Playing,
|
||||
Paused,
|
||||
Stopped
|
||||
};
|
||||
Q_ENUM(MediaState)
|
||||
enum EarDetectionBehavior
|
||||
{
|
||||
PauseWhenOneRemoved,
|
||||
PauseWhenBothRemoved,
|
||||
Disabled
|
||||
};
|
||||
Q_ENUM(EarDetectionBehavior)
|
||||
|
||||
explicit MediaController(QObject *parent = nullptr);
|
||||
~MediaController();
|
||||
|
||||
|
||||
void initializeMprisInterface();
|
||||
void handleEarDetection(const QString &status);
|
||||
void followMediaChanges();
|
||||
@@ -23,6 +37,9 @@ public:
|
||||
void removeAudioOutputDevice();
|
||||
void setConnectedDeviceMacAddress(const QString &macAddress);
|
||||
|
||||
void setEarDetectionBehavior(EarDetectionBehavior behavior);
|
||||
inline EarDetectionBehavior getEarDetectionBehavior() const { return earDetectionBehavior; }
|
||||
|
||||
void pause();
|
||||
|
||||
Q_SIGNALS:
|
||||
@@ -36,6 +53,7 @@ private:
|
||||
bool wasPausedByApp = false;
|
||||
int initialVolume = -1;
|
||||
QString connectedDeviceMacAddress;
|
||||
EarDetectionBehavior earDetectionBehavior = PauseWhenOneRemoved;
|
||||
};
|
||||
|
||||
#endif // MEDIACONTROLLER_H
|
||||
#endif // MEDIACONTROLLER_H
|
||||
Reference in New Issue
Block a user