Commit graph

193 commits

Author SHA1 Message Date
Christian Soffke
c51ca1eeb5 voice: splash_progress
Says "Loading x%" in previously unvoiced splash_progress

Change-Id: I81780e3baf6ea8a8871a4433e1a733100b8cd5f6
2025-06-02 00:03:42 +02:00
Christian Soffke
498d581ca6 voice: fix regression 39f8685 (already voiced)
Some of the splashf messages that were converted
to support voicing in commit 39f8685 already had
a voice equivalent that was more appropriate,
since it also voiced parameters, and included
pauses between announcements where necessary.

Change-Id: Ia91a01c82acd6148afb4afadd64b1105802aea36
2025-05-28 11:18:29 +02:00
Solomon Peachy
39f86858c4 voice: Convert a pile of splashf() messages to be voiced
Basically, this just replaces str(STRID) with ID2P(STRID).

The voiced version of these strings cannot not have any format
specifiers (enforced by the language tooling) and are instead more
generic.

As many of these are error conditions, it is doubly important for
them to be voiced in some way.

There are some places in the code that perform their own voicing
for splash messages (eg the shutdown code); those are left alone.

Change-Id: I7d51af351e8fa5c4beee42fbfc02719f1d6591b8
2025-05-17 17:33:46 -04:00
Solomon Peachy
9d4632b0c3 misc: Clean up a pile of -Wunused-const-variable warnings
And re-enable the warning (applies to GCC 6+)

Change-Id: I7aa679ec65707db12de83c0433966b3821d07087
2025-04-21 21:13:59 -04:00
Christian Soffke
87344d180b Rename 'Playlist Catalogue' to 'Playlists'
When the Playlist Catalogue first appeared in the main menu
in 2011 (FS#11808), the 'Playlists' menu item was renamed
to 'Playlist Catalogue' which seems more verbose than is
necessary these days.

Since we don't have a 'Playlist Catalogue' menu item in the
onplay menu anymore, either, LANG_CATALOG can be eliminated.

Change-Id: I7f38b0847e9b982506371f4a4b473d1fb2551ad0
2025-03-09 17:46:52 +01:00
William Wilgus
10923de8fe [BugFix] OpenPlugins wrong plugin lang id
Failing to use ID2P caused the lang id to be off by VIRT_PTR

Change-Id: Ibbabaae6c1fe130af4053ef3ebe2b1aa69530466
2025-02-25 17:59:52 -05: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
William Wilgus
4e271642df [Feature] Persist pitch settings through reboots part deux
Revisit this after discussion with chris_s on IRC and forum

Pitch menu now changes icon when pitch has been changed

uses NVRAM to save the pitch settings unconditionally

Manual updated

Change-Id: Idcb4c2b7fe42f7a203dc4bfc46285657f370d0fd
2025-01-19 00:29:47 -05:00
Christian Soffke
133eb84177 playlist: Allow replaying finished playlist
Instead of responding with a "Nothing to resume"
message when user tries to resume a playlist that's
finished playing, offer to start from the beginning
again.

Change-Id: Icc4894d4e2d2e29beb1c7646462f9af69e5733aa
2025-01-15 14:51:17 -05:00
William Wilgus
22d921c55c [Bugfix] Plugins run by START_IN_SCREEN won't open another plugin
PLUGIN_GOTO_PLUGIN was using old key instead

Change-Id: If354bd441db7c0b0a476624c8c1dcb3d79f5d366
2025-01-04 15:18:35 -05: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
William Wilgus
9e802be969 [BugFix] run filebrowser automatically for out of tree shortcuts
missed a case for out of tree shortcuts coming from the quickscreen in the main menu

Change-Id: I25714f9deaba5f0c88e50de03ead747733b7f568
2023-12-03 20:22:56 -05:00
William Wilgus
83566008a0 [Feature] run filebrowser automatically for out of tree shortcuts
supersedes g#5499 run .link shortcuts within menu shortcuts
and just extends it to the whole plugin stack which makes
sense as long as it doesn't cause any new bugs ;)

Change-Id: If152f53cf6894430c1173a2af1410e7d0857825e
2023-12-03 15:20:19 -05:00
William Wilgus
4e53ec80b5 [Fix Yellow] root_menu.c
Change-Id: Ib13b54e3d7818746edfd0d13c37328bd90d23b22
2023-11-25 03:21:09 -05:00
William Wilgus
40e685fb71 [Feature] run .link shortcuts within menu shortcuts
Change-Id: Ifbc2b95ab367ae18fa51074a3f8ea551ad2ab6a8
2023-11-25 02:48:49 -05:00
Christian Soffke
5114827937 Fix: Rotate indices after saving playlist w/ first_index > 0
When saving the current playlist, entries written out
to disk were rotated, but its indices were not, resulting
in first_index being out of sync between the two. Thus,
an incorrect index was used for any playlist commands,
from the moment you saved the playlist until the next
time you resumed, which didn't produce the right playlist.

Change-Id: Ie4b02ce9e07e565b1b15c938cc4b820db08e8f1f
2023-11-15 23:49:53 +01:00
Aidan MacDonald
6c52fa139c Remove browse_context_init()
Prefer to use designated initializers to avoid having to specify
unneeded parameters. Non-initialized members are zero-initialized
by the compiler.

Change-Id: Ia6a03c45cb3ef0b30f458d7d0ae1604a350c737c
2022-12-17 13:36:38 +00:00
William Wilgus
6f54bb63fc open_plugin.c access open_plugin_entry through a function
just a few updates to open_plugin save a bit of space by granting access through a getter function

Change-Id: I2c0eaa1ade867510798b213006064ee1c00aa016
2022-12-16 09:05:06 -05:00
William Wilgus
6b87bfadff wps.c cleanup gui_show_wps
remove some old cruft move a few things around clean-up flow

Change-Id: I138c6cd9e2d58ef526eb686333da413819df725d
2022-12-14 22:35:33 -05:00
Christian Soffke
8ff2c81bde Improve transition between plugin and WPS
Eliminate flashing when plugins are launched
from WPS, by not enabling the SBS, and by
deferring other lcd updates.

Also prevents flashing root menu activity when
returning from plugins.

Change-Id: I7d761867027f2275c4ab8e16ada3107c7ba0be6e
2022-12-13 21:10:16 -05:00
Christian Soffke
dfd9c10589 Eliminate skin updates in between activities
1) Adds way to pop activity without refreshing the skin at
the same time.

Activities are sometimes popped in immediate succession,
or one activity is popped before another one is pushed right
away. This can lead to the UI appearing glitchy, due to an
activity only appearing for a split-second, which is especially
noticeable with complex skins that change the dimensions
of the UI viewport depending on the current activity

To fix this, prevent superfluous skin updates

* when switching between:
- WPS and browser
- WPS and Playlist Catalogue
- WPS and playlist
- WPS and Settings/System/Plugins

* when accessing Track Info or when displaying
bookmarks using the context menu on the WPS

* when switching from QuickScreen to Shortcuts Menu

2) The playlist viewer activity was pushed & popped
redundantly by playlist_view.

----
NB:
Behavior has remained unchanged in all instances of the
code where pop_current_activity() has been replaced by
pop_current_activity(ACTIVITY_REFRESH_NOW).

Change-Id: I56b517b8c9dba823a9fed3a3f558d7469dcea9fd
2022-12-11 11:50:33 +01:00
Christian Soffke
f242b0ec6c Settings/System/Plugins: Go to WPS when ACTION_TREEE_WPS is pressed
Used to go to root menu before.

Change-Id: I5c0e0cb204cb3979917dde0f243185c32ef4177a
2022-11-23 01:24:59 -05:00
Christian Soffke
3d34140cfb Fix return to root after selecting items from playlist viewer
When selecting an item, Rockbox only checked that
playback was stopped before entering the viewer and
went to the WPS if music had started playing afterwards,
but returned to the root menu otherwise

The WPS will now be displayed whenever a new item has been
selected, even if audio was paused or playing before.

boomark_autoload required slight adjustments to its return values,
so that the WPS would not be opened after a user cancels out of
the bookmark selection screen for a playlist, since it  previously
returned true in that case, too.

Change-Id: I231ea788e2f80fdda5fe4ad4d2420450931f686f
2022-11-19 10:01:23 +01:00
William Wilgus
0b7a387671 open_plugins add name when plugin can't open & check LANG_LAST_INDEX_IN_ARRAY
can't open '' was confusing for users so pass the key to open plugin
in theory you could have a plugin that defaulted to these lang_ids
run but its good enough to tell the user what failed to open IMO

lang_id changes mess with open_plugin since it uses them as look-up keys
so add checks for LANG_LAST_INDEX_IN_ARRAY to the checksum

the plugin now removes entries with an invalid checksum

devices with harddrives only append their .dat file so have them skip entries
with invalid checksums and only notify user if a valid entry wasn't found
(these users can run the open_plugins plugin to remove invalid entries)

Change-Id: Icf157675beaccda785643d5a9ed032a7cde30f12
2022-11-17 01:43:16 -05:00
William Wilgus
f6c719d7ec replace strlcpy with strmemccpy
replace applicable calls to strlcpy with calls to strmemccpy
which null terminates on truncation

in theory the strmemccpy calls should be slightly faster since they
don't traverse the rest of the source string on truncation
but I seriously doubt there is too much of that going on in the code base

Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
2022-11-14 23:56:16 -05:00
Christian Soffke
ca908d6336 Database: Fix FS#13368 – use separate selected item history
Database and File Browser were sharing
each other’s selected item history before.

Since the database isn’t browsed
recursively, it’s probably unnecessary to
include its own history in the tree context
and its backups, saving.a little bit of memory.

Change-Id: I87c9aed6f7056bc481b8b7299089851ef28f9bc5
2022-11-02 07:19:36 -04:00
William Wilgus
d73aaf3d9e add splash_progress
the loading track splash flashes and is ugly
add a function to display a progressbar along with the splash message

spruce up database commit message as well

Change-Id: I2749b958c1ee5dad2631a5f999a4b00ddca7f225
2022-10-09 08:46:51 -04:00
William Wilgus
a5e684c894 BUGFIX root_menu.c
Change-Id: Ie6268c63f5ed5197d2da678851b4bfdf7764252c
2022-03-18 19:45:01 -04:00
Christian Soffke
d04804b6ff Root menu: prevent infinite loop trying to exit plugin
Rockbox could enter into an infinite loop when last_screen
and next_screen were both GO_TO_PREVIOUS, which
happened when trying to quit PictureFlow in the following
scenario:

1) start playback from PictureFlow plugin
2) return (or be returned) to WPS directly
3) wait for playback to finish and to be returned to PF
plugin

Change-Id: I0b52d4df56d416f81cef027d9024e964a734fcdc
2021-12-24 10:38:18 -05:00
William Wilgus
f07bacac9e plugin_screen don't save settings on every plugin execution
we shouldn't need to save the last_screen unless the plugin were to
bypass the normal shutdown procedure

if its a crash do we really want to resume the plugin?
its it is intentional save the settings prior.

Change-Id: I994ed256e7b9e88add0c846825a39b298e2644dd
2021-11-07 12:48:46 -05:00
William Wilgus
cfbc1cfce1 Shortcuts, allow plugins to run through inbuilt file browser
since the plugin browser now exits before running plugins
it has already loaded the dest data for the plugin
the plugin will be run from the root menu with the open_plugin run key

BUT, since the calls originated from the shortcuts menu
it overwrites the run key with its own
this patch allows the shortcuts menu to overwrite the dest
key as well so it can run the loaded plugin

Change-Id: I63912071d720df01c6fda25d92d9541818e52a43
2021-11-07 03:25:14 -04:00
William Wilgus
1d67f83c58 root_menu.c fix recent regression for shortcuts add resume for plugins
recent changes broke shortcuts when they originated from the root menu

I mistakenly thought GO_TO_ROOT only happened at start and otherwise was
GO_TO_PREVIOUS

this commit also adds a few missing features for Start In Previous
to resume the last plugin running at shutdown

Additionally GO_TO_ROOT now overwrites the global last_screen so you can
return to the main menu on next startup

Change-Id: I86bf842616e25dc3d4f684ff9d476e6a5ba96b04
2021-11-07 01:49:15 -05:00
William Wilgus
2731144094 exit file browser before running plugins
now that the plugin browser is resumable
exit it before running plugins

this causes a problem with the open plugin
shortcuts that call other plugins
but its now handled in count limited loop
so plugins can run plugins in a chain

and overall with less overhead too..

the problem remaining --
the plugin exits on USB, returns to ROOT

the browser resumes the
directory next time you select plugins
making for an unwanted auto return

Change-Id: If401f698207cbae824e95d69a378f13456a5dee4
2021-10-31 21:49:31 -04:00
William Wilgus
dc24a18cef PLUGINBROWSER make resumable
make the plugin browser remember the last item between invocations

this has bugged me for the longest time dealing with the plugin_menu

Fix a very old bug fix for reloading lang strings in the lang menu
FS#8117, sending multiple ENTER_MENU_ITEM callbacks from different
areas of the code makes it hard to keep track of where your callback
is originating

Change-Id: Ib0a61558c11ee4c772134378a7020ac0e10fc4ee
2021-10-29 03:07:42 -04:00
William Wilgus
1cec2c7a73 root_menu fix red for devices with RTC_ALARM but no tuner or recording
Change-Id: I36b21c3d1ef4a4ce3b275a0ee793fbf9538b69ae
2021-10-24 00:12:06 -04:00
William Wilgus
3e10ecb82a root_menu.c code clean up -- stir the ifdef mess?
Change-Id: Ia0a847b5552766e5c78dd2ab00d019e631d600aa
2021-10-23 23:30:42 -04:00
William Wilgus
15ee740060 Open Plugins search by langids
On language change Stored plugins may fail to run due
to hashing on lang dependent string

allows searching by langid when the supplied key is LANG_PTR

Fixes error on hash flush where previous entry was not restored

Adds routine to update file in-place (for ATA targets)
Other targets make a temp file to copy entries

breaking changes:
ROCKBOXDIR is no longer hashed since
/.rockbox directory may soon be able to be changed
packed attribute added to op data structure -- oops

Change-Id: Ieead26609559b9c5bdadc6a95227cb2bfbb9f71c
2021-10-16 10:18:44 -04:00
William Wilgus
3b6c3d769f open_plugins bugfix failure to save
if you added a plugin through the core settings and then used the shortcut
immediately the entry would never get flushed to disk

Change-Id: I62e876bbf0a8fa96acba1cc2582e2563401547f1
2021-08-03 00:31:10 +00:00
William Wilgus
48952d498d shortcuts menu bugfix wps context plugin fallthrough
if you ran a plugin from shortcut menu that originated from the WPS
next time you pressed select in the wps it would attempt to run the
wps context plugin

Change-Id: Id72eb6a20522586efeb479aea0b1c50b53942346
2021-03-18 00:46:43 -04:00
William Wilgus
29fa47d43d Open Plugin cache plugin entry when possible
leave plugin entries in ram and try not to save them unless necessary
doesn't use more space just a bit of careful ordering with the buffer

Change-Id: I1973e9ad4655c2544f596b37cee35601a0cffa94
2021-03-18 02:39:30 +00:00
William Wilgus
13178d23b8 Shortcuts Menu Update
Change Browser shortcut to the plugin icon
drop back into WPS on opx return
allow same action to exit shortcut menu as entered -- might be problematic

Change-Id: Id7013a514c8e8862ee1da44b033d10b7519e9127
2021-03-08 22:17:41 -05:00
William Wilgus
9712d375ce Shortcuts.c -- Update
Fix returns from shortcuts -- should now run plugins
Fix formatting of file names to remove path from browser shortcuts

Change-Id: I46e337110d04b84bedcb0c2945d5dd29a1860847
2021-03-07 10:07:49 -05:00
William Wilgus
2df3a5b04c Headphone / lineout pause/resume #FS13237
Allow Lineout to behave like headphone port in regards to
plug/unplug pause/resume

Change-Id: I9cb2c9c40e0bdf3bf7e1e272164acd343f6b3850
2020-09-18 00:22:52 +00:00
William Wilgus
3550283442 Add open_plugin to core
open_plugin allows arbitrary plugins to be called
in hotkey and start screen

replaces PictureFlow Integration
shortcuts menu plays plugins now too

rather than store paths and parameters in the settings
that reside in memory instead entries in a file are searched by hash.
after all, the plugin has to be loaded from disk anyways

----------------------------------------------------------------------------
shortcut_viewer.rock--  can now call plugins rather than taking you to them
in the browser
-----------------------------------------------------------------------------
Added a new option to menus:
 F_CB_ON_SELECT_ONLY
 instead of option callback every time a item is accessed
 F_CB_ON_SELECT_ONLY fires callback only when item is selected
-----------------------------------------------------------------------------
Added manual entries
-----------------------------------------------------------------------------

Change-Id: I078b57b1d2b4dd633c89212c1082fcbc1b516e6a
2020-08-17 10:15:14 -04:00
William Wilgus
d553bb1149 root_menu move tag cache init check to pictureflow plugin
let pictureflow decide if the tag cache is ready instead of core

Change-Id: I2ab9b375d773dbbc28ea41fbf7bb6fb361ace8fd
2020-08-16 10:35:57 -04:00
Solomon Peachy
092c340a20 [1/4] Remove SH support and all archos targets
This removes all code specific to SH targets

Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24 21:20:13 +00:00
William Wilgus
c39f95465b do_menu pass internal synclist reference to callback
keep running into the rigid nature of do_menu
it isn't too bad when you don't need voice but once
you do the fun awaits

do_menu likes to talk on menu enter which is in a loop when you use do_menu
I would like to move the processing to the callback
TOO BAD you only get an action and the menu_item_ex struct
you sent it when calling the function

Change-Id: Iaefd0cc133435d675b7dd27a558c504d6ccb327a
2020-07-19 22:10:26 +00:00
William Wilgus
10e5e56f3c Bug fix dynamic menus
Dynamic menus had a buffer_len variable in the parent function but it
was discarded before passing to the callbacks

Why!!?? No clue but everything that used it was assuming MAXPATH
Wouldn't be surprised to see some bugs pop out from this one..

init_menu_lists() was assuming MENU_HAS_DESC and setting the
menu title + icon based on such even though it could be invalid
didn't see anywhere in the code that was currently using MENU_DYNAMIC_DESC
in relation to a top level menu but considering it caused all kinds
of corruption to the menu when I tried its probably been tried
and abandoned before...

Change-Id: I8d961d748918bfa8ea6adb5ad60491af4d739d6e
2019-09-20 03:07:29 -05:00
Solomon Peachy
c46147c6b2 Tweak how the pictureflow plugin is invoked
- Only load when database is ready
 - Assign to file browser only when returning to WPS
 - Minor speech fixes

Patch by Igor Poretsky
Re-synchronized by myself

Change-Id: If9c943b3af415a2decd3dd5803d730bd790d09fe
2019-08-13 16:41:14 +02:00
Udo Schläpfer
dbabd0d9c3 iBasso DX50/DX90: Major code cleanup and reorganization.
Reorganization

- Separated iBasso devices from PLATFORM_ANDROID. These are now standlone
  hosted targets. Most device specific code is in the
  firmware/target/hosted/ibasso directory.
- No dependency on Android SDK, only the Android NDK is needed.
  32 bit Android NDK and Android API Level 16.
- Separate implementation for each device where feasible.

Code cleanup

- Rewrite of existing code, from simple reformat to complete reimplementation.
- New backlight interface, seperating backlight from touchscreen.
- Rewrite of device button handler, removing unneeded code and fixing memory
  leaks.
- New Debug messages interface logging to Android adb logcat (DEBUGF, panicf,
  logf).
- Rewrite of lcd device handler, removing unneeded code and fixing memory leaks.
- Rewrite of audiohw device handler/pcm interface, removing unneeded code and
  fixing memory leaks, enabling 44.1/48kHz pthreaded playback.
- Rewrite of power and powermng, proper shutdown, using batterylog results
  (see http://gerrit.rockbox.org/r/#/c/1047/).
- Rewrite of configure (Android NDK) and device specific config.
- Rewrite of the Android NDK specific Makefile.

Misc

- All plugins/games/demos activated.
- Update tinyalsa to latest from https://github.com/tinyalsa/tinyalsa.

Includes

- http://gerrit.rockbox.org/r/#/c/993/
- http://gerrit.rockbox.org/r/#/c/1010/
- http://gerrit.rockbox.org/r/#/c/1035/

Does not include http://gerrit.rockbox.org/r/#/c/1007/ due to new backlight
interface and new option for hold switch, touchscreen, physical button
interaction.

Rockbox needs the iBasso DX50/DX90 loader for startup, see
http://gerrit.rockbox.org/r/#/c/1099/

The loader expects Rockbox to be installed in /mnt/sdcard/.rockbox/. If
/mnt/sdcard/ is accessed as USB mass storage device, Rockbox will exit
gracefully and the loader will restart Rockbox on USB disconnect.

Tested on iBasso DX50.
Compiled (not tested) for iBasso DX90.
Compiled (not tested) for PLATFORM_ANDROID.

Change-Id: I5f5e22e68f5b4cf29c28e2b40b2c265f2beb7ab7
2015-02-02 21:57:55 +01:00