aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-05-21 20:07:11 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-05-21 20:07:21 +0200
commit1a76bf5363348448ad8d3f0a4be55bc1b2fb8e53 (patch)
tree2e865ef9894ffe4d5fffefe136ab6113518d9e51
parentcfccb8ea68ead2ce5b3ff04101dcbda3f3a38a3e (diff)
Actually support muting sinks and sink-inputs
-rw-r--r--pa.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pa.py b/pa.py
index 4586b1e..014a234 100644
--- a/pa.py
+++ b/pa.py
@@ -32,6 +32,9 @@ class Sink:
vol = round(vol * _get_maxvol(self._i))
pacmd.pacmd("set-sink-volume", str(self.index()), str(vol))
+ def set_muted(self, yes):
+ pacmd.pacmd("set-sink-mute", str(self.index()), "true" if yes else "false")
+
def set_default(self):
pacmd.pacmd("set-default-sink", str(self.index()))
@@ -72,6 +75,9 @@ class SinkInput:
vol = round(vol * _get_maxvol(self._i))
pacmd.pacmd("set-sink-input-volume", str(self.index()), str(vol))
+ def set_muted(self, yes):
+ pacmd.pacmd("set-sink-input-mute", str(self.index()), "true" if yes else "false")
+
def move_to_sink(self, idx):
assert type(idx) == int
pacmd.pacmd("move-sink-input", str(self.index()), str(idx))