mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
cd_sdl: prev and next commands must handle data tracks properly.
git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@951 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
cebc9431a6
commit
71c17d7e89
1 changed files with 12 additions and 3 deletions
|
@ -219,6 +219,15 @@ void CDAudio_Resume(void)
|
|||
pausetime = -1.0;
|
||||
}
|
||||
|
||||
static int get_first_audiotrk (void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < cd_handle->numtracks; ++i)
|
||||
if (cd_handle->track[i].type != SDL_DATA_TRACK)
|
||||
return ++i;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void CD_f (void)
|
||||
{
|
||||
const char *command;
|
||||
|
@ -356,15 +365,15 @@ static void CD_f (void)
|
|||
|
||||
if (q_strcasecmp(command, "next") == 0)
|
||||
{
|
||||
if (playTrack == cd_handle->numtracks)
|
||||
playTrack = 0;
|
||||
if (playTrack == cd_handle->numtracks)
|
||||
playTrack = get_first_audiotrk() - 1;
|
||||
CDAudio_Play(playTrack + 1, playLooping);
|
||||
return;
|
||||
}
|
||||
|
||||
if (q_strcasecmp(command, "prev") == 0)
|
||||
{
|
||||
if (playTrack == 1)
|
||||
if (playTrack == get_first_audiotrk())
|
||||
playTrack = cd_handle->numtracks + 1;
|
||||
CDAudio_Play(playTrack - 1, playLooping);
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue