Skip to content

Commit 0f3061f

Browse files
committed
update AudioManager: added volume to event
1 parent d41c8ba commit 0f3061f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

include/GEngine/libdev/systems/driver/output/AudioManager.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class AudioManager
6262
geg::component::network::NetSend());
6363
else {
6464
getMusicComponent().musicId = getMusicIdByPath(e.path);
65+
getMusicComponent().volume = e.volume;
6566
for (auto [e, _unused, netSend] : gengine::Zip(musics, netSends)) {
6667
netSend.update();
6768
break;

include/GEngine/libdev/systems/events/driver/output/Sound.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ struct SoundPlayed : public Event {
4040
};
4141

4242
struct Music : public Event {
43-
Music(const std::string &path)
44-
: path(path) {
43+
Music(const std::string &path, float volume = 1.f)
44+
: path(path)
45+
, volume(volume) {
4546
}
4647

4748
const std::string path;
49+
const float volume;
4850
};
4951
} // namespace gengine::system::event::driver::output

0 commit comments

Comments
 (0)