Commit graph

293 commits

Author SHA1 Message Date
Christian Soffke
129fb4016b Tagtree 'Play Next' Menu: Eliminate redundant filename retrieval
The file name for a track in the database has been
retrieved already, before its context menu is displayed,
or a hotkey is executed, see:
8a22d2678a/apps/tree.c (L811)

So, skip over tagtree_current_playlist_insert and instead
use playlist_insert_track() directly, when user selects
something from the "Playing Next" menu or uses a hotkey.

Change-Id: Ie0789d8314949e9872bf261634d81b96432ccda3
2023-06-29 17:09:15 -04:00
Christian Soffke
422ea20cef Warn before overwriting another playlist on disk
When saving a playlist to an existing file on disk,
warn user, unless the playlist's file name remains
unchanged.

Change-Id: I10d82667de5fadb5323be4f981bea9263849f07a
2023-06-21 13:09:05 -04:00
Christian Soffke
3ef49d9c5e PictureFlow: Make Shuffle options available
The "Playing Next..." menu couldn't display any
options for shuffling tracks of an album before

Change-Id: I54f4497394fb29877bf8bce0ef95a27c82eb2279
2023-05-27 19:17:52 -04:00
Christian Soffke
028eafaeef Onplay: Fix items from Queue submenu appearing at top level
If "Show Queue Options" was set to "in Submenu",
the queue options would incorrectly appear at
the top level after you had queued a track, at
least until you entered and exited the submenu
again without selecting an option.

Change-Id: I59abd73de7e3634bc8701aa2288b56bde7552513
2023-05-26 19:13:29 +02: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
roman.artiukhin
1e678977f2 Hotkey: Add List Bookmarks action
Change-Id: I8cc775d2403b682d6d91069e26947fc08d379258
2023-04-05 09:06:28 -04:00
Christian Soffke
31d56d4a59 Database: Disable delete hotkey unless audio file is selected
Fixes behavior where Rockbox would offer to
delete nonexistent directories.

Change-Id: I219da382b181372023b9408ac9a85189bffdcb74
2023-04-05 07:16:18 -04: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
7f265ee8dd Database: Add ability to insert multiple files into playlists
You could only add single files to playlists
from the database browser before. This
enables adding any database selection to
a new or existing playlist.

Change-Id: I811c7167641c589944bb2afc18dcc1d299a7b979
2023-01-14 12:14:28 -05:00
William Wilgus
cc79f1b543 on_play.c clean up playing_time
move seconds and sizes to arrays indiexed by enums
use a loop for the display and talk of each
stop exiting on SYS_EVENTs

Change-Id: I49d5b9827df4e711b38326e5fef3c54292000370
2023-01-14 10:31:56 -05:00
William Wilgus
6e08731835 [Feature] onplay.c Playlist Playing Time more fault tolerant
bad tracks now get skipped with a message at the end of scanning
rather than an error killing the count

Change-Id: I6d8c14ce00e78416b772bc5e9093a889351bc3de
2023-01-14 00:46:08 -05:00
Christian Soffke
d5e38062ea Fix hotkey strings
missed in 7d13c0c

Change-Id: I7299b6a646dc143943b2c8d1d89ecdc4a16667c7
2023-01-10 17:05:53 +01:00
Christian Soffke
7d13c0c4eb Rename "Playing Next..." menu items & hide Queue/Shuffle
"Play Next" instead of "Insert Next"
"Add" instead of "Insert"
"Play Last" instead of "Insert Last"
"Add Shuffled" instead of "Insert Shuffled"
"Play Last Shuffled" instead of "Insert Last Shuffled"

-"Queue" items hidden by default
- Shuffled options hidden by default
(Both can be enabled in options)

Resulting default menu:

Playing Next...
	Play Next
	Add
	Play Last
	Play

Change-Id: Ib0c07a8077ab4b10c2dbc7af33516adcd0d4b83a
2023-01-07 16:32:22 +01:00
Christian Soffke
ed95892a1f Rename “Current Playlist” and “Playlist Catalogue” context menus
Use action-oriented and more descriptive titles

"Add to Playlist..." instead of "Playlist Catalogue"
- "Add to Existing Playlist" instead of "Add to Playlist"
- "Add to New Playlist" (unchanged)

- "Playing Next..." instead of "Current Playlist"

In WPS context menu:

- "Current Playlist" instead of "Playlist"

Change-Id: I5cce9e317676537988682f46ac6b920598af3b9e
2023-01-07 14:53:36 +01:00
Christian Soffke
21ca64d7cd File Browser: Add “Set As..." context menu
Moves options for configuring:

- Playlist Directory
- Recording Directory
- Start Directory

into a single menu.

Necessary prerequisite for giving the
"Playlist Catalogue" context menu item a title that's a
little more action-oriented ("Add to Playlist…”).

Change-Id: I4ee08fc67d5350c38ae1a57cb345c4ed1082d0b5
2023-01-07 14:53:36 +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
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
ccf1aaa5be menus move functions with parameters to their own type
left the union with function(void) and function_w_param(param)
as a few areas might still need to use both (onplay.c)

there might be a few I missed yet..

Change-Id: I593a6875301923e19ba04ad1b0f3173dc9ebdf1f
2022-12-17 02:51:43 -05:00
William Wilgus
28f768cb84 onplay hotkey add flags
idea here as discussed with chris_s is to allow flags
in the hotkey_assignment struct to change how items are displayed

Change-Id: Id4cf1d79fbe3ff8f5590b9a863fccf00ddd457f9
2022-12-16 01:44:05 -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
Christian Soffke
098a8fd334 Playlist Catalogue: Restore selection in playlist
Saves and restores the selected item in your
most-recently accessed playlist, similar to Database
and File Browser.

Change-Id: I00afca41e33470cb458c4b87baccd6fd4016887a
2022-11-26 17:20:06 +01:00
William Wilgus
71934d4c16 move confirm delete prompt to misc.c
Change-Id: Iadb1c7199caa5070f555eb4d329efb02e3193289
2022-11-24 23:09:26 -05:00
Christian Soffke
6bc443f474 Hotkeys: Add placeholder for function return value
Seems a bit clearer to me than redefining the meaning
of ONPLAY_OK in this context, which was easy to miss.

Fixes the return value for the bookmark_create_menu
hotkey, too. It was previously mapped to ONPLAY_OK
in case the function failed, and to ONPLAY_RELOAD_DIR
if it succeeded. This had no ill effect - or any effect –
since either of the values were disregarded by the WPS
when executing a hotkey.

Return values of playlist_insert_shuffled also had no
effect (by design, apparently, see commit 482b45b).
Use ONPLAY_FUNC_RETURN in hotkey_assignment.

Behavior hasn't changed, it's only been made more
explicit.

Change-Id: Iefc60c9f42c1063af78d368dc382916848064d38
2022-11-23 01:22:14 -05:00
Christian Soffke
8fe42c43c6 WPS plugin hotkey: Fix UB
HOTKEY_PLUGIN action resulted in return value
of void function being assigned and then returned
by execute_hotkey.

Change-Id: I8b141e878fc2c0b09070186fc3520314c18a83b0
2022-11-19 22:19:15 +01:00
Christian Soffke
dcde5aa89d Database & Playlist Viewer: Fix return to WPS from plugin
After calling up PictureFlow from the database or from the
Playlist Viewer, you would not be returned to the WPS as
would be expected when picking a new song, selecting
"Go to WPS" or pressing the WPS action button.

Change-Id: I902ac9185ebe092d0c4c08804db0a813a32cc39c
2022-11-19 17:08:39 +01: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
687767bd8f convert a few more strlcpy to strmemccpy calls Fix Red and Yellow
albumart is imported to plugins just use a macro substitution
for now

Change-Id: I7c2e10d7559c087f0b3d0e6b844027d3b323da55
2022-11-15 01:24:26 -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
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
Aidan MacDonald
d5a081cbd1 gui: Remove "enum list_wrap" from list action functions
Removing the "list_wrap" argument is actually pretty easy.
In practice, almost all lists are using LIST_WRAP_UNLESS_HELD
behavior so we can make that the default. A couple of lists
disable wraparound with LIST_WRAP_OFF; this is now achieved
by setting the list "wraparound" flag to false when setting
up the list. LIST_WRAP_ON was unused and is of questionable
value, so it has been removed entirely.

This makes list wraparound behavior a property of the list,
controlled solely by the "wraparound" flag. The result is a
simpler list API and implementation, without changing the
behavior of any lists.

Change-Id: Ib55d17519e6d92fc95ae17b84ab0aaf4233bcb5a
2022-10-05 11:22:55 -04:00
Christian Soffke
3edf3ba18d add hotkeys for properties and pictureflow
Change-Id: I16b36dd02f1c2aa186d957c64ed7d239c4c91047
2022-08-05 11:39:35 -04:00
Aidan MacDonald
2f71571c0a Fix faulty Play Shuffled behavior (FS#13347)
When replacing a dynamic playlist with Play Shuffled, the current
track could incorrectly be left at the end of the new playlist.
Fix this - the current track should always be at the beginning,
so it can be skipped past regardless of the repeat/shuffle mode.

Change-Id: Ia86539bc23ad8ebd714b8dc50b5720671b4ad0a9
2022-05-15 15:23:36 +01:00
Aidan MacDonald
d20071def0 apps: Add "keep current track when replacing playlist" setting
Add a setting that makes Play and Play Shuffled in the playlist
context menu leave the current song (if any) playing when they
replace the playlist. Default to on, since this was the behavior
of the old "Clear List & Play Next" option.

Change-Id: I1340aed5c28bb3244e36d0953b3308ae59681c97
2022-05-14 16:05:46 +01:00
Aidan MacDonald
70087fb9f3 apps: Change playlist context menu behavior, fix FS#13336
Rename the "Clear List & Play" options to simply Play and Play
Shuffled, and change their behavior slightly. Previously they
would leave the current song playing, but now they will start
playing the first song of the new playlist immediately.

Shuffle options are now consistently hidden whenever a single
file is selected.

Fixes FS#13336 -- Play Shuffled is now always displayed where
applicable, regardless of playback state.

Change-Id: Idd454b4f9ab2c98cda3ce0389add747a3273fb42
2022-05-14 16:05:45 +01:00
Christian Soffke
f3358eb20a Properties plugin: Eliminate redundant Track Info code
When opening an audio file from the file
browser or database using the Properties
plugin, it will now use existing code from
the Show Track Info screen for displaying
metadata. The menu option has been
renamed accordingly.

Change-Id: I5a824865b9f980151b91aff3c3c18ec45830a12c
2022-05-09 09:44:23 -04:00
Christian Soffke
1c66e97522 Database: Remove File View menu
These options don't seem to
apply to the database...

Change-Id: I777073eeaed4099acf44996b95fa05b4c2b3abc4
2022-04-18 10:48:41 -04:00
Christian Soffke
8d453ae9c3 Fix glitches with custom list title viewports
Elements were not being drawn correctly or
title text appeared delayed in several places
when using themes with a custom viewport
for list titles.

E.g.:
- after deleting a shortcut
- when returning from a warning screen in
Playlist Viewer
- returning to some Settings screens
- in "Playing time" screen

Change-Id: I8ab07a31d4b6f290e089ecd7857f43ec195a06e0
2022-02-06 11:20:34 -05:00
Christian Soffke
e3b8b7fa80 PictureFlow: Utilize "Current Playlist" menu (+ GS fixes)
When appending tracks, they were always inserted last.
You can now choose from the usual options offered by
the "Current Playlst" context menu to queue or to insert
tracks at the requested position.
The splash after appending that forced you to wait for
2s has been eliminated.

Also fixes crashes on targets that use the grey_core lib
if a splash showed up when playback was started,
e.g. LANG_PLAYLIST_CONTROL_ACCESS_ERROR, or
when PictureFlow quit.

Change-Id: I661c59057b5315ba793ee1674f7a2ea1ffd7968d
2022-01-04 18:00:49 -05:00
Christian Soffke
7dffbd84af Playlist Viewer: Add Track Info
Adds a command for showing track info to
the Playlist Viewer's context menu, which
brings up the same screen used by the WPS
for currently playing tracks.

Change-Id: I17d99671935934dad565d290a0d6fb3b0dfd8b01
2021-12-28 11:15:57 -05:00
Christian Soffke
e8b9123205 Database: show song's album in PictureFlow
Adds a 'PictureFlow' command to database context
menus for quickly bringing up the album for a
song in PictureFlow.

Change-Id: I88cd89e93d9418558c698a15fc7fb5d9a90fb262
2021-12-28 11:06:10 -05:00
Christian Soffke
747c8d5ea4 Remove dead code/documentation/comments
Change-Id: I4928d5967ad8a1f15b8725853102b74420252cc6
2021-12-24 10:37:28 -05:00
Christian Soffke
6325971451 Warn before replacing playlist when “Insert” hotkey is used
Makes warning  for "Insert" hotkey consistent
with that of "Insert Shuffled hotkey" (both
will result in the current playlist being erased
if playback is stopped).

Change-Id: I7c6a01438c227a963209b8689ee6941b820a004d
2021-12-02 17:38:42 -05: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
8ee24d8cb4 onplay calls plugins to run other plugins
Change-Id: I7c1593c93debc0ac5c0f1b2e839ec0eb1bd375b7
2021-10-27 22:44:35 -04:00
Aidan MacDonald
005c414e5f Document intentional fallthroughs + fix harmless unintended ones
Change-Id: I1ca5b1027ec30cbf61093bab35b980196ed14e6b
2021-08-04 18:59:46 +00:00
Dana Conrad
4f83e66cd4 FS#13287 - Load a newly saved playlist and resume where it was
Works from any playlist saving operation accessed from the
While Playing Screen, all other playlist saving operations
are unchanged.

Now a user-selectable setting! Located in
General Settings -> Playlists -> Current Playlist ->
Reload After Saving (Yes/No)

Change-Id: I5085c3f4c56c518a812d5ee015d15cc4dca19a28
2021-05-03 20:10:27 +00:00
Christian Soffke
576b56b35a Offer function to Clear List & Play Shuffled when playback is stopped
(as per multiple user requests)

When playback is stopped, Rockbox will display an option to
clear the current playlist and add selected tracks in random order, if
Shuffled Adding options are enabled in Settings.

Insert options will not be displayed anymore when playback is stopped to
lessen confusion.

Change-Id: I5e5819149027e63e5c6f30213e838c0d7e7de8d5
2021-03-16 13:05:12 +00:00
Christian Soffke
2d8e0f7c90 Customizable Current Playlist Submenu
Options to add shuffled tracks and to queue tracks in the
Current Playlist Submenu can now be hidden, or the latter
can also be put into its own submenu.
Users can customize this in Settings  by going to
"General Settings - Playlists -> Current Playlist" and
choosing from "Show Shuffled Adding Options"  (No / Yes)
or "Show Queue Options" (No / Yes / In Submenu).

Allows for the paring down of the set of choices to
a minimum of the 4 more common ones for adding tracks
to a dynamic playlist (coming from the current total
of 11).

Defaults have been set so that users have to actively
modify their settings to notice any difference, which
makes it unlikely that anybody's workflow would be
negatively affected by this change.

Change-Id: Ibe48fc4da2c79f54cd7272df8e1e3ba9955203e5
2021-03-14 23:36:03 +00:00