Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 31abe9b718384a0abc2888edf421e3a9 > files > 222

lib64allegro-devel-4.4.2-4.mga4.x86_64.rpm

#include <allegro.h>
#include "../include/defines.h"
#include "../include/global.h"

static int currently_playing = -1;

void play_music(int id, int loop)
{
   if (id == currently_playing && midi_pos >= 0) {
      return;
   }

   if (play_midi(demo_data[id].dat, loop) == 0) {
      currently_playing = id;
   } else {
      currently_playing = -1;
   }
}


void stop_music(void)
{
   stop_midi();
   currently_playing = -1;
}


void play_sound(int id, int vol, int pan, int freq, int loop)
{
   if (freq < 0) {
      freq = 1000 + rand() % (-freq) + freq / 2;
   }

   play_sample(demo_data[id].dat, vol, pan, freq, loop);
}