From 627ffd4f644aaa28185347462dd787e9541d99a6 Mon Sep 17 00:00:00 2001
From: Steven
Date: Tue, 24 Aug 2010 00:35:22 +0000
Subject: [PATCH] Make "cd play" progress tracks
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@291 af15c1b1-3010-417e-b628-4374ebc0bcbd
---
Quake/cd_null.c | 8 ++++++++
Quake/cd_sdl.c | 20 +++++++++++++-------
README.html | 3 ++-
README.sgml | 1 +
README.txt | 4 ++++
5 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/Quake/cd_null.c b/Quake/cd_null.c
index 3c9ec51f..f6c605b2 100644
--- a/Quake/cd_null.c
+++ b/Quake/cd_null.c
@@ -33,6 +33,14 @@ void CDAudio_Stop(void)
{
}
+void CDAudio_Next(void)
+{
+}
+
+void CDAudio_Prev(void)
+{
+}
+
void CDAudio_Pause(void)
{
}
diff --git a/Quake/cd_sdl.c b/Quake/cd_sdl.c
index 06f67842..0d7d7379 100644
--- a/Quake/cd_sdl.c
+++ b/Quake/cd_sdl.c
@@ -90,9 +90,6 @@ void CDAudio_Play(byte track, qboolean looping)
return;
}
- if (track == 0)
- track = 1;
-
track = remap[track];
if (track < 1 || track > cd_handle->numtracks)
@@ -231,7 +228,7 @@ void CDAudio_Resume(void)
static void CD_f (void)
{
- const char *command;
+ const char *command,*arg2;
int ret, n;
if (Cmd_Argc() < 2)
@@ -297,13 +294,21 @@ static void CD_f (void)
if (Q_strcasecmp(command, "play") == 0)
{
- CDAudio_Play((byte)atoi(Cmd_Argv (2)), false);
+ arg2 = Cmd_Argv (2);
+ if (*arg2)
+ CDAudio_Play((byte)atoi(Cmd_Argv (2)), false);
+ else
+ CDAudio_Play((byte)1, false);
return;
}
if (Q_strcasecmp(command, "loop") == 0)
{
- CDAudio_Play((byte)atoi(Cmd_Argv (2)), true);
+ arg2 = Cmd_Argv (2);
+ if (*arg2)
+ CDAudio_Play((byte)atoi(Cmd_Argv (2)), true);
+ else
+ CDAudio_Play((byte)1, true);
return;
}
@@ -431,10 +436,11 @@ void CDAudio_Update(void)
curstat = SDL_CDStatus(cd_handle);
if (curstat != CD_PLAYING && curstat != CD_PAUSED)
{
- playing = false;
endOfTrack = -1.0;
if (playLooping)
CDAudio_Play(playTrack, true);
+ else
+ CDAudio_Next();
}
}
}
diff --git a/README.html b/README.html
index 6d211a5d..ce836567 100644
--- a/README.html
+++ b/README.html
@@ -127,7 +127,8 @@ The process is not for the faint hearted.
Small fix to Sound Block/Unblock on win32
Lots of code fixes (some from uhexen2)
Sys_Error calls Host_Shutdown
- Added MS Visual Studio support
+ Added MS Visual Studio support
+ Add a "-cd" option to let the CD Player work in dedicated mode, and some other CD tweaks.
diff --git a/README.sgml b/README.sgml
index 3475a54b..278df96e 100644
--- a/README.sgml
+++ b/README.sgml
@@ -84,6 +84,7 @@ The process is not for the faint hearted.
- Lots of code fixes (some from uhexen2)
- Sys_Error calls Host_Shutdown
- Added MS Visual Studio support
+
- Add a "-cd" option to let the CD Player work in dedicated mode, and some other CD tweaks.
diff --git a/README.txt b/README.txt
index 8bb61803..861e2914 100644
--- a/README.txt
+++ b/README.txt
@@ -136,6 +136,9 @@
o Added MS Visual Studio support
+ o Add a "-cd" option to let the CD Player work in dedicated mode, and
+ some other CD tweaks.
+
5.2. 0.85.2
@@ -188,6 +191,7 @@
o Remove confirm quit dialog
+
o Don't spam the console with PackFile seek requests
o Default to window mode