- fixed mus_device CVar and reenabled WinMM device.

This commit is contained in:
Christoph Oelckers 2019-10-24 21:02:07 +02:00
parent 9648c026a9
commit e8cf6c3d32
4 changed files with 37 additions and 4 deletions

View file

@ -712,6 +712,7 @@ set (PCH_SOURCES
audiolib/src/driver_adlib.cpp
audiolib/src/driver_nosound.cpp
audiolib/src/driver_sdl.cpp
audiolib/src/driver_winmm.cpp
audiolib/src/flac.cpp
audiolib/src/formats.cpp
audiolib/src/fx_man.cpp

View file

@ -0,0 +1,33 @@
/*
Copyright (C) 2009 Jonathon Fowler <jf@jonof.id.au>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "midifuncs.h"
int WinMMDrv_GetError(void);
const char *WinMMDrv_ErrorString( int ErrorNumber );
int WinMMDrv_MIDI_Init(midifuncs *);
void WinMMDrv_MIDI_Shutdown(void);
int WinMMDrv_MIDI_StartPlayback(void (*service)(void));
void WinMMDrv_MIDI_HaltPlayback(void);
void WinMMDrv_MIDI_SetTempo(int tempo, int division);
void WinMMDrv_MIDI_Lock(void);
void WinMMDrv_MIDI_Unlock(void);

View file

@ -34,6 +34,7 @@
#ifdef _WIN32
# include "driver_directsound.h"
# include "driver_winmm.h"
#endif
int ASS_PCMSoundDriver = ASS_AutoDetect;
@ -139,7 +140,6 @@ static struct {
nullptr,
},
#if 0
// Windows MultiMedia system
{
"WinMM",
@ -160,7 +160,6 @@ static struct {
UNSUPPORTED_COMPLETELY
#endif
},
#endif
};

View file

@ -154,12 +154,12 @@ CUSTOM_CVARD(Int, mus_volume, 255, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "controls mus
if (self > 255) self = 255;
}
int MusicDevice = 1;
int MusicDevice = ASS_WinMM;
CUSTOM_CVARD(Int, mus_device, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "selects music device")
{
if (self < 0) self = 0;
else if (self > 1) self = 1;
else MusicDevice = self; // must be copied because it gets altered by the music code.
else MusicDevice = self? ASS_WinMM : ASS_OPL3; // must be copied because it gets altered by the music code.
}