Rockbox mail archiveSubject: RE: Playing a File
RE: Playing a File
From: Hardeep Sidhu <hardeeps_at_pobox.com>
Date: Thu, 9 Jan 2003 21:55:00 -0800
Yes, you should be using playlist to resume a bookmark because the mpeg code
queries the playlist code to determine what to play. IMO, what you should
be saving in your bookmark is _exactly_ the same information that we save
for resume purposes.
int resume_index; /* index in playlist (-1 for no active resume) */
int resume_offset; /* byte offset in mp3 file */
int resume_seed; /* random seed for playlist shuffle */
int resume_first_index; /* first index of playlist */
int queue_resume; /* resume queue file?: 0 = no
1 = resume at queue index
2 = resume at playlist index */
int queue_resume_index; /* queue index (seek point in queue file) */
unsigned char resume_file[MAX_PATH+1]; /* playlist name (or dir) */
Then, to resume a bookmark, all you need to do is what is done in
> -----Original Message-----
> From: owner-rockbox_at_cool.haxx.se [mailto:owner-rockbox_at_cool.haxx.se]On
> Behalf Of Benjamin
> Sent: Thursday, January 09, 2003 1:16 PM
> To: rockbox_at_cool.haxx.se
> Subject: RE: Playing a File
> Thanks Hardeep,
> Should I be using play_list()? This seems to be more functionality
> then I need since I can provide the playlist/mp3 file. Is there
> a way to bypass this and use mpeg_play() directly?
> build_playlist takes a int, but I'm not sure what it is looking for.
> It indicates that it is the start_index, but I'm not sure how it
> all ties together.
> This is the information that I am storing in the bookmark file.
> 1. Bookmarked file name (MP3/M3U)
> 2. Index (in the case of a booked mark M3U this would be a 0 based
> index or 0 in the case of bookmarked MP3).
> 3. Offset into the MP3.
> With this information, I assume the following:
> 1. Clear out any existing playlists with playlist_clear();
> 2. Call build_playlist() (again, I'm not sure what the passed in
> 3. Call mpeg_play(with the above offset).
> Does this make sense to do it this way?
> > Hi Benjamin,
> > If you want to play a track in a directory, you first need to call
> > apps/tree.c:build_playlist(). Secondly, your assumptions about
> > are not quite correct. If you want to play a track in a directory,
> > arguments would be:
> > int play_list(char *dir, // Absolute pathname of directory
> > the mp3 file)
> > char *file, // NULL
> > int start_index, // Index, in directory, of the
> track > you
> > want to play
> > bool shuffled_index, // FALSE (only needed for shuffle
> > int start_offset, // file offset
> > int random_seed, // 0 (only needed for shuffle play)
> > int first_index, // 0 (index to first track in
> > int queue_resume, // FALSE (only needed for queue
> > int queue_resume_index ) // 0 (only needed for queue
> > Take a look at apps/tree.c:start_resume() to see how play_list()
> is used for
> > both directories and playlist files.
> > -Hardeep
Received on 2003-01-10