Update GStreamer software mixer to use new output API

This commit is contained in:
Stein Magnus Jodal 2010-08-24 01:11:01 +02:00
parent efc3761453
commit d535cf76b3

View File

@ -1,7 +1,4 @@
import multiprocessing
from mopidy.mixers import BaseMixer
from mopidy.utils.process import pickle_connection
class GStreamerSoftwareMixer(BaseMixer):
"""Mixer which uses GStreamer to control volume in software."""
@ -10,16 +7,7 @@ class GStreamerSoftwareMixer(BaseMixer):
super(GStreamerSoftwareMixer, self).__init__(*args, **kwargs)
def _get_volume(self):
my_end, other_end = multiprocessing.Pipe()
self.backend.output_queue.put({
'command': 'get_volume',
'reply_to': pickle_connection(other_end),
})
my_end.poll(None)
return my_end.recv()
return self.backend.output.get_volume()
def _set_volume(self, volume):
self.backend.output_queue.put({
'command': 'set_volume',
'volume': volume,
})
self.backend.output.set_volume(volume)