Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef SOUNDCHARS_H
  7. #define SOUNDCHARS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #define CHAR_STREAM '*' // as one of 1st 2 chars in name, indicates streaming wav data
  12. #define CHAR_USERVOX '?' // as one of 1st 2 chars in name, indicates user realtime voice data
  13. #define CHAR_SENTENCE '!' // as one of 1st 2 chars in name, indicates sentence wav
  14. #define CHAR_DRYMIX '#' // as one of 1st 2 chars in name, indicates wav bypasses dsp fx
  15. #define CHAR_DOPPLER '>' // as one of 1st 2 chars in name, indicates doppler encoded stereo wav: left wav (incomming) and right wav (outgoing).
  16. #define CHAR_DIRECTIONAL '<' // as one of 1st 2 chars in name, indicates stereo wav has direction cone: mix left wav (front facing) with right wav (rear facing) based on soundfacing direction
  17. #define CHAR_DISTVARIANT '^' // as one of 1st 2 chars in name, indicates distance variant encoded stereo wav (left is close, right is far)
  18. #define CHAR_OMNI '@' // as one of 1st 2 chars in name, indicates non-directional wav (default mono or stereo)
  19. #define CHAR_HRTF '~' // as one of 1st 2 chars in name, indicates wav should use HRTF spatialization for non-owners.
  20. #define CHAR_RADIO '+' // as one of 1st 2 chars in name, indicates a 'radio' sound -- should be played without spatialization
  21. #define CHAR_SPATIALSTEREO ')' // as one of 1st 2 chars in name, indicates spatialized stereo wav
  22. #define CHAR_DIRSTEREO '(' // as one of 1st 2 chars in name, indicates directional stereo wav (like doppler)
  23. #define CHAR_FAST_PITCH '}' // as one of 1st 2 chars in name, forces low quality, non-interpolated pitch shift
  24. #define CHAR_SUBTITLED '$' // as one of 1st 2 chars in name, indicates the subtitles are forced
  25. inline bool IsSoundChar(char c)
  26. {
  27. bool b;
  28. b = ( c == CHAR_STREAM || c == CHAR_USERVOX || c == CHAR_SENTENCE || c == CHAR_DRYMIX || c == CHAR_OMNI || c == CHAR_RADIO || c == CHAR_DIRSTEREO );
  29. b = b || ( c == CHAR_DOPPLER || c == CHAR_DIRECTIONAL || c == CHAR_DISTVARIANT || c == CHAR_HRTF || c == CHAR_SPATIALSTEREO || c == CHAR_FAST_PITCH );
  30. b = b || ( c == CHAR_SUBTITLED );
  31. return b;
  32. }
  33. // return pointer to first valid character in file name
  34. // by skipping over CHAR_STREAM...CHAR_DRYMIX
  35. inline char *PSkipSoundChars(const char *pch)
  36. {
  37. char *pcht = (char *)pch;
  38. while ( 1 )
  39. {
  40. if (!IsSoundChar(*pcht))
  41. break;
  42. pcht++;
  43. }
  44. return pcht;
  45. }
  46. inline bool TestSoundChar(const char *pch, char c)
  47. {
  48. char *pcht = (char *)pch;
  49. while ( 1 )
  50. {
  51. if (!IsSoundChar(*pcht))
  52. break;
  53. if (*pcht == c)
  54. return true;
  55. pcht++;
  56. }
  57. return false;
  58. }
  59. #endif // SOUNDCHARS_H