//takes volume in range 0..8 void set_redbook_volume(int volume) { #ifndef MACINTOSH RBASetVolume(0); // makes the macs sound really funny #endif RBASetVolume(volume*REDBOOK_VOLUME_SCALE/8); }
//stop the redbook, so we can read off the CD void songs_stop_redbook(void) { int old_volume = GameCfg.MusicVolume*REDBOOK_VOLUME_SCALE/8; fix old_time = timer_get_fixed_seconds(); if (Redbook_playing) { //fade out volume int new_volume; do { fix t = timer_get_fixed_seconds(); new_volume = fixmuldiv(old_volume,(FADE_TIME - (t-old_time)),FADE_TIME); if (new_volume < 0) new_volume = 0; RBASetVolume(new_volume); } while (new_volume > 0); } RBAStop(); // Stop CD, if playing RBASetVolume(old_volume); //restore volume Redbook_playing = 0; }
//takes volume in range 0..8 //NOTE that we do not check what is playing right now (except Redbook) This is because here we don't (want) know WHAT we're playing - let the subfunctions do it (i.e. digi_win32_set_music_volume() knows if a MIDI plays or not) void songs_set_volume(int volume) { #ifdef _WIN32 digi_win32_set_midi_volume(volume); #endif if (GameCfg.MusicType == MUSIC_TYPE_REDBOOK) { RBASetVolume(0); RBASetVolume(volume); } #ifdef USE_SDLMIXER mix_set_music_volume(volume); #endif }
//stop the redbook, so we can read off the CD void songs_stop_redbook(void) { int old_volume = gameConfig.nRedbookVolume*REDBOOK_VOLUME_SCALE/8; fix old_time = TimerGetFixedSeconds(); if (gameStates.sound.bRedbookPlaying) { //fade out volume int new_volume; do { fix t = TimerGetFixedSeconds(); new_volume = fixmuldiv(old_volume,(FADE_TIME - (t-old_time)),FADE_TIME); if (new_volume < 0) new_volume = 0; RBASetVolume(new_volume); } while (new_volume > 0); } RBAStop(); // Stop CD, if playing RBASetVolume(old_volume); //restore volume gameStates.sound.bRedbookPlaying = 0; }
//takes volume in range 0..8 void set_redbook_volume(int volume) { RBASetVolume(0); // makes the macs sound really funny RBASetVolume(volume*REDBOOK_VOLUME_SCALE/8); }