Commit graph

16588 commits

Author SHA1 Message Date
Christian Soffke
fd50baa23f PictureFlow: Reversible and interruptible animations
Makes PF usable on older devices with few FPS,
and makes it quicker to navigate on current devices.

- PF_BACK while zooming in to zoom out again
- PF_SELECT or PF_PREV/PF_NEXT while zooming in to skip animation

- PF_BACK while zooming out to skip animation
- PF_PREV/PF_NEXT while zooming out to skip animation + scroll
- PF_SELECT while zooming out to zoom in again
- PF_CONTEXT while zooming out to skip animation and append

- PF_CONTEXT while scrolling to append
- PF_SELECT while scrolling to zoom in

Change-Id: I8d041b53f5990181059fe837a8ca121ebf37a676
2021-11-27 09:02:17 -05:00
Christian Soffke
4052a9ddcf Manual: Update Metadata limitations
Limit for devices with more than 8MB of memory had
previously been increased from 300 to 500 bytes
for individual fields, and to 1800 from 900 bytes for
buffer containing all fields.

See a8846e3

Change-Id: I63305c50f6f486ad321664babdb94052ea9209a9
2021-11-24 19:17:33 -05:00
Aidan MacDonald
871572b6c3 touchscreen: improved pixelwise scrolling in lists
Scrolling via the scrollbar is now a bit smoother -- it's
now drawn pixelwise, and dragging it will scroll the list
pixelwise instead of rigidly snapping to items.

Several other general UX issues were fixed:

- List and scrollbar now occupy the full viewport height,
  to maximize use of screen space.
- Fixed issue with last item in the list suddenly appearing
  or disappearing while scrolling.
- Prevented scrolling into blank space after the last item.

Change-Id: Ib279ac87ec2f2ffc8834c19ff0af45286e2d6d4d
2021-11-24 19:03:16 -05:00
William Wilgus
b39acee3ab rb_info plugin and button,action+context name helper
rb_info is just a test plugin

just some info from the running rockbox install

the real star here is the generator scripts to make actions_helper.c and button_helper.c

Change-Id: I23f7bbdae3f2cffca2490c4df40bb13b0b5d5064
2021-11-22 21:39:45 -05:00
Christian Soffke
5bd9ed801f Fix: PictureFlow splash() crash on grayscale targets
On targets where the grayscale framework is used, splash()
won't work (and may crash) if the overlay is not
switched off first. This is not reproducible in the simulator.

Change-Id: Ia22087c4978c8fa247d6d4c64c4b600e4393eebf
2021-11-22 08:06:44 -05:00
Christian Soffke
f9ce8720c4 Fix: PictureFlow crashes
- After appending albums, when memory had been borrowed
from the buflib buffer by shifting memory up using  buflib_buffer_out()
in create_track_index(), memory was later not shifted down using
buflib_buffer_in() (the latter was only called after displaying the track list).

- The picture loading thread was able to allocate memory from the
buflib pool while the main thread was moving the buffer around.
Slide loading will now be paused before shifting operations, and
continued afterwards.

Change-Id: I1c92b6c931fd14ebb885be4bc275148039b76a9a
2021-11-22 08:06:44 -05:00
Aidan MacDonald
3f966b2aa4 touchscreen: make quickscreen easier to use
In absolute pointing mode, the quickscreen now accepts
a touch anywhere in the middle third of the screen edge
to trigger an item, and pressing anywhere else on the
'grid' will exit -- the same as how 3x3 mode works.

Previously it required a touch inside the text viewport
to trigger an item, and exited after any touch outside
the viewports. This made it very difficult to use since
the text viewports are too small to reliably touch.

Change-Id: I971eaeb4a2c67bebef3d7b070a29b897df07b8e7
2021-11-21 20:26:21 +00:00
Aidan MacDonald
bff63a4f90 touchscreen: change odd sentinel value for time of last touch
Using tick 0xffff does not make any sense, use -1 instead.

Change-Id: Id574eb35418c6713c4fc91ed539aadc42fd29aa5
2021-11-21 20:26:20 +00:00
Aidan MacDonald
7e428ad190 touchscreen: force 3x3 mode in the keyboard
In absolute pointing mode the keyboard is virtually unusable since
the keys are too tiny (just 8x6). There are other issues too: for
example putting the keys on top doesn't make sense on touchscreens
and there is a lot of empty space in between keys that serves no
real purpose.

Until these issues can be addressed properly simply force 3x3 mode
when in the keyboard.

Change-Id: I3ea95ae479372f5b5f86ffcc2dbde10a03663820
2021-11-21 20:26:20 +00:00
James Smith
990c543ebc Revert "Pictureflow: Update for tag_virt_canonicalartist."
This reverts commit 60125f6bc9.

Reason for revert: See g#3947.

Change-Id: I34bae3cf5a87a5c99b9a4e5755e1a4a69961b28a
2021-11-21 12:44:57 -05:00
Aidan MacDonald
a14347a6b3 quickscreen: fix non-intuitive behavior of top/bottom items
The behavior of the top/bottom items is not intuitive when used
with settings like volume or brightness -- pressing up will
actually *decrease* the setting, and down will increase it.
This patch inverts the direction, so the top item will increase
the setting.

The reason for this is that historically, the quickscreen seems
to have had only 3 directions -- left, right, and bottom. Bottom
therefore selected the next value, and when top was introduced
it selected the previous value.

The counter-intuitive nature of this was later reported as a bug
on the Fuze V2 and got an incorrect fix (commit 2271995517) under
the assumption that ASCENDING_INT_SETTINGS was the issue.

Change-Id: I3be92534469cea4f5efd81ab024288c052367411
2021-11-20 22:07:29 -05:00
Wolfram Sang
16a71a19a8 debug_menu: add format specifier for seconds in RDS timestamp
Add the 6th format specifier for the 6th parameter and show seconds,
too. Most radio stations will update once per minute only, but still...

Change-Id: Ia878bc001c903112df3ed336df260e30eae68e3b
2021-11-20 23:06:29 +01:00
Christian Soffke
a4e422db9e Stop audio before applying skin
Should prevent a delay, dropouts and memory corruption
that can occur when applying a skin while music is playing

Change-Id: Ic2c8fd788117a7d797fb315a36e366a2e34d3460
2021-11-13 08:13:04 -05:00
William Wilgus
11ddc6cf1c announce_status Fix USB fall through and usb on plugin start
When running and USB plugged announce status ack'd the USB and then un intentionally fell through to EV_EXIT
this caused the thread to exit but not the TSR hook

Now: plugin keeps track of usb status and doesn't announce till usb is unplugged again
on unplug the start-up beep is played to announce its presence

announce_status on startup blocks usb since USB handling is done in the thread that hasn't started yet
Now: don't start if USB is plugged

Plugin now beeps if it couldn't play the announcement excpept for missing voice file unfortunately

Change-Id: I69cf7e687508ce02358432e7bd1adc27c78c4072
2021-11-13 03:38:28 -05:00
Christian Soffke
fbf83dc4ce Add setting for disabling wrap-around lists
Allows user to decide whether scrolling lists will wrap around
to the opposite end after the first or last item has been reached.

Change-Id: I22156812cf4c857ddc4b6c48c1cef013b1985260
2021-11-11 17:31:10 -05:00
William Wilgus
30a23fdd6d folder_select.c move to plugin as db_folder_select
handles the folder selection for autoresume paths and database paths

folder_select uses the pluginbuf to build the directory tree
hopefully having it as a plugin will make it stop corrupting
TSR plugins like battery_bench and announce_status

I left the original include and source in the gui directory for now
there are currently no other users..

Change-Id: If40ccb5a2bec4286a0616c10dfa7e1479a592808
2021-11-11 00:28:59 -05:00
William Wilgus
cf009b4cbb pitchscreen make it a plugin
full commandline parsing
    -has pitch, speed, time_stretch
 /* pitch_screen
 *  accepts args -q, -g, -p=, -s=, -k=; (= sign is optional)
 * -q silences output splash
 * -g runs the gui (Runs immediately)
 * -p100 would set pitch to 100%
 * -s=90 sets speed to 90% if timestrech is enabled
 * -k=true -k1 enables time stretch -k0 -kf-kn disables
*/

Change-Id: I900c4b5d184e12ddbe47509f66fdf3e55193a520
2021-11-10 22:38:37 -05:00
Christian Soffke
e6313201c1 Playback: Skip invalid entries from playlist
Reverts to the behavior pre-commit dfff938 with the additional change
that it will not skip the last entry.

Change-Id: Ia03da03b1bdccd8a9591548cd0ca9f58f4767947
2021-11-10 16:34:27 -05:00
Christian Soffke
a7d09f8104 PictureFlow: remember inspected album artwork
Each time PictureFlow was launched, it would rebuild the
album artwork cache from the beginning.

Depending on the number of albums, this could take a while
and resulted in choppy scrolling.

PictureFlow will now remember how many albums have been
inspected already, and only rescan and write new artwork
when the album index cache gets updated or rebuilt.

Change-Id: Icd78106dacea44b80904ac609caa355cc9113168
2021-11-10 15:43:57 -05:00
Christian Soffke
687096e3f5 Fix: Shortcuts Menu data loss & crash
- Shortcuts Menu would delete SHORTCUT_TIME shortcuts
when deleting any other shortcut.

- Shortcuts would crash or show wrong number of items
after deleting a shortcut and then launching a shortcut
when simplelist_show_list was executed again.

Change-Id: Ia87c94a364c516fd662cb3c7d245c566a3fa91ca
2021-11-10 19:56:19 +01:00
William Wilgus
58462184d1 folder_select.c partial rewrite -- remove static, add full notification
| with some code refactoring we can eliminate the static
  char buffer in get_full_path()

  I'm guessing making the functions recursive prompted the static buffer
  I don't see any reason we can't just pass the same buffer
|
  During tested I noted failure after buffer was full
   -- splash added for buffer full notification

  added some logic to not add partial entries and try to find a
| selected item that will fit in the remaing buffer
------------------------------------------------------------------------

While looking through the source I noticed a few potential
pitfalls with the current code.

Namely the stack allocated temporary buffer
sized to setting_len.

I also noted the rigid vect[32] with the timeless --
/* 32 separate folders should be Enough For Everybody(TM) */
and decided to make it a bit more robust

The saved items are hashed with crc32 on all the paths
and a hashed_len is kept to aid in the buffer full message before the
user actually goes to save the changes
(assuming they even get the message)

In the old code, buffer might be the same since it ran out of
space and didn't get their later selections

the hashed_len could easily be turned into a way to get a needed buffer
size as well for someone in the future just pass a really large maxlen

I made get_full_path non recursive since it liked to blow the stack
while embedded in all the other recursive calls making it a pain to debug
(the real reason the buffer was static?)
traverse first from the current folder to root mutating the
parent pointers to point at the previous child
next traverse back to the folder unmutating & taking names on the way

Folder depth is now uint16 65535 levels is probably excessive
children_count is also uint16 as well
I made the first folders below root '/' stay below root
instead of shifting since the horizontal real estate is limited

slightly smaller than it began but hopefully faster & more reliable

Change-Id: I348f61baf865cccdeacddfd9d50641a882e890fc
2021-11-10 02:34:06 -05:00
Christian Soffke
b14df9077f 2048 plugin: Fix disappearing numbers (FS#13303)
Change-Id: I9df42b9ea1dbf4de0713fe1df583e4a16a4a9426
2021-11-09 10:30:28 -05:00
William Wilgus
aed113042d RFC settings & nvram.bin save setting to tmp file save old
save to a .tmp file on save and rename on next load

I think this should pretty minimally invasive as the same file
still gets overwritten in subsequent attempts until it is loaded again

the save path is still static
so it won't cause issues holding up shutdown.

load might be a bit slower with the searching for tmp+current file
and renaming them

Plus there is now a backup of your last settings file

Change-Id: If95618b93a0ba7954d5d8cab1d6ea3f07e658509
2021-11-08 16:15:47 -05:00
Christian Soffke
25941d5e0c fiiom3k (keymap): Allow scrolling up/down in keyboard context
Change-Id: If04a1243120e1d579f660ab01da9126cdbeda8d2
2021-11-08 14:25:53 -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
Moshe Piekarski
13ac485625 Add single playback mode
(FS#482)

Change-Id: I8b4c3e4ffb6975122153e82f2b9848c382195163
2021-11-05 09:20:04 -04:00
Christian Soffke
22c2e0a7c2 Fix: Reset onplay-context for playlist viewer
The onplay-context was previously not reset when using the playlist
viewer, which led to a bug if onplay() was last called in the context
of the database. If you then tried to insert songs into a dynamic
playlist using the playlist viewer, a selected track from the database
would be picked, instead of one from the displayed playlist, due to
special behavior of add_to_playlist() within the database context.

Change-Id: I727d96fc1bfb2454ed3535959c1b0044ff7d6359
2021-11-03 13:28:10 -04: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
d72a0ed65d Use USB events for storing plugin_menu state
use usb connected callback to cancel menu reentry after USB plug/unplug

Change-Id: I8267deed6e8ada94ca527392f56f50ef22def1d7
2021-10-31 12:42:24 -04:00
Christian Soffke
0b1c05db40 Have ACTION_TREE_ROOT_INIT cause ACTION_STD_MENU
So that a “scroll left” button can be repurposed
for returning to the main menu when there is no
existing menu button mapping.

Change-Id: I38515943313f69cc3241b3f523c94ea012471b88
2021-10-30 01:20:35 +02:00
Christian Soffke
139d447c6a fiiom3k: Modified keymap
see https://forums.rockbox.org/index.php/topic,52917.msg249425.html#msg249425

Change-Id: I8944434c5a840d0d2e35b9591dd72334430b8b09
2021-10-30 01:07:00 +02: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
8ee24d8cb4 onplay calls plugins to run other plugins
Change-Id: I7c1593c93debc0ac5c0f1b2e839ec0eb1bd375b7
2021-10-27 22:44:35 -04:00
William Wilgus
f1ef5ab8a6 menu.c do_menu code cleanup
no functional changes here just removal of cruft

Change-Id: Id16c3607608d8f1ddcaf219dcd346f7a996aec5d
2021-10-27 15:44:38 -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
36d319b084 Open Plugins Ignore hash for lang Ids
no need to look up a hash when we have another searchable field
remove some un-needed checks

Change-Id: I394e5f796a164aa4bcb68a56ca02cd6a7f18d332
2021-10-23 02:45:54 -04:00
William Wilgus
789b2e089e plugin.h change plugin_open() path and parameter to const
it doesn't modify the args..

Change-Id: Ie8e1e36a060231c0137292c770e4f77da3b8203a
2021-10-22 23:17:33 -04:00
William Wilgus
f4c7dc933d lua add ability to pass PLUGIN_ ret vals with os.exit() + add defines
Change-Id: I45998245271fbd8fee4534f8497b014025e4dcc7
2021-10-21 22:28:05 -04:00
Christian Soffke
1697b13693 whitespace fixes
Change-Id: I86880595b78e3cae62361c32ca57cf6f6a4ad963
2021-10-21 22:42:01 +02:00
William Wilgus
cf96a4d386 file tree filetype_list_viewers exit from list before execution
no need to do a callback just to exit the list right after
executing a viewer plugin

Change-Id: I4598ab189bd7d1f350156af75480cbe7103e9e4c
2021-10-21 03:16:54 -04:00
William Wilgus
af573708ed extend filetype_get_plugin() search for viewer by fileext
I noticed the way filetree switch was modified
for the lua (and then) opx and  open plugin viewers
since builtin files are assumed to be handled in the filetree switch
what if instead filetype_get_plugin() could search the available viewers

this could probably be extended further with selectable defaults

Change-Id: I40f74cd698f4b788a0adcbebf32c08a970df29a5
2021-10-21 01:45:47 -04:00
William Wilgus
9878226e4d filetree.c move static and stack allocated buffers around
it makes more sense to make the main buffer static and make the
second (infrequently needed) buffer as stack allocated

Change-Id: Ide7c1a7a312124e47a23ed0ab75a90d7b8be982e
2021-10-20 16:05:21 -04:00
William Wilgus
e1553d860d Open_Plugin add checksum on struct offsets
Adding a checksum over the struct offset will allow checking
for compatibility across machines rather than using packed structs
to ensure compability

For any file created by the user from the device  this isn't really a concern

But for files between machines, across installs (sim v device),
possibly even across compilers this at least will alert the user
rather than returning junk data

Change-Id: Id0531bbaa7013dce24dece270849f0a10ac99c20
2021-10-18 23:30:27 -04:00
William Wilgus
71cc1e78fd Open_plugins.c bugfix address of packed struct element
helpful gcc warning after g#3895 change to packed struct

Change-Id: I89f765da94eeee14c606ea8ebaab5e219dceb2ac
2021-10-16 11:04:17 -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
6fb942d8ff skin engine - fail gracefully when %Sx is used on non lang id string
CheckWPS doesn't catch errors involving translated strings
Instead of breaking old themes when the langids no long exist
return "<ERR>"

Change-Id: I0d744cd48bb5a27e735fce3f6f740450d1f6a55a
2021-10-13 18:02:19 -04:00
Dana Conrad
d435bb77b5 Yes/No Screen Keymap: add fallbacks to targets lacking them
With the addition of ignoring unknown actions to the yes/no
screen, several (mostly older) targets won't have keys defined
to cancel out of the yes/no screen.

Adding fallbacks to standard context to correct this.

Targets:
Shanling Q1 - changed, untested (doesn't appear sim has buttons mapped)
Sansa Connect - changed, untested (can't figure out sim keys)

HM60x - changed, untested (sim won't build)
HM801 - changed, untested (sim won't build)
ihifi - changed, untested (sim won't build)
MA - changed, untested (sim won't build)

M3 - changed, tested on sim
X5 - changed, tested on sim
MPIO HD300 - changed, sim tested
MPIO HD200 - changed, sim tested (remote not tested)
Vibe 500 - changed, sim tested

Change-Id: Ib5290ada8e12bb845d3840e481e8533515b42e95
2021-10-02 10:07:02 -04:00