dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Playing a File
From: Benjamin (
Date: 2003-01-09

Hi all,
I'm developing a bookmark capability for Rockbox. I can write the
bookmark file without any issue, but when I go to load it, I'm not
quiet sure how to get RockBox to play it.

I've looked over the code, but I can't seem to find a function that
would accept a file name (mp3 or m3u), an index in that file (to
handle playlists), and the offset into the MP3 file. I've written
a function that leverages the resume capability of RockBox to do
this, but I'm not having much success. Below is that code.

void Play_File(char* filename, int playlist_index, int file_offset)
    int temp_resume = global_settings.resume;
    global_settings.resume = RESUME_ON; //Keeps the user from being
    strncpy(global_settings.resume_file,filename, MAX_PATH);
    global_settings.resume_index = playlist_index;
    global_settings.resume_offset = file_offset;
    global_settings.resume = temp_resume; //restores original resume

filename will be a full path to a MP3 or M3U file (i.e. \spoken\speech.
playlist_index will be the index of the file to play in a M3U.
file_offset will be the file offset in the MP3 at which to start.

The basic idea is to leverage the existing resume capability to handle
the bookmark playback.

I don't have the ability to debug (I can't get the pesky win32 uisimulator
to compile. Can anyone supply me with one), so any help is appreciated.
I put the full bookmark source at:
zip, which is based off of rockbox-daily-20030106.


Page was last modified "Jan 10 2012" The Rockbox Crew