Team Fortress 2 Source Code as on 22/4/2020
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.

74 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //-----------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #ifndef VOX_PRIVATE_H
  14. #define VOX_PRIVATE_H
  15. #pragma once
  16. #ifndef VOX_H
  17. #include "vox.h"
  18. #endif
  19. #ifndef UTLVECTOR_H
  20. #include "utlvector.h"
  21. #endif
  22. #include "utlsymbol.h"
  23. struct channel_t;
  24. class CSfxTable;
  25. class CAudioMixer;
  26. struct voxword_t
  27. {
  28. int volume; // increase percent, ie: 125 = 125% increase
  29. int pitch; // pitch shift up percent
  30. int start; // offset start of wave percent
  31. int end; // offset end of wave percent
  32. int cbtrim; // end of wave after being trimmed to 'end'
  33. int fKeepCached; // 1 if this word was already in cache before sentence referenced it
  34. int samplefrac; // if pitch shifting, this is position into wav * 256
  35. int timecompress; // % of wave to skip during playback (causes no pitch shift)
  36. CSfxTable *sfx; // name and cache pointer
  37. };
  38. #define CVOXWORDMAX 32
  39. #define CVOXZEROSCANMAX 255 // scan up to this many samples for next zero crossing
  40. struct sentence_t
  41. {
  42. sentence_t() :
  43. pName( 0 ),
  44. length( 0.0f ),
  45. closecaption( false )
  46. {
  47. }
  48. char *pName;
  49. float length;
  50. bool closecaption : 7;
  51. bool isPrecached : 1;
  52. CUtlSymbol caption;
  53. };
  54. extern CUtlVector<sentence_t> g_Sentences;
  55. extern int VOX_FPaintPitchChannelFrom8( channel_t *ch, sfxcache_t *sc, int count, int pitch, int timecompress );
  56. extern void VOX_TrimStartEndTimes( channel_t *ch, sfxcache_t *sc );
  57. extern int VOX_ParseWordParams( char *psz, voxword_t *pvoxword, int fFirst );
  58. extern void VOX_SetChanVol( channel_t *ch );
  59. extern char **VOX_ParseString( char *psz );
  60. extern CAudioMixer *CreateSentenceMixer( voxword_t *pwords );
  61. #endif // VOX_PRIVATE_H