|
| 1 | +/***************************************************************************** |
| 2 | + * |
| 3 | + * PROJECT: Multi Theft Auto v1.0 |
| 4 | + * LICENSE: See LICENSE in the top level directory |
| 5 | + * FILE: game_sa/CVehicleAudioSettingsEntrySA.h |
| 6 | + * PURPOSE: Header file for vehicle audio settings entry class |
| 7 | + * |
| 8 | + * Multi Theft Auto is available from http://www.multitheftauto.com/ |
| 9 | + * |
| 10 | + *****************************************************************************/ |
| 11 | + |
| 12 | +#pragma once |
| 13 | + |
| 14 | +#include "game/CVehicleAudioSettingsEntry.h" |
| 15 | +#include <game/Common.h> |
| 16 | + |
| 17 | +// SA interface |
| 18 | +struct tVehicleAudioSettings |
| 19 | +{ |
| 20 | + eVehicleSoundType m_eVehicleSoundType; |
| 21 | + int16 m_nEngineOnSoundBankId; |
| 22 | + int16 m_nEngineOffSoundBankId; |
| 23 | + int8 m_nBassSetting; // 0 or 1 or 2 |
| 24 | + float m_fBassEq; |
| 25 | + float field_C; |
| 26 | + int8 m_nHornToneSoundInBank; |
| 27 | + float m_fHornHigh; |
| 28 | + char m_nDoorSound; |
| 29 | + char m_EngineUpgrade; |
| 30 | + char m_nRadioID; |
| 31 | + char m_nRadioType; |
| 32 | + char m_nVehTypeForAudio; |
| 33 | + float m_fHornVolumeDelta; |
| 34 | +}; |
| 35 | +static_assert(sizeof(tVehicleAudioSettings) == 0x24, "Invalid size for tVehicleAudioSettings"); |
| 36 | + |
| 37 | +class CVehicleAudioSettingsEntrySA final : public CVehicleAudioSettingsEntry |
| 38 | +{ |
| 39 | +public: |
| 40 | + CVehicleAudioSettingsEntrySA(): m_Settings{} {}; |
| 41 | + CVehicleAudioSettingsEntrySA(tVehicleAudioSettings* pSettings) { m_Settings = *pSettings; }; |
| 42 | + ~CVehicleAudioSettingsEntrySA() = default; |
| 43 | + |
| 44 | + const tVehicleAudioSettings& GetInterface() const noexcept { return m_Settings; }; |
| 45 | + |
| 46 | + void Assign(const tVehicleAudioSettings& settings) noexcept { m_Settings = settings; } |
| 47 | + void Assign(const CVehicleAudioSettingsEntry& settings) noexcept { m_Settings = static_cast<const CVehicleAudioSettingsEntrySA&>(settings).GetInterface(); }; |
| 48 | + |
| 49 | + eVehicleSoundType GetSoundType() const noexcept override { return m_Settings.m_eVehicleSoundType; }; |
| 50 | + short GetEngineOnSoundBankID() const noexcept override { return m_Settings.m_nEngineOnSoundBankId; }; |
| 51 | + short GetEngineOffSoundBankID() const noexcept override { return m_Settings.m_nEngineOffSoundBankId; }; |
| 52 | + char GetBassSetting() const noexcept override { return m_Settings.m_nBassSetting; }; |
| 53 | + float GetBassEq() const noexcept override { return m_Settings.m_fBassEq; }; |
| 54 | + float GetFieldC() const noexcept override { return m_Settings.field_C; }; |
| 55 | + char GetHornTon() const noexcept override { return m_Settings.m_nHornToneSoundInBank; }; |
| 56 | + float GetHornHign() const noexcept override { return m_Settings.m_fHornHigh; }; |
| 57 | + char GetEngineUpgrade() const noexcept override { return m_Settings.m_EngineUpgrade; }; |
| 58 | + char GetDoorSound() const noexcept override { return m_Settings.m_nDoorSound; }; |
| 59 | + char GetRadioNum() const noexcept override { return m_Settings.m_nRadioID; }; |
| 60 | + char GetRadioType() const noexcept override { return m_Settings.m_nRadioType; }; |
| 61 | + char GetVehicleTypeForAudio() const noexcept override { return m_Settings.m_nVehTypeForAudio; }; |
| 62 | + float GetHornVolumeDelta() const noexcept override { return m_Settings.m_fHornVolumeDelta; }; |
| 63 | + |
| 64 | + void SetSoundType(eVehicleSoundType value) noexcept override { m_Settings.m_eVehicleSoundType = value; }; |
| 65 | + void SetEngineOnSoundBankID(short value) noexcept override { m_Settings.m_nEngineOnSoundBankId = value; }; |
| 66 | + void SetEngineOffSoundBankID(short value) noexcept override { m_Settings.m_nEngineOffSoundBankId = value; }; |
| 67 | + void SetBassSetting(char value) noexcept override { m_Settings.m_nBassSetting = value; }; |
| 68 | + void SetBassEq(float value) noexcept override { m_Settings.m_fBassEq = value; }; |
| 69 | + void SetFieldC(float value) noexcept override { m_Settings.field_C = value; }; |
| 70 | + void SetHornTon(char value) noexcept override { m_Settings.m_nHornToneSoundInBank = value; }; |
| 71 | + void SetHornHign(float value) noexcept override { m_Settings.m_fHornHigh = value; }; |
| 72 | + void SetEngineUpgrade(char value) noexcept override { m_Settings.m_EngineUpgrade = value; }; |
| 73 | + void SetDoorSound(char value) noexcept override { m_Settings.m_nDoorSound = value; }; |
| 74 | + void SetRadioNum(char value) noexcept override { m_Settings.m_nRadioID = value; }; |
| 75 | + void SetRadioType(char value) noexcept override { m_Settings.m_nRadioType = value; }; |
| 76 | + void SetVehicleTypeForAudio(char value) noexcept override { m_Settings.m_nVehTypeForAudio = value; }; |
| 77 | + void SetHornVolumeDelta(float value) noexcept override { m_Settings.m_fHornVolumeDelta = value; }; |
| 78 | + |
| 79 | +private: |
| 80 | + tVehicleAudioSettings m_Settings; |
| 81 | +}; |
0 commit comments