summaryrefslogtreecommitdiff
path: root/engine/audio/private/vox_private.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /engine/audio/private/vox_private.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'engine/audio/private/vox_private.h')
-rw-r--r--engine/audio/private/vox_private.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/engine/audio/private/vox_private.h b/engine/audio/private/vox_private.h
new file mode 100644
index 0000000..cd29c05
--- /dev/null
+++ b/engine/audio/private/vox_private.h
@@ -0,0 +1,74 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $Workfile: $
+// $Date: $
+//
+//-----------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef VOX_PRIVATE_H
+#define VOX_PRIVATE_H
+#pragma once
+
+#ifndef VOX_H
+#include "vox.h"
+#endif
+
+#ifndef UTLVECTOR_H
+#include "utlvector.h"
+#endif
+
+#include "utlsymbol.h"
+
+struct channel_t;
+class CSfxTable;
+class CAudioMixer;
+
+struct voxword_t
+{
+ int volume; // increase percent, ie: 125 = 125% increase
+ int pitch; // pitch shift up percent
+ int start; // offset start of wave percent
+ int end; // offset end of wave percent
+ int cbtrim; // end of wave after being trimmed to 'end'
+ int fKeepCached; // 1 if this word was already in cache before sentence referenced it
+ int samplefrac; // if pitch shifting, this is position into wav * 256
+ int timecompress; // % of wave to skip during playback (causes no pitch shift)
+ CSfxTable *sfx; // name and cache pointer
+};
+
+#define CVOXWORDMAX 32
+#define CVOXZEROSCANMAX 255 // scan up to this many samples for next zero crossing
+
+struct sentence_t
+{
+ sentence_t() :
+ pName( 0 ),
+ length( 0.0f ),
+ closecaption( false )
+ {
+ }
+
+ char *pName;
+ float length;
+ bool closecaption : 7;
+ bool isPrecached : 1;
+ CUtlSymbol caption;
+};
+
+extern CUtlVector<sentence_t> g_Sentences;
+
+
+extern int VOX_FPaintPitchChannelFrom8( channel_t *ch, sfxcache_t *sc, int count, int pitch, int timecompress );
+extern void VOX_TrimStartEndTimes( channel_t *ch, sfxcache_t *sc );
+extern int VOX_ParseWordParams( char *psz, voxword_t *pvoxword, int fFirst );
+extern void VOX_SetChanVol( channel_t *ch );
+extern char **VOX_ParseString( char *psz );
+extern CAudioMixer *CreateSentenceMixer( voxword_t *pwords );
+
+#endif // VOX_PRIVATE_H