mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
Commit FS#12069 - Playback rework - first stages. Gives as thorough as possible a treatment of codec management, track change and metadata logic as possible while maintaining fairly narrow focus and not rewriting everything all at once. Please see the rockbox-dev mail archive on 2011-04-25 (Playback engine rework) for a more thorough manifest of what was addressed. Plugins and codecs become incompatible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29785 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dcf0f8de4a
commit
c537d5958e
62 changed files with 6047 additions and 4221 deletions
|
|
@ -822,9 +822,6 @@ static int add_track_to_playlist(struct playlist_info* playlist,
|
|||
playlist->amount++;
|
||||
playlist->num_inserted_tracks++;
|
||||
|
||||
/* Update index for resume. */
|
||||
playlist_update_resume_index();
|
||||
|
||||
return insert_position;
|
||||
}
|
||||
|
||||
|
|
@ -925,9 +922,6 @@ static int remove_track_from_playlist(struct playlist_info* playlist,
|
|||
sync_control(playlist, false);
|
||||
}
|
||||
|
||||
/* Update index for resume. */
|
||||
playlist_update_resume_index();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -987,9 +981,6 @@ static int randomise_playlist(struct playlist_info* playlist,
|
|||
playlist->first_index, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Update index for resume. */
|
||||
playlist_update_resume_index();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1030,9 +1021,6 @@ static int sort_playlist(struct playlist_info* playlist, bool start_current,
|
|||
playlist->first_index, -1, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Update index for resume. */
|
||||
playlist_update_resume_index();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1205,9 +1193,6 @@ static void find_and_set_playlist_index(struct playlist_info* playlist,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update index for resume. */
|
||||
playlist_update_resume_index();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2486,6 +2471,12 @@ const char* playlist_peek(int steps, char* buf, size_t buf_size)
|
|||
if (index < 0)
|
||||
return NULL;
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Just testing - don't care about the file name */
|
||||
if (!buf || !buf_size)
|
||||
return "";
|
||||
#endif
|
||||
|
||||
control_file = playlist->indices[index] & PLAYLIST_INSERT_TYPE_MASK;
|
||||
seek = playlist->indices[index] & PLAYLIST_SEEK_MASK;
|
||||
|
||||
|
|
@ -2632,30 +2623,17 @@ int playlist_get_resume_info(int *resume_index)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* Get current playlist index. */
|
||||
int playlist_get_index(void)
|
||||
{
|
||||
return current_playlist.index;
|
||||
}
|
||||
|
||||
/* Update resume index within playlist_info structure. */
|
||||
void playlist_update_resume_index(void)
|
||||
{
|
||||
struct playlist_info* playlist = ¤t_playlist;
|
||||
playlist->resume_index = playlist->index;
|
||||
}
|
||||
|
||||
/* Update resume info for current playing song. Returns -1 on error. */
|
||||
int playlist_update_resume_info(const struct mp3entry* id3)
|
||||
{
|
||||
struct playlist_info* playlist = ¤t_playlist;
|
||||
|
||||
|
||||
if (id3)
|
||||
{
|
||||
if (global_status.resume_index != playlist->resume_index ||
|
||||
if (global_status.resume_index != playlist->index ||
|
||||
global_status.resume_offset != id3->offset)
|
||||
{
|
||||
global_status.resume_index = playlist->resume_index;
|
||||
global_status.resume_index = playlist->index;
|
||||
global_status.resume_offset = id3->offset;
|
||||
status_save();
|
||||
}
|
||||
|
|
@ -3203,9 +3181,6 @@ int playlist_move(struct playlist_info* playlist, int index, int new_index)
|
|||
queue_post(&playlist_queue, PLAYLIST_LOAD_POINTERS, 0);
|
||||
#endif
|
||||
|
||||
/* Update index for resume. */
|
||||
playlist_update_resume_index();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue