core: Pass audio in to playback
This commit is contained in:
parent
7595778d30
commit
ccd91c0b72
@ -234,6 +234,7 @@ class Command(object):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
# TODO: move out of this file
|
||||
class RootCommand(Command):
|
||||
def __init__(self):
|
||||
super(RootCommand, self).__init__()
|
||||
@ -279,7 +280,7 @@ class RootCommand(Command):
|
||||
mixer = self.start_mixer(config, mixer_class)
|
||||
audio = self.start_audio(config, mixer)
|
||||
backends = self.start_backends(config, backend_classes, audio)
|
||||
core = self.start_core(mixer, backends)
|
||||
core = self.start_core(audio, mixer, backends)
|
||||
self.start_frontends(config, frontend_classes, core)
|
||||
loop.run()
|
||||
except (exceptions.BackendError,
|
||||
@ -360,9 +361,9 @@ class RootCommand(Command):
|
||||
|
||||
return backends
|
||||
|
||||
def start_core(self, mixer, backends):
|
||||
def start_core(self, audio, mixer, backends):
|
||||
logger.info('Starting Mopidy core')
|
||||
return Core.start(mixer=mixer, backends=backends).proxy()
|
||||
return Core.start(audio=audio, mixer=mixer, backends=backends).proxy()
|
||||
|
||||
def start_frontends(self, config, frontend_classes, core):
|
||||
logger.info(
|
||||
|
||||
@ -40,7 +40,7 @@ class Core(
|
||||
"""The tracklist controller. An instance of
|
||||
:class:`mopidy.core.TracklistController`."""
|
||||
|
||||
def __init__(self, mixer=None, backends=None):
|
||||
def __init__(self, audio=None, mixer=None, backends=None):
|
||||
super(Core, self).__init__()
|
||||
|
||||
self.backends = Backends(backends)
|
||||
@ -50,7 +50,7 @@ class Core(
|
||||
self.history = HistoryController()
|
||||
|
||||
self.playback = PlaybackController(
|
||||
mixer=mixer, backends=self.backends, core=self)
|
||||
audio=audio, mixer=mixer, backends=self.backends, core=self)
|
||||
|
||||
self.playlists = PlaylistsController(
|
||||
backends=self.backends, core=self)
|
||||
|
||||
@ -14,11 +14,13 @@ logger = logging.getLogger(__name__)
|
||||
class PlaybackController(object):
|
||||
pykka_traversable = True
|
||||
|
||||
def __init__(self, mixer, backends, core):
|
||||
def __init__(self, audio, mixer, backends, core):
|
||||
# TODO: these should be internal
|
||||
self.mixer = mixer
|
||||
self.backends = backends
|
||||
self.core = core
|
||||
|
||||
self._audio = audio
|
||||
self._state = PlaybackState.STOPPED
|
||||
self._volume = None
|
||||
self._mute = False
|
||||
|
||||
Loading…
Reference in New Issue
Block a user