forked from len0rd/rockbox
lua -- temp loader
fix a few bugs, improve memory usage Change-Id: I6ceefd033000a6178eab0dd513679b5d72cec81c
This commit is contained in:
parent
15ad1c42db
commit
adff45ca21
7 changed files with 233 additions and 99 deletions
|
@ -1,19 +1,51 @@
|
|||
--[[
|
||||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2021 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
]]
|
||||
--menu core settings loaded from rockbox user settings
|
||||
--Bilgus 4/2021
|
||||
|
||||
local function get_core_settings()
|
||||
local tmploader = require("temploader")
|
||||
-- rbsettings is a large module to have sitting in RAM
|
||||
-- if user already has it in RAM then use that
|
||||
local rbs_is_loaded = (package.loaded.rbsettings ~= nil)
|
||||
local s_is_loaded = (package.loaded.settings ~= nil)
|
||||
local rbold = rb
|
||||
|
||||
require("rbsettings")
|
||||
require("settings")
|
||||
rb.metadata = nil -- remove track metadata settings
|
||||
if not rbs_is_loaded then
|
||||
--replace the rb table so we can keep the defines out of the namespace
|
||||
rb = { global_settings = rb.global_settings,
|
||||
global_status = rb.global_status}
|
||||
end
|
||||
|
||||
tmploader("rbsettings")
|
||||
tmploader("settings")
|
||||
|
||||
local rb_settings = rb.settings.dump('global_settings', "system")
|
||||
local color_table = {}
|
||||
local talk_table = {}
|
||||
local list_settings_table = {}
|
||||
local list_settings = "cursor_style|show_icons|statusbar|scrollbar|scrollbar_width|list_separator_height|backdrop_file|"
|
||||
|
||||
for key, value in pairs(rb_settings) do
|
||||
key = key or ""
|
||||
if (key:find("color")) then
|
||||
|
@ -27,15 +59,9 @@ local function get_core_settings()
|
|||
|
||||
if not s_is_loaded then
|
||||
rb.settings = nil
|
||||
package.loaded.settings = nil
|
||||
end
|
||||
|
||||
if not rbs_is_loaded then
|
||||
rb.system = nil
|
||||
rb.metadata = nil
|
||||
package.loaded.rbsettings = nil
|
||||
end
|
||||
|
||||
rb = rbold
|
||||
rb.core_color_table = color_table
|
||||
rb.core_talk_table = talk_table
|
||||
rb.core_list_settings_table = list_settings_table
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue