mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-01-27 06:07:56 +03:00
Added volume scale to env_microphone
This commit is contained in:
parent
4884d02481
commit
a1332a442d
@ -48,6 +48,7 @@ BEGIN_DATADESC( CEnvMicrophone )
|
|||||||
DEFINE_KEYFIELD(m_iszLandmarkName, FIELD_STRING, "landmark"),
|
DEFINE_KEYFIELD(m_iszLandmarkName, FIELD_STRING, "landmark"),
|
||||||
DEFINE_FIELD(m_hLandmark, FIELD_EHANDLE),
|
DEFINE_FIELD(m_hLandmark, FIELD_EHANDLE),
|
||||||
DEFINE_KEYFIELD(m_flPitchScale, FIELD_FLOAT, "PitchScale"),
|
DEFINE_KEYFIELD(m_flPitchScale, FIELD_FLOAT, "PitchScale"),
|
||||||
|
DEFINE_KEYFIELD(m_flVolumeScale, FIELD_FLOAT, "VolumeScale"),
|
||||||
DEFINE_KEYFIELD(m_nChannel, FIELD_INTEGER, "channel"),
|
DEFINE_KEYFIELD(m_nChannel, FIELD_INTEGER, "channel"),
|
||||||
#endif
|
#endif
|
||||||
// DEFINE_FIELD(m_bAvoidFeedback, FIELD_BOOLEAN), // DONT SAVE
|
// DEFINE_FIELD(m_bAvoidFeedback, FIELD_BOOLEAN), // DONT SAVE
|
||||||
@ -61,6 +62,7 @@ BEGIN_DATADESC( CEnvMicrophone )
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
DEFINE_INPUTFUNC(FIELD_INTEGER, "SetDSPPreset", InputSetDSPPreset),
|
DEFINE_INPUTFUNC(FIELD_INTEGER, "SetDSPPreset", InputSetDSPPreset),
|
||||||
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetPitchScale", InputSetPitchScale ),
|
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetPitchScale", InputSetPitchScale ),
|
||||||
|
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetVolumeScale", InputSetVolumeScale ),
|
||||||
DEFINE_INPUTFUNC( FIELD_INTEGER, "SetChannel", InputSetChannel ),
|
DEFINE_INPUTFUNC( FIELD_INTEGER, "SetChannel", InputSetChannel ),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -272,6 +274,15 @@ void CEnvMicrophone::InputSetPitchScale( inputdata_t &inputdata )
|
|||||||
m_flPitchScale = inputdata.value.Float();
|
m_flPitchScale = inputdata.value.Float();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose:
|
||||||
|
// Input : &inputdata -
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void CEnvMicrophone::InputSetVolumeScale( inputdata_t &inputdata )
|
||||||
|
{
|
||||||
|
m_flVolumeScale = inputdata.value.Float();
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
// Input : &inputdata -
|
// Input : &inputdata -
|
||||||
@ -545,11 +556,13 @@ MicrophoneResult_t CEnvMicrophone::SoundPlayed( int entindex, const char *soundn
|
|||||||
EmitSound_t ep;
|
EmitSound_t ep;
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
ep.m_nChannel = m_nChannel;
|
ep.m_nChannel = m_nChannel;
|
||||||
|
if (m_flVolumeScale != 1.0f)
|
||||||
|
ep.m_flVolume = (flVolume * m_flVolumeScale);
|
||||||
#else
|
#else
|
||||||
ep.m_nChannel = CHAN_STATIC;
|
ep.m_nChannel = CHAN_STATIC;
|
||||||
|
ep.m_flVolume = flVolume;
|
||||||
#endif
|
#endif
|
||||||
ep.m_pSoundName = soundname;
|
ep.m_pSoundName = soundname;
|
||||||
ep.m_flVolume = flVolume;
|
|
||||||
ep.m_SoundLevel = soundlevel;
|
ep.m_SoundLevel = soundlevel;
|
||||||
ep.m_nFlags = iFlags;
|
ep.m_nFlags = iFlags;
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
|
@ -57,6 +57,7 @@ public:
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
void InputSetDSPPreset( inputdata_t &inputdata );
|
void InputSetDSPPreset( inputdata_t &inputdata );
|
||||||
void InputSetPitchScale( inputdata_t &inputdata );
|
void InputSetPitchScale( inputdata_t &inputdata );
|
||||||
|
void InputSetVolumeScale( inputdata_t &inputdata );
|
||||||
void InputSetChannel( inputdata_t &inputdata );
|
void InputSetChannel( inputdata_t &inputdata );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -88,6 +89,7 @@ private:
|
|||||||
string_t m_iszLandmarkName;
|
string_t m_iszLandmarkName;
|
||||||
EHANDLE m_hLandmark;
|
EHANDLE m_hLandmark;
|
||||||
float m_flPitchScale = 1.0f;
|
float m_flPitchScale = 1.0f;
|
||||||
|
float m_flVolumeScale = 1.0f;
|
||||||
int m_nChannel = CHAN_STATIC;
|
int m_nChannel = CHAN_STATIC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user