INNER CODE UNIT · C++
audio
symphony-of-empires/symphony-of-empires · eng3d/eng3d/audio.cpp:88
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;
bool is_busy = Mix_PlayingMusic() != 0;
return !is_busy;
}
void Eng3D::AudioManager::set_music_volume(float v) {
Mix_VolumeMusic(v);
}
Eng3D::AudioManager::~AudioManager() {