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

audio source reinitialization fix, sound volume level tweaks

This commit is contained in:
tmj-fstate
2017-11-30 16:37:25 +01:00
parent ef2195fbcc
commit 34f96595fd
9 changed files with 222 additions and 160 deletions

11
sound.h
View File

@@ -15,7 +15,7 @@ http://mozilla.org/MPL/2.0/.
float const EU07_SOUND_CABCONTROLSCUTOFFRANGE { 7.5f };
float const EU07_SOUND_BRAKINGCUTOFFRANGE { 100.f };
float const EU07_SOUND_RUNNINGNOISECUTOFFRANGE { 100.f };
float const EU07_SOUND_RUNNINGNOISECUTOFFRANGE { 200.f };
enum class sound_type {
single,
@@ -122,6 +122,15 @@ private:
// potentially updates area-based gain factor of the source. returns: true if location has changed
bool
update_placement_gain();
void
insert( audio::buffer_handle Buffer );
template <class Iterator_>
void
insert( Iterator_ First, Iterator_ Last ) {
audio::renderer.insert( this, First, Last );
update_counter( *First, 1 );
}
// members
TDynamicObject const * m_owner { nullptr }; // optional, the vehicle carrying this sound source