static void XMMS2_PlayList_SetNext(int absolute) { xmmsc_result_t *result; if (!MP3_XMMS2_IsPlayerRunning()) { Com_Printf("%s is not running\n", mp3_player->PlayerName_LeadingCaps); return; } result = qxmmsc_playlist_set_next(connection, absolute); qxmmsc_result_wait(result); if (qxmmsc_result_iserror (result)) { Com_DPrintf("playlist set next returned error, %s", qxmmsc_result_get_error (result)); } qxmmsc_result_unref (result); /* Start playing the playists song */ result = qxmmsc_playback_tickle(connection); qxmmsc_result_wait(result); if (qxmmsc_result_iserror (result)) { Com_DPrintf("playback tickle returned error, %s", qxmmsc_result_get_error (result)); } qxmmsc_result_unref (result); /* If playback is stopped we need to force play */ if (MP3_XMMS2_GetStatus() == MP3_STOPPED) { MP3_Play_f(); } }
void MP3_PlayTrackNum_f(void) { if (!MP3_IsPlayerRunning()) { Com_Printf("%s\n", mp3_notrunning_msg); return; } if (Cmd_Argc() > 2) { Com_Printf("Usage: %s [track #]\n", Cmd_Argv(0)); return; } if (Cmd_Argc() == 2) { MP3_PlayTrack (atoi(Cmd_Argv(1))); return; } MP3_Play_f(); }
qboolean MP3_PlayTrack (int num) { int length = -1; num -= 1; if (num < 0) return false; MP3_GetPlaylistInfo(NULL, &length); if(num > length) { Com_Printf("XMMS: playlist got only %i tracks\n", length); return false; } qxmms_remote_set_playlist_pos(XMMS_SESSION, num); MP3_Play_f(); return true; }