2016-07-08, 08:10
Hi, friends! I use small python script for enabling/disabling audio DSP processing on the fly, mapped to my ir remote button.
When the music plays and i disable audio DSP processing on the fly music continues to play and when i enable audio DSP processing again music track starts playing from the beginning. This is a bug or feature?
Code:
# created by BytEvil (2016)
import xbmc
import os
tempdir = xbmc.translatePath('special://temp/')
tempfile0 = os.path.join(tempdir, 'audiooutput0')
print("CURRENT DSP STATUS:")
print(xbmc.executeJSONRPC('{"jsonrpc":"2.0","method":"Settings.GetSettingValue", "params":{"setting":"audiooutput.dspaddonsenabled"},"id":1}'))
if not os.path.isfile(tempfile0):
# dsp addon enabled
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.dspaddonsenabled","value":true}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{"title":"AUDIO OUTPUT", "message":"DSP enabled", "image":"/home/vis/.kodi/addons/audiooutput.dspswitch/icon.png"}, "id":1}')
file = open(tempfile0, "a")
file.close()
else:
# dsp addon disabled
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"Settings.SetSettingValue", "params":{"setting":"audiooutput.dspaddonsenabled","value":false}, "id":1}')
xbmc.executeJSONRPC('{"jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{"title":"AUDIO OUTPUT", "message":"DSP disabled", "image":"/home/vis/.kodi/addons/audiooutput.dspswitch/icon.png"}, "id":1}')
os.remove(tempfile0)
When the music plays and i disable audio DSP processing on the fly music continues to play and when i enable audio DSP processing again music track starts playing from the beginning. This is a bug or feature?