move the creation of the cd command to cd.c

This commit is contained in:
Bill Currie 2001-06-02 04:36:42 +00:00
parent 28638a9a98
commit 88d536933f
5 changed files with 32 additions and 77 deletions

View file

@ -29,6 +29,7 @@
*/
#include "QF/cdaudio.h"
#include "QF/cmd.h"
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
@ -38,22 +39,6 @@ cvar_t *cd_plugin;
plugin_t *cdmodule = NULL;
int
CDAudio_Init (void)
{
cd_plugin = Cvar_Get ("cd_plugin", "null", CVAR_ARCHIVE, NULL,
"CD Plugin to use");
cdmodule = PI_LoadPlugin ("cd", cd_plugin->string);
if (!cdmodule) {
Con_Printf ("Loading of cd module: %s failed!\n", cd_plugin->string);
return -1;
} else {
cdmodule->functions->general->p_Init ();
return 0; // FIXME: Assumes success
}
}
void
CDAudio_Pause (void)
{
@ -100,3 +85,33 @@ CD_f (void)
if (cdmodule)
cdmodule->functions->cd->pCD_f ();
}
int
CDAudio_Init (void)
{
cd_plugin = Cvar_Get ("cd_plugin", "null", CVAR_ARCHIVE, NULL,
"CD Plugin to use");
cdmodule = PI_LoadPlugin ("cd", cd_plugin->string);
if (!cdmodule) {
Con_Printf ("Loading of cd module: %s failed!\n", cd_plugin->string);
return -1;
} else {
cdmodule->functions->general->p_Init ();
return 0; // FIXME: Assumes success
}
Cmd_AddCommand ("cd", CD_f, "Control the CD player.\n"
"Commands:\n"
"eject - Eject the CD.\n"
"info - Reports information on the CD.\n"
"loop (track number) - Loops the specified track.\n"
"remap (track1) (track2) ... - Remap the current track order.\n"
"reset - Causes the CD audio to re-initialize.\n"
"resume - Will resume playback after pause.\n"
"off - Shuts down the CD audio system..\n"
"on - Re-enables the CD audio system after a cd off command.\n"
"pause - Pause the CD playback.\n"
"play (track number) - Plays the specified track one time.\n"
"stop - Stops the currently playing track.");
Con_Printf ("CD Audio Initialized\n");
}

View file

@ -49,8 +49,8 @@
#include <linux/cdrom.h>
#include "QF/cdaudio.h"
#include "QF/cmd.h"
#include "QF/console.h"
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
@ -454,22 +454,6 @@ I_CDAudio_Init (void)
{
mus_cddevice = Cvar_Get("mus_cddevice", "/dev/cdrom", CVAR_NONE,
Mus_CDChange, "device to use for CD music");
Cmd_AddCommand ("cd", I_CD_f, "Control the CD player.\n"
"Commands:\n"
"eject - Eject the CD.\n"
"info - Reports information on the CD.\n"
"loop (track number) - Loops the specified track.\n"
"remap (track1) (track2) ... - Remap the current track order.\n"
"reset - Causes the CD audio to re-initialize.\n"
"resume - Will resume playback after pause.\n"
"off - Shuts down the CD audio system..\n"
"on - Re-enables the CD audio system after a cd off command.\n"
"pause - Pause the CD playback.\n"
"play (track number) - Plays the specified track one time.\n"
"stop - Stops the currently playing track.");
Con_Printf ("CD Audio Initialized\n");
}

View file

@ -283,20 +283,6 @@ I_CDAudio_Init (void)
cdValid = false;
}
Cmd_AddCommand ("cd", I_CD_f, "Control the CD player.\n"
"Commands:\n"
"eject - Eject the CD.\n"
"info - Reports information on the CD.\n"
"loop (track number) - Loops the specified track.\n"
"remap (track1) (track2) ... - Remap the current track order.\n"
"reset - Causes the CD audio to re-initialize.\n"
"resume - Will resume playback after pause.\n"
"off - Shuts down the CD audio system..\n"
"on - Re-enables the CD audio system after a cd off command.\n"
"pause - Pause the CD playback.\n"
"play (track number) - Plays the specified track one time.\n"
"stop - Stops the currently playing track.");
Con_Printf ("CD Audio Initialized.\n");
}

View file

@ -348,20 +348,6 @@ pCDAudio_Init (void)
initialized = true;
enabled = true;
Cmd_AddCommand ("cd", CD_f, "Control the CD player.\n"
"Commands:\n"
"eject - Eject the CD.\n"
"info - Reports information on the CD.\n"
"loop (track number) - Loops the specified track.\n"
"remap (track1) (track2) ... - Remap the current track order.\n"
"reset - Causes the CD audio to re-initialize.\n"
"resume - Will resume playback after pause.\n"
"off - Shuts down the CD audio system..\n"
"on - Re-enables the CD audio system after a cd off command.\n"
"pause - Pause the CD playback.\n"
"play (track number) - Plays the specified track one time.\n"
"stop - Stops the currently playing track.");
Con_Printf ("CD Audio Initialized\n");
return 0;

View file

@ -497,22 +497,6 @@ I_CDAudio_Init (void)
cdValid = false;
enabled = false;
}
Cmd_AddCommand ("cd", I_CD_f, "Control the CD player.\n"
"Commands:\n"
"eject - Eject the CD.\n"
"info - Reports information on the CD.\n"
"loop (track number) - Loops the specified track.\n"
"remap (track1) (track2) ... - Remap the current track order.\n"
"reset - Causes the CD audio to re-initialize.\n"
"resume - Will resume playback after pause.\n"
"off - Shuts down the CD audio system..\n"
"on - Re-enables the CD audio system after a cd off command.\n"
"pause - Pause the CD playback.\n"
"play (track number) - Plays the specified track one time.\n"
"stop - Stops the currently playing track.");
// Con_Printf("CD Audio Initialized\n");
}