Beispiel #1
0
 void restart()
 {
   if (tune != NULL) {
     stop_mod();
     done = 0;
     play_mod(tune, 0);
   }
 }
Beispiel #2
0
glui32 glk_schannel_play_ext(schanid_t chan, glui32 snd, glui32 repeats, glui32 notify)
{
    long len;
    glui32 type;
    char *buf = 0;

    if (!chan)
    {
        gli_strict_warning("schannel_play_ext: invalid id.");
        return 0;
    }

    /* stop previous noise */
    glk_schannel_stop(chan);

    if (repeats == 0)
        return 1;

    /* load sound resource into memory */
    type = load_sound_resource(snd, &len, &buf);

    chan->sdl_memory = (unsigned char*)buf;
    chan->sdl_rwops = SDL_RWFromConstMem(buf, len);
    chan->notify = notify;
    chan->resid = snd;
    chan->loop = repeats;

    switch (type)
    {
        case giblorb_ID_FORM:
        case giblorb_ID_AIFF:
        case giblorb_ID_WAVE:
            return play_sound(chan);
            break;

        case giblorb_ID_OGG:
            return play_compressed(chan, "OGG");
            break;

        case giblorb_ID_MP3:
            return play_compressed(chan, "MP3");
            break;

        case giblorb_ID_MOD:
            return play_mod(chan, len);
            break;

        default:
            gli_strict_warning("schannel_play_ext: unknown resource type.");
    }

    return 0;
}
int MYMOD::play() {
    play_mod(tune, repeat);

    return 1;
}
Beispiel #4
0
  int play() {
    play_mod(tune, repeat);

    return 1;
  }