mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
Space, the final frontier...
This commit is contained in:
parent
2342dfcd8f
commit
08de21404f
1 changed files with 35 additions and 34 deletions
|
@ -56,10 +56,13 @@ static cvar_t *wildmidi_config;
|
|||
|
||||
static int
|
||||
midi_init ( void ) {
|
||||
wildmidi_volume = Cvar_Get ("wildmidi_volume", "100", CVAR_ARCHIVE, NULL, "Set the Master Volume");
|
||||
wildmidi_config = Cvar_Get ("wildmidi_config", "/etc/timidity.cfg", CVAR_ROM, NULL, "path/filename of timidity.cfg");
|
||||
wildmidi_volume = Cvar_Get ("wildmidi_volume", "100", CVAR_ARCHIVE, NULL,
|
||||
"Set the Master Volume");
|
||||
wildmidi_config = Cvar_Get ("wildmidi_config", "/etc/timidity.cfg",
|
||||
CVAR_ROM, NULL,
|
||||
"path/filename of timidity.cfg");
|
||||
|
||||
if (WildMidi_Init(wildmidi_config->string, shm->speed, 0) == -1)
|
||||
if (WildMidi_Init (wildmidi_config->string, shm->speed, 0) == -1)
|
||||
return 1;
|
||||
midi_intiialized = 1;
|
||||
return 0;
|
||||
|
@ -70,7 +73,7 @@ get_info (void * handle) {
|
|||
wavinfo_t info;
|
||||
struct _WM_Info *wm_info;
|
||||
|
||||
if ((wm_info = WildMidi_GetInfo(handle)) == NULL) {
|
||||
if ((wm_info = WildMidi_GetInfo (handle)) == NULL) {
|
||||
Sys_Printf ("Could not obtain midi information\n");
|
||||
return info;
|
||||
}
|
||||
|
@ -135,11 +138,11 @@ midi_stream_open (sfx_t *_sfx)
|
|||
|
||||
QFS_FOpenFile (stream->file, &file);
|
||||
|
||||
local_buffer_size = Qfilesize(file);
|
||||
local_buffer_size = Qfilesize (file);
|
||||
|
||||
local_buffer = malloc(local_buffer_size);
|
||||
Qread(file, local_buffer, local_buffer_size);
|
||||
Qclose(file);
|
||||
local_buffer = malloc (local_buffer_size);
|
||||
Qread (file, local_buffer, local_buffer_size);
|
||||
Qclose (file);
|
||||
|
||||
handle = WildMidi_OpenBuffer(local_buffer, local_buffer_size);
|
||||
|
||||
|
@ -187,27 +190,25 @@ midi_stream_open (sfx_t *_sfx)
|
|||
void
|
||||
SND_LoadMidi (QFile *file, sfx_t *sfx, char *realname)
|
||||
{
|
||||
|
||||
wavinfo_t info;
|
||||
sfxstream_t *stream = calloc (1, sizeof (sfxstream_t));
|
||||
midi * handle;
|
||||
midi *handle;
|
||||
unsigned char *local_buffer;
|
||||
unsigned long int local_buffer_size = Qfilesize(file);
|
||||
unsigned long int local_buffer_size = Qfilesize (file);
|
||||
|
||||
if (!midi_intiialized) {
|
||||
if (midi_init()) {
|
||||
if (midi_init ()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
local_buffer = malloc(local_buffer_size);
|
||||
Qread(file, local_buffer, local_buffer_size);
|
||||
Qclose(file);
|
||||
local_buffer = malloc (local_buffer_size);
|
||||
Qread (file, local_buffer, local_buffer_size);
|
||||
Qclose (file);
|
||||
|
||||
// WildMidi takes ownership, so be damned if you touch it
|
||||
handle = WildMidi_OpenBuffer(local_buffer, local_buffer_size);
|
||||
|
||||
handle = WildMidi_OpenBuffer (local_buffer, local_buffer_size);
|
||||
|
||||
if (handle == NULL)
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue