static void start_music0 (gchar *filename) { gchar *playlist[1]; gint i; playlist[0] = filename; old_length = xmms_remote_get_playlist_length (0); old_playlist = (gchar **) g_malloc (old_length * sizeof (gchar *)); for (i = 0; i < old_length; i++) old_playlist[i] = xmms_remote_get_playlist_file (0, i); #ifdef XMMS_PLAYLIST_BUG xmms_remote_playlist_clear (0); xmms_remote_playlist (0, playlist, 1, TRUE); xmms_remote_play (0); #else xmms_remote_playlist (0, playlist, 1, FALSE); #endif old_repeat = xmms_remote_is_repeat (0); if (!old_repeat) xmms_remote_toggle_repeat (0); }
void xmms_remote_playlist_add(int session, GList * list) { char **str_list; GList *node; int i, num; g_return_if_fail(list != NULL); num = g_list_length(list); str_list = g_malloc0(num * sizeof (char *)); for (i = 0, node = list; i < num && node; i++, node = g_list_next(node)) str_list[i] = node->data; xmms_remote_playlist(session, str_list, num, TRUE); g_free(str_list); }
void sound_stop_music () { gint i; if (xmms_remote_is_running (0)) { if (xmms_remote_is_playing (0)) xmms_remote_stop (0); xmms_remote_playlist_clear (0); xmms_remote_playlist (0, old_playlist, old_length, TRUE); if (xmms_remote_is_repeat (0) != old_repeat) xmms_remote_toggle_repeat (0); } for (i = 0; i < old_length; i++) g_free (old_playlist[i]); g_free (old_playlist); }