INNER CODE UNIT · C++
is_busy
symphony-of-empires/symphony-of-empires · eng3d/eng3d/audio.cpp:79
bool is_busy = Mix_Playing(this->current_sound->channel) != 0;
return !is_busy;
}
void Eng3D::AudioManager::set_sound_volume(float v) {
Mix_Volume(this->current_sound->channel, v);
}
void Eng3D::AudioManager::play_music(const std::string_view path) {
auto audio = this->load(path, false);
if(Mix_PlayMusic((Mix_Music *)audio->stream, 0) < 0)
Eng3D::Log::warning("audio", Eng3D::translate_format("Unable to load audio %s: %s", path.data(), Mix_GetError()));
this->current_music = audio;
}
bool Eng3D::AudioManager::can_play_music() {
if(this->current_music.get() == nullptr)
return true;