- removed CD audio support.

Mainly because this is an ancient deprecated feature on the system side that serves no good purpose anymore.
This commit is contained in:
Christoph Oelckers 2020-02-18 21:52:56 +01:00
parent 78bae1f166
commit 5391382807
5 changed files with 13 additions and 165 deletions

View file

@ -2226,7 +2226,6 @@ int IsPointInMap(FLevelLocals *Level, double x, double y, double z)
void FLevelLocals::SetMusic() void FLevelLocals::SetMusic()
{ {
if (cdtrack == 0 || !S_ChangeCDMusic(cdtrack, cdid))
S_ChangeMusic(Music, musicorder); S_ChangeMusic(Music, musicorder);
} }

View file

@ -129,8 +129,6 @@ void DrawFullscreenSubtitle(const char *text)
void DIntermissionScreen::Init(FIntermissionAction *desc, bool first) void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
{ {
if (desc->mCdTrack == 0 || !S_ChangeCDMusic (desc->mCdTrack, desc->mCdId))
{
if (desc->mMusic.IsEmpty()) if (desc->mMusic.IsEmpty())
{ {
// only start the default music if this is the first action in an intermission // only start the default music if this is the first action in an intermission
@ -140,7 +138,6 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
{ {
S_ChangeMusic (desc->mMusic, desc->mMusicOrder, desc->mMusicLooping); S_ChangeMusic (desc->mMusic, desc->mMusicOrder, desc->mMusicLooping);
} }
}
mDuration = desc->mDuration; mDuration = desc->mDuration;
const char *texname = desc->mBackground; const char *texname = desc->mBackground;

View file

@ -66,42 +66,6 @@ static bool ungzip(uint8_t *data, int size, std::vector<uint8_t> &newdata);
int nomusic = 0; int nomusic = 0;
#ifdef _WIN32
//==========================================================================
//
// CVAR: cd_drive
//
// Which drive (letter) to use for CD audio. If not a valid drive letter,
// let the operating system decide for us.
//
//==========================================================================
EXTERN_CVAR(Bool, cd_enabled);
CUSTOM_CVAR(String, cd_drive, "", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG)
{
if (cd_enabled && !Args->CheckParm("-nocdaudio")) CD_Enable(self);
}
//==========================================================================
//
// CVAR: cd_enabled
//
// Use the CD device? Can be overridden with -nocdaudio on the command line
//
//==========================================================================
CUSTOM_CVAR(Bool, cd_enabled, true, CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG)
{
if (self && !Args->CheckParm("-nocdaudio"))
CD_Enable(cd_drive);
else
CD_Enable(nullptr);
}
#endif
//========================================================================== //==========================================================================
// //
// CVAR snd_musicvolume // CVAR snd_musicvolume

View file

@ -308,28 +308,6 @@ void S_ActivatePlayList (bool goBack)
} }
} }
//==========================================================================
//
// S_ChangeCDMusic
//
// Starts a CD track as music.
//==========================================================================
bool S_ChangeCDMusic (int track, unsigned int id, bool looping)
{
char temp[32];
if (id != 0)
{
mysnprintf (temp, countof(temp), ",CD,%d,%x", track, id);
}
else
{
mysnprintf (temp, countof(temp), ",CD,%d", track);
}
return S_ChangeMusic (temp, 0, looping);
}
//========================================================================== //==========================================================================
// //
// S_StartMusic // S_StartMusic
@ -434,20 +412,11 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force)
if (strnicmp (musicname, ",CD,", 4) == 0) if (strnicmp (musicname, ",CD,", 4) == 0)
{ {
int track = strtoul (musicname+4, nullptr, 0); static bool warned = false;
const char *more = strchr (musicname+4, ','); if (!warned)
unsigned int id = 0; Printf(TEXTCOLOR_RED "CD Audio no longer supported\n");
warned = true;
if (more != nullptr) return false;
{
id = strtoul (more+1, nullptr, 16);
}
S_StopMusic (true);
mus_playing.handle = ZMusic_OpenCDSong (track, id);
if (mus_playing.handle == nullptr)
{
Printf("Unable to start CD Audio for track #%d, ID %d\n", track, id);
}
} }
else else
{ {
@ -745,84 +714,6 @@ CCMD (stopmus)
mus_playing.LastSong = ""; // forget the last played song so that it won't get restarted if some volume changes occur mus_playing.LastSong = ""; // forget the last played song so that it won't get restarted if some volume changes occur
} }
//==========================================================================
//
// CCMD cd_play
//
// Plays a specified track, or the entire CD if no track is specified.
//==========================================================================
CCMD (cd_play)
{
char musname[16];
if (argv.argc() == 1)
{
strcpy (musname, ",CD,");
}
else
{
mysnprintf (musname, countof(musname), ",CD,%d", atoi(argv[1]));
}
S_ChangeMusic (musname, 0, true);
}
#ifdef _WIN32
//==========================================================================
//
// CCMD cd_stop
//
//==========================================================================
CCMD (cd_stop)
{
CD_Stop ();
}
//==========================================================================
//
// CCMD cd_eject
//
//==========================================================================
CCMD (cd_eject)
{
CD_Eject ();
}
//==========================================================================
//
// CCMD cd_close
//
//==========================================================================
CCMD (cd_close)
{
CD_UnEject ();
}
//==========================================================================
//
// CCMD cd_pause
//
//==========================================================================
CCMD (cd_pause)
{
CD_Pause ();
}
//==========================================================================
//
// CCMD cd_resume
//
//==========================================================================
CCMD (cd_resume)
{
CD_Resume ();
}
#endif
//========================================================================== //==========================================================================
// //
// CCMD playlist // CCMD playlist

View file

@ -47,9 +47,6 @@ bool S_StartMusic (const char *music_name);
// Start music using <music_name>, and set whether looping // Start music using <music_name>, and set whether looping
bool S_ChangeMusic (const char *music_name, int order=0, bool looping=true, bool force=false); bool S_ChangeMusic (const char *music_name, int order=0, bool looping=true, bool force=false);
// Start playing a cd track as music
bool S_ChangeCDMusic (int track, unsigned int id=0, bool looping=true);
void S_RestartMusic (); void S_RestartMusic ();
void S_MIDIDeviceChanged(int newdev); void S_MIDIDeviceChanged(int newdev);