Index: audio/Playback.lua =================================================================== --- audio/Playback.lua (revision 8150) +++ audio/Playback.lua (working copy) @@ -12,6 +12,7 @@ local Stream = require("squeezeplay.stream") local Rtmp = require("jive.audio.Rtmp") local SlimProto = require("jive.net.SlimProto") +local Player = require("jive.slim.Player") local Task = require("jive.ui.Task") local Timer = require("jive.ui.Timer") @@ -86,6 +87,10 @@ return obj:_aude(data) end) + obj.slimproto:subscribe("setd", function(_, data) + return obj:_setd(data) + end) + obj.timer = Timer(100, function() obj:_timerCallback() end) @@ -679,7 +684,25 @@ decode:audioEnable(data.enable) end +function _setd(self, data) + + -- only send response if we're queried (no additional data) + if data.command == 0 and #data.packet <= 5 then + + -- get playername + local player = Player:getLocalPlayer() + + self.slimproto:send({ + opcode = 'SETD', + data = table.concat({ + string.sub(data.packet, 5, 5), + player:getName() + }) + }) + end +end + function incrementSequenceNumber(self) self.sequenceNumber = self.sequenceNumber + 1 Index: net/SlimProto.lua =================================================================== --- net/SlimProto.lua (revision 8150) +++ net/SlimProto.lua (working copy) @@ -273,7 +273,15 @@ fixedDigital = fixedDigital, preampAtten = preampAtten, sequenceNumber = sequenceNumber, - } end, + } + end, + + setd = function(self, packet) + return { + command = unpackNumber(packet, 5, 1), + packet = packet + } + end, strm = function(self, packet) return {