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

Method stopMusic

framework/sound/sdlraw_backend.cpp:354–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352 }
353
354 void stopMusic() override
355 {
356 std::shared_future<void> outstanding_get_music;
357 {
358 std::lock_guard<std::recursive_mutex> l(this->audio_lock);
359 this->music_playing = false;
360 this->track = nullptr;
361 if (this->get_music_future.valid())
362 outstanding_get_music = std::move(this->get_music_future);
363 while (!music_queue.empty())
364 music_queue.pop();
365 }
366 if (outstanding_get_music.valid())
367 outstanding_get_music.wait();
368 }
369
370 ~SDLRawBackend() override
371 {

Callers 2

~SDLRawBackendMethod · 0.95
stopMethod · 0.45

Calls 2

emptyMethod · 0.80
popMethod · 0.80

Tested by

no test coverage detected