mirror of
https://github.com/beetbox/beets.git
synced 2026-01-14 12:12:23 +01:00
added option for initial volume setting
This commit is contained in:
parent
6348164e9a
commit
ab5c5dcfd5
1 changed files with 7 additions and 3 deletions
|
|
@ -1149,16 +1149,19 @@ class BPDPlugin(BeetsPlugin):
|
|||
'host': u'',
|
||||
'port': 6600,
|
||||
'password': u'',
|
||||
'volume': VOLUME_MAX,
|
||||
})
|
||||
|
||||
def start_bpd(self, lib, host, port, password, debug):
|
||||
def start_bpd(self, lib, host, port, password, volume, debug):
|
||||
"""Starts a BPD server."""
|
||||
if debug:
|
||||
log.setLevel(logging.DEBUG)
|
||||
else:
|
||||
log.setLevel(logging.WARNING)
|
||||
try:
|
||||
Server(lib, host, port, password).run()
|
||||
server = Server(lib, host, port, password)
|
||||
server.cmd_setvol(None, volume)
|
||||
server.run()
|
||||
except NoGstreamerError:
|
||||
global_log.error(u'Gstreamer Python bindings not found.')
|
||||
global_log.error(u'Install "python-gst0.10", "py27-gst-python", '
|
||||
|
|
@ -1179,8 +1182,9 @@ class BPDPlugin(BeetsPlugin):
|
|||
if args:
|
||||
raise beets.ui.UserError('too many arguments')
|
||||
password = self.config['password'].get(unicode)
|
||||
volume = self.config['volume'].get(int)
|
||||
debug = opts.debug or False
|
||||
self.start_bpd(lib, host, int(port), password, debug)
|
||||
self.start_bpd(lib, host, int(port), password, volume, debug)
|
||||
|
||||
cmd.func = func
|
||||
return [cmd]
|
||||
|
|
|
|||
Loading…
Reference in a new issue