Update GStreamer software mixer to use new output API
This commit is contained in:
parent
efc3761453
commit
d535cf76b3
@ -1,7 +1,4 @@
|
|||||||
import multiprocessing
|
|
||||||
|
|
||||||
from mopidy.mixers import BaseMixer
|
from mopidy.mixers import BaseMixer
|
||||||
from mopidy.utils.process import pickle_connection
|
|
||||||
|
|
||||||
class GStreamerSoftwareMixer(BaseMixer):
|
class GStreamerSoftwareMixer(BaseMixer):
|
||||||
"""Mixer which uses GStreamer to control volume in software."""
|
"""Mixer which uses GStreamer to control volume in software."""
|
||||||
@ -10,16 +7,7 @@ class GStreamerSoftwareMixer(BaseMixer):
|
|||||||
super(GStreamerSoftwareMixer, self).__init__(*args, **kwargs)
|
super(GStreamerSoftwareMixer, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
def _get_volume(self):
|
def _get_volume(self):
|
||||||
my_end, other_end = multiprocessing.Pipe()
|
return self.backend.output.get_volume()
|
||||||
self.backend.output_queue.put({
|
|
||||||
'command': 'get_volume',
|
|
||||||
'reply_to': pickle_connection(other_end),
|
|
||||||
})
|
|
||||||
my_end.poll(None)
|
|
||||||
return my_end.recv()
|
|
||||||
|
|
||||||
def _set_volume(self, volume):
|
def _set_volume(self, volume):
|
||||||
self.backend.output_queue.put({
|
self.backend.output.set_volume(volume)
|
||||||
'command': 'set_volume',
|
|
||||||
'volume': volume,
|
|
||||||
})
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user