Something went wrong. Try again.
A modern, network-enabled music player platform built on Rockbox technology. rockboxd.tsiry-sandratraina.com
rust deno navidrome airplay libadwaita zig mpris snapcast mpd rockbox audio subsonic
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980--[[ Lua RB Playlist Operations/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * * Copyright (C) 2018 William Wilgus * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/]]
-- [[ conversion to old style playlist_ functions ]]if not rb.playlist then rb.splash(rb.HZ, "No Support!") return nil end
rb.playlist_amount = function() return rb.playlist("amount") endrb.playlist_add = function (filename) return rb.playlist("insert_track", filename, rb.PLAYLIST_INSERT_LAST, false, true) endrb.playlist_create = function(dir, filename) return rb.playlist("create", dir, filename) endrb.playlist_start = function(index, elapsed, offset) rb.playlist("start", index, elapsed, offset) endrb.playlist_resume_track = function(index, crc, elapsed, offset) rb.playlist("resume_track", index, crc, elapsed, offset) endrb.playlist_resume = function() return rb.playlist("resume") endrb.playlist_shuffle = function(random_seed, index) rb.playlist("shuffle", random_seed, index) endrb.playlist_sync = function () rb.playlist("sync") endrb.playlist_remove_all_tracks = function() return rb.playlist("remove_all_tracks") endrb.playlist_insert_track = function(filename, pos, bqueue, bsync) return rb.playlist("insert_track", filename, pos, bqueue, bsync) endrb.playlist_insert_directory = function(dir, pos, bqueue, brecurse) return rb.playlist("insert_directory", dir, pos, bqueue, brecurse) endrb.playlist_tracks = function(dir, filename) local tracks = {} local count = 0 local fullpath = dir .. "/" .. filename local file = io.open('/' .. fullpath, "r")
if not file then rb.splash(rb.HZ, "Error opening /" .. fullpath) return tracks end
-- strip BOM --"\xEF\xBB\xBF" local bom = file:read(3) if not string.find(bom, "\239\187\191") then file:seek("set", 0) end
for line in file:lines() do if string.len(line) > 3 and (not string.find(line, "%s*#.*")) then count = count + 1 tracks[count] = line end end file:close() return tracks end