Commit graph

39385 commits

Author SHA1 Message Date
William Wilgus
ddc31e8ddc Revert "[Bugfix] FS#13943 - Single mode tracks shorter than one second do not play"
This reverts commit f4e9ba7f17.

Reason for revert: Wasn't the issue??

Change-Id: Ib25ec4b7f90d2ddb0b8a414e18469a9bf5c88140
2026-07-02 01:56:46 -04:00
Vencislav Atanasov
1ded71b751 mks5lboot: Mark uint8_t[] struct members that are initialized from a character array as not containing a null terminator
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I77c3d4b907b175447fef522378d6e61d65f4d2cf
2026-07-01 21:03:49 -04:00
elishay
5c02cf3b3c bidi: do not pass non-ASCII codepoints to ispunct()
bidi_l2v() classified each character with ispunct((int)c), but c is
a decoded Unicode codepoint. ispunct() is only defined for values
that fit in an unsigned char (or EOF); a larger value is undefined
behaviour, and glibc then reads past the ctype table and reports
some codepoints as punctuation.

Hebrew final kaf (U+05DA) and gimel (U+05D2) land on such entries,
so a string ending in one had that letter trimmed off its RTL block
as if it were trailing punctuation and moved to the wrong end of
the line. Limit the punctuation test to ASCII so the result is
well-defined.

Change-Id: Ie6c3d8413f35ec3652e9228e3d5af05ef5bb811a
2026-07-01 21:03:38 -04:00
Vencislav Atanasov
c7d5603c63 mkimxboot: Fix potentially unaligned pointer access of a packed structure
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I437ae173a8f1304a33082e62b86110c9bc4488ba
2026-07-01 17:27:49 +03:00
William Wilgus
f4e9ba7f17 [Bugfix] FS#13943 - Single mode tracks shorter than one second do not play
Change-Id: I8eceb8179231fc7d4c6b8d9c08844a67240c926f
2026-06-30 14:20:01 -04:00
William Wilgus
acff6143c4 FS#13938 - Line disappears after %Vf tag and %Vb tag
As far as I can tell this was indtroduced during this commit
32ff4e93bd
basically they added a NOBREAK flag
to all the commands that had '\n'
where as
    { SKIN_TOKEN_VIEWPORT_FGCOLOUR,       "Vf" , "S"},
    { SKIN_TOKEN_VIEWPORT_BGCOLOUR,       "Vb" , "S"},
do not have \n yet they were changed to have the NOBREAK flag applied
    { SKIN_TOKEN_VIEWPORT_FGCOLOUR,       "Vf" , "S", NOBREAK },
    { SKIN_TOKEN_VIEWPORT_BGCOLOUR,       "Vb" , "S", NOBREAK },
this causes anything after the command to be ignored

-- Note added to manual this will be a won't fix
due to the possibility of breaking existing themes

Change-Id: I0135f04c344bf817c104f951a657e2690f2d36bb
2026-06-30 13:55:03 -04:00
William Wilgus
d87755c535 FS#13944 - FONT_UI loads the last loaded font not global_status.font_id
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
2026-06-30 13:29:23 -04:00
Vencislav Atanasov
3ba63d667e libspeex: Fix compile warnings on Apple Clang 21
- unused function parameters
- signed/unsigned comparisons
- unused local variable

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I64e9e2573174377465b10e5912d10ca2a22da0e1
2026-06-30 10:28:55 -04:00
Vencislav Atanasov
3d3df07c45 bspatch: Fix compile warnings on Apple Clang 21
- signed/unsigned comparisons
- unambiguous fclose() result code handling

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I6c4184ddef39281610de01b5c6ab402450d9a3ec
2026-06-29 23:11:33 -04:00
Vencislav Atanasov
9e3b38c863 rbutilqt: Remove unused macOS includes from utils
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I603e327acbad48bb1dd2ff8be8a2953c7155f5b9
2026-06-29 21:18:23 -04:00
Vencislav Atanasov
379c056299 rbutilqt: Replace Utils::ejectDevice() on macOS with a diskutil process invocation
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Icedf758af6f1f0843c58e7ea5bb3efb2e7177b4a
2026-06-29 21:16:30 -04:00
Vencislav Atanasov
1039eb305a rbutilqt: Add error handling to TTSCarbon::generateSettings()
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Iad04028853e930b508e72c2c9c3e9ebd9504d4bb
2026-06-29 21:16:19 -04:00
Vencislav Atanasov
92d62cf6ac cmake: Make sure pip is upgraded before using it to install dmgbuild
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I4221aab7dd031bd79548a94b30ce5978d81e282b
2026-06-29 20:13:50 -04:00
Vencislav Atanasov
174a2330e9 rbutilqt/themeeditor: Fix compiler warnings
- match sign in integer comparison
- remove unused RBViewport member

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I9a59d701593a4290523bf4b837ab0794bea2ebaa
2026-06-29 20:13:29 -04:00
Vencislav Atanasov
6aa8d80ba2 rbutilqt: Replace Utils::findRunningProcess() on macOS with a libproc implementation
GetNextProcess, GetProcessPID and GetProcessInformation are replaced by proc_listallpids() and proc_pidpath()

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ic4fe13c405e11b658b1a9540e49741d4e69069f3
2026-06-29 20:13:09 -04:00
Vencislav Atanasov
45bd7c4400 rbutilqt: Simplify Utils::filesystemName()
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ib8851f27c473afa0d656ea3885e4d65342d10ab5
2026-06-29 20:12:48 -04:00
Vencislav Atanasov
204684f3e2 themeeditor: Fix class member initialization by calling the getter
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I5137c7c5094200809f79880bc425b0f31fee02cc
2026-06-29 20:12:32 -04:00
Vencislav Atanasov
05de3651d2 rbutilqt: Simplify conversion from UTF-16 string to QString for proxy host
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Idf3437f66c6ac95d38cad997143b995b2fe9a5f2
2026-06-29 17:41:25 -04:00
Vencislav Atanasov
cf2872af11 rbutilqt: Replace insecure sprintf() with snprintf()
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ic2abe417f17a6f104cc4523b155ca6fdb5965bb1
2026-06-29 17:41:06 -04:00
Vencislav Atanasov
e3e416c51b rbutilqt/themeeditor: Fix Qt6 deprecations
- insertMulti() -> insert()
- QString::fromUtf16() with a parameter type other than char16_t*
- enterEvent() parameter type changed from QEvent to QEnterEvent
- QVariant -> QMetaType

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ia9c6c93e281475856e8355a8aa0e64c474eed80c
2026-06-29 17:28:53 -04:00
Vencislav Atanasov
d618846a8f ipodpatcher: Remove unused functions
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Iedb2d42612d543e7761dd1c2628310cd053652e3
2026-06-29 16:56:16 -04:00
Vencislav Atanasov
dcc997e4e4 rbutilqt: Switch to a Qt API to get macOS version number, get system architecture using a compiler macro
This removes usage of the deprecated macOS Gestalt() API (2/2)

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Id10386285469c06f082a7dcdcc3284b97519b10a
2026-06-29 16:55:47 -04:00
Vencislav Atanasov
1cbf61607e rbutilqt: Switch to a Qt API to get the CPU cores count
This removes usage of the deprecated macOS Gestalt() API (1/2)

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ia3af510412a97258dcd9fc9134708900c04c62c4
2026-06-29 16:54:27 -04:00
Vencislav Atanasov
cac0be6af5 rbutilqt: Replace deprecated macro Q_OS_MACX with Q_OS_MACOS
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I0c51044574b8ec96ceaf0b953c6735ccf5d19e5e
2026-06-29 16:53:48 -04:00
Vencislav Atanasov
e0ac7a75a3 macOS 12.0 Deprecation: kIOMasterPortDefault -> kIOMainPortDefault
Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I4b5d6b73b87b7ea9e79ed20bbd27fb88fc8647ab
2026-06-29 16:53:21 -04:00
William Wilgus
b99b2e98df [Bugfix] lua FS#13940 - FONT_UI using last selected font instead of the UI font
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
2026-06-29 01:06:34 -04:00
William Wilgus
d9b1819e0b FS#13942 - Lua strftime os.date("%C")
Change-Id: I5a4cb8d362a69d12c2d7e5013dcf179cc20d01b3
2026-06-28 14:32:33 -04:00
William Wilgus
24b0254d96 metadata.c small cleanup
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
2026-06-28 14:24:02 -04:00
William Wilgus
3cd286d8f8 metadata add audio_fmt to get_metadata_ex
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
2026-06-27 14:14:01 -04:00
William Wilgus
3e08b86e4b FixRed a824085 skin: add %pX tag checkwps, ATA builds
ata_disk_isssd() return 0 for SIMULATOR

Change-Id: If281b5ce7a98f338dfd81635c8936dd90c41b9bb
2026-06-27 13:27:35 -04:00
Adam N. Burke
a824085057 skin: add %pX tag for time-based playlist progress
%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
2026-06-27 12:29:31 -04:00
Solomon Peachy
02f7dabc67 rbutil: Port TTS preview to QT6
Change-Id: Ib4a5b1ef1cd3927792e0022e387b6abc8e5f099e
2026-06-27 11:42:50 -04:00
Solomon Peachy
5462f203d3 bidi: Expand+Correct the list of RTL codepoints in is_rtl_char()
Was missing:

 * Arabic Supplement
 * Arabic Extended B
 * Arabic Extended A
 * Rumi Numerals
 * Arabic Extended C
 * Indic Isqaq Numerals
 * Ottoman Siyaq Numerals
 * Arabic Mathematical Alphabet Symbols

Worth noting that most of these are vanishingly unlikely to ever show up
in the context of Rockbox.  (The exceptions are "Arabic Supplement" and
possibly the Mathematical Symbols)

Also corrected "Arabic Presentation" into two distint blocks, as
the characters between them (fe00-fe6f) are NOT indicative of RTL.

Change-Id: I0c5c547921c789d32425682c8c75edb21428f549
2026-06-27 10:20:03 -04:00
elishay
0e3355de50 keyboard: fix RTL (Hebrew/Arabic) on-screen keyboard
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
2026-06-27 07:45:12 -04:00
Solomon Peachy
0db37606b0 rbutilqt: Handle translation load failures, part deux
This set happens on startup, when we try to load a translation
matching the system locale

Change-Id: Ib1d3effa7aa738550841023a14f733d8d5b48837
2026-06-27 07:35:21 -04:00
Solomon Peachy
4875f706c2 rbutil: Cleanly handle translation loading errors at runtime
Change-Id: I2d8c566437b9a6224db41608bf3cbab8aed76763
2026-06-27 07:29:21 -04:00
Solomon Peachy
a700dcdfb0 rbutil: Use add_compile_definitions instead of add_compile_options
Change-Id: Iaeca86f89ccfb961456a10b96f3257d444cc0971
2026-06-27 07:29:21 -04:00
Solomon Peachy
44713c3014 themeeditor: Fix a pile of unusued argument warnings
Change-Id: I919c239a410e0ff708276d5ca9d1046b70af536b
2026-06-27 07:29:21 -04:00
Solomon Peachy
5d3723bbf4 rbutil: Use QT_NO_USE_NODISCARD_FILE_OPEN everywhere
Not sure why we needed to specify this in three different places, but eh

Change-Id: If8d7304971f176bcfca839f5d6da626908621be4
2026-06-26 21:38:57 -04:00
Solomon Peachy
3c41d6a1c1 rbutil: Eliminate more pre-QT6 workarounds
Change-Id: I7b5cf428ef626543aa8e932622f4658e789e9236
2026-06-26 21:38:57 -04:00
Solomon Peachy
202243a1ab tools: fix up build warnings
Change-Id: Ib1b11f2361d4a20a8cd3c4107f8e546f8ece3f49
2026-06-26 21:38:57 -04:00
Vencislav Atanasov
115b2ae800 rbutilqt: Add a CODESIGN_IDENTITY CMake variable for macOS builds
It can be used to choose which Apple Developer ID to use when signing the build of the Qt apps. By default, it uses ad-hoc signing, i.e. no Apple Developer ID is needed.

Change-Id: I5634e318f4949107eb954b729b2f8f1d60fad115
2026-06-27 02:31:11 +03:00
Solomon Peachy
e0bbf8f9da rbutil: Drop support for QT5, start cleaning up the warnings
* All deprecation warnings fixed
 * Explicitly set QT_NO_USE_NODISCARD_FILE_OPEN

Change-Id: Ice52133e93d4a01f12ff845a3056a81b100ed891
2026-06-26 16:53:17 -04:00
William Wilgus
22b4cd3232 metadata.c get_metadata_ex add flag METADATA_EXCLUDE_NORMALIZE
no need to normalize data you don't intend to use

Change-Id: Ieef5474fef47b2f96db3d02875db95a1de02eb5e
2026-06-25 13:43:20 -04:00
Solomon Peachy
949a99a24d rbutil: Support linux non-x86_64 appimage deployments
Change-Id: I6d95e45b3a013941e131ee89b50c7225b21931bf
2026-06-23 20:16:56 -04:00
Solomon Peachy
9a85d01a32 FS#13933 - Updated Romanian and Moldavian translations (Mihai Alexandru Vasiliu)
Change-Id: Ia2aad85d518f4037b39565036940622aac52812b
2026-06-23 17:31:04 -04:00
Solomon Peachy
30567451b1 mkimxboot: Fix up a large pile of compile warnings with -Wextra
Change-Id: Ida1eae89e4a2cc99e8e2ed734c4d669c1a2a8cb2
2026-06-22 20:59:18 -04:00
Solomon Peachy
b6db69e7ef build: Move utf8proc build decision into configure script.
It is always enabled, except in the following situations:

 * bootloaders
 * warble or checkwps applications
 * devices with less than 4MB of RAM
 * imx233-based devices

imx233 is a special case; that will be backed out we figure out why
it fails to boot if the binary size exceeds 1MB.

Change-Id: If4a89e389f562bb5791a565fba99c830213473d3
2026-06-22 17:31:15 -04:00
Solomon Peachy
aeb42039f9 rbutil: Explicitly use C++17 and C11 for building (was "compiler default")
Change-Id: I9757a77520fc9d7d39a52185b92615d5eb9c0cbc
2026-06-22 10:27:38 -04:00
Solomon Peachy
cf10fa5243 FS#13929 - Updated Latvian translation (Renalds Belaks)
Change-Id: Id5fd597b16be8e93823d89129256fcb0dfd3e36b
2026-06-21 17:22:29 -04:00