Jump to content

abner007

c4Forums Member
  • Content Count

    5
  • Joined

  • Last visited

About abner007

  • Rank
    New Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. function REV_CMD.GetHostRoomList(NetResponse) --local NetResponse = ParseCommand(string.sub(TotalData,5)) gZone1Id = NetResponse.arg.roomList[1].roomId gZone2Id = NetResponse.arg.roomList[2].roomId gZone3Id = NetResponse.arg.roomList[3].roomId gZone4Id = NetResponse.arg.roomList[4].roomId local tempID = string.sub(gZone1Id,8,8)..string.sub(gZone2Id,8,8)..string.sub(gZone3Id,8,8)..string.sub(gZone4Id,8,8) print(gZone1Id , gZone2Id , gZone3Id , gZone4Id) C4:UpdateProperty('Zone ID',tempID) GetMapInput() rev = {} end function GetMapInput() gMapInput = { [0] = gZone1Id, [1] = gZone2Id, [2] = gZone3Id, [3] = gZone4Id, } end Hello,there are some problem with my diver. Could you teach me about it,Now the problem is I don‘t know how to tell the diver which gzone id and roomid was in the same room!thanks a lot!
  2. Thanks a lot!I get it,the image should be put in Cover Art!
  3. We are try to develop a Multi-Room Music Audio Driver,used 2 proxies:amplifier and media service proxy! And now I have a problem。The lua txt is like that,now the problem is it can not show the ImageUrl picture on control 4 app,I didn't know what's wong with the diver. function PRX_CMD.QUEUE_DELETED(idBinding, tParams) -- This is a notification that we receive when the queue gets deleted local queueId = tonumber(tParams["QUEUE_ID"]) local lastQueueState = tParams["LAST_STATE"] local lastQueueStateTime = tonumber(tParams["LAST_STATE_TIME"]) print("PRX_CMD.QUEUE_DELETED() for queue " .. queueId .. ", last state was " .. lastQueueState .. " for " .. lastQueueStateTime .. " seconds") local queueInfo = gQueues[queueId] if (queueInfo ~= nil) then print("Deleting queue info for queue " .. queueId .. ", was playing QUEUE_INFO " .. tParams["QUEUE_INFO"]) ChangeDashboard(queueInfo, nil) -- Clear the media dashboard if (lastQueueState == "PLAY") then -- Save the current time when this station stopped playing for reporting purposes queueInfo["END_TIME"] = os.time() end gQueues[queueId] = nil queueInfo = nil ClearNowPlayingQueue(queueId) end end function PRX_CMD.QUEUE_MEDIA_INFO_UPDATED(idBinding, tParams) -- GetNowPlayinginfo() end ------------------------------------------------------------------------------------------------------------------------------------------------------ function SPRX_CMD.NetData(idBinding, tParams table.insert(MainTable,tParams) end function SPRX_CMD.GetPlayingInfo(id, tParams) if (gNowPlaying ~= nil) then gNowPlaying = {} gCurrentSongIndex = 1 end table.insert(gNowPlaying,tParams) local tResponse = {} local NowPlayingIndex = BuildSimpleXml(nil, {["NowPlayingIndex"] = 0}) local List = BuildListXml(gNowPlaying, true) local args = NowPlayingIndex .. List tResponse["ROOMID"] = gROOMID tResponse["NAVID"] = gNAVID tResponse["NAME"] = "QueueChanged" tResponse["EVTARGS"] = args SendToProxy(idBinding, "SEND_EVENT", tResponse, "COMMAND") UpdateMediaInfo(idBinding, gNowPlaying[1].Title, gNowPlaying[1].SubTitle, "", "", gNowPlaying[1].ImageUrl, gROOMID , true) end function DataReceived(idBinding, navId, seq, response) local data if (type(response) == "table") then data = BuildListXml(response, false) else data = response end local tResponse = { ["NAVID"] = navId, ["SEQ"] = seq, ["DATA"] = data, } SendToProxy(idBinding, "DATA_RECEIVED", tResponse) end function NowPlayingChanged(idBinding, tParams) local id = gCurrentSongIndex local nowplaying = BuildSimpleXml(nil, {["Id"] = id}) local tResponse = { ["NAME"] = "NowPlayingChanged", ["EVTARGS"] = nowplaying, } local queueId if (tParams["QUEUE_ID"] ~= nil) then queueId = tonumber(tParams["QUEUE_ID"]) else queueId = GetQueueFromRoom(nil, tParams["ROOMID"]) end local tRooms = GetRoomsByQueue(nil, queueId) local rooms = "" for i,v in pairs(tRooms) do if (string.len(rooms) > 0) then rooms = rooms .. "," end rooms = rooms .. tostring(v) end if (string.len(rooms) > 0) then tResponse["ROOMS"] = rooms else tResponse["NAVID"] = tParams["NAVID"] end --[[ SendToProxy(GENERIC_MEDIA_PROXY_BINDING_ID, "SEND_EVENT", tResponse, "COMMAND") --]] local NowPlayingIndex = BuildSimpleXml(nil, {["NowPlayingIndex"] = gCurrentSongIndex - 1}) local NowPlaying = "<NowPlaying><actionIds>Preset</actionIds>" .. "<key>" .. gNowPlaying[gCurrentSongIndex].key .. "</key>" .. "<type>" .. gNowPlaying[gCurrentSongIndex].type .. "</type>" .. "<is_preset>" .. gNowPlaying[gCurrentSongIndex].is_preset .. "</is_preset>" .. "</NowPlaying>" local args = NowPlayingIndex .. NowPlaying QueueChanged(idBinding, nil, tParams["ROOMID"], args) local roomid if (tParams["ROOMID"] ~= nil) then roomid = tParams["ROOMID"] elseif (tParams["QUEUE_ID"] ~= nil) then --local tRooms = GetRoomsByQueue(nil, tonumber(tParams["QUEUE_ID"])) roomid = tRooms[1] else print("NowPlayingChanged(), no valid Room ID.") return end SelectInternetRadio(idBinding, roomid, gNowPlaying[id].URL, id) UpdateMediaInfo(idBinding, gNowPlaying[id].Title, gNowPlaying[id].SubTitle, "", "", gNowPlaying[id].ImageUrl, roomid, "secondary", "True") end function ClearNowPlayingQueue(queueId) print("ClearNowPlayingQueue(queueId=" .. queueId .. ")") --gNowPlaying = {} --gCurrentSongIndex = 1 -- Update all navigators that care SendQueueChangedEvent(queueId, gNowPlaying) end function SelectInternetRadio(idBinding, roomId, url, info, vol) local tResponse = { ["ROOM_ID"] = roomId, ["STATION_URL"] = url, ["QUEUE_INFO"] = info, } if (vol ~= nil) then tResponse["VOLUME"] = vol end SendToProxy(idBinding, "SELECT_INTERNET_RADIO", tResponse, "COMMAND") end function UpdateMediaInfo(idBinding, line1, line2, line3, line4, url, roomId , merge) tResponse = { ["LINE1"] = line1, ["LINE2"] = line2, ["LINE3"] = line3, ["LINE4"] = line4, ["IMAGEURL"] = url, ["ROOMID"] = roomId, ["MERGE"] = merge, } SendToProxy(idBinding, "UPDATE_MEDIA_INFO", tResponse, "COMMAND", true) end
  4. abner007

    Multi-Room Music Driver Issue

    We also develop a Multi-Room Music Audio Driver,used 2 proxies:amplifier and media service proxy!we separate it by zone id function GetMapInput() gMapInput = { [0] = gZone1Id, [1] = gZone2Id, [2] = gZone3Id, [3] = gZone4Id, } end we are do the same kind diver we can learn from each other,the media diver is complex!
×