Index: apps/plugins/SOURCES =================================================================== RCS file: /cvsroot/rockbox/apps/plugins/SOURCES,v retrieving revision 1.51 diff -u -r1.51 SOURCES --- apps/plugins/SOURCES 7 Aug 2005 22:20:39 -0000 1.51 +++ apps/plugins/SOURCES 17 Aug 2005 02:53:57 -0000 @@ -15,6 +15,7 @@ vbrfix.c viewer.c dict.c +appendplaylist.c #ifdef HAVE_LCD_BITMAP /* Recorder/Ondio models only */ bounce.c Index: apps/plugins/viewers.config =================================================================== RCS file: /cvsroot/rockbox/apps/plugins/viewers.config,v retrieving revision 1.22 diff -u -r1.22 viewers.config --- apps/plugins/viewers.config 4 Jul 2005 07:07:43 -0000 1.22 +++ apps/plugins/viewers.config 17 Aug 2005 02:53:57 -0000 @@ -21,4 +21,4 @@ mid,midi2wav.rock, 20 70 70 3F 00 00 rsp,searchengine.rock, 0e 11 11 31 7e 60 wav,wav2wv.rock, 00 00 00 00 00 00 - +m3u,appedplaylist.rock, 00 00 00 00 00 00 --- /dev/null 2005-08-17 04:45:34.000000000 +0100 +++ apps/plugins/appendplaylist.c 2005-08-17 04:43:42.000000000 +0100 @@ -0,0 +1,49 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * + * Copyright (C) 2005 David Dent + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ +#include "plugin.h" + +static struct plugin_api* rb; + +/* this is the plugin entry point */ +enum plugin_status plugin_start(struct plugin_api* api, void* parameter) +{ + TEST_PLUGIN_API(api); + (void)parameter; + rb = api; + + struct mp3entry* id3 = rb->audio_current_track(); + if (!id3) + { + rb->splash(HZ, true, "Error getting filename"); + return PLUGIN_OK; + } + + int fd = rb->open(parameter, O_CREAT|O_WRONLY|O_APPEND); + if (!fd) + { + rb->splash(HZ, true, "Error opening playlist"); + return PLUGIN_OK; + } + + rb->write(fd, id3->path, rb->strlen(id3->path)); + rb->write(fd, "\n", rb->strlen("\n")); + + rb->close(fd); + + return PLUGIN_OK; +}