Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fw

custom
ailurux 3 months ago
commit 5e3cfc8f3d
  1. 2
      lib/libtags/id3v2.c
  2. 1
      lib/libtags/tags.h
  3. 1
      lib/libtags/vorbis.c
  4. 1
      lua/browser.lua
  5. 1
      lua/file_browser.lua
  6. 8
      lua/widgets.lua
  7. 6
      src/drivers/nvs.cpp
  8. 2
      src/tangara/database/tag_parser.cpp

@ -68,6 +68,8 @@ v2cb(Tagctx *ctx, char *k, char *v)
return 0;
}else if(strcmp(k-1, "COM") == 0 || strcmp(k-1, "COMM") == 0){
txtcb(ctx, Tcomment, k-1, v);
}else if(strcmp(k, "POS") == 0){
txtcb(ctx, Tdisc, k-1, v);
}else if(strcmp(k, "XXX") == 0){
k = v;
v += strlen(v) + 1;

@ -16,6 +16,7 @@ enum
Ttitle,
Tdate, /* "2014", "2015/02/01", but the year goes first */
Ttrack, /* "1", "01", "1/4", but the track number goes first */
Tdisc,
Talbumgain,
Talbumpeak,
Ttrackgain,

@ -14,6 +14,7 @@ static const struct {
{"artists", Tmultiartists},
{"albumartist", Talbumartist},
{"tracknumber", Ttrack},
{"discnumber", Tdisc},
{"date", Tdate},
{"replaygain_track_peak", Ttrackpeak},
{"replaygain_track_gain", Ttrackgain},

@ -118,6 +118,7 @@ return screen:new {
end
widgets.InfiniteList(self.root, self.iterator, {
focus_first_item = true,
get_icon = get_icon_func,
callback = function(item)
return function()

@ -59,6 +59,7 @@ return screen:new {
end
widgets.InfiniteList(self.root, self.iterator, {
focus_first_item = true,
callback = function(item)
return function()
local is_dir = item:is_directory()

@ -306,10 +306,11 @@ function widgets.InfiniteList(parent, iterator, opts)
fwd_iterator:prev()
end
local function add_item(item, index)
local function add_item(item, index, item_opts)
if not item then
return
end
item_opts = item_opts or {}
local this_item = index
local add_to_top = false
if this_item < first_index then
@ -325,6 +326,9 @@ function widgets.InfiniteList(parent, iterator, opts)
if add_to_top then
btn:move_to_index(0)
end
if item_opts.focus then
btn:focus()
end
-- opts.callback should take an item and return a function matching the arg of onClicked
if opts.callback then
btn:onClicked(opts.callback(item))
@ -361,7 +365,7 @@ function widgets.InfiniteList(parent, iterator, opts)
if not val then
break
end
add_item(val, idx)
add_item(val, idx, { focus = (opts.focus_first_item and idx == 0) })
end
return infinite_list

@ -172,9 +172,7 @@ auto Setting<std::vector<bluetooth::MacAndName>>::store(
}
template <>
auto Setting<std::string>::store(
nvs_handle_t nvs,
std::string v) -> void {
auto Setting<std::string>::store(nvs_handle_t nvs, std::string v) -> void {
cppbor::Tstr cbor{v};
auto encoded = cbor.encode();
nvs_set_blob(nvs, name_, encoded.data(), encoded.size());
@ -295,6 +293,7 @@ auto NvsStorage::Read() -> void {
display_rows_.read(handle_);
haptic_motor_type_.read(handle_);
lra_calibration_.read(handle_);
fast_charge_.read(handle_);
brightness_.read(handle_);
sensitivity_.read(handle_);
amp_max_vol_.read(handle_);
@ -317,6 +316,7 @@ auto NvsStorage::Write() -> bool {
display_rows_.write(handle_);
haptic_motor_type_.write(handle_);
lra_calibration_.write(handle_);
fast_charge_.write(handle_);
brightness_.write(handle_);
sensitivity_.write(handle_);
amp_max_vol_.write(handle_);

@ -41,6 +41,8 @@ static auto convert_tag(int tag) -> std::optional<Tag> {
return Tag::kAlbum;
case Ttrack:
return Tag::kTrack;
case Tdisc:
return Tag::kDisc;
case Tgenre:
return Tag::kGenres;
default:

Loading…
Cancel
Save