mirror of
https://github.com/theCheeseboard/thedesk.git
synced 2025-01-22 18:32:09 -05:00
Implement Quiet Mode Mute
This commit is contained in:
parent
c7097ffd68
commit
fea6ec03bf
3 changed files with 27 additions and 2 deletions
|
@ -67,6 +67,9 @@ EventHandler::EventHandler(QObject* parent) : QObject(parent) {
|
|||
{"text", StateManager::quietModeManager()->description(newMode)}
|
||||
});
|
||||
});
|
||||
|
||||
connect(StateManager::quietModeManager(), &QuietModeManager::quietModeChanged, this, &EventHandler::quietModeChanged);
|
||||
quietModeChanged();
|
||||
}
|
||||
|
||||
EventHandler::~EventHandler() {
|
||||
|
@ -159,3 +162,11 @@ void EventHandler::showHud(PulseAudioQt::Sink* sink, qint64 volume) {
|
|||
|
||||
StateManager::instance()->hudManager()->showHud(hudData);
|
||||
}
|
||||
|
||||
void EventHandler::quietModeChanged() {
|
||||
QuietModeManager::QuietMode mode = StateManager::quietModeManager()->currentMode();
|
||||
QVector<PulseAudioQt::Sink*> sinks = PulseAudioQt::Context::instance()->sinks();
|
||||
for (PulseAudioQt::Sink* sink : sinks) {
|
||||
sink->setMuted(mode == QuietModeManager::Mute);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ class EventHandler : public QObject {
|
|||
void adjustVolume(int percentageChange);
|
||||
void defaultSinkChanged(PulseAudioQt::Sink* defaultSink);
|
||||
void showHud(PulseAudioQt::Sink* sink, qint64 volume = -1);
|
||||
void quietModeChanged();
|
||||
};
|
||||
|
||||
#endif // KEYHANDLER_H
|
||||
|
|
|
@ -41,9 +41,9 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<y>-188</y>
|
||||
<width>655</width>
|
||||
<height>630</height>
|
||||
<height>636</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -414,6 +414,19 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in a new issue