Commit graph

159 commits

Author SHA1 Message Date
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
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
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
66a411a1ba Tree / Playlist Viewer / Menu: Fix redraw issues
1) Tree_lists was only initialized when booting the player.

In cases where a skin used custom UI viewports of
different sizes, when switching between screens, such as
between root menu, QuickScreen, and tree browser, this
caused list titles to appear with a significant delay,
unless a GUI_EVENT_ACTIONUPDATE was sent.

Tree_lists is now initialized when entering dirbrowse
or when restoring/reloading the list.

This eliminates multiple redundant UI refreshes when
entering the tree browser, due to gui_synclist_draw not
being called twice anymore and by being able to omit
GUI_EVENT_ACTIONUPDATE.

Separate calls to gui_synclist_init_display_settings
have become unnecessary since it is already called
by gui_synclist_init.

2) The synclist is also re-initialized when returning
from the QuickScreen in the Playlist Viewer or
regular menus, or when returning from Settings
menus

Change-Id: I2884249eda55f782e97abad9dc19b3d9d1267fc9
2022-12-08 00:38:59 -05: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
Christian Soffke
0c7f66ab5f Playlist Viewer: Display playlist name in title
Change-Id: I7b258a566f55d026710d3441d1b4188f7614c5ee
2022-11-23 01:22:14 -05: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
b3a464c9d1 Playlist Viewer & Catalogue: Go to WPS when ACTION_TREE_WPS is pressed
Change-Id: Id69253beadcc203ea0e2d16e5acc353aee0f6ad4
2022-11-19 13:39:58 +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
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
b25a9d8f99 add memccpy.c
Not sure if this is worth the added bin size yet but I will
see where I can use it to try and make it worth it

Change-Id: Icc299d3986172ff224a14be48da3bf065d728a66
2022-11-15 00:56:01 -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
c1c0318c8d Playlist Viewer: Fix unintentional fallthrough
Change-Id: Iead5635e0e7f20dc556f26f735fd47597c9169b6
2022-08-19 00:29:17 -04:00
Solomon Peachy
d4917888e3 Fix yellow introduced in cef9fa22ef
(Wrap new function in HAVE_HOTKEY)

Change-Id: Idf5f96bd1e097fc580a6b1ba5be4b93a78de9deb
2022-08-05 14:05:33 -04:00
Christian Soffke
cef9fa22ef playlist viewer: enable hotkey
'File Browser' hotkeys can now be used while
browsing a playlist.

The manual has been updated to reflect this and
to say that the File Browser hotkey works in
the context of the database as well (existing
behavior)

Change-Id: I51b23e82e0fb00772efdb8784db966d454fb2560
2022-08-05 11:39:35 -04:00
Christian Soffke
7727486423 playlist viewer: add menu option to show songs in pictureflow
(The playlist viewer has to be re-initialized
after returning from PictureFlow, since they
both use the plugin buffer)

Change-Id: Ib3ef0acec65c88363830c59c8c73e9cdf8b528f0
2022-08-05 11:39:35 -04:00
Christian Soffke
6703f43f5c Playlist Viewer: Always retrieve track Info from disk
Frequency, file size, and the codec are not stored
in the database and thus can’t be displayed in the
Playlist Viewer's Track Info screen when metadata
is only retrieved from the database.

Change-Id: I9e1d11c13ad8bf7b90b654ed78e4e7f763c30f8a
2022-04-17 10:58:42 -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
1697b13693 whitespace fixes
Change-Id: I86880595b78e3cae62361c32ca57cf6f6a4ad963
2021-10-21 22:42:01 +02:00
James Smith
4f450b6e11 Revert "Playlist Viewer: Add file properties to playlist entry menu."
This reverts commit 67716c6b46.

Reason for revert: Only partially working on bare-metal ports, so revert this for now.

Change-Id: I5cea7d2b6466a43aaff4c3eb90ab5d7aee736a5b
2021-09-29 00:53:48 -04:00
James Smith
a7f2d1ffb4 Revert "Fix the build for 67716c6b."
This reverts commit 483563a1b2.

Reason for revert: Only partially works.

Change-Id: I28e412bf4eeb515cf72845f27d5772746cebc5e5
2021-09-29 00:53:29 -04:00
James D. Smith
483563a1b2 Fix the build for 67716c6b.
Change-Id: I3917f64313345cf39d6105a0c0bc2f2a4617be8a
2021-09-19 21:28:10 -06:00
James D. Smith
67716c6b46 Playlist Viewer: Add file properties to playlist entry menu.
Change-Id: I8fb0da7d117e4a011345bae7f6137ab3253fea4f
2021-09-19 21:05:38 -04:00
Christian Soffke
4bc7bafc68 Enable QuickScreen in filtered dir modes & playlist viewer
Will allow the QuickScreen to be accessed in the playlist catalogue
and when editing a playlist using the playlist viewer.

Change-Id: I4b7108db6384eb2077ffdccb2992f2e51a39f42f
2021-04-04 11:14:18 +02:00
Christian Soffke
76c9e3f558 Use "Save" instead of "Save Current Playlist" in Playlist Viewer
LANG_SAVE_DYNAMIC_PLAYLIST refers to dynamic playlists.

A playlist being edited is only the "current playlist" in case of a
dynamic playlist. When other playlists are edited, the current
playlist is different from the edited/selected playlist.

(A possible motivation for differentiating between the two here
is because "Current Playlist" is already the title of a submenu in that
same context menu where the name refers to the dynamic playlist
and not to the selected playlist. "Save Current Playlist" is also used
in the Playlist Catalogue's context menu for example, referring to
the dynamic playlist.)

Change-Id: If320b3c804bb98fccb2e945ae1a30ffc92673c7e
2021-03-11 19:43:48 +00:00
William Wilgus
cb94b3ae2e keyboard add ability to specify temporary custom layouts
rb core allows you to load custom keyboard layouts

this patch adds the ability to load a keyboard layout in a buffer
the custom layout is temporary and does not overwrite the current layout

use like so:

    unsigned short kbd[64];
    unsigned short *kbd_p = kbd;
    if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
        kbd_p = NULL;

    rb->kbd_input(buf,sizeof(buf), kbd_p);

Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
2020-07-22 06:48:28 -04:00
William Wilgus
776ceae119 Playlist Viewer Fix FS#13197
While playing a track the playlist viewer may not
have a big enough temporary buffer to load and display
'max_files_in_playlist' entries

This patch attempts to load as many entries as possible

If tracks were already playing (dynamic playlist or otherwise)
The original code only gave half the plugin buffer to a playlist
loaded from file

On some targets half the plugin buffer is not enough to load all entries…

Now we attempt to get as many entries possible while at least leaving a
small buffer (MAX_PATH) for the name buffer

Change-Id: Ic06eaabc4e2550f076d625957d6d073790852743
2020-05-20 18:41:58 +02:00
Solomon Peachy
4adad0bc1f FS#6323: Speech for ID3 viewer, playlist catalog and playlist viewer
Modified from original ticket, Taken from Igor Poretsky's tree, and
further modified by myself to incorporate feedback.

Change-Id: Ibc2180e52af76890b1448d23f79386fd0f88f709
2018-12-15 18:00:23 +01:00
Thomas White
d5ead5c8fa Don't shorten the playlist on shuffle. Fixes FS#13040
Change-Id: Ia482ac8248d831a5364ec7bf4d2ccb7b361d2f05
2015-04-19 12:31:45 +02:00
Michael Sevakis
31b7122867 Implement time-based resume and playback start.
This complements offset-based resume and playback start funcionality.
The implementation is global on both HWCODEC and SWCODEC.

Basically, if either the specified elapsed or offset are non-zero,
it indicates a mid-track resume.

To resume by time only, set elapsed to nonzero and offset to zero.
To resume by offset only, set offset to nonzero and elapsed to zero.

Which one the codec uses and which has priority is up to the codec;
however, using an elapsed time covers more cases:

* Codecs not able to use an offset such as VGM or other atomic
formats

* Starting playback at a nonzero elapsed time from a source that
contains no offset, such as a cuesheet

The change re-versions pretty much everything from tagcache to nvram.

Change-Id: Ic7aebb24e99a03ae99585c5e236eba960d163f38
Reviewed-on: http://gerrit.rockbox.org/516
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2014-03-10 04:12:30 +01:00
Thomas Martitz
fe73d75e74 playlist_viewer: Reset icon callback after leaving the playlist viewer settings.
This fixes that the playlist viewer still shows the icons after changing
the playlist viewer specific show_icons value until re-opened.

Change-Id: I42f287bcf02b27f0255dc157560c2e6575307eb6
2014-01-11 10:49:45 +01:00
Thomas Martitz
2d4bf62032 playlist_viewer: Resurrect playlist viewer settings submenu in the playlist viewer context menu.
This was lost in 97a4c1ef (svn r30177) for unkown reason but the manual still
mentions this item, so I assume it was an accident. It doesn't hurt anyway.

Fixes FS#12930.

Change-Id: I2f5cd81913ec7bb911d1117e50c010a5c1b89b52
2014-01-11 10:46:37 +01:00
Purdea Andrei
323282f22d Fixing data abort (pc in strchr). when scrolling a big playlist very fast.
Change-Id: Ibe00a11592a18d320682cce755e48ce701ff5b4a
Reviewed-on: http://gerrit.rockbox.org/281
Reviewed-by: Thomas Martitz <kugel@rockbox.org>
Tested-by: Thomas Martitz <kugel@rockbox.org>
2012-07-19 00:00:41 +02:00
Boris Gjenero
8e6030c822 FS#12378 : Remove various unused code, and comment out some unused code and data for reference or future use.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31256 a1c6a512-1295-4272-9138-f99709370657
2011-12-14 21:45:25 +00:00
Jonathan Gordon
e03faf835d Add an option to shuffle the playlist in the playlist viewer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30563 a1c6a512-1295-4272-9138-f99709370657
2011-09-17 09:29:19 +00:00
Thomas Martitz
d1322b7159 GSoC/Buflib: Replace all direct accesses to audiobuf with buffer API functions.
Namely, introduce buffer_get_buffer() and buffer_release_buffer().
buffer_get_buffer() aquires all available and grabs a lock, attempting to
call buffer_alloc() or buffer_get_buffer() while this lock is locked will cause
a panicf() (doesn't actually happen, but is for debugging purpose).
buffer_release_buffer() unlocks that lock and can additionally increment the
audiobuf buffer to make an allocation. Pass 0 to only unlock if buffer was
used temporarily only.
buffer_available() is a replacement function to query audiobuflen, i.e. what's
left in the buffer.
Buffer init is moved up in the init chain and handles ipodvideo64mb internally.

Further changes happened to mp3data.c and talk.c as to not call the above API
functions, but get the buffer from callers. The caller is the audio system
which has the buffer lock while mp3data.c and talk mess with the buffer.
mpeg.c now implements some buffer related functions of playback.h, especially
audio_get_buffer(), allowing to reduce #ifdef hell a tiny bit.

audiobuf and audiobufend are local to buffer.c now.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30308 a1c6a512-1295-4272-9138-f99709370657
2011-08-14 15:13:00 +00:00
Jonathan Gordon
835683b442 %cs (current screen) changes:
* Every top level menu item now has a different screen number
* Playlist viewer and Playlist Catalogue browsers no longer share the same number

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30261 a1c6a512-1295-4272-9138-f99709370657
2011-08-07 08:39:56 +00:00
Frank Gevaerts
94b4a8bb9a revert r30226, which is apparently broken.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30232 a1c6a512-1295-4272-9138-f99709370657
2011-08-01 08:38:32 +00:00
Frank Gevaerts
92b392e722 Reload the current playlist after reboot even if it has ended. (FS#11644)
This is done to make reboot more transparent. If a playlist has ended, there should be no difference between the player doing nothing for ten minutes and the player shutting down after the idle timeout and being restarted.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30226 a1c6a512-1295-4272-9138-f99709370657
2011-07-31 12:56:00 +00:00
Jonathan Gordon
d1fd4f08f5 Fix FS#8656 - Error saving non-current playlist file
Use the plugin buffer to save the playlist copy if there isnt enough buffer already allocated to the inram copy of the playlist

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30184 a1c6a512-1295-4272-9138-f99709370657
2011-07-21 06:40:21 +00:00
Jonathan Gordon
061ff42187 s/Playlist/Current Playlist/ in the playlist viewer context menu.
This menu needs to be changed to a proper menu so the icons dont suck

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30180 a1c6a512-1295-4272-9138-f99709370657
2011-07-20 14:54:10 +00:00
Jonathan Gordon
97a4c1efa4 FS#11808 - Major playlist handling changes (on disk playlists)
* Playlists are treated similar to directories in the browser, they now open in the viewer when selected instead of automatically starting the playlist.
* Make the "Playlists" main menu item useful, it now displays the playlist catalog (and has been renamed accordingly)
* Default to storing playlists in the catalog
* Add a UI to move the catalog directory

(other minor stuff too)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30177 a1c6a512-1295-4272-9138-f99709370657
2011-07-20 14:11:15 +00:00
Nils Wallménius
e7c6ba66aa Whitespace and cosmetics consistency cleanup in playlist_viewer.c, no functional changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29694 a1c6a512-1295-4272-9138-f99709370657
2011-04-08 13:39:56 +00:00
Nils Wallménius
a0791178ae Voice filenames in the playlist viewer, closes FS#11951
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29693 a1c6a512-1295-4272-9138-f99709370657
2011-04-08 13:10:32 +00:00
Thomas Martitz
16d44e9b02 Playlist viewer: Fix regression introduced by r28138 which made some buttons not work in the playlist viewer.
Fixes FS#11772.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28648 a1c6a512-1295-4272-9138-f99709370657
2010-11-23 07:39:16 +00:00
Thomas Martitz
c4925f14a3 Playlist viewer: Fix off-by-one when moving tracks caused by r28131.
The callbacks for the list code need the current item for rendering the moving track,
which is not known until after the first draw. Hence the first draw is off.
A second one is needed.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28199 a1c6a512-1295-4272-9138-f99709370657
2010-10-02 20:15:35 +00:00