get_files(path, recurse, finddir, findfile, sort_by, cancel_fn, f_t, d_t)
get_files returns a sorted tables of directories and (another) of files
path is the starting path; recurse == false.. only that path will be searched
findfile & finddir are definable search functions
if not defined all files/dirs are returned if false is passed.. none
or you can provide your own function
sort_by can be by "name" "size" "date" or "none" to perform no sorting
note: for "size" and "date" you may need to strip the attribute data to use
the returned filename
cancel_fn if not defined or not a function no user cancel otherwise supply
your own cancel function which returns true to cancel searching for files
f_t and d_t allow you to pass your own tables for re-use but isn't necessary
Change-Id: Ic4c2ad9c9b5abeeeeaf572880edbc8873d52066b
I rewrote some of the problematic scripts to use an event loop which
fixed most of the issues but it turns out the underlying issue is
that when the device is under load the timeout that detects a repeat press
makes the key a repeat press and we miss the initial press completely
due to being under load and under the gun
Adds entries for PLA_EXIT and PLA_CANCEL with a Repeat press
Change-Id: I8247b0ebd37fc58608f6be126c49e56f8375e9cf
not sure if there's a reason these weren't included
in g#3229
- simple lists
- playlist viewer
- browse_id3
- option select
Change-Id: I0e15aaeb563e68ea21bf5df667ce134d01a95195
* Devices with ADB now have HAVE_USB_ADB
* DX50/DX90 no longer set USB_NONE
* stub out necessary functions
* usb_set_mode() and global_settings.usb_mode are now:
* called for all devices with (HAVE_USB_ADB | HAVE_USB_POWER)
* wrapped with consistent #ifdefs
Fixes regression in ce88de54b8
Change-Id: Ib0c16082fe237e8159cd42847355186ea5c74589
All required code is already present in the left usb_set_mode call.
Affects iBasso DX50, iBasso DX90, HiBy R1 and HiBy R3 PRO II.
Fixes FS#13890
Change-Id: Ib554ca98a36ceeaa48c0aa699c3671a40d4fee47
FONT_UI scans from MAXFONTS-1 to 0 to maximize the chances of getting a loaded
font but this may result in global_status.font_id being ignored even
if set through setuifont
this should take care of all the plugin woes dues to this
by setting the lcd font to the ui font before loading the plugin
and also making FONT_UI map to this font when font_get(FONT_UI) is called
if the desired font is not loaded then fallback to the previous behavior
Change-Id: I101d6f91910c17b08fca2b988a0a99c9e6899bee
FONT_UI is a placeholder when it gets assigned it isn't resolved
immediately
when its time to resolve the font it is processed with font_get(int font)
first it sets it to the last slot
and then decrements till it gets a valid font
Change-Id: I3c203d58ed2d813d206f5b435e6b55ed196cf213
add get_metadata_afmt function so we don't have to extra functions
remove unneeded bounds check on audio_format in rbcodec_format_is_atomic()
add bounds check on audio_format in get_metadata_afmt()
Change-Id: I76bd869100b000579c6546f0670ba4ba2c541f22
tagcache.c add_tagcache() and potentially
skin_tokens.c wps_playlist_percent_prepare()
make calls to probe_file_format() prior to calling get_metadata_ex
resulting in some small amout of duplicated work
especially in the case of add_tagcache this can add
up to a lot of duplicated work
breaks out audio_fmt so these can supply the afmt other callers just
supply probe_file_format(trackname) in the function call
Change-Id: I8084213b8ee7e04d76dce0986beb83d443ac804b
%pP reports playlist progress by position index, which treats every
track as equally long. For playlists with tracks of unequal length --
audiobooks with chapters anywhere from two minutes to an hour are the
motivating case -- position is a poor proxy for listening progress.
%pX reports the played percentage of the whole playlist by time: the
summed length of all preceding tracks plus the elapsed time in the
current one, relative to the playlist's total duration. It can be
used as a value, in a conditional, with %if(), or as a bar tag like
%pb.
If a playlist contains more than 500 tracks or the scan is taking too
long and the user aborts the tag will fallback to the behavior of %pP
except the progress through the current track will be included in the
returned percentage
--------------------------------------
Computing this needs every track's length, and reading metadata for
every track is too slow and disk-heavy for a tag that refreshes on the
WPS. Instead each track's length is estimated from its file size: the
skin engine scans the playlist in the background, a batch of files each
skin refresh, opening each file only to read its size (directory
metadata, no header parse). Size is turned into time by calibrating one
file of each type -- the first file of each extension is parsed once
with get_metadata to learn its bytes-per-second, and every later file
of that type reuses it. A single-format playlist, the usual audiobook
case, parses exactly one file and stat's the rest.
The result is an estimate -- bitrate varies within a type, especially
for VBR -- but it is cheap and accurate enough for a progress
indicator, and the playing track always contributes its exact elapsed
time. Per-track lengths are stored as two bytes of minutes each in a
movable buffer sized to the track count and allocated only while the
tag is in use; the cache is keyed on the track count and a crc of the
first, middle and last filenames, so a playlist swap or reshuffle is
caught. If the buffer cannot be allocated (a very large playlist on a
low-memory target) the tag falls back to position-based progress.
The buffer is allocated when playback starts (and when the now-playing
screen is opened with playback already active) rather than lazily on the
first WPS refresh, so the one-time allocation happens at a playback
boundary instead of during steady-state playback; it falls back to
allocating on first use if that point is missed.
Until the scan finishes the tag does not blank: it returns an instant
equal-weight estimate -- (completed tracks + fraction through the
current one) / track count -- which sharpens into the size-based value
as the scan fills in. So a theme can just use %pX and it is correct
from the first frame, and %?pX is true whenever a playlist is loaded.
Tested on a Sansa Clip Zip and in the simulator. On a 216-track,
~745 MB single-format audiobook playlist the length scan dropped from
~4150 ms (get_metadata on every track) to ~174 ms (one parse plus 215
file-size stats), roughly 24x lighter.
Change-Id: I6e572e78a10444bd513ddc77e30da04aa5153ef2
Commit d1be73c ("keyboard.c Use viewports, move text box pos")
moved the picker and edit line into dedicated viewports. Under an
RTL UI language these viewports get VP_FLAG_ALIGN_RIGHT, so
lcd_putsxy mirrors every call; with the per-character cell drawing
this reversed the picker grid and the edit line (Hebrew shown
reversed, Latin filenames backwards, wrong caret).
- Clear the alignment flag on the keyboard own viewports so the
picker grid and cell layout are no longer mirrored.
- Draw the edit line as a single string so the bidi engine reorders
mixed Hebrew/Latin correctly, and use the full line width.
- Compute the caret from the bidi (LTR-base) visual layout so it
lands at the insertion point, including mixed Hebrew+Latin text.
- Pick the edit-line direction and invert the left/right cursor
keys based on the text first strong character.
Change-Id: I79f1c444bc9121fd5018ad5f6f4148afe2c1a3e1
Clipzip, ClipPlus other devices may be similar
Autoscan from the main menu and the device hangs at scanning 88.1
try to record with no station set and it just records static
Change-Id: I59fe17dde80736e4fae8445c0aea7fcf5e476317
I accidentally added an extra character wittthe last patch by changing
< to <= in the process of testing this I realized spaces were sometimes
being included at the beginning of the line and also that sometime
sentences were being cut short even though they fit on the screen
Change-Id: Iee0ed64e18defad2acb3c107d334ea2a49bd5b6f
fix lua strpbrk function skipping the first accept chr
lua splash_scroller fix NULL pointer in brk due to lastbreak
not being reset on a new line
Change-Id: Ica0c9ee5f9194f5be54ab90ad16309adead1c207
the other items that scroll use the menu button and reset on STD_OK
OS stacks use STD_OK to scroll and any other button to reset
Change-Id: I1fa1caa322fe761c6f92d2d08cc418e78843863b
Fix FS#13832
If the remote is already plugged in when Rockbox boots, it stays dead
until you replug it. These remotes only send their identify packet
once at power-up, so we never see it and then throw away all button
events because lingo 0x02 was never negotiated. The OF doesn't care,
so accept ContextButtonStatus from unidentified devices too. Stray
bytes received before iap_setup() also made iap_getc() return false,
which the serial driver takes as "sync found" and locks autobaud onto
the wrong bitrate.
The ghost clicks come from the repeatbtn handshake. A held button
resends its down event every 30-100ms and each one re-armed
iap_repeatbtn, which stalls handling of the following packet. So
during a long press packets pile up, the event queue overflows, and
the leftovers replay as keypresses after you let go. Skipping fires
on button release which is why next/prev showed it the worst. Now
repeatbtn is only re-armed when the button state actually changes,
and iap_handlepkt() drains whatever complete packets are in the RX
buffer rather than relying on one queued event per packet.
While at it, fix two more things found along the way: the button
state is now written in one go (the temporary BUTTON_NONE could be
picked up by the button tick mid-update), and iap_rxlen is
decremented when a frame is received so the overflow check actually
does something.
Tested on ipodmini2g with an A1018 remote.
Change-Id: Ie18512e47d642fe6957fc010eaf79b6d2af4c070
only load the namebuf once unless user changes the plugin
also displays the plugin name when user selects the whole context menu
Change-Id: I32b53729a3dcc2bf2c42393876407df7f3d38d8c
also fixes a bug where synclist viewport could be empty if the list isn't
initialized
voices path and parameters now
adds the item [Add] as the last item in the list
Change-Id: I1aad62baf3c19a67d04fa1fb3db8a7573e0a467f
Have a report of a hanging scrolling item, ensure the lists are stopped
on exit with gui_synclist_scroll_stop()
Change-Id: If670806f710118c79377bf8c5de6c1a5168e37fc
Go to root menu when Start Screen has been set to "Resume Playback"
but playlist is finished
https://forums.rockbox.org/index.php?topic=55770
Change-Id: I6939fa313dd5fd6485628e22a2d860763492d5cf
Only react to Power button release if previous
button code was Power button press, so that
screen doesn't lock when device may have just
been turned on
Change-Id: I1ba228103efedeeceaaa00c49b1b1da66b63bb75
Clearing the display makes the backdrop come to the foreground.
which can look odd or glitchy, particularly for themes that do
custom drawing on the backdrop buffer (2c71aa9). It also causes
issues if the shutdown has to be canceled.
Instead, enable theme, then clear the UI vp.
Change-Id: Ia96d1e766a9b86ec133522f7cd259e8b88f64216
allows you to import a file and merge native keymaps
pops a yes no prompt to erase existing
duplicates will be overwritten
Change-Id: I167c6fac65775754b2a9874185d14f65638db9d7
Only apply dir filter to 'Browse' shortcuts, so that,
when trying to run a file from Shortcuts that is hidden
due to current dir filter settings, you don't get a 'Failed
reading Unknown' message (LANG_READ_FAILED/LANG_UNKNOWN)
because the tree entry can't be found in ft_enter.
Change-Id: I4eaad2ec415c9bac352a409922848e4407dac993
allows you to import a file and merge text keymaps
pops a yes no prompt to erase existing
duplicates will be overwritten
Change-Id: I0f4425e765f0a2ff6b73b830bcaea1b3f31e83cb
The skin is not unloaded using skin_unload_all in
settings_apply_skins anymore since commit 0ca4b38.
usb_screen was last remaining user until commit a969e1f.
Change-Id: I65a41ed220165587a04e699a7f210c575c00a4eb
I think they mean corrupted not crashes as I couldn't repro that
splash_scroller stepped by individual chars and split multibyte
sequences leaving corrupted chars
now it uses the new font_measurestring() to get the max_w and chops
it at break chars instead
this required a bit of a logic change to the function but should be
as good with less complications
Change-Id: I692db8b4737f41aec08dbc122fb844028498326d