converted CDMode to enum
This commit is contained in:
parent
fbaacaf971
commit
3e2c46ac06
9 changed files with 154 additions and 145 deletions
src
game
include
sound
stratagus
ui
|
@ -540,7 +540,7 @@ global void ShowIntro(const Intro *intro)
|
|||
CallbackMusicOn();
|
||||
StopMusic();
|
||||
// FIXME: should this be GameMusic?
|
||||
if( !strcmp(CDMode, ":off") ) {
|
||||
if (CDMode == CDModeOff || CDMode == CDModeStopped) {
|
||||
PlayMusic(MenuMusic);
|
||||
} else {
|
||||
CDRomCheck(NULL);
|
||||
|
|
|
@ -123,8 +123,6 @@ extern void PlayMusic(const char* name);
|
|||
/// Stop music playing
|
||||
extern void StopMusic(void);
|
||||
|
||||
extern int PlayCDRom(const char* name);
|
||||
|
||||
/// Turn music stopped callback on
|
||||
#define CallbackMusicOn() \
|
||||
CallbackMusic=1;
|
||||
|
|
|
@ -235,7 +235,13 @@ extern unsigned CompressedSoundMemory;
|
|||
#endif
|
||||
|
||||
/// cd play mode, ":off" ":random" ":all" or ":defined"
|
||||
extern char *CDMode;
|
||||
enum _cd_mode_ {
|
||||
CDModeStopped = -1,
|
||||
CDModeOff,
|
||||
CDModeAll,
|
||||
CDModeRandom,
|
||||
CDModeDefined,
|
||||
} CDMode;
|
||||
/// FIXME: docu
|
||||
enum _play_section_ {
|
||||
PlaySectionMainMenu,
|
||||
|
@ -246,6 +252,8 @@ enum _play_section_ {
|
|||
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
|
||||
/// FIXME: docu
|
||||
extern int CDTrack;
|
||||
|
||||
extern int PlayCDRom(int name);
|
||||
#endif
|
||||
|
||||
#if defined(USE_SDLCD)
|
||||
|
|
|
@ -66,8 +66,6 @@
|
|||
global Sample* MusicSample; /// Music samples
|
||||
#endif
|
||||
|
||||
global char *CDMode = ":off"; /// cd play mode, ":off" ":random" ":all" or ":defined"
|
||||
//global char *CDPlaySection = "menu";
|
||||
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
|
||||
global int CDTrack = 0; /// Current cd track
|
||||
#endif
|
||||
|
@ -242,16 +240,16 @@ local Sample* LoadMod(const char* name,int flags __attribute__((unused)))
|
|||
**
|
||||
** @return True if name is handled by the cdrom module.
|
||||
*/
|
||||
global int PlayCDRom(const char* name)
|
||||
global int PlayCDRom(int name)
|
||||
{
|
||||
// Old mode off, starting cdrom play.
|
||||
if (!strcmp(CDMode, ":off")) {
|
||||
if (CDMode == CDModeOff) {
|
||||
if (!strncmp(name, ":", 1)) {
|
||||
if (SDL_Init(SDL_INIT_CDROM) < 0)
|
||||
return 1;
|
||||
CDRom = SDL_CDOpen(0);
|
||||
if (!SDL_CDStatus(CDRom)) {
|
||||
CDMode = ":off";
|
||||
CDMode = CDModeOff;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -264,22 +262,22 @@ global int PlayCDRom(const char* name)
|
|||
|
||||
if (!CDRom) {
|
||||
fprintf(stderr, "Couldn't open cdrom drive: %s\n", SDL_GetError());
|
||||
CDMode = ":stopped";
|
||||
CDMode = CDModeStopped;
|
||||
return 1;
|
||||
}
|
||||
// if mode is play all tracks
|
||||
if (!strcmp(name, ":all")) {
|
||||
CDMode = ":all";
|
||||
CDMode = CDModeAll;
|
||||
if (SDL_CDPlayTracks(CDRom, 0, 0, 0, 0) < 0)
|
||||
CDMode = ":stopped";
|
||||
CDMode = CDModeStopped;
|
||||
return 1;
|
||||
}
|
||||
// if mode is play random tracks
|
||||
if (!strcmp(name, ":random")) {
|
||||
CDMode = ":random";
|
||||
CDMode = CDModeRandom;
|
||||
CDTrack = MyRand() % CDRom->numtracks;
|
||||
if (SDL_CDPlayTracks(CDRom, CDTrack, 0, 0, 0) < 0)
|
||||
CDMode = ":stopped";
|
||||
CDMode = CDModeStopped;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -297,105 +295,99 @@ global int PlayCDRom(const char* name)
|
|||
**
|
||||
** @return True if name is handled by the cdrom module.
|
||||
*/
|
||||
global int PlayCDRom(const char* name)
|
||||
global int PlayCDRom(int name)
|
||||
{
|
||||
int i;
|
||||
int data_cd;
|
||||
int track;
|
||||
|
||||
if (!strcmp(CDMode, ":off")) {
|
||||
if (!strncmp(name, ":", 1)) {
|
||||
if (cd_init()) {
|
||||
fprintf(stderr, "Error initialising libcda \n");
|
||||
CDMode = ":off";
|
||||
return 1;
|
||||
}
|
||||
if (cd_get_tracks(&CDTrack, &NumCDTracks)) {
|
||||
CDMode = ":off";
|
||||
return 1;
|
||||
}
|
||||
data_cd = 1;
|
||||
for (i = 1; i <= NumCDTracks; ++i) {
|
||||
if (cd_is_audio(i) > 0) {
|
||||
data_cd = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (data_cd || !NumCDTracks) {
|
||||
CDMode = ":off";
|
||||
return 1;
|
||||
if (CDMode == CDModeOff) {
|
||||
if (cd_init()) {
|
||||
fprintf(stderr, "Error initialising libcda \n");
|
||||
CDMode = CDModeOff;
|
||||
return 1;
|
||||
}
|
||||
if (cd_get_tracks(&CDTrack, &NumCDTracks)) {
|
||||
CDMode = CDModeOff;
|
||||
return 1;
|
||||
}
|
||||
data_cd = 1;
|
||||
for (i = 1; i <= NumCDTracks; ++i) {
|
||||
if (cd_is_audio(i) > 0) {
|
||||
data_cd = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
--CDTrack;
|
||||
if (data_cd || !NumCDTracks) {
|
||||
CDMode = CDModeOff;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
--CDTrack;
|
||||
|
||||
StopMusic();
|
||||
|
||||
if (cd_get_tracks(NULL, NULL) == -1)
|
||||
return 1;
|
||||
|
||||
// if mode is play all tracks
|
||||
if (name == CDModeAll) {
|
||||
CDMode = CDModeAll;
|
||||
do {
|
||||
if (CDTrack >= NumCDTracks)
|
||||
CDTrack = 0;
|
||||
} while (cd_is_audio(++CDTrack) < 1);
|
||||
if (cd_play(CDTrack))
|
||||
CDMode = CDModeStopped;
|
||||
return 1;
|
||||
}
|
||||
// if mode is play random tracks
|
||||
if (name == CDModeRandom) {
|
||||
CDMode = CDModeRandom;
|
||||
do {
|
||||
CDTrack = MyRand() % NumCDTracks;
|
||||
} while (cd_is_audio(CDTrack) < 1);
|
||||
if (cd_play(CDTrack))
|
||||
CDMode = CDModeStopped;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!strncmp(name, ":", 1)) {
|
||||
|
||||
StopMusic();
|
||||
|
||||
if (cd_get_tracks(NULL, NULL) == -1)
|
||||
return 1;
|
||||
|
||||
// if mode is play all tracks
|
||||
if (!strcmp(name, ":all")) {
|
||||
CDMode = ":all";
|
||||
do {
|
||||
if (CDTrack >= NumCDTracks)
|
||||
CDTrack = 0;
|
||||
} while (cd_is_audio(++CDTrack) < 1);
|
||||
if (cd_play(CDTrack))
|
||||
CDMode = ":stopped";
|
||||
return 1;
|
||||
}
|
||||
// if mode is play random tracks
|
||||
if (!strcmp(name, ":random")) {
|
||||
CDMode = ":random";
|
||||
do {
|
||||
CDTrack = MyRand() % NumCDTracks;
|
||||
} while (cd_is_audio(CDTrack) < 1);
|
||||
if (cd_play(CDTrack))
|
||||
CDMode = ":stopped";
|
||||
return 1;
|
||||
}
|
||||
// FIXME: remove :defined
|
||||
if (!strcmp(name, ":defined")) {
|
||||
CDMode = ":defined";
|
||||
track = cd_current_track();
|
||||
if (PlaySection == PlaySectionStats) {
|
||||
if (GameResult == GameVictory) {
|
||||
if (!ThisPlayer->Race && track != 8) {
|
||||
cd_play(8);
|
||||
} else if (ThisPlayer->Race && track != 16) {
|
||||
cd_play(16);
|
||||
}
|
||||
} else {
|
||||
if (!ThisPlayer->Race && track != 9) {
|
||||
cd_play(9);
|
||||
} else if (ThisPlayer->Race && track != 17) {
|
||||
cd_play(17);
|
||||
}
|
||||
if (name == CDModeDefined) {
|
||||
CDMode = CDModeDefined;
|
||||
track = cd_current_track();
|
||||
if (PlaySection == PlaySectionStats) {
|
||||
if (GameResult == GameVictory) {
|
||||
if (!ThisPlayer->Race && track != 8) {
|
||||
cd_play(8);
|
||||
} else if (ThisPlayer->Race && track != 16) {
|
||||
cd_play(16);
|
||||
}
|
||||
} else if (PlaySection == PlaySectionBriefing) {
|
||||
if (!ThisPlayer->Race && track != 7) {
|
||||
cd_play(7);
|
||||
} else if (ThisPlayer->Race && track != 15) {
|
||||
cd_play(15);
|
||||
} else {
|
||||
if (!ThisPlayer->Race && track != 9) {
|
||||
cd_play(9);
|
||||
} else if (ThisPlayer->Race && track != 17) {
|
||||
cd_play(17);
|
||||
}
|
||||
} else if ((PlaySection == PlaySectionMainMenu) && track != 15) {
|
||||
cd_play(15);
|
||||
} else if ((PlaySection == PlaySectionGame) &&
|
||||
!ThisPlayer->Race && (track < 3 || track > 6)) {
|
||||
do CDTrack = (MyRand() % NumCDTracks) + 3;
|
||||
while (CDTrack < 3 || CDTrack > 7);
|
||||
cd_play(CDTrack);
|
||||
} else if ((PlaySection == PlaySectionGame) &&
|
||||
ThisPlayer->Race && (track < 10 || track > 14)) {
|
||||
do CDTrack = (MyRand() % NumCDTracks) + 9;
|
||||
while (CDTrack < 11 || CDTrack > 14);
|
||||
cd_play(CDTrack);
|
||||
}
|
||||
} else if (PlaySection == PlaySectionBriefing) {
|
||||
if (!ThisPlayer->Race && track != 7) {
|
||||
cd_play(7);
|
||||
} else if (ThisPlayer->Race && track != 15) {
|
||||
cd_play(15);
|
||||
}
|
||||
} else if ((PlaySection == PlaySectionMainMenu) && track != 15) {
|
||||
cd_play(15);
|
||||
} else if ((PlaySection == PlaySectionGame) &&
|
||||
!ThisPlayer->Race && (track < 3 || track > 6)) {
|
||||
do CDTrack = (MyRand() % NumCDTracks) + 3;
|
||||
while (CDTrack < 3 || CDTrack > 7);
|
||||
cd_play(CDTrack);
|
||||
} else if ((PlaySection == PlaySectionGame) &&
|
||||
ThisPlayer->Race && (track < 10 || track > 14)) {
|
||||
do CDTrack = (MyRand() % NumCDTracks) + 9;
|
||||
while (CDTrack < 11 || CDTrack > 14);
|
||||
cd_play(CDTrack);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -415,7 +407,7 @@ local int PlayCDRom(const char* name)
|
|||
int i;
|
||||
Sample *sample;
|
||||
|
||||
if (!strcmp(CDMode, ":off")) {
|
||||
if (CDMode == CDModeOff) {
|
||||
if (!strncmp(name, ":", 1)) {
|
||||
CDDrive = open("/dev/cdrom", O_RDONLY | O_NONBLOCK);
|
||||
ioctl(CDDrive, CDROMRESET);
|
||||
|
@ -430,7 +422,7 @@ local int PlayCDRom(const char* name)
|
|||
NumCDTracks = i - 1;
|
||||
|
||||
if (NumCDTracks == 0) {
|
||||
CDMode = ":off";
|
||||
CDMode = CDModeOff;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -442,7 +434,7 @@ local int PlayCDRom(const char* name)
|
|||
|
||||
// if mode is play all tracks
|
||||
if (!strcmp(name, ":all")) {
|
||||
CDMode = ":all";
|
||||
CDMode = CDModeAll;
|
||||
do {
|
||||
if (CDTrack >= NumCDTracks)
|
||||
CDTrack = 0;
|
||||
|
@ -450,7 +442,7 @@ local int PlayCDRom(const char* name)
|
|||
}
|
||||
// if mode is play random tracks
|
||||
if (!strcmp(name, ":random")) {
|
||||
CDMode = ":random";
|
||||
CDMode = CDModeRanom;
|
||||
do {
|
||||
CDTrack = MyRand() % NumCDTracks;
|
||||
} while (CDtocentry[CDTrack].cdte_ctrl&CDROM_DATA_TRACK);
|
||||
|
|
|
@ -376,12 +376,23 @@ local SCM CclSetMusicVolume(SCM volume)
|
|||
local SCM CclSetCdMode(SCM mode)
|
||||
{
|
||||
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
|
||||
char *str;
|
||||
int cdmode;
|
||||
char *str = gh_scm2newstr(mode, NULL);
|
||||
|
||||
if ( !gh_null_p(mode) ) {
|
||||
PlayCDRom(str = gh_scm2newstr(mode,NULL));
|
||||
free(str);
|
||||
if (!strcmp(str, "all")) {
|
||||
cdmode = CDModeAll;
|
||||
} else if (!strcmp(str, "random")) {
|
||||
cdmode = CDModeRandom;
|
||||
} else if (!strcmp(str, "defined")) {
|
||||
cdmode = CDModeDefined;
|
||||
} else {
|
||||
free(str);
|
||||
return mode;
|
||||
}
|
||||
|
||||
free(str);
|
||||
|
||||
PlayCDRom(cdmode);
|
||||
#endif
|
||||
return mode;
|
||||
}
|
||||
|
|
|
@ -230,22 +230,22 @@ global void StopMusic(void)
|
|||
global int CDRomCheck(void *unused __attribute__ ((unused)))
|
||||
{
|
||||
#if defined(USE_SDLCD)
|
||||
if (strcmp(CDMode, ":off") && strcmp(CDMode, ":stopped")
|
||||
if (CDMode != CDModeOff && CDMode != CDModeStopped)
|
||||
&& SDL_CDStatus(CDRom) == 1) {
|
||||
DebugLevel0Fn("Playing new track\n");
|
||||
if (!strcmp(CDMode, ":all")) {
|
||||
if (CDMode == CDModeAll) {
|
||||
PlayCDRom(":all");
|
||||
} else if (!strcmp(CDMode, ":random")) {
|
||||
} else if (CDMode == CDModeRandom) {
|
||||
PlayCDRom(":random");
|
||||
}
|
||||
}
|
||||
#elif defined(USE_LIBCDA)
|
||||
if (strcmp(CDMode, ":off") && strcmp(CDMode, ":stopped")
|
||||
&& !cd_current_track() && strcmp(CDMode, ":defined")) {
|
||||
if (CDMode != CDModeRandom && CDMode != CDModeStopped
|
||||
&& !cd_current_track() && CDMode != CDModeDefined) {
|
||||
DebugLevel0Fn("Playing new track\n");
|
||||
PlayCDRom(CDMode);
|
||||
} else if (strcmp(CDMode, ":off") && strcmp(CDMode, ":stopped")) {
|
||||
if (!strcmp(CDMode, ":defined")) {
|
||||
} else if (CDMode != CDModeOff && CDMode != CDModeStopped) {
|
||||
if (CDMode == CDModeDefined) {
|
||||
PlayCDRom(CDMode);
|
||||
}
|
||||
DebugLevel0Fn("get track\n");
|
||||
|
@ -255,12 +255,12 @@ global int CDRomCheck(void *unused __attribute__ ((unused)))
|
|||
}
|
||||
}
|
||||
#elif defined(USE_CDDA)
|
||||
if (strcmp(CDMode, ":off") && strcmp(CDMode, ":stopped")
|
||||
if (CDMode != CDModeOff && CDMode != CDModeStopped)
|
||||
&& !PlayingMusic) {
|
||||
DebugLevel0Fn("Playing new track\n");
|
||||
if (!strcmp(CDMode, ":all")) {
|
||||
if (CDMode == CDModeAll) {
|
||||
PlayCDRom(":all");
|
||||
} else if (!strcmp(CDMode, ":random")) {
|
||||
} else if (CDMode == CDModeRandom) {
|
||||
PlayCDRom(":random");
|
||||
}
|
||||
}
|
||||
|
@ -1199,7 +1199,7 @@ global int InitSound(void)
|
|||
DebugLevel0Fn("FIXME: must write non GLIB hash functions\n");
|
||||
#endif
|
||||
|
||||
if( TitleMusic && (!strcmp(CDMode, ":off")) ) {
|
||||
if( TitleMusic && (CDMode == CDModeOff || CDMode == CDModeStopped) ) {
|
||||
PlayMusic(TitleMusic);
|
||||
}
|
||||
|
||||
|
@ -1272,21 +1272,21 @@ global void QuitSound(void)
|
|||
global void QuitCD(void)
|
||||
{
|
||||
#if defined(USE_SDLCD)
|
||||
if (strcmp(CDMode,":off") && strcmp(CDMode,":stopped"))
|
||||
if (CDMode != CDModeOff && CDMode != CDModeStopped)
|
||||
SDL_CDStop(CDRom);
|
||||
CDMode = ":stopped";
|
||||
if (strcmp(CDMode,":off")) {
|
||||
CDMode = CDModeStopped;
|
||||
if (CDMode != CDModeStopped) {
|
||||
SDL_CDClose(CDRom);
|
||||
CDMode = ":off";
|
||||
CDMode = CDModeOff;
|
||||
}
|
||||
#elif defined(USE_LIBCDA)
|
||||
if (strcmp(CDMode,":off") && strcmp(CDMode,":stopped"))
|
||||
if (CDMode != CDModeOff && CDMode != CDModeStopped)
|
||||
cd_stop();
|
||||
CDMode = ":stopped";
|
||||
if (strcmp(CDMode,":off")) {
|
||||
CDMode = CDModeStopped;
|
||||
if (CDMode == CDModeStopped) {
|
||||
cd_close();
|
||||
cd_exit();
|
||||
CDMode = ":off";
|
||||
CDMode = CDModeOff;
|
||||
}
|
||||
#elif defined(USE_CDDA)
|
||||
close(CDDrive);
|
||||
|
|
|
@ -904,7 +904,7 @@ global void SavePreferences(void)
|
|||
}
|
||||
fprintf(fd,"(set-music-volume! %d)\n", MusicVolume);
|
||||
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
|
||||
fprintf(fd,"(set-cd-mode! \"%s\")\n", CDMode);
|
||||
fprintf(fd,"(set-cd-mode! \"%d\")\n", CDMode);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1075,7 +1075,7 @@ global void MenuLoop(char* filename, WorldMap* map)
|
|||
// FIXME: If second loop?
|
||||
|
||||
if( !PlayingMusic && strcmp(TitleMusic,MenuMusic) ) {
|
||||
if (!strcmp(CDMode, ":off")) {
|
||||
if (CDMode == CDModeOff) {
|
||||
PlayMusic(MenuMusic);
|
||||
} else {
|
||||
CDRomCheck(NULL);
|
||||
|
|
|
@ -1562,7 +1562,7 @@ local void SoundOptionsInit(Menuitem *mi __attribute__((unused)))
|
|||
menu->items[11].flags = 0;
|
||||
}
|
||||
#if defined(USE_LIBCDA) || defined(USE_SDLCD) || defined(USE_CDDA)
|
||||
if (strcmp(":off", CDMode) && strcmp(":stopped", CDMode)) {
|
||||
if (CDMode != CDModeStopped && CDMode != CDModeOff) {
|
||||
menu->items[8].flags = MenuButtonDisabled;
|
||||
menu->items[11].flags = MenuButtonDisabled;
|
||||
}
|
||||
|
@ -1580,7 +1580,7 @@ local void SoundOptionsInit(Menuitem *mi __attribute__((unused)))
|
|||
menu->items[21].flags = MenuButtonDisabled; // random tracks button
|
||||
#if defined(USE_LIBCDA) || defined(USE_SDLCD) || defined(USE_CDDA)
|
||||
menu->items[17].flags = 0; // cd power
|
||||
if (strcmp(":off", CDMode) && strcmp(":stopped", CDMode)) {
|
||||
if (CDMode != CDModeStopped && CDMode != CDModeOff) {
|
||||
#if (!defined(USE_WIN32) && defined(USE_LIBCDA)) || defined(USE_CDDA)
|
||||
int i = 0;
|
||||
#ifdef USE_LIBCDA
|
||||
|
@ -1595,10 +1595,10 @@ local void SoundOptionsInit(Menuitem *mi __attribute__((unused)))
|
|||
menu->items[19].flags = 0;
|
||||
menu->items[21].flags = 0;
|
||||
|
||||
if (!strcmp(":all", CDMode)) {
|
||||
if (CDMode == CDModeAll) {
|
||||
menu->items[19].d.gem.state = MI_GSTATE_CHECKED;
|
||||
menu->items[21].d.gem.state = MI_GSTATE_UNCHECKED;
|
||||
} else if (!strcmp(":random", CDMode)) {
|
||||
} else if (CDMode == CDModeRandom) {
|
||||
menu->items[19].d.gem.state = MI_GSTATE_UNCHECKED;
|
||||
menu->items[21].d.gem.state = MI_GSTATE_CHECKED;
|
||||
}
|
||||
|
@ -1814,36 +1814,36 @@ local void SetCdPower(Menuitem *mi __attribute__((unused)))
|
|||
#ifdef WITH_SOUND
|
||||
#ifdef USE_SDLCD
|
||||
// Start Playing CD
|
||||
if (!strcmp(":off", CDMode) || !strcmp(":stopped", CDMode)) {
|
||||
if (CDMode == CDModeOff || CDMode == CDModeStopped) {
|
||||
#ifdef USE_WIN32
|
||||
SDL_CDResume(CDRom);
|
||||
#endif
|
||||
PlayCDRom(":random");
|
||||
PlayCDRom(CDModeRandom);
|
||||
} else {
|
||||
// Stop Playing CD
|
||||
SDL_CDPause(CDRom);
|
||||
CDMode = ":stopped";
|
||||
CDMode = CDModeStopped;
|
||||
}
|
||||
if (strcmp(":off", CDMode) && strcmp(":stopped", CDMode)) {
|
||||
if (CDMode != CDModeOff && CDMode != CDModeStopped) {
|
||||
StopMusic();
|
||||
}
|
||||
#elif defined(USE_LIBCDA)
|
||||
// Start Playing CD
|
||||
if (!strcmp(":off", CDMode) || !strcmp(":stopped", CDMode)) {
|
||||
PlayCDRom(":random");
|
||||
if (CDMode == CDModeOff || CDMode == CDModeStopped) {
|
||||
PlayCDRom(CDModeRandom);
|
||||
} else {
|
||||
// Stop Playing CD
|
||||
cd_pause();
|
||||
CDMode = ":stopped";
|
||||
CDMode = CDModeStopped;
|
||||
}
|
||||
#elif defined(USE_CDDA)
|
||||
// Start Playing CD
|
||||
if (!strcmp(":off", CDMode) || !strcmp(":stopped", CDMode)) {
|
||||
PlayCDRom(":random");
|
||||
if (CDMode == CDModeOff || CDMode == CDModeStopped) {
|
||||
PlayCDRom(CDModeRandom);
|
||||
} else {
|
||||
// Stop Playing CD
|
||||
StopMusic();
|
||||
CDMode = ":stopped";
|
||||
CDMode = CDModeStopped;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -1889,7 +1889,7 @@ local void SetCommandKey(Menuitem *mi __attribute__((unused)))
|
|||
local void SetCdModeAll(Menuitem *mi __attribute__((unused)))
|
||||
{
|
||||
#if defined(WITH_SOUND) && (defined(USE_LIBCDA) || defined(USE_SDLCD))
|
||||
CDMode = ":all";
|
||||
CDMode = CDModeAll;
|
||||
#endif
|
||||
SoundOptionsInit(NULL);
|
||||
}
|
||||
|
@ -1900,7 +1900,7 @@ local void SetCdModeAll(Menuitem *mi __attribute__((unused)))
|
|||
local void SetCdModeRandom(Menuitem *mi __attribute__((unused)))
|
||||
{
|
||||
#if defined(WITH_SOUND) && (defined(USE_LIBCDA) || defined(USE_SDLCD))
|
||||
CDMode = ":random";
|
||||
CDMode = CDModeRandom;
|
||||
#endif
|
||||
SoundOptionsInit(NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue