OpenGothic
Open source reimplementation of Gothic I and II
Loading...
Searching...
No Matches
soundfx.h
Go to the documentation of this file.
1#pragma once
2
3#include <Tempest/SoundEffect>
4#include <Tempest/Sound>
5#include <vector>
6
7#include <zenkit/addon/daedalus.hh>
8
9class GSoundEffect;
10
11class SoundFx {
12 public:
13 SoundFx(std::string_view tagname);
14 SoundFx(Tempest::Sound &&raw);
15 SoundFx(SoundFx&&)=default;
17
18 Tempest::SoundEffect load(Tempest::SoundDevice& dev, bool& loop) const;
19
20 private:
21 struct SoundVar {
22 SoundVar()=default;
23 SoundVar(const zenkit::ISoundEffect& sfx,Tempest::Sound&& snd);
24 SoundVar(const float vol,Tempest::Sound&& snd);
25
26 Tempest::Sound snd;
27 float vol = 0.5f;
28 bool loop = false;
29 };
30
31 std::vector<SoundVar> inst;
32 void implLoad (std::string_view name);
33 void loadVariants(std::string_view name);
34 };
35
SoundFx & operator=(SoundFx &&)=default
SoundFx(SoundFx &&)=default
Tempest::SoundEffect load(Tempest::SoundDevice &dev, bool &loop) const
Definition soundfx.cpp:49