void* Mixer_Play_Music(int pathId, int loop, int streaming) { if (gOpenRCT2Headless) return 0; if (streaming) { const utf8 *filename = get_file_path(pathId); SDL_RWops* rw = SDL_RWFromFile(filename, "rb"); if (rw == NULL) { return 0; } Source_SampleStream* source_samplestream = new Source_SampleStream; if (source_samplestream->LoadWAV(rw)) { Channel* channel = gMixer.Play(*source_samplestream, loop, false, true); if (!channel) { delete source_samplestream; } else { channel->SetGroup(MIXER_GROUP_RIDE_MUSIC); } return channel; } else { delete source_samplestream; return 0; } } else { if (gMixer.LoadMusic(pathId)) { Channel* channel = gMixer.Play(*gMixer.musicsources[pathId], MIXER_LOOP_INFINITE, false, false); if (channel) { channel->SetGroup(MIXER_GROUP_RIDE_MUSIC); } return channel; } } return 0; }
void* Mixer_Play_Music(int pathid) { if (gMixer.LoadMusic(pathid)) { return gMixer.Play(gMixer.musicstreams[pathid], MIXER_LOOP_INFINITE, false); } return 0; }