16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 01:19:19 +02:00

build 210424. soundproofing enhancement, battery sound, heating command propagation, memory cell command retrieval logic enhancement, coupling mode logic enhancement, motor overload relay threshold cab control animation fix, cab control fallback sound activation fixes,

This commit is contained in:
tmj-fstate
2021-04-24 19:37:16 +02:00
parent 66bd63336b
commit 3775d20e0c
17 changed files with 276 additions and 112 deletions

10
sound.h
View File

@@ -116,6 +116,11 @@ public:
start( float const Offset );
float const &
start() const;
// custom soundproofing setter/getter
auto &
soundproofing();
auto const &
soundproofing() const;
// returns true if there isn't any sound buffer associated with the object, false otherwise
bool
empty() const;
@@ -231,6 +236,7 @@ private:
std::vector<soundchunk_pair> m_soundchunks; // table of samples activated when associated variable is within certain range
bool m_soundchunksempty { true }; // helper, cached check whether sample table is linked with any actual samples
int m_crossfaderange {}; // range of transition from one chunk to another
std::optional< std::array<float, 6> > m_soundproofing; // custom soundproofing parameters
};
// owner setter/getter
@@ -245,6 +251,10 @@ inline std::string const & sound_source::name() const { return m_name; }
// playback starting point shift setter/getter
inline void sound_source::start( float const Offset ) { m_startoffset = Offset; }
inline float const & sound_source::start() const { return m_startoffset; }
// custom soundproofing setter/getter
inline auto & sound_source::soundproofing() { return m_soundproofing; }
inline auto const & sound_source::soundproofing() const { return m_soundproofing; }
// collection of sound sources present in the scene
class sound_table : public basic_table<sound_source> {