mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
parent
1199a5f9b4
commit
b59aa27104
6 changed files with 74 additions and 107 deletions
|
@ -64,12 +64,12 @@ void I_InitMusic(void){}
|
|||
|
||||
void I_ShutdownMusic(void){}
|
||||
|
||||
void I_PauseSong(INT32 handle)
|
||||
void I_PauseSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
||||
void I_ResumeSong(INT32 handle)
|
||||
void I_ResumeSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
@ -80,23 +80,19 @@ void I_ResumeSong(INT32 handle)
|
|||
|
||||
UINT8 midimusic_started = 0;
|
||||
|
||||
void I_InitMIDIMusic(void){}
|
||||
|
||||
void I_ShutdownMIDIMusic(void){}
|
||||
|
||||
void I_SetMIDIMusicVolume(INT32 volume)
|
||||
{
|
||||
(void)volume;
|
||||
}
|
||||
|
||||
INT32 I_RegisterSong(void *data, size_t len)
|
||||
boolean I_LoadSong(char *data, size_t len)
|
||||
{
|
||||
(void)data;
|
||||
(void)len;
|
||||
return -1;
|
||||
}
|
||||
|
||||
boolean I_PlaySong(INT32 handle, INT32 looping)
|
||||
void I_SetMIDIMusicVolume(INT32 volume)
|
||||
{
|
||||
(void)volume;
|
||||
}
|
||||
|
||||
boolean I_PlaySong(boolean looping)
|
||||
{
|
||||
(void)handle;
|
||||
(void)looping;
|
||||
|
|
|
@ -408,31 +408,7 @@ void I_ShutdownMIDIMusic(void)
|
|||
music_started=false;
|
||||
}
|
||||
|
||||
void I_InitDigMusic(void)
|
||||
{
|
||||
// CONS_Printf("Digital music not yet supported under DOS.\n");
|
||||
}
|
||||
|
||||
void I_ShutdownDigMusic(void)
|
||||
{
|
||||
// CONS_Printf("Digital music not yet supported under DOS.\n");
|
||||
}
|
||||
|
||||
void I_InitMusic(void)
|
||||
{
|
||||
if (!nodigimusic)
|
||||
I_InitDigMusic();
|
||||
if (!nomidimusic)
|
||||
I_InitMIDIMusic();
|
||||
}
|
||||
|
||||
void I_ShutdownMusic(void)
|
||||
{
|
||||
I_ShutdownMIDIMusic();
|
||||
I_ShutdownDigMusic();
|
||||
}
|
||||
|
||||
boolean I_PlaySong(INT32 handle, INT32 looping)
|
||||
boolean I_PlaySong(boolean looping)
|
||||
{
|
||||
handle = 0;
|
||||
if (nomidimusic)
|
||||
|
@ -495,7 +471,7 @@ void I_UnRegisterSong(INT32 handle)
|
|||
//destroy_midi(currsong);
|
||||
}
|
||||
|
||||
INT32 I_RegisterSong(void *data, size_t len)
|
||||
boolean I_LoadSong(char *data, size_t len)
|
||||
{
|
||||
int e = len; //Alam: For error
|
||||
if (nomidimusic)
|
||||
|
|
|
@ -70,7 +70,7 @@ void I_PauseSong(INT32 handle)
|
|||
(void)handle;
|
||||
}
|
||||
|
||||
void I_ResumeSong(INT32 handle)
|
||||
void I_ResumeSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
}
|
||||
|
@ -79,23 +79,14 @@ void I_ResumeSong(INT32 handle)
|
|||
// MIDI I/O
|
||||
//
|
||||
|
||||
void I_InitMIDIMusic(void){}
|
||||
|
||||
void I_ShutdownMIDIMusic(void){}
|
||||
|
||||
void I_SetMIDIMusicVolume(UINT8 volume)
|
||||
{
|
||||
(void)volume;
|
||||
}
|
||||
|
||||
INT32 I_RegisterSong(void *data, size_t len)
|
||||
boolean I_LoadSong(char *data, size_t len)
|
||||
{
|
||||
(void)data;
|
||||
(void)len;
|
||||
return -1;
|
||||
}
|
||||
|
||||
boolean I_PlaySong(INT32 handle, boolean looping)
|
||||
boolean I_PlaySong(boolean looping)
|
||||
{
|
||||
(void)handle;
|
||||
(void)looping;
|
||||
|
|
|
@ -1605,7 +1605,7 @@ static void I_PauseGME(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void I_PauseSong(INT32 handle)
|
||||
void I_PauseSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
I_PauseGME();
|
||||
|
@ -1625,7 +1625,7 @@ static void I_ResumeGME(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void I_ResumeSong(INT32 handle)
|
||||
void I_ResumeSong(void)
|
||||
{
|
||||
(void)handle;
|
||||
I_ResumeGME();
|
||||
|
@ -1669,7 +1669,7 @@ void I_UnRegisterSong(INT32 handle)
|
|||
#endif
|
||||
}
|
||||
|
||||
INT32 I_RegisterSong(void *data, size_t len)
|
||||
boolean I_LoadSong(char *data, size_t len)
|
||||
{
|
||||
#ifdef HAVE_MIXER
|
||||
if (nomidimusic || !musicStarted)
|
||||
|
|
|
@ -110,9 +110,9 @@ static LRESULT CALLBACK MainWndproc(HWND hWnd, UINT message, WPARAM wParam, LPAR
|
|||
|
||||
// pause music when alt-tab
|
||||
if (appActive && !paused)
|
||||
I_ResumeSong(0);
|
||||
I_ResumeSong();
|
||||
else if (!paused)
|
||||
I_PauseSong(0);
|
||||
I_PauseSong();
|
||||
{
|
||||
HANDLE ci = GetStdHandle(STD_INPUT_HANDLE);
|
||||
DWORD mode;
|
||||
|
|
|
@ -456,14 +456,14 @@ void I_ShutdownMusic(void)
|
|||
I_ShutdownMIDIMusic();
|
||||
}
|
||||
|
||||
void I_PauseSong(INT32 handle)
|
||||
void I_PauseSong(void)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(handle);
|
||||
if (music_stream)
|
||||
FMR_MUSIC(FMOD_Channel_SetPaused(music_channel, true));
|
||||
}
|
||||
|
||||
void I_ResumeSong(INT32 handle)
|
||||
void I_ResumeSong(void)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(handle);
|
||||
if (music_stream)
|
||||
|
@ -644,8 +644,6 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
|
|||
current_track = 0;
|
||||
|
||||
// Try to find a loop point in streaming music formats (ogg, mp3)
|
||||
if (looping)
|
||||
{
|
||||
FMOD_RESULT e;
|
||||
FMOD_TAG tag;
|
||||
unsigned int loopstart, loopend;
|
||||
|
@ -662,6 +660,13 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
|
|||
return true;
|
||||
}
|
||||
|
||||
// todo
|
||||
// if(music type == MIDI)
|
||||
// {
|
||||
// FMR(FMOD_Sound_SetMode(music_stream, FMOD_LOOP_NORMAL));
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// Use LOOPMS for time in miliseconds.
|
||||
e = FMOD_Sound_GetTag(music_stream, "LOOPMS", 0, &tag);
|
||||
if (e != FMOD_ERR_TAGNOTFOUND)
|
||||
|
@ -698,7 +703,6 @@ boolean I_StartDigSong(const char *musicname, boolean looping)
|
|||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// No special loop point, but we're playing so it's all good.
|
||||
return true;
|
||||
|
@ -825,7 +829,7 @@ void I_SetMIDIMusicVolume(UINT8 volume)
|
|||
FMR_MUSIC(FMOD_Channel_SetVolume(music_channel, volume / 31.0));
|
||||
}
|
||||
|
||||
INT32 I_RegisterSong(void *data, size_t len)
|
||||
boolean I_PlaySong(boolean looping)
|
||||
{
|
||||
FMOD_CREATESOUNDEXINFO fmt;
|
||||
memset(&fmt, 0, sizeof(FMOD_CREATESOUNDEXINFO));
|
||||
|
|
Loading…
Reference in a new issue