Commit graph

596 commits

Author SHA1 Message Date
Hairo R. Carela
893828b488 Use ROCKBOX_DIR in legal notices file paths
These paths were hardcoded to /.rockbox/ and could cause issues with ports not using that path.

Change-Id: I1aef65d21d47b7f49f06c304a4dc9d30471d3ae2
2025-07-09 19:04:34 -04:00
Solomon Peachy
c145f41658 theme_menu: Error out gracefully when a directory doesn't exist
Normally we can't browse into a directory that doesn't exist; hwoever
the theme menu lets us directly browse (eg) fonts, themes, etc.  If the
target directory is not present (due to a broken installation) we
actually crash!

So, um, check and bail gracefully.

Should fix FS#13636

Change-Id: Idb28c55cf0ce3954114d056725f9992ceaf1db20
2025-06-17 18:40:06 -04:00
Christian Soffke
5f593fb000 album art setting: use settings callback
Since even Shuffle and Repeat are now immediately applied
from the Quickscreen, I suppose it makes sense to do the
same for the album art setting as the remaining holdout.

Change-Id: Ib1b56c31f28d8197e001901296d9897a23134564
2025-06-15 11:30:59 -04:00
Christian Soffke
94cf3403e2 shortcuts: add missing voice for sleep shortcuts without name
Change-Id: I1178be8c82671d64746297306b27ee9ccb50c1a2
2025-06-06 19:12:07 +02:00
Christian Soffke
e9d0be5dfd shortcuts: Don't require name for 'time' (i.e. talk or sleep) shortcuts
Change-Id: I5b0777c10527f6a49ac7305ca0ba1d4c269333fe
2025-06-06 18:12:06 +02:00
William Wilgus
4811e48026 [Bugfix] make theme menu reset browse context
we try to reuse the browse context to return to folders in the plugin browser

but in the browse_folder() case we want to load the root directory
so reset the current browse context and force the browse
to be reloaded

Change-Id: I416ee40411cdce4e404b6119b33d91ff6ba533c8
2025-06-03 11:10:53 -04:00
Christian Soffke
4346a1e8e7 playlist catalog: sort independently from file browser
Allow independent sorting of playlists in the
playlist catalog, using the context menu.

You may want to usually sort playlists by their date
(modified), but sort audio tracks alphabetically.
This is now possible without having to constantly
adjust a setting.

The fact that 'Sort Files' applied to both the file
browser and playlist catalog seems more like a side
effect of the implementation, rather than behavior
that is wanted. Additionally, the 'By Type' sorting
makes no sense when only a single type is displayed.

Since many of the other File View settings don't
apply to the playlist catalog, hide the menu there.

Change-Id: Ic35038015d0860998ae117f472ce23ce3bc80cfa
2025-05-30 08:30:47 -04:00
Christian Soffke
f3d127f372 Minor confirm prompt adjustments
* Rename LANG_RESET_ASK to LANG_ARE_YOU_SURE,
  so that it matches the actual language string
  (translations remain valid), and can be repurposed
  for generic confirmation prompts, where the
  first line says "Are you sure?", and the second
  line reiterates the selected action

* Add "Reset Settings" as second line to the prompt
  shown before resetting settings, instead of just
  asking "Are you sure?"

* Make Shuffle prompt consistent between WPS and
  Playlist Viewer, and ask whether user is sure they
  want to Shuffle instead of warning them that the
  current playlist will be erased, which was a bit
  misleading

* Explicitly say "Cancelled" when user answers NO to
  erasing the current playlist or to overwriting a file.
  Improves consistency with other prompts that are
  displayed for potentially destructive actions, e.g.
  before items are deleted, renamed, saved, or reset.

* PictureFlow: Prompt before rebuilding/updating cache

Change-Id: Id8ae36db7187315eb1a374701307e6ab4dcdbd1d
2025-05-26 23:15:53 -04:00
Christian Soffke
5efb6d7fac Settings menu: add main menu customization
Lets you launch the main_menu_config plugin
from Settings, so that it remains accessible,
even after all other menu items have been
hidden.

Includes minor changes to the main menu config
plugin, so that it better fits in with the rest
of the settings menus:

* Keep theme enabled
* Autosave
* Add "On" or "Off" suffix to each item, to prevent
  confusion when Icon_Config is blank, as is the case
  with certain iconsets
* Update current selection after swapping items
* Prefix spoken selection with row number for enhanced
  clarity when swapping items
* Change title to LANG_MAIN_MENU
* ACTION_STD_OK to toggle an item's visibility
* ACTION_STD_CONTEXT to access options for reordering
  menu items, or for reverting to the default menu
* Ask for confirmation before reverting

Change-Id: I74240b94243224c76e23ef8f3a0559bd8ba28df0
2025-05-23 14:28:29 -04:00
Solomon Peachy
3b974e791a misc: Fix more build warnings uncovered with GCC15 and -Wunused-const-variable
Change-Id: I43f5d03d8496b2ac8b30df30b14d1c6e816ef0e2
2025-04-21 21:55:03 -04:00
Christian Soffke
96615af033 Shortcuts & QS: Fix tree sort settings not immediately applied
Change-Id: I51158f786ad7dae46ce6201826cb35958e8014ec
2025-04-18 20:00:42 -04:00
Christian Soffke
a77cb9dc77 playlist save: ensure required file exists, proper filename used
Trying to save a current playlist associated with a
file that doesn't exist anymore, is likely to result
in a panic.

+return to keyboard picker after
complaining about missing dir.

Change-Id: I00ea0b08521d4a4503243d636af01252119939bc
2025-03-13 19:27:57 +01:00
William Wilgus
4f3bbeaffc Remove BATTERY_TYPES
Change-Id: I4fa03a10d0032fd6f92722bbe1d4b7eec0b95cb4
2025-03-11 02:26:38 -04:00
Christian Soffke
fb115e5bdb playlist_save: fix dir may not exist
Attempting to save a playlist to a dir that does
not exist would make playlist_save panic.

https://forums.rockbox.org/index.php/topic,55241

Change-Id: Ibf55255949782315e997733b519c590ac53221a2
2025-03-11 01:23:01 -04:00
Christian Soffke
2e91a67c3f Deprioritize 'Create Playlist' option
Make "View Current Playlist" option more
accessible by moving it into the spot of
the 'Create Playlist' option, which
currently appears first in the context
menu, and is thus automatically selected

Change-Id: I28de5d7ad5be9bee79578ea7255a96aa72fafd2f
2025-03-09 23:51:14 +01:00
William Wilgus
7100090f99 Remove NVRAM infavor of a separate cfg file
remove nvram and use the existing settings framework for it

add a crc check to the user_settings data to see if we need to save
the user setting file or if we can just save the status file (resume.cfg)

move volume to the system_status struct so we don't write the whole settings file
over volume changes

allow user to still export volume with save sound settings

allow the user to also export pitch and speed

name the file .resume.cfg

Rename all the SYSTEM_STATUS save file variables to TLAs to save space and
discourage tinkering

Cleanup DEBUG_AVAIL_SETTINGS output

when saving user_settings it calls status_save as well this cause the resume
file to be written twice. instead remove the callback for status_save
when setting_save is called

remove header text when saving .resume.cfg

convert status_save() to status_save(bool force)
add SYSTEM_STATUS_UPDATE_TICKS

for ATA device set this to 5 minutes
since we arlready wait for the disk to be up before saving
we don't want to miss our window

for all other every 15 minutes

that way if the battery is too low by the time shutdown comes around you
don't lose much progress

Change-Id: I27214ffd6e5d5494ee5ca83b14f04a41ba426ad7
2025-01-21 00:04:32 -05:00
Christian Soffke
b83504635c playlist: eliminate error message disconnecting USB
With no control file present, the message
"Error accessing playlist control file"
was displayed, due to playlist_resume being
called from gui_usb_screen_run.

You were likely to only run into this after a clean
install, if you hadn't listened to any music yet.

It probably makes sense to move the check for the
existence of the control file into playlist_resume,
and not even have it show a separate access error
message when the file doesn't exist.

Change-Id: Ib3a643c43d3d4d499fa5a13c01955779d69cd357
2025-01-15 14:00:10 -05:00
William Wilgus
c3fd32bdf2 [Feature] playback logging from core
people don't like having to remember to run the TSR plugin so
lets meet them halfway

all tracks are added with timestamp, elapsed, length, trackname

added buffering for ATA devices

still needed:
-Done -- a plugin that parses for duplicates and reads the track info
to create the actual scrobbler log
(log can be truncated once dumped)
this should allow you to run the plugin at leisure

later I'd like to expand this logging to allow
track culling based on skipped songs..

remove the TSR plugin as hard disk no longer need to use it

Change-Id: Ib0b74b4c868fecb3e4941a8f4b9de7bd8728fe3e
2025-01-13 00:45:09 -05:00
Christian Soffke
e5c9846cb4 Playlist Catalogue: fix: "Save Current Playlist" may fail silently
- After rebooting, unless the current playlist
had been manually resumed already, the "Save
Current Playlist" option in the root menu's/
playlist catalogue's context menu failed to work.

- Eliminate error message attempting to view current
playlist when no control file present.

Change-Id: I58f1d3dc6f256fcee106ff5a17f69fa46d67b2e4
2025-01-09 06:10:46 +01:00
Solomon Peachy
10b8448511 Don't use CHECK_VOL(x) as a loop conditional
...On non-multidrive targets it will always evaluate to true because
it effectively ignores the argument passed in.

Instead use 'x < NUM_VOLUMES'

Fixes regression introduced with a41a001258 on non-multivolume devices

Change-Id: I1a620af113c87cf3227ef8b40d0b51b2600cd816
2024-12-15 15:34:18 -05:00
Dana Conrad
5ed0db6e90 erosqnative: Repurpose stereosw_select setting for output select
Turns out they did not swap the stereo switch lines on us,
so this setting isn't really useful. Repurpose it to allow
the user to force the device into headphone or line output mode.

Note that settings other than "Automatic" will cause jack detection
to not work.

Default Automatic.

Change-Id: If94499fbb8f0d92111811fe51f6107ce213b66ad
2024-12-07 09:20:40 -05:00
William Wilgus
80a0bf590f radio.c presets.c small clean-up
remove some extern vars in favor of get/set functions

Change-Id: Ic4effae2acdd480beeab76c9f0319b1783a3bab3
2024-11-30 16:42:43 -05:00
Solomon Peachy
f24bae5baf ...This time, fix the non-multidrive+non-multivolume builds.
I swear, this is getting old.

Change-Id: If810a6559eaebbed0a0f0c6a0891b09101783be6
2024-11-23 23:07:12 -05:00
Solomon Peachy
fb2316b9b0 Hopfully fix up the remaining warnings
Change-Id: Iba1facabf4980b491d80842ef91e92d6bc374cfa
2024-11-23 22:39:35 -05:00
Solomon Peachy
57cd8cd712 fix warnings and errors in a41a001258
* volume_partition() wasn't defined for hosted targets
 * wrap the "special" volume stuff in HAVE_MULTIDRIVE

Change-Id: Icbea256ab6438e1f7e45d361ed61724feec7ef0b
2024-11-23 20:59:32 -05:00
Solomon Peachy
a41a001258 info_menu: Don't print a line for volumes that don't exist
This is an example of what could happen:

 HD1: Not present
 ouping Not present
 ouping Not present
 ouping Not present

We have up to 4 fixed volume slots (==partitions) per drive, but
shouldn't display an entry if the slot isn't used, ie the normal case.
Instead, we _were_ displaying a partially-unitialized entry!

There is a special case for targets that support multiple *drives*, in
that we want to show 'not present' for the first volume slot of the
2nd drive.

Change-Id: I717edd305cd654ff4e13ba9ffb57e7a4c9935c17
2024-11-23 20:33:26 -05:00
William Wilgus
56378cb38e [FixRed] main_menu.c typo CONFIG_CHARGING == CHARGING_SIMPLE
Change-Id: I5422a566459336727bf9189130b2c02d7c1b40e2
2024-11-22 02:37:16 -05:00
William Wilgus
b73fc15f1f [FixRed] Info menu Devices without HAVE_RECORDING
Change-Id: I61ffcfdf81ed286e620adddf5801c8eaa08b2a4c
2024-11-22 02:07:56 -05:00
William Wilgus
4340f33b63 main_menu.c convert system>info menu to static simplelist
Change-Id: Iec9f7f4b6def905abdfe281c7b71a8bf2506a3f7
2024-11-22 01:40:56 -05:00
neofright
9efed5542e Add reset EQ menu option
Change-Id: Ia555359263a42545abe3f1039d7933204be02f6d
2024-10-16 17:20:27 +01:00
Solomon Peachy
77ff799502 lang: Delete two completely redundant strings
Change-Id: Icedae2687688b8d042c9d9ca232b566ff8f65531
2024-09-22 16:44:08 -04:00
Paul Sauro
f69d9c8a95 Settings: Add a new option to prevent text scrollings in the home screen
This option is especially useful for theme creators that want to create themes with lockscreens. When text is scrolling, it is breaking the lockscreen so setting this option to true prevent this. Text will continue to scroll normally in all other contexts.

Change-Id: I194f6837217881d50f567a775b81d0b422caf35c
2024-08-28 20:24:44 -04:00
Solomon Peachy
8c25fcfbf0 ...fix more red from 15e52374
Change-Id: Ibbfb89b2c40c0ac8b5a514f130d7b672afb866fa
2024-08-12 15:38:11 -04:00
Solomon Peachy
05354e1bef Hopefully fix the remaining red from 15e52374
(imx233, ipodnano2g, !multidrive hosted/sims)

Change-Id: I9c89887078f9f50d3aac73f468ac323699e1fd1f
2024-08-12 15:20:13 -04:00
Solomon Peachy
6e69241279 Fix some of the red in 15e52374
Change-Id: I712102ec09d6058567768b86430bc3120a179a40
2024-08-12 15:03:56 -04:00
Solomon Peachy
15e5237469 storage: 64-bit sector offsets
* Create new 'sector_t' type alias:
    * uint64_t for all targets with HAVE_LBA48 or HAVE_SDUC
    * unsigned long for the everything else
 * Alter all storage APIs to use sector_t instead of 'unsigned long'
 * Alter Volume/Partition/storage info structures to use sector_t
 * Disk cache converted to sector_t
 * ATA Core:
    * convert to using sector_t for sector addresses and drive sizes
    * Always fill out upper 16 bits of LBA48 addresses
    * IDENTIFY INFO is fixed at 512 bytes, not SECTOR_SIZE
 * USB mass storage:
    * convert to using sector_t for sector addesses and drive sizes
    * Implement READ_16/WRITE_16 for LBA48 addresses
 * Convert FAT code to use sector_t for all sector references
 * output_dyn_value() now accepts int64_t instead of 'int'
 * Corrected "rockbox info" to work for (MULTIVOLUME & !MULTIDRIVE)
 * Better reporting of disk and (logical+physical) sector sizes in debug info
 * Detect SDUC cards and report on storage debug_info screen

To-do: SDUC

 * Refactor SD core to remove duplicate code in every driver
   * Card probe and init state machine
 * Implement core SDUC support
   * SD2.0 needs to be 2.0+ (fixed for jz47xx and x1000)
   * Host and Card ID (ACMD41)
   * 32-bit addressing for all read/write/erase operations (CMD22)
 * ADD SDUC to target device drivers, defining HAVE_SDUC as appropriate

Change-Id: Ib0138781a0081664d11511037685503df1b93608
2024-08-12 14:23:44 -04:00
Solomon Peachy
eaeaac598d FS#13431: Provide a way to view the rockbox license in the menus
This adds a "Legal Notices" entry under the System menu that will
launch the text viewer plugin to display:

1) COPYING.txt   (containing the GPLv2 overall license for Rockbox)
2) LICENSES.txt  (containing all other relevant licenses and notices)

Change-Id: Id41ae491b6f9a6ec5663090246d0f6b661cddea5
2024-05-30 21:22:01 -04:00
Christian Soffke
fdba79cd77 shortcuts: refactor sleeptimer / talk_timedate
move some functions around, with no effect on behavior

Change-Id: I4638a28f5ff2a851534a3dd696ea7e763029cb2f
2024-05-13 18:18:45 +02:00
Christian Soffke
f631bfe5b4 shortcuts: sleep timer: allow omitting number of minutes
'sleep' can now appear in the data field of a 'time' shortcut
without being followed by a number, allowing you to stop a
running timer, or to start a new one using the default sleep
timer duration (the duration setting can already be added to
the Shortcuts menu as well).

Also see here:
https://forums.rockbox.org/index.php/topic,54312.msg250940.html

Change-Id: I9d0e62ef1b6187c35133067349729a4d94273c7a
2024-05-13 18:06:55 +02:00
Dana Conrad
5f377c2613 Eros Q Native: Add Stereo SW behavior setting
Hopefully this should cover our bases so we can change
the behavior of the stereo switch to keep line out working
when they change the hardware on us!

Change-Id: Ic36bcb3778d5681a5f3f158c689df9c1420c1d7e
2024-05-12 09:42:02 -04:00
Christian Soffke
e8816552f6 Offer choice of default browsers
The database or playlist catalogue can now be set
as the browser that is launched when pressing
ACTION_WPS_BROWSE on the WPS, unless another browser
has more recently been opened.

Previously you'd always have to exit the File Browser
first, after the player had been restarted, which is
annoying for users who prefer the database.

The playlist catalogue has become part of the MRU
browser list, so pressing ACTION_WPS_BROWSE after
selecting a track from a playlist in the playlist
catalogue will now take you back there.

Settings menus have been slightly restructured.

- Eliminated "Set WPS Context Plugin" and "Hotkey" menus
  from the General menu

- Added "What's Playing Screen" menu in Settings-General
  with option for setting default browser. The "WPS Hotkey"
  and "WPS Context Plugin" menu options have been moved to
  this menu.

- "File Browser Hotkey" is now part of the File View menu,
  which means it is accessible from the browser's context
  menu as well.

Overview of resulting menu structure in Settings->General:

What's Playing Screen
    Default Browser
    WPS Hotkey
    Set WPS Context Plugin

File View
    (...)
    File Browser Hotkey

Change-Id: Iaa3619a791c20ce3562a1efd2cf90c72933b729a
2024-04-24 05:05:42 +02:00
Christian Soffke
ea5ce8034b Replace "Reload After Saving" with option to remove queued tracks
The "Reload After Saving" setting was added in
g3347 (4f83e66) to solve FS#13287, by allowing
you to bookmark a modified playlist after saving,
without having to manually reload it first.

Since the rewrite of playlist_save in g5192
(90e3571), a modified playlist doesn't have to be
reloaded anymore in order to be bookmarked after
it's been saved, unless it contains queued tracks.

To cover the remaining use cases of the previously
available option, Rockbox will now offer to remove
any queued tracks from a playlist when saving it.

Change-Id: I2d6f12bcce14d8ff41a4d921ce84d628774103ac
2024-04-21 18:28:16 +02:00
William Wilgus
2570909e52 [Feature] Add root_realpath to Rockbox Info
Change-Id: I5a6bb78495a00960d0aa0f1a3fad227e4b8e17f3
2024-04-01 08:39:55 -05:00
William Wilgus
1dc22c7241 use path_append for setting directories is several settings
sprintf, strcpy, memccpy can all just go thru path_append
with the added benefit of some path sanitizing too

Change-Id: I33510b56a364b8b3a0b06f2ff14b76491f6e3870
2024-04-01 07:35:53 -04:00
Christian Soffke
d77c417fd1 Fix bookmarking/reloading after saving shuffled playlist
The resume index into the playlist file
that was used for bookmarks created immediately
after saving a shuffled playlist, or for reloading
the saved playlist (in case "Reload After Saving"
was enabled), tended to be incorrect.

The playlist file effectively isn't shuffled
anymore after saving it to a file, but the
resume index may still have to be rotated unless
playback has been stopped and resumed before
bookmarking, due to indices that are shifted
by first_index.

Change-Id: Id335a7a71adc216989d7b415bfa48237d92fd7b0
2023-10-30 14:09:51 -04:00
Christian Soffke
bdec7ed31b Suggest numbered filename when saving untitled playlist
+ update misleading comment for catalog_add_to_a_playlist's
m3u8name parameter (the keyboard picker will be shown even
if it's not NULL)

Change-Id: I7576a83fd40cdcdb7a912c90d8c1d9a8f25e277c
2023-10-28 18:24:00 -04:00
Aidan MacDonald
90e35716e3 playlist: Rewrite playlist_save(), optimization & fixes
playlist_save() was a poorly thought out mess. This fixes the
glaring issues and hopefully ensures that saving the playlist
never loses state (such as queued tracks or modified status)
after save+resume.

Indices are now updated on the fly, which is faster and needs
no extra memory. But if an error occurs, the playlist will be
corrupted. There is currently no attempt to handle this since
errors should be unlikely, but some error handling needs to be
added in the future.

Change-Id: If8a5dbd6a596460be08ee0b7bab9f24337886ea4
2023-10-28 14:54:02 -04:00
William Wilgus
1c47722226 [Feature] add a prompt to database commit on start-up
adds a new function:
gui_syncyesno_run_w_tmo(ticks, tmo_default_res, main_msg,yes_msg, no_msg)

when a database needs committed on start-up
a yes no prompt will appear if not answered within 5 seconds
it defaults to Yes

if instead you choose No next start-up you will be asked again

you could rebuild the db still and waste time but it wouldn't hurt
anything so I don't think that path needs blocked

Change-Id: I58411f6e6bfebb6f142d99f33a1e8885ae7785c1
2023-10-01 11:51:38 -04:00
Solomon Peachy
74ded2bdd7 settings: Fix up the remaining stragglers from 8cc3266b
Change-Id: I20e98d1e7cf13a59194f62935a8f46e96f83a1f9
2023-09-22 10:31:00 -04:00
Solomon Peachy
8cc3266b2a Settings: Rename INT/BOOL setting type enum to RB_INT/RB_BOOL
....Because INT and BOOL are already defined in mingw32.

Change-Id: I28ab8189c00002c8f68bc9d0c23d2ae78d9e33d0
2023-09-22 10:00:46 -04:00