MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / playMusic

Method playMusic

framework/sound/sdlraw_backend.cpp:332–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330 }
331
332 void playMusic(std::function<void(void *)> finishedCallback, void *callbackData) override
333 {
334 std::lock_guard<std::recursive_mutex> l(this->audio_lock);
335 while (!music_queue.empty())
336 music_queue.pop();
337 music_finished_callback = finishedCallback;
338 music_callback_data = callbackData;
339 music_playing = true;
340 this->get_music_future =
341 fw().threadPoolEnqueue(std::mem_fn(&SDLRawBackend::getMoreMusic), this);
342 LogInfo("Playing music on SDL backend");
343 }
344
345 void setTrack(sp<MusicTrack> track) override
346 {

Callers 2

beginMethod · 0.45
playMethod · 0.45

Calls 3

emptyMethod · 0.80
popMethod · 0.80
threadPoolEnqueueMethod · 0.80

Tested by

no test coverage detected