Skip to content

Commit

Permalink
Added volume, mute, unmet control
Browse files Browse the repository at this point in the history
Added volume control so you can control the volume, and you can mute
and unmute
  • Loading branch information
ttopholm committed Jan 4, 2017
1 parent 0e178f6 commit b53c8d1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dlnap/dlnap.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def _send_tcp(to, payload):
sock.connect(to)
sock.sendall(payload.encode('utf-8'))

data = (sock.recv(2048))
data = sock.recv(2048)
if py3:
data = data.decode('utf-8')
data = _xml2dict(_unescape_xml(data), True)
Expand Down Expand Up @@ -626,6 +626,9 @@ def usage():
print(' --play <url> - set current url for play and start playback it. In case of url is empty - continue playing recent media.')
print(' --pause - pause current playback')
print(' --stop - stop current playback')
print(' --mute - mute playback')
print(' --unmute - unmute playback')
print(' --volume <vol> - set current volume for playback')
print(' --timeout <seconds> - discover timeout')
print(' --ssdp-version <version> - discover devices by protocol version, default 1')
print(' --proxy - use local proxy on proxy port')
Expand All @@ -649,7 +652,7 @@ def version():
'play=',
'pause',
'stop',
'volume',
'volume=',
'mute',
'unmute',

Expand All @@ -673,6 +676,7 @@ def version():

device = ''
url = ''
vol = 10
timeout = 1
action = ''
logLevel = logging.WARN
Expand Down Expand Up @@ -718,6 +722,7 @@ def version():
action = 'stop'
elif opt in ('--volume'):
action = 'volume'
vol = arg
elif opt in ('--mute'):
action = 'mute'
elif opt in ('--unmute'):
Expand Down Expand Up @@ -777,7 +782,7 @@ def version():
elif action == 'stop':
d.stop()
elif action == 'volume':
d.volume()
d.volume(vol)
elif action == 'mute':
d.mute()
elif action == 'unmute':
Expand Down

0 comments on commit b53c8d1

Please sign in to comment.