'cd next', 'cd prev' commands. 'cd play' plays track 1.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@950 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
stevenaaus 2014-08-04 00:08:22 +00:00
parent 797b3bd0f8
commit cebc9431a6
2 changed files with 23 additions and 2 deletions

View file

@ -291,3 +291,5 @@ debug:
clean:
rm -f $(shell find . \( -name '*~' -o -name '#*#' -o -name '*.o' -o -name '*.res' -o -name $(DEFAULT_TARGET) \) -print)
install: quakespasm
cp quakespasm /usr/local/games/quake

View file

@ -229,7 +229,7 @@ static void CD_f (void)
Con_Printf("commands:");
Con_Printf("on, off, reset, remap, \n");
Con_Printf("play, stop, loop, pause, resume\n");
Con_Printf("eject, info\n");
Con_Printf("eject, info, next, prev\n");
return;
}
@ -287,7 +287,10 @@ static void CD_f (void)
if (q_strcasecmp(command, "play") == 0)
{
CDAudio_Play((byte)atoi(Cmd_Argv (2)), false);
n = atoi(Cmd_Argv (2));
if (n == 0)
n = 1;
CDAudio_Play((byte)n, false);
return;
}
@ -351,6 +354,22 @@ static void CD_f (void)
return;
}
if (q_strcasecmp(command, "next") == 0)
{
if (playTrack == cd_handle->numtracks)
playTrack = 0;
CDAudio_Play(playTrack + 1, playLooping);
return;
}
if (q_strcasecmp(command, "prev") == 0)
{
if (playTrack == 1)
playTrack = cd_handle->numtracks + 1;
CDAudio_Play(playTrack - 1, playLooping);
return;
}
Con_Printf("cd: unknown command \"%s\".\n",command);
}