Commit graph

4850 commits

Author SHA1 Message Date
Franklin Wei
4554b90859 sdl: fix two bugs in ROCKBOXAUD_PlayAudio()
First was an off-by-one bug in the loop over buffers. The condition was
`i < this->hidden->n_buffers', but should have been <=, not <. This wasn't
a critical issue, because the last iteration would check the currently
playing buffer - an unlikely situation.

The second logic bug would make the code always think it had found an empty
buffer, even when it had not, since `idx' was being unconditionally set
every loop, rendering it unusable for a sentinel value. Fix that.

Change-Id: I137330965d699acf827e59b6aa5c5f9ddf2ca617
2023-05-17 13:23:14 -04:00
William Wilgus
100e9ac137 Fix Red lastfm_scrobbler_viewer.c
plugins need rb-> for things like strlen

Change-Id: Ia3b52423d3f7f91c2996aa9b9b194f39af44468f
2023-04-17 00:36:04 -04:00
William Wilgus
dfe12252bb [Feature, Plugin] lastfm_scrobbler_viewer
a plugin to view lastfm scrobbler logs

uses print cell to give a spreadsheet view of scrobbler logs

buffers the whole file if possible otherwise it reads entries from disk

rudimentary text searching for columns
include / exclude; all/any and case sensitive

Change-Id: Id9616e5796658952fba4ea747f596cb77d6f34c0
2023-04-16 23:50:24 -04:00
Christian Soffke
43b0fba75d Track Info: Show number of tracks being inspected
Applies to the database and PictureFlow

+ fix red 6ca57ec

Change-Id: If708851ebdfe075e9d6ea3f2e2dd790cc9deac94
2023-04-13 03:55:21 +02:00
Christian Soffke
6ca57ec389 Track Info: Display larger file size and length values
When displaying Track Info for multiple tracks,
the value for combined file sizes or length was
capped at 2 GiB / ~596h.
Limit has been raised by a factor of 1000.

Change-Id: I942c64e81864cba3f719c83a24912883fafeb70e
2023-04-13 02:31:32 +02:00
Christian Soffke
3554306617 PictureFlow: Minor fixes/refactoring
- get_albumart_for_index_from_db:
slide_index not allowed to be -1

- Fix visual glitch changing scroll direction:
An errant frame was displayed when switching
from one scroll direction immediately to the other

- Rename/combine functions and replace
magic numbers for zoom animation

- iPods: Fix inability to skip or reverse zoom animation
using Back button

Change-Id: I888c3c437bb123325813bf79be56b320cfbfda0c
2023-04-05 11:42:31 -04:00
Christian Soffke
8b95f2e758 plugins lib: use existing mp3info function
Change-Id: I88d3c04db5cbc0905153b0e616adb7a64afee707
2023-04-05 11:27:25 -04:00
Christian Soffke
287747591e plugins: vbrfix: Fix fd leak & error handling
- mp3info returns true for error
- fd wasn't closed for non-vbr files

Change-Id: I5432025d3384ddf92ed0a478587dcc1715fcf524
2023-04-01 08:19:22 -04:00
William Wilgus
2456d28e21 [BugFix] open_plugin didn't recognize opx shortcuts
opx shortcuts allow an easy way to add parameters to plugins
you should be able to set them as shortcuts now

the plugin hd a use after free bug on the dat file file descriptor

Change-Id: I5fe3b0628e7da003c03b9b54f5788b0d0dbfea74
2023-03-30 01:04:51 -04:00
William Wilgus
a2e5d9563f [Feature] resume TSR plugins after interruption WIP
save tsr plugin path for later

resume tsr plugin when user stops the interrupting plugin

expand return of tsr_exit function to allow
continue, suspend, terminate

tsr plugins check parameter at start to determine if
the plugin is being resumed

Change-Id: I6fc70de664c7771e7dbc9a1af7a831e7b50b1d15
2023-03-25 10:02:43 -04:00
Aidan MacDonald
58b2e45782 Fix unified syntax in ARM inline assembly
GCC 4.9 always emits assembly with divided syntax. Setting unified
syntax in inline assembly causes the assembler to complain about
GCC's generated code, because the directive extends past the scope
of the inline asm. Fix this by setting divided mode at the end of
the inline assembly block.

The assembler directives are hidden behind macros because later
versions of GCC won't need this workaround: they can be told to
use the unified syntax with -masm-syntax-unified.

Change-Id: Ic09e729e5bbb6fd44d08dac348daf6f55c75d7d8
2023-03-23 18:16:33 +00:00
Chris Chua
86429dbf1e Using ARM Unified Assembler Language
Change-Id: Iae32a8ba8eff6087330e458fafc912a12fee4509
2023-03-23 13:28:22 -04:00
Aidan MacDonald
a64cad847e playlist: Simplify playlist modified detection
Any modifications to the playlist (insert, delete, shuffle, etc)
will cause the modified flag to be set. The flag is cleared when
the playlist is saved. Code that generates playlists can manually
clear the modified flag if appropriate; there is now a proper API
for this so the tagcache and pictureflow don't need to resort to
hacks.

Change-Id: I8d3c723265a41db07a13de3f1d2abb0444528d57
2023-03-23 13:01:23 -04:00
Aidan MacDonald
d40a598970 plugins: Simplify plugin/codec API versioning
Replace the minimum version bound with a check on the size of
the API struct. The version only needs to be incremented for
ABI breaking changes. Additions to the API won't need to touch
the version number, resulting in fewer merge conflicts.

Change-Id: I916a04a7bf5890dcf5d615ce30087643165f8e1f
2023-03-21 16:23:54 -04:00
William Wilgus
977bc698db [Feature] lastfm_scrobbler add option to set beep volume level
Change-Id: Id045f0f844b67f07ba5cd47d084f5d8f1841dad8
2023-03-20 19:04:12 -04:00
William Wilgus
1c26f565bf tagnavi make track submenu
add some faster options to the track menu
add a shortcut for basename formatting
sort basename results

filename - by sorted filename
title - just title no formatting untagged items are unsorted as well
title mm:ss - title and duration

Change-Id: I90aea95051f6231580ef7f1fc08cd2d0d69601fb
2023-02-07 08:44:57 -05:00
Aidan MacDonald
d85f4b5e1c pdbox: Move core thread off COP
This is all but guaranteed to be broken since pdbox doesn't use
SHAREDBSS_ATTR or SHAREDDATA_ATTR, needed to share memory safely
with COP threads.

Judging by the codec performance comparison on the wiki, if the
iRiver H100 and H300 can run PDbox on one core, PP targets should
have no problem doing it - they are 2-4x faster even on codecs
that don't have multi-core optimizations.

Change-Id: I8f556013146cb670f69cc42e80b1c768ba0f74cd
2023-01-29 07:15:40 -05:00
Aidan MacDonald
5b27e2255a Add perceptual volume adjustment
The perceived loudness change of a change in volume depends
on the listening volume: at high volumes a 1 dB increment is
noticeable, but at low volumes a larger increment is needed
to get a comparable change in loudness.

Perceptual volume adjustment accounts for this fact, and
divides the hardware volume range into a number of steps.
Each step changes the dB volume by a variable amount, with
most of the steps concentrated at higher volumes. This
makes it possible to sweep over the entire hardware volume
range quickly, without losing the ability to finely adjust
the volume at normal listening levels.

Use "Volume Adjustment Mode" in the system settings menu
to select perceptual volume mode. The number of steps used
is controlled by "Number of Volume Steps". (Number of steps
has no effect in direct adjustment mode.)

It's still possible to set a specific dB volume level from
the sound settings menu when perceptual volume is enabled,
and perceptual volume does not affect the volume displayed
by themes.

Change-Id: I6f91fd3f7c5e2d323a914e47b5653033e92b4b3b
2023-01-22 21:19:57 +00:00
Christian Soffke
32f365bf3c database: make parent tables work with plugin
Enables the use of PictureFlow and the Properties plugin
with parent tables of ALLSUBENTRIES, such as an album
or album artist, instead of individual tracks.

Change-Id: I18c4779ed116a48c732ae32b9629e7e0d93ce7c8
2023-01-19 15:56:35 -05:00
Christian Soffke
4d53d1b52b PictureFlow: fix_path_part checked too many chars
Shouldn't have any effect if album_name
is null-terminated, but still....

Change-Id: I51acb6c7858347d3bd922758ac4f0fcde349c9e1
2023-01-19 15:36:18 -05:00
Christian Soffke
f441d6bf05 plugins: lrcplayer: eliminate redundant function
Change-Id: I93fff9eb616f08bdad021180f83fea1fdb758870
2023-01-19 15:34:20 -05:00
Christian Soffke
36cef88d47 PictureFlow: id3 functions refactoring
- Move multiple-id3 functionality into lib
- Extract retrieve_id3 function

In preparation for using these functions
from the Properties plugin.

Change-Id: I7252581340680e32df763f1f4b41646a055fe19e
2023-01-19 15:12:57 -05:00
Christian Soffke
6129bfbb95 PictureFlow: Eliminate 'prompt' launch parameter
This was added in commit d553bb1 and
doesn’t seem to be used anymore.

Return PLUGIN_OK since an error message
is already produced.

Change-Id: I5eaf7e7eb7c850a6fa9c3d2717c440e335f5efd1
2023-01-19 14:52:49 -05:00
Christian Soffke
e61a5c957c PictureFlow: Add ability to insert into playlists
Songs or albums can now be added to new or
existing playlists directly from PictureFlow.

Change-Id: I6ea27e393fee0d5688385f9e91cf835be1756a7a
2023-01-14 19:44:11 +01:00
Christian Soffke
1e4ee1917c Fix red in 7f265ee
Change-Id: Ib2496af0ed6176ea537e1f61804c1ba514374fb6
2023-01-14 19:40:29 +01:00
Christian Soffke
a513cee822 PictureFlow: Add 'Track Info' for tracks or whole albums
Context menu gains new option to view
metadata for individual tracks or albums.

Will display an album's length and total file size.
Other fields are displayed only if they are identical
across all tracks (except for the album year, which
is determined by the highest value encountered).

Change-Id: Ibc14cfaf2cb3d91b8d1cfbee05c6261db4975355
2023-01-10 18:50:12 +01:00
Christian Soffke
b444ecfca2 plugins: Properties: Add 'Last Modified' for audio files
In commit f3358eb, the Properties plugin started using the
Track Info screen for audio files, which didn't show when
the file was last modified. This adds it back.

Change-Id: I3ce519da234a4bcadab1d64b67de0298cada8f6e
2023-01-06 19:00:24 +01:00
Christian Soffke
8366b8511d Fix red in 9bd5249
Change-Id: I4aa18b4afd68e35b1af5fe40dc02cc406ee31978
2023-01-06 06:38:57 +01:00
Christian Soffke
9bd5249445 plugins: Credits: Fix logo sizes
Commit 1930ca8 repurposed the 'Logo' plugin's
logos, whose dimensions are different from those
used by show_logo, which was previously called
to display the logo.

Change-Id: I4d0c5f597dadfdadae244d895518bbcfefebb581
2023-01-05 23:45:41 -05:00
Aidan MacDonald
e8e781b006 lua: rocklib_events fix
Do not spawn threads on COP as PP lacks cache coherency between cores,
making it unsafe to access cacheable memory that might be accessed by
the other core.

Change-Id: Idf910e9cc9dad3f0bf5bdb63800ed4abaa97558a
2023-01-02 13:38:08 -05:00
William Wilgus
84fe501f53 Add locked actions to all soft lock targets
fiio m3k native is currently the only player with
defined buttons different from the standard
mapping.

This allows the user to use the keyremap plugin
to specify differing keymaps for their device in the locked state

Change-Id: Ie0b447bba0d5978e8d23fed423df30c794afc6f9
2023-01-02 13:19:43 -05:00
William Wilgus
6ebec601f9 [Feature/Bugfix] keyremap add Context flags
Add context flags to keyremap
CONTEXT_LOCKED
CONTEXT_REMOTE
CONTEXT_REMOTE_LOCKED

--CONTEXT_PLUGIN-- Removed -- Plugins need a custom action list
supplied and a method of supplying them

Change-Id: I5201d275ad0ab6130c2d05d5afb0c450f5c1746c
2022-12-31 16:12:18 -05:00
William Wilgus
0330aa8eb2 [BugFix] printcell_helper selection out of bounds
on load printcell.selcol is -1 whioch is out of bounds as an index into an array

Change-Id: I1e823712d268537d5d444458993ec2aa2cd253ff
2022-12-31 16:12:18 -05:00
William Wilgus
855540e1f5 [BugFix] keyremap browse missing root, entry count off by 1
browse_context was missing its root causing a NULL deref

Export User Keys was looking for at least 4 entries when it only needed 3

Change-Id: If92ecccb36bd54e1b850ac2a969fe262b5d7fd14
2022-12-31 07:04:18 -05:00
Christian Soffke
d59e135b04 plugins: Xobox: Fix highscore table on 2bit grayscale displays
After finishing a game of Xobox, background and
foreground were both the same color, making the
high score table invisible..

Change-Id: Iab4bad0e7d3f247a4b600ff9ec8e57207bc3832f
2022-12-29 11:26:57 +01:00
Christian Soffke
66bed14f17 plugins: SpaceRocks: iPod keymap, use Menu button for Menu
Missing from faa2cb9

- Thrust is now Right instead of Menu
- Teleport is Left instead of Play/Pause
- Pause is Play/Pause

Change-Id: Idd9758a68250bcfb2adec14589dffbe1a091511c
2022-12-29 08:10:01 +01:00
Christian Soffke
faa2cb9942 plugins: Improve usability of iPod keymaps
- Reduce need to press multiple buttons at
the same time to quit a plugin

- Have "Menu" be default way to quit plugins or
to access plugin menu

- Fall back to (Long) "Select" or Long "Menu"
in cases where Menu button isn't available
(e.g. in ImageViewer and many games)

out of scope:
boomshine, lua_scripts, Rockpaint,
Doom, Duke3D, Pacbox, Quake,
Sgt-Puzzles, Wolf3D, XWorld,
Minesweeper, Pixel Painter, Spacerocks

Change-Id: I6d4dc7174695fe4b8ee9cbaccb21bdbfe6af5c48
2022-12-29 04:39:22 +01:00
Christian Soffke
52f59f637d plugins: VU Meter: Ignore backlight timeout
Change-Id: Ic61cbd61dab18afe951b00a84b9ebeb15a8ee5f0
2022-12-27 09:43:34 -05:00
William Wilgus
18ec1a2aa6 [Bug Fix] Credits Plugin don't set the back/foreground on greyscale displays
Change-Id: I2e5a37111dd055932b84962b70ff6c3eace945c7
2022-12-20 02:40:14 -05:00
William Wilgus
1930ca8d66 remove rockboxlogo after boot INIT_ATTR
nets about 5k on clipzip  (less on mono, more on others)
to move rockboxlogo to .initdata section

Remove show_logo completely and move to main.c
remove plugin stub
give credits plugin its own copy
credit fallback is now show_info()

Change-Id: Id9ed787e605ed29e7ab1e7a74d3821cd0f840ed4
2022-12-19 18:59:59 -05: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
Aidan MacDonald
701e262d3d settings: Remove setting ID return from find_setting()
Now that all users have replaced setting IDs with direct pointers,
find_setting() and friends don't need to return an ID value.

Change-Id: I8c5c31bb68d3bca5350d43538335265a55fd5517
2022-12-17 13:36:38 +00:00
William Wilgus
c85a4f1fa4 menus remove reserved 'param' parameter
-- missed the plugin menu --

Change-Id: Iac2c9b0b8212ab5f3ac2ef90e1ac2723d212f86c
2022-12-17 04:24:37 -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
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
William Wilgus
1e6d643cfb Fix Red lib/helper.h
missing brightness defines

Change-Id: I7f6d67e2eb1be9c156a02ad3ff1ba4141e7cd08c
2022-11-23 23:55:45 -05:00
William Wilgus
97a82ee3ec plugins HAVE_BACKLIGHT helper remove ifdefs in favor of dummy functions
lessen the ifdef hell

Change-Id: I52f830284e4599f3fc3a75c27dda27058b8de1a3
2022-11-23 23:00:29 -05:00
Christian Soffke
17cae50497 PictureFlow: Add hotkeys for changing sorting on iPods / Update manual
Adjust current sorting by pressing both
the Select button and Menu (or Play)
at the same time.

Change-Id: I474b79a16e278d34e3983384125015bdfb6f484a
2022-11-23 01:24:59 -05:00
Christian Soffke
b7603adc64 Properties: Refactoring & Minor fix
- Extract functions for
* determining whether it's a file or dir
* showing stats for dir or file without id3

- Remove typedef for struct
- Fix unit string not being displayed correctly during scanning
(use %s instead of %cB)

Change-Id: I31440ebd96bca791a96c66511c3de9727608218a
2022-11-20 00:41:10 -05: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