summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Cellerier <dionoea@videolan.org>2007-10-15 20:34:02 +0000
committerAntoine Cellerier <dionoea@videolan.org>2007-10-15 20:34:02 +0000
commit24907008678ae5d5e609c7d72d073886d7b0010f (patch)
treec76c2f9ebe31f9531d21fbb53a0f419683b72ba9
parent8714b75d2b4b4067370f1ea9520e0c48e7bfa63e (diff)
downloadrockbox-24907008678ae5d5e609c7d72d073886d7b0010f.tar.gz
rockbox-24907008678ae5d5e609c7d72d073886d7b0010f.tar.bz2
rockbox-24907008678ae5d5e609c7d72d073886d7b0010f.zip
Playlist viewer move live preview. Closes FS #7968.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15124 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playlist_viewer.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c
index 8452f4369a..7769e683d5 100644
--- a/apps/playlist_viewer.c
+++ b/apps/playlist_viewer.c
@@ -524,11 +524,33 @@ bool playlist_viewer(void)
return playlist_viewer_ex(NULL);
}
+static int get_track_num( struct playlist_viewer * local_viewer,
+ int selected_item )
+{
+ if( local_viewer->move_track >= 0 )
+ {
+ if( local_viewer->selected_track == selected_item )
+ {
+ return local_viewer->move_track;
+ }
+ else if( local_viewer->selected_track > selected_item
+ && selected_item >= local_viewer->move_track )
+ {
+ return selected_item+1;
+ }
+ else if( local_viewer->selected_track < selected_item
+ && selected_item <= local_viewer->move_track )
+ {
+ return selected_item-1;
+ }
+ }
+ return selected_item;
+}
+
static char *playlist_callback_name(int selected_item, void *data, char *buffer)
{
struct playlist_viewer * local_viewer = (struct playlist_viewer *)data;
- struct playlist_entry *track=
- playlist_buffer_get_track(&(local_viewer->buffer), selected_item);
+ struct playlist_entry *track = playlist_buffer_get_track(&(local_viewer->buffer), get_track_num(local_viewer,selected_item));
format_line(track, buffer, MAX_PATH);
return(buffer);
}
@@ -538,7 +560,8 @@ static int playlist_callback_icons(int selected_item, void *data)
{
struct playlist_viewer * local_viewer=(struct playlist_viewer *)data;
struct playlist_entry *track=
- playlist_buffer_get_track(&(local_viewer->buffer), selected_item);
+ playlist_buffer_get_track(&(local_viewer->buffer),
+ get_track_num(local_viewer, selected_item));
if (track->index == local_viewer->current_playing_track)
{
/* Current playing track */
@@ -580,8 +603,6 @@ bool playlist_viewer_ex(char* filename)
while (!exit)
{
int track;
- if (viewer.move_track != -1)
- gui_synclist_flash(&playlist_lists);
if (global_status.resume_index != -1 && !viewer.playlist)
playlist_get_resume_info(&track);
@@ -616,6 +637,7 @@ bool playlist_viewer_ex(char* filename)
:
BACKWARD
);
+ gui_synclist_draw(&playlist_lists);
}
switch (button)
{