Advertisement
Guest User

Untitled

a guest
May 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. class IEngineSound
  2. {
  3. public:
  4. // Precache a particular sample
  5. virtual bool PrecacheSound(const char *pSample, bool bPreload = false, bool bIsUISound = false) = 0;
  6. virtual bool IsSoundPrecached(const char *pSample) = 0;
  7. virtual void PrefetchSound(const char *pSample) = 0;
  8. virtual bool IsLoopingSound(const char *pSample) = 0;
  9.  
  10. // Just loads the file header and checks for duration (not hooked up for .mp3's yet)
  11. // Is accessible to server and client though
  12. virtual float GetSoundDuration(const char *pSample) = 0;
  13.  
  14. // Pitch of 100 is no pitch shift. Pitch > 100 up to 255 is a higher pitch, pitch < 100
  15. // down to 1 is a lower pitch. 150 to 70 is the realistic range.
  16. // EmitSound with pitch != 100 should be used sparingly, as it's not quite as
  17. // fast (the pitchshift mixer is not native coded).
  18.  
  19. // NOTE: setting iEntIndex to -1 will cause the sound to be emitted from the local
  20. // player (client-side only)
  21. virtual int EmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample,
  22. float flVolume, float flAttenuation, int nSeed, int iFlags = 0, int iPitch = PITCH_NORM,
  23. const Vector *pOrigin = NULL, const Vector *pDirection = NULL, CUtlVector< Vector >* pUtlVecOrigins = NULL, bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1) = 0;
  24.  
  25. virtual int EmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSoundEntry, unsigned int nSoundEntryHash, const char *pSample,
  26. float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags = 0, int iPitch = PITCH_NORM,
  27. const Vector *pOrigin = NULL, const Vector *pDirection = NULL, CUtlVector< Vector >* pUtlVecOrigins = NULL, bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1) = 0;
  28.  
  29. virtual void EmitSentenceByIndex(IRecipientFilter& filter, int iEntIndex, int iChannel, int iSentenceIndex,
  30. float flVolume, soundlevel_t iSoundlevel, int nSeed, int iFlags = 0, int iPitch = PITCH_NORM,
  31. const Vector *pOrigin = NULL, const Vector *pDirection = NULL, CUtlVector< Vector >* pUtlVecOrigins = NULL, bool bUpdatePositions = true, float soundtime = 0.0f, int speakerentity = -1) = 0;
  32.  
  33. virtual void StopSound(int iEntIndex, int iChannel, const char *pSample, unsigned int nSoundEntryHash) = 0;
  34.  
  35. // stop all active sounds (client only)
  36. virtual void StopAllSounds(bool bClearBuffers) = 0;
  37.  
  38. // Set the room type for a player (client only)
  39. virtual void SetRoomType(IRecipientFilter& filter, int roomType) = 0;
  40.  
  41. // Set the dsp preset for a player (client only)
  42. virtual void SetPlayerDSP(IRecipientFilter& filter, int dspType, bool fastReset) = 0;
  43.  
  44. // emit an "ambient" sound that isn't spatialized
  45. // only available on the client, assert on server
  46. virtual int EmitAmbientSound(const char *pSample, float flVolume, int iPitch = PITCH_NORM, int flags = 0, float soundtime = 0.0f) = 0;
  47.  
  48.  
  49. // virtual EntChannel_t CreateEntChannel() = 0;
  50.  
  51. virtual float GetDistGainFromSoundLevel(soundlevel_t soundlevel, float dist) = 0;
  52.  
  53. // Client .dll only functions
  54. virtual int GetGuidForLastSoundEmitted() = 0;
  55. virtual bool IsSoundStillPlaying(int guid) = 0;
  56. virtual void StopSoundByGuid(int guid, bool bForceSync) = 0;
  57. // Set's master volume (0.0->1.0)
  58. virtual void SetVolumeByGuid(int guid, float fvol) = 0;
  59.  
  60. // Retrieves list of all active sounds
  61. virtual void GetActiveSounds(CUtlVector< SndInfo_t >& sndlist) = 0;
  62.  
  63. virtual void PrecacheSentenceGroup(const char *pGroupName) = 0;
  64. virtual void NotifyBeginMoviePlayback() = 0;
  65. virtual void NotifyEndMoviePlayback() = 0;
  66.  
  67. virtual bool GetSoundChannelVolume(const char* sound, float &flVolumeLeft, float &flVolumeRight) = 0;
  68.  
  69. virtual float GetElapsedTimeByGuid(int guid) = 0;
  70.  
  71. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement