/usr/share/mopidy/mopidy/frontends/mpd/protocol/audio_output.py is in mopidy 0.17.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | from __future__ import unicode_literals
from mopidy.frontends.mpd.exceptions import MpdNoExistError
from mopidy.frontends.mpd.protocol import handle_request
@handle_request(r'disableoutput\ "(?P<outputid>\d+)"$')
def disableoutput(context, outputid):
"""
*musicpd.org, audio output section:*
``disableoutput``
Turns an output off.
"""
if int(outputid) == 0:
context.core.playback.set_mute(False)
else:
raise MpdNoExistError('No such audio output', command='disableoutput')
@handle_request(r'enableoutput\ "(?P<outputid>\d+)"$')
def enableoutput(context, outputid):
"""
*musicpd.org, audio output section:*
``enableoutput``
Turns an output on.
"""
if int(outputid) == 0:
context.core.playback.set_mute(True)
else:
raise MpdNoExistError('No such audio output', command='enableoutput')
@handle_request(r'outputs$')
def outputs(context):
"""
*musicpd.org, audio output section:*
``outputs``
Shows information about all outputs.
"""
muted = 1 if context.core.playback.get_mute().get() else 0
return [
('outputid', 0),
('outputname', 'Mute'),
('outputenabled', muted),
]
|