Beispiel #1
0
 def on_sink_info(self, sink, eol):
     if eol:  # dont operate on sink in case its an eol callback
         if not self._subscribed:
             self.timeout_add(0.1, self.subscribe_to_sink_events)
         return
     name = ffi.string(sink.name).decode('utf-8')
     if name == self.default_sink_name:
         self.default_sink = {
             'name': name,
             'description': ffi.string(sink.description).decode('utf-8'),
             'index': int(sink.index),
             'base_volume': sink.base_volume,
             'muted': bool(sink.mute),
             'channels': sink.volume.channels,
             'values': list(sink.volume.values),
         }
         self.update()
Beispiel #2
0
 def on_sink_info(self, sink, eol):
     if eol:  # dont operate on sink in case its an eol callback
         if not self._subscribed:
             self.timeout_add(0.1, self.subscribe_to_sink_events)
         return
     name = ffi.string(sink.name).decode("utf-8")
     if name == self.default_sink_name:
         self.default_sink = {
             "name": name,
             "description": ffi.string(sink.description).decode("utf-8"),
             "index": int(sink.index),
             "base_volume": sink.base_volume,
             "muted": bool(sink.mute),
             "channels": sink.volume.channels,
             "values": list(sink.volume.values),
         }
         self.update()
Beispiel #3
0
 def on_server_info(self, info):
     self.default_sink_name = ffi.string(info.default_sink_name) \
         .decode('utf-8')
     self.timeout_add(0.1, self.get_sinks)