[Moeng-cvs] BBRpg/src sound.cpp,1.8.2.1,1.8.2.2
Status: Alpha
Brought to you by:
b_lindeijer
From: <b_l...@us...> - 2004-01-07 18:14:06
|
Update of /cvsroot/moeng/BBRpg/src In directory sc8-pr-cvs1:/tmp/cvs-serv12234/src Modified Files: Tag: bbrpg sound.cpp Log Message: MIDI changes and crash fix. Index: sound.cpp =================================================================== RCS file: /cvsroot/moeng/BBRpg/src/sound.cpp,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** sound.cpp 6 Jan 2004 23:16:33 -0000 1.8.2.1 --- sound.cpp 7 Jan 2004 18:14:03 -0000 1.8.2.2 *************** *** 51,57 **** // Initialize alogg - #ifdef ENABLE_MUSIC - alogg_init(); - #endif int midi_driver = MIDI_NONE; --- 51,54 ---- *************** *** 62,65 **** --- 59,65 ---- } if (sfx_enabled || (sound_enabled && music_format != MUSIC_MIDI)) { + #ifdef ENABLE_MUSIC + alogg_init(); + #endif sound_driver = DIGI_AUTODETECT; } *************** *** 144,148 **** error = NULL; ! if (sound_enabled) { if (channel < 0 || channel > CHANNELS) {error = "invalid channel";} else if (!channels[channel].ass) {error = "no music on this channel to adjust";} --- 144,148 ---- error = NULL; ! if (sound_enabled && music_format != MUSIC_MIDI) { if (channel < 0 || channel > CHANNELS) {error = "invalid channel";} else if (!channels[channel].ass) {error = "no music on this channel to adjust";} *************** *** 153,157 **** if (error == NULL) { voice_set_volume(channels[channel].ass->voice, int(vol * (float(music_vol) / 255.0f))); - //alogg_adjust_oggstream(ogg[channel]->s, vol, pan, speed); //console.log(CON_LOG | CON_CONSOLE, CON_ALWAYS, "Adjusted channel parameters (%d, %d, %d, %d)", channel, vol, pan, speed); } else { --- 153,156 ---- *************** *** 173,190 **** void poll_sound() { ! for (int i = 0; i < CHANNELS; i++) { ! if (channels[i].stream) { ! int ret = alogg_update_streaming(channels[i].stream); ! if (ret == 0) { ! // Loop song ! stop_music(i); ! channels[i].stream = alogg_start_streaming(channels[i].filename, BLOCK_SIZE); ! if (!channels[i].stream) { ! fprintf(stderr,"Error opening %s\n", channels[i].filename); ! alogg_exit(); ! exit(1); } - channels[i].ass = alogg_get_audio_stream(channels[i].stream); - break; } } --- 172,191 ---- void poll_sound() { ! if (music_format != MUSIC_MIDI) { ! for (int i = 0; i < CHANNELS; i++) { ! if (channels[i].stream) { ! int ret = alogg_update_streaming(channels[i].stream); ! if (ret == 0) { ! // Loop song ! stop_music(i); ! channels[i].stream = alogg_start_streaming(channels[i].filename, BLOCK_SIZE); ! if (!channels[i].stream) { ! fprintf(stderr,"Error opening %s\n", channels[i].filename); ! alogg_exit(); ! exit(1); ! } ! channels[i].ass = alogg_get_audio_stream(channels[i].stream); ! break; } } } *************** *** 202,206 **** } */ ! if (channels[channel].stream) { alogg_stop_streaming(channels[channel].stream); channels[channel].stream = NULL; --- 203,207 ---- } */ ! if (music_format != MUSIC_MIDI && channels[channel].stream) { alogg_stop_streaming(channels[channel].stream); channels[channel].stream = NULL; *************** *** 259,263 **** } ! alogg_exit(); #endif } --- 260,266 ---- } ! if (sound_enabled && music_format != MUSIC_MIDI) { ! alogg_exit(); ! } #endif } |