Rockbox mail archive
Subject: Re: just curious
From: Jerome Kuptz (jerome_at_geekrox.com)
Well here is a patch for the player made against current cvs. It puts
the playlist in the root directory as "favorites.m3u". I took over the
Menu + Play combo (normally mute on the player) just to test until I can
dig up a better combo button to use :).
This is not complete, but should demonstrate the feature.
Jerome Kuptz wrote:
> My only issue is that I don't have a recorder. I could supply a patch
> for ppl to try on the player, but someone else would have to pick a
> key combo for the recorder. We could put it behind menus as well, but
> then that drastically reduces it's usefulness imo.
> Eric Linenberg wrote:
>> this sounds awesome. I would love for there to be a favorites.m3u
>> file in the /.rockbox directory or something like that. I download
>> many mp3s from shoutcast and then listen to them as if I am listening
>> to the radio.
>> JK> Awhile back I did a preliminary favorite track(s) marker
>> JK> at the press of a combo button. Since we have file writes I
>> went ahead
>> JK> made it so that a favorites.m3u is created, and each selection is
>> JK> appended to the list. Thus it's very easy to go back later from
>> a large
>> JK> shuffle|playlist and play just the ones you really really like.
>> JK> Panasonic does/did this with their large cd players when they first
>> JK> started coming out.
>> JK> I'm curious if ppl care about this type of feature before I put
>> JK> work into it. I have cvs access and could proceed with furthering
>> JK> development
>> JK> on it (clean up and such), but I would need someone to pick up on
>> JK> recorder testing/implementation (I don't have one).
>> JK> The feature is described here as well, and was submitted long ago.
>> JK> Comments? Thoughts? Useless?
>> JK> --jk
RCS file: /cvsroot/rockbox/apps/wps.c,v
retrieving revision 1.173
diff -u -r1.173 wps.c
--- wps.c 23 Jan 2003 14:28:16 -0000 1.173
+++ wps.c 24 Jan 2003 05:32:18 -0000
@@ -53,6 +53,44 @@
static struct mp3entry* id3 = NULL;
static char current_track_path[MAX_PATH+1];
+#define FAVORITES_FILE "/favorites.m3u"
+ bool sucess = false;
+ int fd, seek, result, len;
+ if (!(mpeg_status() & MPEG_STATUS_PLAY))
+ return sucess;
+ fd = open(FAVORITES_FILE, O_WRONLY);
+ // creat the file if it does not return on open.
+ if (fd < 0)
+ fd = creat(FAVORITES_FILE, 0);
+ if (fd > 0)
+ len = strlen(current_track_path);
+ // seek to the end of file
+ seek = lseek(fd, 0, SEEK_END);
+ // append the current mp3 path
+ current_track_path[len] = '\n';
+ result = write(fd, current_track_path, len);
+ current_track_path[len] = '\0';
+ if (result > 0)
+ sucess = true;
+ return sucess;
void player_change_volume(int button)
@@ -575,15 +613,18 @@
/* mute */
- case BUTTON_MENU | BUTTON_PLAY:
+ case BUTTON_MENU | BUTTON_PLAY:
case BUTTON_F1 | BUTTON_PLAY:
- if ( muted )
- mpeg_sound_set(SOUND_VOLUME, global_settings.volume);
+ if ( muted )
+ mpeg_sound_set(SOUND_VOLUME, global_settings.volume);
muted = !muted;
@@ -796,7 +837,6 @@
/* volume up */
RCS file: /cvsroot/rockbox/apps/wps.h,v
retrieving revision 1.17
diff -u -r1.17 wps.h
--- wps.h 21 Nov 2002 09:32:32 -0000 1.17
+++ wps.h 24 Jan 2003 05:32:18 -0000
@@ -27,6 +27,7 @@
bool refresh_wps(bool refresh_scroll);
Page was last modified "Jan 10 2012" The Rockbox Crew