mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
PictureFlow: Add ability to go to last album
After launch, PictureFlow always goes to the currently playing album, or to a selected album, if applicable. Which is probably a useful default, but not always wanted. You can now get back to the album you were looking at when PictureFlow was last closed, or when the sorting was last changed. Change-Id: Iba3e0d5388f6b49534d09fe0224b0dbfa65d5f1d
This commit is contained in:
parent
bbef598817
commit
49b877470d
3 changed files with 43 additions and 2 deletions
|
@ -16624,3 +16624,17 @@
|
|||
*: "Show Tracks While Browsing"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_GOTO_LAST_ALBUM
|
||||
desc: in PictureFlow Main Menu
|
||||
user: core
|
||||
<source>
|
||||
*: "Go to Last Album"
|
||||
</source>
|
||||
<dest>
|
||||
*: "Go to Last Album"
|
||||
</dest>
|
||||
<voice>
|
||||
*: "Go to Last Album"
|
||||
</voice>
|
||||
</phrase>
|
||||
|
|
|
@ -3241,7 +3241,10 @@ static bool sort_albums(int new_sorting, bool from_settings)
|
|||
|
||||
if(!rb->strcmp(pf_idx.album_names + album_idx, current_album_name) &&
|
||||
!rb->strcmp(pf_idx.artist_names + artist_idx, current_album_artist))
|
||||
{
|
||||
set_current_slide(i);
|
||||
pf_cfg.last_album = i;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -3651,6 +3654,7 @@ static int settings_menu(void)
|
|||
*/
|
||||
enum {
|
||||
PF_SHOW_TRACKS_WHILE_BROWSING,
|
||||
PF_GOTO_LAST_ALBUM,
|
||||
PF_GOTO_WPS,
|
||||
#if PF_PLAYBACK_CAPABLE
|
||||
PF_MENU_CLEAR_PLAYLIST,
|
||||
|
@ -3664,7 +3668,7 @@ enum {
|
|||
static int main_menu(void)
|
||||
{
|
||||
int selection = 0;
|
||||
int result;
|
||||
int result, curr_album;
|
||||
|
||||
#if LCD_DEPTH > 1
|
||||
rb->lcd_set_foreground(N_BRIGHT(255));
|
||||
|
@ -3672,6 +3676,7 @@ static int main_menu(void)
|
|||
|
||||
MENUITEM_STRINGLIST(main_menu, "PictureFlow Main Menu", NULL,
|
||||
ID2P(LANG_SHOW_TRACKS_WHILE_BROWSING),
|
||||
ID2P(LANG_GOTO_LAST_ALBUM),
|
||||
ID2P(LANG_GOTO_WPS),
|
||||
#if PF_PLAYBACK_CAPABLE
|
||||
ID2P(LANG_CLEAR_PLAYLIST),
|
||||
|
@ -3692,6 +3697,24 @@ static int main_menu(void)
|
|||
}
|
||||
show_tracks_while_browsing = true;
|
||||
return 0;
|
||||
case PF_GOTO_LAST_ALBUM:
|
||||
if (pf_state == pf_scrolling)
|
||||
curr_album = target;
|
||||
else
|
||||
curr_album = center_index;
|
||||
|
||||
if (pf_state == pf_show_tracks)
|
||||
free_borrowed_tracks();
|
||||
if (pf_state == pf_show_tracks ||
|
||||
pf_state == pf_cover_in ||
|
||||
pf_state == pf_cover_out)
|
||||
skip_animation_to_idle_state();
|
||||
|
||||
set_current_slide(pf_cfg.last_album);
|
||||
pf_cfg.last_album = curr_album;
|
||||
|
||||
pf_state = pf_idle;
|
||||
return 0;
|
||||
case PF_GOTO_WPS: /* WPS */
|
||||
return -2;
|
||||
#if PF_PLAYBACK_CAPABLE
|
||||
|
@ -4848,6 +4871,9 @@ enum plugin_status plugin_start(const void *parameter)
|
|||
|
||||
ret = file_id3 ? pictureflow_main(file) : pictureflow_main(NULL);
|
||||
if ( ret == PLUGIN_OK || ret == PLUGIN_GOTO_WPS) {
|
||||
if (pf_state == pf_scrolling)
|
||||
pf_cfg.last_album = target;
|
||||
else
|
||||
pf_cfg.last_album = center_index;
|
||||
if (configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS,
|
||||
CONFIG_VERSION))
|
||||
|
|
|
@ -201,6 +201,7 @@ reduces the time it takes for cover art to be displayed.}}
|
|||
\subsubsection{Main Menu}
|
||||
\begin{description}
|
||||
\item[Show Tracks While Browsing.] Scroll through albums from their track list.
|
||||
\item[Go to Last Album.] Go to selected album when PictureFlow was last quit or the sorting changed.
|
||||
\item[Go to WPS.] Leave PictureFlow and enter the While Playing Screen.
|
||||
\item[Clear playlist] Removes all entries from the current playlist.
|
||||
\item[Playback Control.] Control music playback from within the plugin.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue