From 42fa77db1fbfb2e44af6ed8caedc087904b6513f Mon Sep 17 00:00:00 2001 From: John Wieland Date: Thu, 2 May 2024 10:16:30 -0400 Subject: [PATCH 01/12] Update main.lua --- Color Screen Widget/main.lua | 39 +++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/Color Screen Widget/main.lua b/Color Screen Widget/main.lua index fe6139d..6e9bb97 100644 --- a/Color Screen Widget/main.lua +++ b/Color Screen Widget/main.lua @@ -48,7 +48,7 @@ local function create(zone, options) local tunes = { zone=zone, options=options} model.setGlobalVariable(7,0,1) model.setGlobalVariable(8,0,1) - model.setCustomFunction(62,{switch = 132,func = 16,name = playlist[1][2]})--resets playing song on to the 1st song on startup + model.setCustomFunction(62,{switch = 132,func = 16,name = playlist[1][2]})--resets playing song on to the 1st song on startup aircraft = Bitmap.open("/IMAGES/" .. model.getInfo().bitmap) return tunes end @@ -66,6 +66,22 @@ end --BackGround local function background(tunes) + local long=playlist[playingSong][3] + if model.getTimer(2).value >= long then + if playingSong == #playlist then + model.setGlobalVariable(7,0,1) + playingSong = model.getGlobalVariable(7,0) + flushAudio() + model.setCustomFunction(62,{switch=228,func = 16,name=playlist[playingSong][2],active=1}) + model.setTimer(2,{value=0}) + else + flushAudio() + playingSong = playingSong +1 + model.setGlobalVariable(7,0,playingSong) + model.setCustomFunction(62,{switch=228,func = 16,name=playlist[playingSong][2],active=1}) + model.setTimer(2,{value=0}) + end + end end -- Following is the various widgets zones from top bar to full screen (make changes as desired) @@ -87,7 +103,7 @@ end --- Zone size: 180x70 1/4th (with sliders/trim) --- Zone size: 225x98 1/4th (no sliders/trim) local function refreshZoneMedium(tunes) - local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played local long=playlist[playingSong][3] local k = math.floor((upTime/long)*12)*10 lcd.drawTimer(tunes.zone.x,tunes.zone.y, upTime, SMLSIZE+INVERS) @@ -116,7 +132,7 @@ end --- Zone size: 192x152 1/2 local function refreshZoneLarge(tunes) lcd.drawText(tunes.zone.x+2, tunes.zone.y," iTunes Music", MIDSIZE) - local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played local long=playlist[playingSong][3] local k = math.floor((upTime/long)*12)*10 lcd.drawTimer(tunes.zone.x,tunes.zone.y+40, upTime, SMLSIZE+INVERS) @@ -144,7 +160,7 @@ end --- Zone size: 390x172 1/1 (with sliders and trims) local function refreshZoneXLarge(tunes) - local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played local long=playlist[playingSong][3] function round(num, decimals) @@ -199,7 +215,7 @@ local function refreshZoneXLarge(tunes) --Music -- Progressbar - local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played local k = math.floor((upTime/long)*33)*10 lcd.drawTimer(44, y-10, upTime, SMLSIZE+INVERS) lcd.drawTimer(400,y-10, long, SMLSIZE+INVERS) @@ -229,7 +245,7 @@ end --- Zone size: 460x252 1/1 (no sliders/trim/topbar) local function refreshZoneFull(tunes) - local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played local long=playlist[playingSong][3] function round(num, decimals) @@ -302,9 +318,8 @@ local function refreshZoneFull(tunes) local y = 185 lcd.drawFilledRectangle(6,y-18,462,6,GREY_DEFAULT) ---Music --- Progressbar - --local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played +--Music Progressbar + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played local k = math.floor((upTime/long)*40)*10 lcd.drawTimer(7, y-10, upTime, SMLSIZE+INVERS) lcd.drawTimer(434,y-10, long, SMLSIZE+INVERS) @@ -353,8 +368,8 @@ function refresh(tunes) model.setCustomFunction(62,{switch = 132,func = 16,name = playlist[playingSong][2]}) model.setTimer(2,{value=0}) end - end + -- Next song if nextS > -1 then if not nextSongSwitchPressed then @@ -396,7 +411,7 @@ function refresh(tunes) --Change next Playlist if listN > -1 then if not nextListSwitchPressed then - if model.getGlobalVariable(8,0) >= #songList then + if model.getGlobalVariable(8,0) > #songList then set2 = songList[1] model.setGlobalVariable(8,0,1) playingSong = 1 @@ -414,6 +429,7 @@ function refresh(tunes) nextListSwitchPressed = false end end + -- previous song if prevS > -1 then if not prevSongSwitchPressed then @@ -431,7 +447,6 @@ function refresh(tunes) prevSongSwitchPressed = false end - --Widget Display by Size if tunes.zone.w > 450 and tunes.zone.h > 240 then refreshZoneFull(tunes) elseif tunes.zone.w > 200 and tunes.zone.h > 165 then refreshZoneXLarge(tunes) From 68cb492d78b8ab7b12b44d36ab17446a86be3d83 Mon Sep 17 00:00:00 2001 From: John Wieland Date: Thu, 2 May 2024 12:03:08 -0400 Subject: [PATCH 02/12] Code Cleanup Added background music advance Cleaned up code --- Color Screen Widget/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Color Screen Widget/main.lua b/Color Screen Widget/main.lua index 6e9bb97..b8ce458 100644 --- a/Color Screen Widget/main.lua +++ b/Color Screen Widget/main.lua @@ -12,7 +12,7 @@ ---- # GNU General Public License for more details. # ---- # # ---- ######################################################################### - +$ git tag v4.4.1 ---OpenTX sources used to control the music --Locals From a20ec591948b5b8d3acc72d30387402e709b865f Mon Sep 17 00:00:00 2001 From: John Wieland Date: Thu, 2 May 2024 13:33:53 -0400 Subject: [PATCH 03/12] v4.1 Edge compatable Added background advancement --- Grayscale Radios/iTunes.lua | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Grayscale Radios/iTunes.lua b/Grayscale Radios/iTunes.lua index 76d6868..5100c2a 100644 --- a/Grayscale Radios/iTunes.lua +++ b/Grayscale Radios/iTunes.lua @@ -16,7 +16,7 @@ --Locals local playingSong = 1 local errorOccured = false -local ver = getVersion() --OpenTX Version +local ver = getVersion() --EdgeTX Version loadScript("/SOUNDS/lists/bubba_mix/playlist.lua")() --1st playlist in songList (see sample list below) --Playlists folders names i.e. /SONGS/lists/"foldername" below are sample names @@ -61,14 +61,29 @@ end --BackGround local function background(tunes) +if model.getTimer(2).value >= long then + if playingSong == #playlist then + model.setGlobalVariable(7,0,1) + playingSong = model.getGlobalVariable(7,0) + flushAudio() + model.setCustomFunction(62,{switch = sw1,func = 16,name = playlist[playingSong][2]}) + model.setTimer(2,{value=0}) + else + flushAudio() + playingSong = playingSong +1 + model.setGlobalVariable(7,0,playingSong) + model.setCustomFunction(62,{switch = sw1,func = 16,name = playlist[playingSong][2]}) + model.setTimer(2,{value=0}) + end + end end local function run(tunes) --Update Locals lcd.clear() local selection=playingSong - local long=playlist[playingSong][3]--do not change this value it is the length of the current song playing - local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played + local long=playlist[playingSong][3] --do not change this value it is the length of the current song playing + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played local batt = getValue("tx-voltage") local datenow = getDateTime() local timemins = (string.format("%02d",datenow.min)) @@ -123,7 +138,7 @@ local function run(tunes) lcd.drawText(LCD_W/2-(string.len(title))/2*5, y+12, title, SMLSIZE) -- Progressbar - --local k = math.floor((upTime/long)*33)*10 + local k = math.floor((upTime/long)*33)*10 lcd.drawLine(0, y+18, LCD_W, y+18,SOLID,FORCE) lcd.drawFilledRectangle(20, y+11, math.floor((upTime/long)*(LCD_W-43)), 7) lcd.drawTimer(1, y+12, upTime, SMLSIZE+INVERS) From 998196ab22f2b82192a3039a984df1986ebfde57 Mon Sep 17 00:00:00 2001 From: John Wieland Date: Mon, 6 May 2024 12:58:25 -0400 Subject: [PATCH 04/12] Set 2.9 as Active version Until v2.10 is stable set the current version to EdgeTX v2.9 Compatibility to 2.10 is commented in the file --- .../EdgeTX/Dark Theme/main.lua | 208 +++++++++--------- 1 file changed, 105 insertions(+), 103 deletions(-) diff --git a/Color Screen Widget/EdgeTX/Dark Theme/main.lua b/Color Screen Widget/EdgeTX/Dark Theme/main.lua index b4f97c3..00940c8 100644 --- a/Color Screen Widget/EdgeTX/Dark Theme/main.lua +++ b/Color Screen Widget/EdgeTX/Dark Theme/main.lua @@ -1,5 +1,5 @@ ---- ######################################################################### ------# TaraniTunes v.4.3 # +-----# TaraniTunes v.4.4 # ---- # License GPLv3: http://www.gnu.org/licenses/gpl-3.0.html # ---- # # ---- # This program is free software; you can redistribute it and/or modify # @@ -26,26 +26,32 @@ local songList= "garage", } --- Options +--Options local options = { } -- create zones local function create(zone, options) local tunes = { zone=zone, options=options} - model.setGlobalVariable(7,0,1) + model.setGlobalVariable(7,0,1) model.setGlobalVariable(8,0,1) - model.setCustomFunction(62,{switch=228,func=FUNC_BACKGND_MUSIC,name=playlist[playingSong][2],active=1})--resets playing song on to the 1st song on startup + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1})--resets playing song on to the 1st song on startup aircraft = Bitmap.open("/IMAGES/" .. model.getInfo().bitmap) return tunes end --- Update zones and options +-- control functions +local function error(strings) + errorStrings = strings + errorOccured = true +end + +--Update zones and options local function update(tunes, options) tunes.options = options end --- BackGround +--BackGround local function background(tunes) local long=playlist[playingSong][3] if model.getTimer(2).value >= long then @@ -53,98 +59,93 @@ local function background(tunes) model.setGlobalVariable(7,0,1) playingSong = model.getGlobalVariable(7,0) flushAudio() - model.setCustomFunction(62,{switch=228,func=FUNC_BACKGND_MUSIC,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) model.setTimer(2,{value=0}) else flushAudio() playingSong = playingSong +1 model.setGlobalVariable(7,0,playingSong) - model.setCustomFunction(62,{switch=228,func=FUNC_BACKGND_MUSIC,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) model.setTimer(2,{value=0}) end end end - - -- Following is the various widgets zones from top bar to full screen (make changes as desired) - -- Zone size: top bar widgets local function refreshZoneTiny(tunes) local selection=playingSong lcd.drawText(tunes.zone.x, tunes.zone.y,songList[1], SMLSIZE) - lcd.drawText(tunes.zone.x, tunes.zone.y+15,"> ".. playlist[selection][2],YELLOW+SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+15,"> ".. playlist[selection][2],SMLSIZE) end --- Zone size: 160x32 1/8th local function refreshZoneSmall(tunes) local selection=playingSong lcd.drawText(tunes.zone.x, tunes.zone.y+2,title, SMLSIZE) - lcd.drawText(tunes.zone.x, tunes.zone.y+17, playlist[selection][1], YELLOW+SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+17, playlist[selection][1], INVERS+SMLSIZE) end --- Zone size: 180x70 1/4th (with sliders/trim) --- Zone size: 225x98 1/4th (no sliders/trim) +--- Zone size: 180x70 1/4th (with sliders/trim) +--- Zone size: 225x98 1/4th (no sliders/trim) local function refreshZoneMedium(tunes) - local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played local long=playlist[playingSong][3] local k = math.floor((upTime/long)*12)*10 lcd.drawTimer(tunes.zone.x,tunes.zone.y, upTime, SMLSIZE+INVERS) lcd.drawTimer(tunes.zone.x+145,tunes.zone.y, long, SMLSIZE+INVERS) - lcd.setColor(CUSTOM_COLOR,lcd.RGB(219,172,52)) + lcd.setColor(CUSTOM_COLOR,lcd.RGB(0,100,0)) lcd.drawFilledRectangle(tunes.zone.x+35,tunes.zone.y+2,k,8,CUSTOM_COLOR) local selection=playingSong lcd.drawText(tunes.zone.x, tunes.zone.y+16,"Playing > ".. title, SMLSIZE) - if selection == #playlist then lcd.drawText(tunes.zone.x, tunes.zone.y+30, playlist[selection - 2][1],SMLSIZE) lcd.drawText(tunes.zone.x, tunes.zone.y+45, playlist[selection - 1][1],SMLSIZE) - lcd.drawText(tunes.zone.x, tunes.zone.y+60, string.char(126) .. playlist[selection][1],YELLOW+SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+60, string.char(126) .. playlist[selection][1],INVERS+SMLSIZE) else if selection == 1 then - lcd.drawText(tunes.zone.x, tunes.zone.y+30, string.char(126) .. playlist[selection][1],YELLOW+SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+30, string.char(126) .. playlist[selection][1],INVERS+SMLSIZE) lcd.drawText(tunes.zone.x, tunes.zone.y+45, playlist[selection + 1][1],SMLSIZE) lcd.drawText(tunes.zone.x, tunes.zone.y+60, playlist[selection + 2][1],SMLSIZE) else lcd.drawText(tunes.zone.x, tunes.zone.y+30, playlist[selection - 1][1],SMLSIZE) - lcd.drawText(tunes.zone.x, tunes.zone.y+45, string.char(126) .. playlist[selection][1], YELLOW+SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+45, string.char(126) .. playlist[selection][1], INVERS+SMLSIZE) lcd.drawText(tunes.zone.x, tunes.zone.y+60, playlist[selection + 1][1],SMLSIZE) end end end --- Zone size: 192x152 1/2 +--- Zone size: 192x152 1/2 local function refreshZoneLarge(tunes) lcd.drawText(tunes.zone.x+2, tunes.zone.y," iTunes Music", MIDSIZE) - local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played local long=playlist[playingSong][3] local k = math.floor((upTime/long)*12)*10 lcd.drawTimer(tunes.zone.x,tunes.zone.y+40, upTime, SMLSIZE+INVERS) lcd.drawTimer(tunes.zone.x+160,tunes.zone.y+40, long, SMLSIZE+INVERS) - lcd.setColor(CUSTOM_COLOR,lcd.RGB(219,172,52)) + lcd.setColor(CUSTOM_COLOR,lcd.RGB(0,100,0)) lcd.drawFilledRectangle(tunes.zone.x+35,tunes.zone.y+40,k,18,CUSTOM_COLOR) local selection=playingSong lcd.drawText(tunes.zone.x, tunes.zone.y+60,"Playing > ".. title, SMLSIZE) - if selection == #playlist then lcd.drawText(tunes.zone.x, tunes.zone.y+85, playlist[selection - 2][1]) lcd.drawText(tunes.zone.x, tunes.zone.y+105, playlist[selection - 1][1]) - lcd.drawText(tunes.zone.x, tunes.zone.y+125, string.char(126) .. playlist[selection][1],YELLOW) + lcd.drawText(tunes.zone.x, tunes.zone.y+125, string.char(126) .. playlist[selection][1],INVERS) else if selection == 1 then - lcd.drawText(tunes.zone.x, tunes.zone.y+85, string.char(126) .. playlist[selection][1],YELLOW) + lcd.drawText(tunes.zone.x, tunes.zone.y+85, string.char(126) .. playlist[selection][1],INVERS) lcd.drawText(tunes.zone.x, tunes.zone.y+105, playlist[selection + 1][1]) lcd.drawText(tunes.zone.x, tunes.zone.y+125, playlist[selection + 2][1]) else lcd.drawText(tunes.zone.x, tunes.zone.y+85, playlist[selection - 1][1]) - lcd.drawText(tunes.zone.x, tunes.zone.y+105, string.char(126) .. playlist[selection][1],YELLOW) + lcd.drawText(tunes.zone.x, tunes.zone.y+105, string.char(126) .. playlist[selection][1],INVERS) lcd.drawText(tunes.zone.x, tunes.zone.y+125, playlist[selection + 1][1]) end end end --- Zone size: 390x172 1/1 (with sliders and trims) +--- Zone size: 390x172 1/1 (with sliders and trims) local function refreshZoneXLarge(tunes) - local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played local long=playlist[playingSong][3] function round(num, decimals) @@ -152,25 +153,25 @@ local function refreshZoneXLarge(tunes) return math.floor(num * mult + .5) / mult end --- Current Model Information +--Current Model Information - lcd.drawText(150,60, model.getInfo().name, MIDSIZE) --adjust for right look - lcd.drawBitmap(aircraft,180,70,75) --adjust location and % for right look + lcd.drawText(150,60, model.getInfo().name, MIDSIZE)--adjust for right look + lcd.drawBitmap(aircraft,180,70,75)--adjust location and % for right look --- Transmitter battery +--Transmitter battery local batt = getValue("tx-voltage") lcd.drawText(40, 51,"TX Batt "..round(batt,1).."v") --- Flight Time +--Flight Time local fly=model.getTimer(1).value --flight duration timer: 0=timer1, 1=timer2 lcd.drawText(355, 51, "Flight Time") - lcd.drawTimer(380, 72, fly, 2+GREEN) + lcd.drawTimer(380, 72, fly, 2) - -- Flight Battery - --I use different capacity batteries the timers are adjusted using SF depending on the battery I'm flying - + -- Flight Battery Loaded + --[[ I use different capacity batteries the timers are + adjusted using SF depending on the battery I'm flying ]]-- lcd.drawFilledRectangle(40,73,100,2) - local battsw = getValue('se') + local battsw = getValue('sg') lcd.drawText(40, 90, "Flight Battery",SMLSIZE) lcd.drawFilledRectangle(40,105,100,2) if battsw == -1024 then @@ -180,73 +181,75 @@ local function refreshZoneXLarge(tunes) lcd.drawSwitch(40,75,14) lcd.drawText(90,75,"REG 4.2", SMLSIZE) else lcd.drawSwitch(60,75,15) - lcd.drawText(90,75,"HV 4.35", SMLSIZE) + lcd.drawText(90,75,"4.35 PACK", SMLSIZE) end end -- Cell Voltage lcd.drawFilledRectangle(365,96,78,2) - lcd.drawText(370, 98, "Lipo") - lcd.drawChannel(380, 119,"Cel", PREC2+ORANGE) + lcd.drawText(375, 98, "Lipo Cell") + lcd.drawChannel(390, 119,"LCEL", PREC2+INVERS) --displays a custom telementry sensor (lowest cell)calculated from "cels" sensor --- Altitude from Altimeter ("Alt") or GPS Sensor ("GAlt") +-- Altitude lcd.drawText(40,110,"HEIGHT= ", SMLSIZE) lcd.drawChannel(100,110,"Alt",SMLSIZE) lcd.drawText(42, 125,"Max", SMLSIZE) lcd.drawChannel(82,125,"Alt+",2+SMLSIZE) --- Tementry Separator Bar +--Tementry separator bar local y = 160 - lcd.drawFilledRectangle(40,y-18,400,6,RED) + lcd.drawFilledRectangle(40,y-18,400,6,GREY_DEFAULT) ---Music Progress Bar - local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played +--Music +-- Progressbar + local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played local k = math.floor((upTime/long)*33)*10 lcd.drawTimer(44, y-10, upTime, SMLSIZE+INVERS) lcd.drawTimer(400,y-10, long, SMLSIZE+INVERS) - lcd.setColor(CUSTOM_COLOR,lcd.RGB(219,172,52)) + lcd.setColor(CUSTOM_COLOR,lcd.RGB(0,100,0)) lcd.drawFilledRectangle(80,y-10,k,18,CUSTOM_COLOR) ---Music Display +--music display local selection=playingSong lcd.drawText(90, y+5, "Selected Playlist >>",SMLSIZE) lcd.drawText(220, y+5, title, SMLSIZE) if selection == #playlist then lcd.drawText(40, y+20, playlist[selection - 2][1]) lcd.drawText(40, y+38, playlist[selection - 1][1]) - lcd.drawText(40, y+56, string.char(126) .. playlist[selection][1],YELLOW) + lcd.drawText(40, y+56, string.char(126) .. playlist[selection][1],INVERS) else if selection == 1 then - lcd.drawText(40, y+20, string.char(126) .. playlist[selection][1],YELLOW) + lcd.drawText(40, y+20, string.char(126) .. playlist[selection][1],INVERS) lcd.drawText(40, y+38, playlist[selection + 1][1]) lcd.drawText(40, y+56, playlist[selection + 2][1]) else lcd.drawText(40, y+20, playlist[selection - 1][1]) - lcd.drawText(40, y+38, string.char(126) .. playlist[selection][1],YELLOW) + lcd.drawText(40, y+38, string.char(126) .. playlist[selection][1], INVERS) lcd.drawText(40, y+56, playlist[selection + 1][1]) end end end --- Zone size: 460x252 1/1 (no sliders/trim/topbar) +elogo = Bitmap.open("/THEMES/edge.png") +--- Zone size: 460x252 1/1 (no sliders/trim/topbar) local function refreshZoneFull(tunes) - local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played local long=playlist[playingSong][3] - - function round(num, decimals) + + function round(num, decimals) local mult = 10^(decimals or 0) return math.floor(num * mult + .5) / mult end --- Current time, EdgeTX Version & Model Information +--Current time, EdgeTX Version & Model Information local datenow = getDateTime() local timemins = (string.format("%02d",datenow.min)) lcd.drawText(63,24,"Time "..datenow.hour12..":"..timemins.." "..datenow.suffix) local ver = getVersion() --EdgeTX Version lcd.drawBitmap(elogo,4,0,50) lcd.drawText(63,4,"V. "..ver) - lcd.drawText(185,5, model.getInfo().name,DBLSIZE) --adjust as needed - lcd.drawBitmap(aircraft,160,45,90) --adjust as needed + lcd.drawText(185,5, model.getInfo().name,DBLSIZE)--adjust as needed + lcd.drawBitmap(aircraft,170,45,90)--adjust as needed --Transmitter battery local batt = getValue("tx-voltage") @@ -258,13 +261,14 @@ local function refreshZoneFull(tunes) lcd.drawChannel(160,50,"RxBt") -- Flight Battery Loaded - --[[ I use different capacity batteries, the timers are adjusted using SF depending on the battery capactity ]]-- + --[[ I use different capacity batteries, the timers are + adjusted using SF depending on the battery capactity ]]-- lcd.drawFilledRectangle(8,73,130,2) lcd.drawText(10, 95, "Battery Loaded") lcd.drawFilledRectangle(8,116,130,2) local battsw = getValue('se') if battsw == -1024 then - lcd.drawText(50,77,"SHORT 4.2") --older Battery + lcd.drawText(50,77,"SHORT 4.2") lcd.drawSwitch(10,77,13)else if battsw == 0 then lcd.drawSwitch(10,77,14) @@ -274,11 +278,9 @@ local function refreshZoneFull(tunes) end end --- Separators + -- Flight Mode lcd.drawFilledRectangle(341,60,125,2) lcd.drawFilledRectangle(341,105,125,2) - --- Flight Mode -- local fmno, fmname = getFlightMode() -- if fmname == "" then -- fmname = "FM".. fmno @@ -293,44 +295,45 @@ local function refreshZoneFull(tunes) lcd.drawText(341,83,"Top Spd= ") lcd.drawChannel(420,83,"GSpd+",2+YELLOW) --- Flight Time +--Flight Time local fly=model.getTimer(1).value --flight duration timer: 0=timer1, 1=timer2 lcd.drawText(384, 4, "Flight Time") lcd.drawTimer(380, 22, fly, DBLSIZE+PREC2+GREEN) -- Cell Voltage - lcd.drawText(387, 104, "Lipo",MIDSIZE) - lcd.drawChannel(370, 130,"Cels", DBLSIZE+PREC2+ORANGE) + lcd.drawText(372, 104, "Lipo Cell",MIDSIZE) + lcd.drawChannel(380, 130,"LCEL", DBLSIZE+PREC2+ORANGE) --displays a custom telementry sensor (lowest cell)calculated from "cels" sensor --- RSSI +--rssi lcd.drawText(8,122,"RSSI Sig ") lcd.drawChannel(80,122,"RSSI") lcd.drawText(123,122," //MIN ") lcd.drawChannel(170,122,"RSSI-") --- Altitude from Altimeter ("Alt") or GPS Sensor ("GAlt") + --Altitude lcd.drawText(8,143,"HEIGHT= ") lcd.drawChannel(80,143,"GAlt") - lcd.drawText(135, 143,"//Max") - lcd.drawChannel(190,143,"GAlt+",2) + lcd.drawText(130, 143,"//Max") + lcd.drawChannel(185,143,"GAlt+",2) -- GPS - lcd.drawText(320,232,"GPS Location") - lcd.drawChannel(285,250,"GPS") +lcd.drawText(320,232,"GPS Location") +lcd.drawChannel(290,250,"GPS") --Tementry separator bar local y = 185 lcd.drawFilledRectangle(6,y-18,462,6,RED) --- Music Progress Bar - local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played +--Music +-- Progressbar + local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played local k = math.floor((upTime/long)*40)*10 lcd.drawTimer(7, y-10, upTime, SMLSIZE+BRIGHTGREEN) lcd.drawTimer(434,y-10, long, SMLSIZE+BRIGHTGREEN) lcd.setColor(CUSTOM_COLOR,lcd.RGB(219,172,52)) lcd.drawFilledRectangle(44,y-10,k,14,CUSTOM_COLOR) --- Music Display +--music display local selection=playingSong lcd.drawText(150, y+4, "Selected Playlist >> ".. title, SMLSIZE) if selection == #playlist then @@ -351,37 +354,35 @@ local function refreshZoneFull(tunes) end function refresh(tunes) ---[[ -Custom Function Switch numbers based on Edge Version Installed - Edge 2.8 switch = 132 - Edge 2.9 switch = 144 - Edge 2.10 switch = 228 -]]-- +--SF commands for songs to play based on Version Installed +-- Edge 2.8 switch = 132,func=16 +-- Edge 2.9 switch = 144, func=16 +-- Edge 2.10 switch = 228,func=FUNC_BACKGND_MUSIC -listP = getValue("ls63") -listN = getValue("ls64") -prevS = getValue("ls61") -nextS = getValue("ls62") - - --Song Over + listP = getValue("ls63") + listN = getValue("ls64") + prevS = getValue("ls61") + nextS = getValue("ls62") + + --song over local long=playlist[playingSong][3] if model.getTimer(2).value >= long then if playingSong == #playlist then model.setGlobalVariable(7,0,1) playingSong = model.getGlobalVariable(7,0) flushAudio() - model.setCustomFunction(62,{switch=228,func=FUNC_BACKGND_MUSIC,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) model.setTimer(2,{value=0}) else flushAudio() playingSong = playingSong +1 model.setGlobalVariable(7,0,playingSong) - model.setCustomFunction(62,{switch=228,func=FUNC_BACKGND_MUSIC,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) model.setTimer(2,{value=0}) end + end - --- Next Song +-- Next song if nextS > -1 then if not nextSongSwitchPressed then if playingSong == #playlist then @@ -391,14 +392,14 @@ nextS = getValue("ls62") playingSong = model.getGlobalVariable(7,0) end flushAudio() - model.setCustomFunction(62,{switch=228,func=FUNC_BACKGND_MUSIC,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) model.setTimer(2,{value=0}) else nextSongSwitchPressed = false end end --- Change Previous Playlist +--Change Previous Playlist if listP > -1 then if not prevListSwitchPressed then if model.getGlobalVariable(8,0)<= 0 then @@ -410,7 +411,7 @@ nextS = getValue("ls62") playingSong = 1 end loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() - model.setCustomFunction(62,{switch=228,func=FUNC_BACKGND_MUSIC,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) model.setGlobalVariable(7,0,1) flushAudio() model.setTimer(2,{value=0}) @@ -419,10 +420,10 @@ nextS = getValue("ls62") end end --- Change next Playlist +--Change next Playlist if listN > -1 then if not nextListSwitchPressed then - if model.getGlobalVariable(8,0) > #songList then + if model.getGlobalVariable(8,0) >= #songList then set2 = songList[1] model.setGlobalVariable(8,0,1) playingSong = 1 @@ -430,8 +431,9 @@ nextS = getValue("ls62") set2 = songList[model.getGlobalVariable(8,0)] playingSong = 1 end + loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() - model.setCustomFunction(62,{switch=228,func=FUNC_BACKGND_MUSIC,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) model.setGlobalVariable(7,0,1) flushAudio() model.setTimer(2,{value=0}) @@ -439,8 +441,7 @@ nextS = getValue("ls62") nextListSwitchPressed = false end end - --- Previous Song +-- previous song if prevS > -1 then if not prevSongSwitchPressed then if playingSong == 1 then @@ -450,14 +451,15 @@ nextS = getValue("ls62") playingSong = model.getGlobalVariable(7,0) end flushAudio() - model.setCustomFunction(62,{switch=228,func=FUNC_BACKGND_MUSIC,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) model.setTimer(2,{value=0}) end else prevSongSwitchPressed = false end --- Widget Display by Size + +--Widget Display by Size if tunes.zone.w > 450 and tunes.zone.h > 240 then refreshZoneFull(tunes) elseif tunes.zone.w > 200 and tunes.zone.h > 165 then refreshZoneXLarge(tunes) elseif tunes.zone.w > 180 and tunes.zone.h > 145 then refreshZoneLarge(tunes) From 4d042caf405367f688d03edeff4326421b70194b Mon Sep 17 00:00:00 2001 From: John Wieland Date: Mon, 6 May 2024 13:01:47 -0400 Subject: [PATCH 05/12] Changed focus Colors better visibility on which item is selected --- Color Screen Widget/EdgeTX/Dark Theme/theme.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Color Screen Widget/EdgeTX/Dark Theme/theme.yml b/Color Screen Widget/EdgeTX/Dark Theme/theme.yml index 38ece17..ae806ed 100644 --- a/Color Screen Widget/EdgeTX/Dark Theme/theme.yml +++ b/Color Screen Widget/EdgeTX/Dark Theme/theme.yml @@ -5,13 +5,13 @@ summary: info: "A dark theme with contrast." colors: PRIMARY1: 0xF8FCF8 - PRIMARY2: 0xF84040 - PRIMARY3: 0xC0E4B0 - SECONDARY1: 0x606060 - SECONDARY2: 0xF8B038 + PRIMARY2: 0xF80000 + PRIMARY3: 0xF0F8C0 + SECONDARY1: 0x282828 + SECONDARY2: 0xF0D498 SECONDARY3: 0x000000 - FOCUS: 0xF8B038 - EDIT: 0xD0D0E0 + FOCUS: 0x2030C8 + EDIT: 0x404440 ACTIVE: 0xF8B038 WARNING: 0xE83030 DISABLED: 0xA07420 From 71d4bea01927521e252ac62472c3e2a693e3c51b Mon Sep 17 00:00:00 2001 From: John Wieland Date: Mon, 6 May 2024 13:04:25 -0400 Subject: [PATCH 06/12] Cleanup code --- Color Screen Widget/main.lua | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Color Screen Widget/main.lua b/Color Screen Widget/main.lua index b8ce458..669b892 100644 --- a/Color Screen Widget/main.lua +++ b/Color Screen Widget/main.lua @@ -12,7 +12,7 @@ ---- # GNU General Public License for more details. # ---- # # ---- ######################################################################### -$ git tag v4.4.1 + ---OpenTX sources used to control the music --Locals @@ -24,17 +24,7 @@ loadScript("/SOUNDS/lists/bubba_mix/playlist.lua")() --1st playlist in songList --Playlists folders names i.e. /SONGS/lists/"foldername" below are sample names local songList= {"bubba_mix", -"classic_country", -"country_rock", -"easy", -"fun_country", -"todays", -"funrock", -"hard", -"laid_back", -"modern", "rock", -"soundtracks", "garage", "upbeat", } From c22fe22c914596f12010700ce07bc32f3e36fd6c Mon Sep 17 00:00:00 2001 From: John Wieland Date: Mon, 6 May 2024 13:37:32 -0400 Subject: [PATCH 07/12] Itunes Edge v2.8-2.9 Capatable with Edge versions 2.8 and 2.9 --- Grayscale Radios/iTunes.lua | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Grayscale Radios/iTunes.lua b/Grayscale Radios/iTunes.lua index 5100c2a..5fc0a2e 100644 --- a/Grayscale Radios/iTunes.lua +++ b/Grayscale Radios/iTunes.lua @@ -22,18 +22,7 @@ loadScript("/SOUNDS/lists/bubba_mix/playlist.lua")() --1st playlist in songList --Playlists folders names i.e. /SONGS/lists/"foldername" below are sample names local songList= {"bubba_mix", -"classic_country", -"country_rock", -"easy", -"fun_country", -"todays", -"funrock", -"hard", -"laid_back", -"modern", "rock", -"soundtracks", -"garage", "upbeat", } From fa6db3df33e4e182eca6b094f9aa22d460429b8b Mon Sep 17 00:00:00 2001 From: John Wieland Date: Mon, 6 May 2024 13:52:15 -0400 Subject: [PATCH 08/12] Create Edge v2.10 Itunes script for version 2.10 not compatible with lower versions --- Grayscale Radios/Edge v2.10 | 253 ++++++++++++++++++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 Grayscale Radios/Edge v2.10 diff --git a/Grayscale Radios/Edge v2.10 b/Grayscale Radios/Edge v2.10 new file mode 100644 index 0000000..38a765d --- /dev/null +++ b/Grayscale Radios/Edge v2.10 @@ -0,0 +1,253 @@ +--[[ ######################################################################### + # TaraniTunes v.4.1 # + # B&W Radios # + # License GPLv3: http://www.gnu.org/licenses/gpl-3.0.html # + # # + # This program is free software; you can redistribute it and/or modify # + # it under the terms of the GNU General Public License version 3 as # + # published by the Free Software Foundation. # + # # + # This program is distributed in the hope that it will be useful # + # but WITHOUT ANY WARRANTY; without even the implied warranty of # + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # + # GNU General Public License for more details. # + #########################################################################--]] + +--Locals +local playingSong = 1 +local errorOccured = false +local ver = getVersion() --EdgeTX Version +loadScript("/SOUNDS/lists/bubba_mix/playlist.lua")() --1st playlist in songList (see sample list below) + +--Playlists folders names i.e. /SONGS/lists/"foldername" below are sample names +local songList= +{"bubba_mix", +"rock", +"upbeat", +} + +-- Initiate Program +local function init() + model.setGlobalVariable(7,0,1) + model.setGlobalVariable(8,0,1) + shPresent =getValue("sh") + if shPresent== 0 then + sw1=180 + elseif LCD_W==212 then + sw1=160 + else + sw1=180 + end + model.setCustomFunction(62,{switch = sw1,func = FUNC_BACKGND_MUSIC,name = playlist[1][2],active=1})--resets playing song on to the 1st song on startup + return tunes +end + +-- error Control functions +local function error(strings) + errorStrings = strings + errorOccured = true +end + +--BackGround +local function background(tunes) +if model.getTimer(2).value >= long then + if playingSong == #playlist then + model.setGlobalVariable(7,0,1) + playingSong = model.getGlobalVariable(7,0) + flushAudio() + model.setCustomFunction(62,{switch = sw1,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1}) + model.setTimer(2,{value=0}) + else + flushAudio() + playingSong = playingSong +1 + model.setGlobalVariable(7,0,playingSong) + model.setCustomFunction(62,{switch = sw1,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1}) + model.setTimer(2,{value=0}) + end + end +end + +local function run(tunes) +--Update Locals + lcd.clear() + local selection=playingSong + local long=playlist[playingSong][3] --do not change this value it is the length of the current song playing + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local batt = getValue("tx-voltage") + local datenow = getDateTime() + local timemins = (string.format("%02d",datenow.min)) + local fly=model.getTimer(1).value --flight duration timer: 0=timer1, 1=timer2 + local altN=getValue("Alt")--current altitude from telementry + local altM=getValue("Alt+")--max altitude from telementry + local shPresent =getValue("sh") + + -- LS60 Switch Number controled by Radio profile + if shPresent== 0 then + sw1=180 + elseif LCD_W==212 then + sw1=160 + else + sw1=180 + end + +--Math + function round(num, decimals) + local mult = 10^(decimals or 0) + return math.floor(num * mult + .5) / mult + end + +--Current time, OpenTX Version & Model Name + lcd.drawText(1,10,datenow.hour12..":"..timemins..datenow.suffix,SMLSIZE) + lcd.drawText(1,2,"OTX "..ver,SMLSIZE) + if LCD_W == 212 then + lcd.drawText(LCD_W/2-(string.len(model.getInfo().name)/2)*6,2,model.getInfo().name) + else + lcd.drawText(LCD_W/2-(string.len(model.getInfo().name)/2)*5,13,model.getInfo().name) + end + + --Transmitter battery + lcd.drawText(14, 18,"TX "..round(batt,1).."v",PREC1+SMLSIZE) + + -- Altitude + lcd.drawText(1, 26,"Alt= "..round(altN,2).."/"..round(altM,2),SMLSIZE) + +--Flight Time + lcd.drawTimer(LCD_W-32, 20, fly, MIDSIZE) + +--rssi + lcd.drawText(LCD_W-51,1,"RSSI "..getValue("RSSI").."/"..getValue("RSSI-")) + +--Cell Voltage + lcd.drawChannel(LCD_W-(string.len("LCEL"))*6, 11,"LCEL", PREC2) --displays a custom telementry sensor (lowest cell)calculated from "cels" sensor + +--Music Display + local y = 23; +--Playlist title + lcd.drawLine(0, y+10, LCD_W, y+10,SOLID,FORCE) + lcd.drawText(LCD_W/2-(string.len(title))/2*5, y+12, title, SMLSIZE) + +-- Progressbar + local k = math.floor((upTime/long)*33)*10 + lcd.drawLine(0, y+18, LCD_W, y+18,SOLID,FORCE) + lcd.drawFilledRectangle(20, y+11, math.floor((upTime/long)*(LCD_W-43)), 7) + lcd.drawTimer(1, y+12, upTime, SMLSIZE+INVERS) + lcd.drawTimer(LCD_W-22, y+12, long, SMLSIZE+INVERS) + +--Song display + if selection == #playlist then + lcd.drawText(6, y+19, playlist[selection - 1][1],SMLSIZE) + lcd.drawText(1, y+26, string.char(126) .. playlist[selection][1],SMLSIZE) + lcd.drawText(6, y+33, playlist[1][1],SMLSIZE) + else + if selection == 1 then + lcd.drawText(6, y+19, playlist[#playlist][1],SMLSIZE) + lcd.drawText(1, y+26, string.char(126) .. playlist[selection][1],SMLSIZE) + lcd.drawText(6, y+33, playlist[selection + 1][1],SMLSIZE) + else + lcd.drawText(6, y+19, playlist[selection - 1][1],SMLSIZE) + lcd.drawText(1, y+26, string.char(126) .. playlist[selection][1], SMLSIZE) + lcd.drawText(6, y+33, playlist[selection + 1][1],SMLSIZE) + end + end + +-- Music Controls + listP = getValue("ls63") + listN = getValue("ls64") + prevS = getValue("ls61") + nextS = getValue("ls62") + +--song over + if model.getTimer(2).value >= long then + if playingSong == #playlist then + model.setGlobalVariable(7,0,1) + playingSong = model.getGlobalVariable(7,0) + flushAudio() + model.setCustomFunction(62,{switch = sw1,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1}) + model.setTimer(2,{value=0}) + else + flushAudio() + playingSong = playingSong +1 + model.setGlobalVariable(7,0,playingSong) + model.setCustomFunction(62,{switch = sw1,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1}) + model.setTimer(2,{value=0}) + end + end + +-- Next song + if nextS > -1 then + if not nextSongSwitchPressed then + if playingSong == #playlist then + model.setGlobalVariable(7,0,1) + playingSong = model.getGlobalVariable(7,0) + else + playingSong = model.getGlobalVariable(7,0) + end + flushAudio() + model.setCustomFunction(62,{switch = sw1,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1}) + model.setTimer(2,{value=0}) + else + nextSongSwitchPressed = false + end + end + +--Change Previous Playlist + if listP > -1 then + if not prevListSwitchPressed then + if model.getGlobalVariable(8,0)<= 0 then + model.setGlobalVariable(8,0,#songList) + set2 = songList[model.getGlobalVariable(8,0)] + playingSong = 1 + else + set2 = songList[model.getGlobalVariable(8,0)] + playingSong = 1 + end + loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() + model.setCustomFunction(62,{switch = sw1,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1}) + model.setGlobalVariable(7,0,1) + flushAudio() + model.setTimer(2,{value=0}) + else + prevListSwitchPressed = false + end + end + +--Change next Playlist + if listN > -1 then + if not nextListSwitchPressed then + if model.getGlobalVariable(8,0) >= #songList then + set2 = songList[1] + model.setGlobalVariable(8,0,1) + playingSong = 1 + else + set2 = songList[model.getGlobalVariable(8,0)] + playingSong = 1 + end + loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() + model.setCustomFunction(62,{62,{switch = sw1,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1}) + model.setGlobalVariable(7,0,1) + flushAudio() + model.setTimer(2,{value=0}) + else + nextListSwitchPressed = false + end + end + +-- previous song + if prevS > -1 then + if not prevSongSwitchPressed then + if playingSong == 1 then + model.setGlobalVariable(7,0,#playlist) + playingSong = model.getGlobalVariable(7,0) + else + playingSong = model.getGlobalVariable(7,0) + end + flushAudio() + model.setCustomFunction(62,{switch = sw1,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1}) + model.setTimer(2,{value=0}) + end + else + prevSongSwitchPressed = false + end +end + +return {run = run, background = background, init = init} From ce8db8010eaffb774be32461f2774626e501909c Mon Sep 17 00:00:00 2001 From: John Wieland Date: Mon, 6 May 2024 13:53:56 -0400 Subject: [PATCH 09/12] Rename Edge v2.10 to Itunesv210.lua --- Grayscale Radios/{Edge v2.10 => Itunesv210.lua} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Grayscale Radios/{Edge v2.10 => Itunesv210.lua} (100%) diff --git a/Grayscale Radios/Edge v2.10 b/Grayscale Radios/Itunesv210.lua similarity index 100% rename from Grayscale Radios/Edge v2.10 rename to Grayscale Radios/Itunesv210.lua From 4fbafe91798a4e2e4921e6783363b3dec9023326 Mon Sep 17 00:00:00 2001 From: John Wieland Date: Mon, 6 May 2024 13:54:48 -0400 Subject: [PATCH 10/12] iTunes-v210.lua --- Grayscale Radios/{Itunesv210.lua => iTunes-v210.lua} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Grayscale Radios/{Itunesv210.lua => iTunes-v210.lua} (100%) diff --git a/Grayscale Radios/Itunesv210.lua b/Grayscale Radios/iTunes-v210.lua similarity index 100% rename from Grayscale Radios/Itunesv210.lua rename to Grayscale Radios/iTunes-v210.lua From 8033472caf0f7bb9a52e2504a98e89f3d26e6ec7 Mon Sep 17 00:00:00 2001 From: John Wieland Date: Mon, 6 May 2024 15:05:23 -0400 Subject: [PATCH 11/12] Set 2.9 as Active version Until v2.10 is stable set the current version to EdgeTX v2.9 Compatibility to 2.10 is commented in the file --- Color Screen Widget/EdgeTX/main.lua | 472 ++++++++++++++++++++++++++++ 1 file changed, 472 insertions(+) diff --git a/Color Screen Widget/EdgeTX/main.lua b/Color Screen Widget/EdgeTX/main.lua index bad82cb..54421e6 100644 --- a/Color Screen Widget/EdgeTX/main.lua +++ b/Color Screen Widget/EdgeTX/main.lua @@ -30,6 +30,478 @@ local songList= local options = { } +--[[ +Custom Function Switch numbers based on Edge Version Installed + Edge 2.8 switch = 132,func = 16,name = playlist[playingSong][2] + Edge 2.9 switch = 144,func = 16,name = playlist[playingSong][2] + Edge 2.10 switch = 228,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1 +Change the song Controls below at the refresh section +]]-- + +-- Create Zones +local function create(zone, options) + local tunes = { zone=zone, options=options} + model.setGlobalVariable(7,0,1) + model.setGlobalVariable(8,0,1) + model.setCustomFunction(62,{switch = 144,func = 16,name = playlist[playingSong][2]})--resets playing song on to the 1st song on startup + aircraft = Bitmap.open("/IMAGES/" .. model.getInfo().bitmap) + return tunes +end + +-- Update zones and options +local function update(tunes, options) +tunes.options = options +end + +-- BackGround +local function background(tunes) + local long=playlist[playingSong][3] + if model.getTimer(2).value >= long then + if playingSong == #playlist then + model.setGlobalVariable(7,0,1) + playingSong = model.getGlobalVariable(7,0) + flushAudio() + model.setCustomFunction(62,{switch = 144,func = 16,name = playlist[playingSong][2]}) + model.setTimer(2,{value=0}) + else + flushAudio() + playingSong = playingSong +1 + model.setGlobalVariable(7,0,playingSong) + model.setCustomFunction(62,{switch = 144,func = 16,name = playlist[playingSong][2]}) + model.setTimer(2,{value=0}) + end + end +end + +-- Following is the various widgets zones from top bar to full screen (make changes as desired) + +-- Zone: Top Bar Widget Only +local function refreshZoneTiny(tunes) + local selection=playingSong + lcd.drawText(tunes.zone.x, tunes.zone.y,songList[1], SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+15,"> ".. playlist[selection][2],SMLSIZE) +end + +-- Zone size: 160x32 1/8th +local function refreshZoneSmall(tunes) + local selection=playingSong + lcd.drawText(tunes.zone.x, tunes.zone.y+2,title, SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+17, playlist[selection][1], INVERS+SMLSIZE) +end + +-- Zone size: 180x70 1/4th (with sliders/trim) +-- Zone size: 225x98 1/4th (no sliders/trim) +local function refreshZoneMedium(tunes) + local upTime=model.getTimer(2).value--do not change this value it is how long the current song has played + local long=playlist[playingSong][3] + local k = math.floor((upTime/long)*12)*10 + lcd.drawTimer(tunes.zone.x,tunes.zone.y, upTime, SMLSIZE+INVERS) + lcd.drawTimer(tunes.zone.x+145,tunes.zone.y, long, SMLSIZE+INVERS) + lcd.setColor(CUSTOM_COLOR,lcd.RGB(0,100,0)) + lcd.drawFilledRectangle(tunes.zone.x+35,tunes.zone.y+2,k,8,CUSTOM_COLOR) + local selection=playingSong + lcd.drawText(tunes.zone.x, tunes.zone.y+16,"Playing > ".. title, SMLSIZE) + if selection == #playlist then + lcd.drawText(tunes.zone.x, tunes.zone.y+30, playlist[selection - 2][1],SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+45, playlist[selection - 1][1],SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+60, string.char(126) .. playlist[selection][1],INVERS+SMLSIZE) + else + if selection == 1 then + lcd.drawText(tunes.zone.x, tunes.zone.y+30, string.char(126) .. playlist[selection][1],INVERS+SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+45, playlist[selection + 1][1],SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+60, playlist[selection + 2][1],SMLSIZE) + else + lcd.drawText(tunes.zone.x, tunes.zone.y+30, playlist[selection - 1][1],SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+45, string.char(126) .. playlist[selection][1], INVERS+SMLSIZE) + lcd.drawText(tunes.zone.x, tunes.zone.y+60, playlist[selection + 1][1],SMLSIZE) + end + end +end + +-- Zone size: 192x152 1/2 +local function refreshZoneLarge(tunes) + lcd.drawText(tunes.zone.x+2, tunes.zone.y," iTunes Music", MIDSIZE) + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local long=playlist[playingSong][3] + local k = math.floor((upTime/long)*12)*10 + lcd.drawTimer(tunes.zone.x,tunes.zone.y+40, upTime, SMLSIZE+INVERS) + lcd.drawTimer(tunes.zone.x+160,tunes.zone.y+40, long, SMLSIZE+INVERS) + lcd.setColor(CUSTOM_COLOR,lcd.RGB(0,100,0)) + lcd.drawFilledRectangle(tunes.zone.x+35,tunes.zone.y+40,k,18,CUSTOM_COLOR) + local selection=playingSong + lcd.drawText(tunes.zone.x, tunes.zone.y+60,"Playing > ".. title, SMLSIZE) + if selection == #playlist then + lcd.drawText(tunes.zone.x, tunes.zone.y+85, playlist[selection - 2][1]) + lcd.drawText(tunes.zone.x, tunes.zone.y+105, playlist[selection - 1][1]) + lcd.drawText(tunes.zone.x, tunes.zone.y+125, string.char(126) .. playlist[selection][1],INVERS) + else + if selection == 1 then + lcd.drawText(tunes.zone.x, tunes.zone.y+85, string.char(126) .. playlist[selection][1],INVERS) + lcd.drawText(tunes.zone.x, tunes.zone.y+105, playlist[selection + 1][1]) + lcd.drawText(tunes.zone.x, tunes.zone.y+125, playlist[selection + 2][1]) + else + lcd.drawText(tunes.zone.x, tunes.zone.y+85, playlist[selection - 1][1]) + lcd.drawText(tunes.zone.x, tunes.zone.y+105, string.char(126) .. playlist[selection][1],INVERS) + lcd.drawText(tunes.zone.x, tunes.zone.y+125, playlist[selection + 1][1]) + end + end +end + +-- Zone size: 390x172 1/1 (with sliders and trims) +local function refreshZoneXLarge(tunes) + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local long=playlist[playingSong][3] + function round(num, decimals) + local mult = 10^(decimals or 0) + return math.floor(num * mult + .5) / mult + end + +-- Current Model Information + lcd.drawText(150,60, model.getInfo().name, MIDSIZE) --adjust for right look + lcd.drawBitmap(aircraft,180,70,75) --adjust location and % for right look + +-- Transmitter battery + local batt = getValue("tx-voltage") + lcd.drawText(40, 51,"TX Batt "..round(batt,1).."v") + +-- Flight Time + local fly=model.getTimer(1).value --flight duration timer: 0=timer1, 1=timer2 + lcd.drawText(355, 51, "Flight Time") + lcd.drawTimer(380, 72, fly, 2) + + -- Flight Battery Loaded + -- I use different capacity batteries the timers are adjusted using SF depending on the battery I'm flying + lcd.drawFilledRectangle(40,73,100,2) + local battsw = getValue('se') + lcd.drawText(40, 90, "Flight Battery",SMLSIZE) + lcd.drawFilledRectangle(40,105,100,2) + if battsw == -1024 then + lcd.drawText(90,75,"SHORT 4.2",SMLSIZE) + lcd.drawSwitch(60,75,13) + else + if battsw == 0 then + lcd.drawSwitch(40,75,14) + lcd.drawText(90,75,"REG 4.2", SMLSIZE) + else + lcd.drawSwitch(60,75,15) + lcd.drawText(90,75,"4.35", SMLSIZE) + end + end + +-- Cell Voltage + lcd.drawFilledRectangle(365,96,78,2) + lcd.drawText(370, 98, "Lipo") + lcd.drawChannel(380, 119,"Cel", PREC2+INVERS) + +-- Altitude from Altimeter ("Alt") or GPS Sensor ("GAlt") + lcd.drawText(40,110,"HEIGHT= ", SMLSIZE) + lcd.drawChannel(100,110,"GAlt",SMLSIZE) + lcd.drawText(42, 125,"Max", SMLSIZE) + lcd.drawChannel(82,125,"GAlt+",2+SMLSIZE) + +-- Tementry separator bar + local y = 160 + lcd.drawFilledRectangle(40,y-18,400,6,GREY_DEFAULT) + +-- Music Progress bar + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local k = math.floor((upTime/long)*33)*10 + lcd.drawTimer(44, y-10, upTime, SMLSIZE+INVERS) + lcd.drawTimer(400,y-10, long, SMLSIZE+INVERS) + lcd.setColor(CUSTOM_COLOR,lcd.RGB(0,100,0)) + lcd.drawFilledRectangle(80,y-10,k,18,CUSTOM_COLOR) + +-- Music Dispay + local selection=playingSong + lcd.drawText(90, y+5, "Selected Playlist >>",SMLSIZE) + lcd.drawText(220, y+5, title, SMLSIZE) + if selection == #playlist then + lcd.drawText(40, y+20, playlist[selection - 2][1]) + lcd.drawText(40, y+38, playlist[selection - 1][1]) + lcd.drawText(40, y+56, string.char(126) .. playlist[selection][1],INVERS) + else + if selection == 1 then + lcd.drawText(40, y+20, string.char(126) .. playlist[selection][1],INVERS) + lcd.drawText(40, y+38, playlist[selection + 1][1]) + lcd.drawText(40, y+56, playlist[selection + 2][1]) + else + lcd.drawText(40, y+20, playlist[selection - 1][1]) + lcd.drawText(40, y+38, string.char(126) .. playlist[selection][1], INVERS) + lcd.drawText(40, y+56, playlist[selection + 1][1]) + end + end +end + +-- Zone size: 460x252 1/1 (no sliders/trim/topbar) +local function refreshZoneFull(tunes) + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local long=playlist[playingSong][3] + + function round(num, decimals) + local mult = 10^(decimals or 0) + return math.floor(num * mult + .5) / mult + end + +--Current time, EdgeTX Version & Model Information + local datenow = getDateTime() + local timemins = (string.format("%02d",datenow.min)) + lcd.drawText(63,24,"Time "..datenow.hour12..":"..timemins.." "..datenow.suffix) + local ver = getVersion() --EdgeTX Version + lcd.drawBitmap(elogo,3,0,53) + lcd.drawText(63,4,"V. "..ver) + lcd.drawText(185,5, model.getInfo().name,DBLSIZE) --adjust as needed + lcd.drawBitmap(aircraft,170,45,90) --adjust as needed + +--Transmitter battery + local batt = getValue("tx-voltage") + lcd.drawText(8, 50,"TX Batt "..round(batt,1).."v") + + --Receiver Voltage battery + lcd.drawText(100, 50,"RX Batt ") + lcd.drawChannel(160,50,"RxBt") + + -- Flight Battery Loaded + --I use different capacity batteries, the timers are adjusted using SF depending on the battery capactity + lcd.drawFilledRectangle(8,73,130,2) + lcd.drawText(10, 95, "Battery Loaded") + lcd.drawFilledRectangle(8,116,130,2) + local battsw = getValue('se') + if battsw == -1024 then + lcd.drawText(65,75,"SHORT 4.2", INVERS) --older Battery + lcd.drawSwitch(30,75,13)else + if battsw == 0 then + lcd.drawSwitch(30,75,14) + lcd.drawText(65,75,"REG 4.2", INVERS) else + lcd.drawSwitch(30,75,15) + lcd.drawText(65,75,"HV 4.35", INVERS) + end + end + +-- Separators + lcd.drawFilledRectangle(341,60,125,2) + lcd.drawFilledRectangle(341,105,125,2) + +-- Flight Mode +-- local fmno, fmname = getFlightMode() +-- if fmname == "" then +-- fmname = "FM".. fmno +-- lcd.drawText(410, 63, fmname)else +-- lcd.drawText(410, 63, "FM"..fmno) +-- lcd.drawText(380,83, fmname) +-- end + +-- Speed + lcd.drawText(355,63,"Speed= ") + lcd.drawChannel(420,63,"GSpd") + lcd.drawText(341,83,"Top Spd= ") + lcd.drawChannel(420,83,"GSpd+",2) + +-- Flight Time + local fly=model.getTimer(1).value --flight duration timer: 0=timer1, 1=timer2 + lcd.drawText(384, 4, "Flight Time") + lcd.drawTimer(380, 28, fly, DBLSIZE+PREC2) + +-- Cell Voltage + lcd.drawText(387, 104, "Lipo",MIDSIZE) + lcd.drawChannel(370, 130,"Cels", DBLSIZE+PREC2+INVERS) + +-- RSSI + lcd.drawText(8,122,"RSSI Sig ") + lcd.drawChannel(80,122,"RSSI") + lcd.drawText(123,122," //MIN ") + lcd.drawChannel(170,122,"RSSI-") + +-- Altitude + lcd.drawText(8,143,"HEIGHT= ") + lcd.drawChannel(80,143,"GAlt") + lcd.drawText(130, 143,"//Max") + lcd.drawChannel(185,143,"GAlt+",2) + +-- GPS + lcd.drawText(320,232,"GPS Location") + lcd.drawChannel(285,250,"GPS") + +-- Tementry Separator Bar + local y = 185 + lcd.drawFilledRectangle(6,y-18,462,6,GREY_DEFAULT) + +-- Music Progressbar + local upTime=model.getTimer(2).value --do not change this value it is how long the current song has played + local k = math.floor((upTime/long)*40)*10 + lcd.drawTimer(7, y-10, upTime, SMLSIZE+INVERS) + lcd.drawTimer(434,y-10, long, SMLSIZE+INVERS) + lcd.setColor(CUSTOM_COLOR,lcd.RGB(0,100,0)) + lcd.drawFilledRectangle(44,y-10,k,18,CUSTOM_COLOR) + +-- Musci Display + local selection=playingSong + lcd.drawText(90, y+4, "Selected Playlist >>".. title, SMLSIZE) + if selection == #playlist then + lcd.drawText(12, y+20, playlist[selection - 2][1]) + lcd.drawText(12, y+40, playlist[selection - 1][1]) + lcd.drawText(12, y+60, string.char(126) .. playlist[selection][1],INVERS) + else + if selection == 1 then + lcd.drawText(12, y+20, string.char(126) .. playlist[selection][1],INVERS) + lcd.drawText(12, y+40, playlist[selection + 1][1]) + lcd.drawText(12, y+60, playlist[selection + 2][1]) + else + lcd.drawText(12, y+20, playlist[selection - 1][1]) + lcd.drawText(12, y+40, string.char(126) .. playlist[selection][1], INVERS) + lcd.drawText(12, y+60, playlist[selection + 1][1]) + end + end +end + +function refresh(tunes) +--[[ + Custom Function Switch numbers based on Edge Version Installed + Edge 2.8 switch = 132,func = 16,name = playlist[playingSong][2] + Edge 2.9 switch = 144,func = 16,name = playlist[playingSong][2] + Edge 2.10 switch = 228,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1 + ]]-- + +listP = getValue("ls63") +listN = getValue("ls64") +prevS = getValue("ls61") +nextS = getValue("ls62") + +-- Song Over + local long=playlist[playingSong][3] + if model.getTimer(2).value >= long then + if playingSong == #playlist then + model.setGlobalVariable(7,0,1) + playingSong = model.getGlobalVariable(7,0) + flushAudio() + model.setCustomFunction(62,{switch = 144,func = 16,name = playlist[playingSong][2]}) + model.setTimer(2,{value=0}) + else + flushAudio() + playingSong = playingSong +1 + model.setGlobalVariable(7,0,playingSong) + model.setCustomFunction(62,{switch = 144,func = 16,name = playlist[playingSong][2]}) + model.setTimer(2,{value=0}) + end + end + +-- Next song + if nextS > -1 then + if not nextSongSwitchPressed then + if playingSong == #playlist then + model.setGlobalVariable(7,0,1) + playingSong = model.getGlobalVariable(7,0) + else + playingSong = model.getGlobalVariable(7,0) + end + flushAudio() + model.setCustomFunction(62,{switch = 144,func = 16,name = playlist[playingSong][2]}) + model.setTimer(2,{value=0}) + else + nextSongSwitchPressed = false + end + end + +-- Change Previous Playlist + if listP > -1 then + if not prevListSwitchPressed then + if model.getGlobalVariable(8,0)<= 0 then + model.setGlobalVariable(8,0,#songList) + set2 = songList[model.getGlobalVariable(8,0)] + playingSong = 1 + else + set2 = songList[model.getGlobalVariable(8,0)] + playingSong = 1 + end + loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() + model.setCustomFunction(62,{switch = 144,func = 16,name = playlist[playingSong][2]}) + model.setGlobalVariable(7,0,1) + flushAudio() + model.setTimer(2,{value=0}) + else + prevListSwitchPressed = false + end + end + +-- Change next Playlist + if listN > -1 then + if not nextListSwitchPressed then + if model.getGlobalVariable(8,0) > #songList then + set2 = songList[1] + model.setGlobalVariable(8,0,1) + playingSong = 1 + else + set2 = songList[model.getGlobalVariable(8,0)] + playingSong = 1 + end + loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() + model.setCustomFunction(62,{switch = 144,func = 16,name = playlist[playingSong][2]}) + model.setGlobalVariable(7,0,1) + flushAudio() + model.setTimer(2,{value=0}) + else + nextListSwitchPressed = false + end + end + +-- previous song + if prevS > -1 then + if not prevSongSwitchPressed then + if playingSong == 1 then + model.setGlobalVariable(7,0,#playlist) + playingSong = model.getGlobalVariable(7,0) + else + playingSong = model.getGlobalVariable(7,0) + end + flushAudio() + model.setCustomFunction(62,{switch = 144,func = 16,name = playlist[playingSong][2]}) + model.setTimer(2,{value=0}) + end + else + prevSongSwitchPressed = false + end + +-- Widget Display by Size + if tunes.zone.w > 450 and tunes.zone.h > 240 then refreshZoneFull(tunes) + elseif tunes.zone.w > 200 and tunes.zone.h > 165 then refreshZoneXLarge(tunes) + elseif tunes.zone.w > 180 and tunes.zone.h > 145 then refreshZoneLarge(tunes) + elseif tunes.zone.w > 170 and tunes.zone.h > 65 then refreshZoneMedium(tunes) + elseif tunes.zone.w > 150 and tunes.zone.h > 28 then refreshZoneSmall(tunes) + elseif tunes.zone.w > 65 and tunes.zone.h > 35 then refreshZoneTiny(tunes) + end +end + +return { name="iTunes", options=options, create=create, update=update, refresh=refresh, background=background }---- ######################################################################### +-----# TaraniTunes v.4.4 # +---- # License GPLv3: http://www.gnu.org/licenses/gpl-3.0.html # +---- # # +---- # This program is free software; you can redistribute it and/or modify # +---- # it under the terms of the GNU General Public License version 3 as # +---- # published by the Free Software Foundation. # +---- # # +---- # This program is distributed in the hope that it will be useful # +---- # but WITHOUT ANY WARRANTY; without even the implied warranty of # +---- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +---- # GNU General Public License for more details. # +---- # # +---- ######################################################################### + +-- Locals +local playingSong = 1 +local errorOccured = false +elogo = Bitmap.open("/THEMES/edge.png") +loadScript("/SOUNDS/lists/bubba_mix/playlist.lua")() --1st playlist in songList (see sample list below) + +-- Playlists folders names i.e. /SONGS/lists/"foldername" below are sample names +local songList= +{"bubba_mix", +"rock", +"garage", +} + +--Options +local options = { +} + --[[ Custom Function Switch numbers based on Edge Version Installed Edge 2.8 switch = 132 From 64c0778b85bc6690c6008463d6d5860a2d312b33 Mon Sep 17 00:00:00 2001 From: John Wieland Date: Mon, 6 May 2024 15:10:32 -0400 Subject: [PATCH 12/12] v.2.9 active version --- .../EdgeTX/Dark Theme/main.lua | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/Color Screen Widget/EdgeTX/Dark Theme/main.lua b/Color Screen Widget/EdgeTX/Dark Theme/main.lua index 00940c8..f5347e0 100644 --- a/Color Screen Widget/EdgeTX/Dark Theme/main.lua +++ b/Color Screen Widget/EdgeTX/Dark Theme/main.lua @@ -29,13 +29,19 @@ local songList= --Options local options = { } - +--[[ +Custom Function Switch numbers based on Edge Version Installed + Edge 2.8 switch = 132,func = 16,name = playlist[playingSong][2] + Edge 2.9 switch = 144,func = 16,name = playlist[playingSong][2] + Edge 2.10 switch = 228,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1 +Change the song Controls below at the refresh section +]]-- -- create zones local function create(zone, options) local tunes = { zone=zone, options=options} model.setGlobalVariable(7,0,1) model.setGlobalVariable(8,0,1) - model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1})--resets playing song on to the 1st song on startup + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2]})--resets playing song on to the 1st song on startup aircraft = Bitmap.open("/IMAGES/" .. model.getInfo().bitmap) return tunes end @@ -59,13 +65,13 @@ local function background(tunes) model.setGlobalVariable(7,0,1) playingSong = model.getGlobalVariable(7,0) flushAudio() - model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2]}) model.setTimer(2,{value=0}) else flushAudio() playingSong = playingSong +1 model.setGlobalVariable(7,0,playingSong) - model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2]}) model.setTimer(2,{value=0}) end end @@ -355,9 +361,13 @@ end function refresh(tunes) --SF commands for songs to play based on Version Installed --- Edge 2.8 switch = 132,func=16 --- Edge 2.9 switch = 144, func=16 --- Edge 2.10 switch = 228,func=FUNC_BACKGND_MUSIC +--[[ +Custom Function Switch numbers based on Edge Version Installed + Edge 2.8 switch = 132,func = 16,name = playlist[playingSong][2] + Edge 2.9 switch = 144,func = 16,name = playlist[playingSong][2] + Edge 2.10 switch = 228,func = FUNC_BACKGND_MUSIC,name = playlist[playingSong][2],active=1 +Change the song Controls below at the refresh section +]]-- listP = getValue("ls63") listN = getValue("ls64") @@ -371,13 +381,13 @@ function refresh(tunes) model.setGlobalVariable(7,0,1) playingSong = model.getGlobalVariable(7,0) flushAudio() - model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2]}) model.setTimer(2,{value=0}) else flushAudio() playingSong = playingSong +1 model.setGlobalVariable(7,0,playingSong) - model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2]}) model.setTimer(2,{value=0}) end @@ -392,7 +402,7 @@ function refresh(tunes) playingSong = model.getGlobalVariable(7,0) end flushAudio() - model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2]}) model.setTimer(2,{value=0}) else nextSongSwitchPressed = false @@ -411,7 +421,7 @@ function refresh(tunes) playingSong = 1 end loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() - model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2]}) model.setGlobalVariable(7,0,1) flushAudio() model.setTimer(2,{value=0}) @@ -433,7 +443,7 @@ function refresh(tunes) end loadScript("/SOUNDS/lists/"..set2.."/playlist.lua")() - model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2]}) model.setGlobalVariable(7,0,1) flushAudio() model.setTimer(2,{value=0}) @@ -451,7 +461,7 @@ function refresh(tunes) playingSong = model.getGlobalVariable(7,0) end flushAudio() - model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2],active=1}) + model.setCustomFunction(62,{switch = 144, func=16,name=playlist[playingSong][2]}) model.setTimer(2,{value=0}) end else