Mercurial > audlegacy
changeset 1365:97000f8de201 trunk
[svn] - Added playlist-delete command.
author | nhjm449 |
---|---|
date | Sat, 01 Jul 2006 04:24:23 -0700 |
parents | 18a6a71b8c15 |
children | f66048e606f0 |
files | ChangeLog audtool/audtool.c audtool/audtool.h |
diffstat | 3 files changed, 31 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sat Jul 01 04:01:26 2006 -0700 +++ b/ChangeLog Sat Jul 01 04:24:23 2006 -0700 @@ -1,3 +1,12 @@ +2006-07-01 11:01:26 +0000 George Averill <nhjm449@gmail.com> + revision [1640] + - No more cdaudio crashy. + + + Changes: Modified: + +3 -2 trunk/Plugins/Input/cdaudio/cdaudio.c + + 2006-07-01 10:11:13 +0000 William Pitcock <nenolod@nenolod.net> revision [1638] - fix the skinwin realisation bug
--- a/audtool/audtool.c Sat Jul 01 04:01:26 2006 -0700 +++ b/audtool/audtool.c Sat Jul 01 04:24:23 2006 -0700 @@ -40,6 +40,7 @@ {"playlist-advance", playlist_advance, "go to the next song in the playlist"}, {"playlist-reverse", playlist_reverse, "go to the previous song in the playlist"}, {"playlist-addurl", playlist_add_url_string, "adds a url to the playlist"}, + {"playlist-delete", playlist_delete, "deletes a song from the playlist"}, {"playlist-length", playlist_length, "returns the total length of the playlist"}, {"playlist-song", playlist_song, "returns the title of a song in the playlist"}, {"playlist-song-filename", playlist_song_filename, "returns the filename of a song in the playlist"}, @@ -335,6 +336,26 @@ xmms_remote_playlist_add_url_string(session, argv[2]); } +void playlist_delete(gint session, gint argc, gchar **argv) +{ + if (argc < 3) + { + g_print("%s: invalid parameters for playlist-delete.\n", argv[0]); + g_print("%s: syntax: %s playlist-delete <position>\n", argv[0], argv[0]); + return; + } + + gint playpos = atoi(argv[2]); + + if (playpos < 1 || playpos > xmms_remote_get_playlist_length(session)) + { + g_print("%s: invalid playlist position %d\n", argv[0], playpos); + return; + } + + xmms_remote_playlist_delete(session, playpos - 1); +} + void playlist_length(gint session, gint argc, gchar **argv) { gint i;
--- a/audtool/audtool.h Sat Jul 01 04:01:26 2006 -0700 +++ b/audtool/audtool.h Sat Jul 01 04:24:23 2006 -0700 @@ -54,6 +54,7 @@ extern void playlist_position(gint, gint, gchar **); extern void playlist_jump(gint, gint, gchar **); extern void playlist_add_url_string(gint, gint, gchar **); +extern void playlist_delete(gint, gint, gchar **); extern void playlist_clear(gint, gint, gchar **); extern void playlist_repeat_status(gint, gint, gchar **); extern void playlist_repeat_toggle(gint, gint, gchar **);