- Moved the identical code between the MUS and MIDI streamers into a new base

class so they all the low-level details of MIDI streaming are kept in
  one place.
- Converted the SMF MIDI playback to use the same MIDI streams as MUS
  playback.
- Moved MUS playback back into its own thread so that it can continue
  uninterrupted if the main thread is too busy to service it in a timely
  manner.
- Fixed: The MEVT_* values are not defined shifted into their spot for a
  MIDIEVENT, so I need to do it myself.
- Fixed: Pausing a MUS and the changing snd_midivolume caused the paused
  notes to become audible.


SVN r784 (trunk)
This commit is contained in:
Randy Heit 2008-03-05 03:10:31 +00:00
commit 68a8ea2189
11 changed files with 1673 additions and 1238 deletions

View file

@ -95,7 +95,6 @@
#include "gameconfigfile.h"
#include "win32iface.h"
#include "templates.h"
#include "i_musicinterns.h"
#define DINPUT_BUFFERSIZE 32
@ -110,7 +109,6 @@ BOOL DI_InitJoy (void);
extern HINSTANCE g_hInst;
extern DWORD SessionID;
extern HANDLE MusicEvent;
extern void ShowEAXEditor ();
extern bool SpawnEAXWindow;
@ -1931,23 +1929,7 @@ void I_GetEvent ()
// Briefly enter an alertable state so that if a secondary thread
// crashed, we will execute the APC it sent now.
if (MusicEvent != NULL)
{
DWORD res;
do
{
res = WaitForSingleObjectEx(MusicEvent, 0, TRUE);
}
while (res == WAIT_IO_COMPLETION);
if (res == WAIT_OBJECT_0 && currSong != NULL)
{
currSong->ServiceEvent();
}
}
else
{
SleepEx (0, TRUE);
}
SleepEx (0, TRUE);
while (PeekMessage (&mess, NULL, 0, 0, PM_REMOVE))
{