diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/public/soundchars.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/soundchars.h')
| -rw-r--r-- | mp/src/public/soundchars.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/mp/src/public/soundchars.h b/mp/src/public/soundchars.h new file mode 100644 index 00000000..3f460d14 --- /dev/null +++ b/mp/src/public/soundchars.h @@ -0,0 +1,68 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#ifndef SOUNDCHARS_H
+#define SOUNDCHARS_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#define CHAR_STREAM '*' // as one of 1st 2 chars in name, indicates streaming wav data
+#define CHAR_USERVOX '?' // as one of 1st 2 chars in name, indicates user realtime voice data
+#define CHAR_SENTENCE '!' // as one of 1st 2 chars in name, indicates sentence wav
+#define CHAR_DRYMIX '#' // as one of 1st 2 chars in name, indicates wav bypasses dsp fx
+#define CHAR_DOPPLER '>' // as one of 1st 2 chars in name, indicates doppler encoded stereo wav: left wav (incomming) and right wav (outgoing).
+#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
+#define CHAR_DISTVARIANT '^' // as one of 1st 2 chars in name, indicates distance variant encoded stereo wav (left is close, right is far)
+#define CHAR_OMNI '@' // as one of 1st 2 chars in name, indicates non-directional wav (default mono or stereo)
+#define CHAR_SPATIALSTEREO ')' // as one of 1st 2 chars in name, indicates spatialized stereo wav
+#define CHAR_FAST_PITCH '}' // as one of 1st 2 chars in name, forces low quality, non-interpolated pitch shift
+
+inline bool IsSoundChar(char c)
+{
+ bool b;
+
+ b = (c == CHAR_STREAM || c == CHAR_USERVOX || c == CHAR_SENTENCE || c == CHAR_DRYMIX || c == CHAR_OMNI );
+ b = b || (c == CHAR_DOPPLER || c == CHAR_DIRECTIONAL || c == CHAR_DISTVARIANT || c == CHAR_SPATIALSTEREO || c == CHAR_FAST_PITCH );
+
+ return b;
+}
+
+// return pointer to first valid character in file name
+// by skipping over CHAR_STREAM...CHAR_DRYMIX
+
+inline char *PSkipSoundChars(const char *pch)
+{
+ char *pcht = (char *)pch;
+
+ while ( 1 )
+ {
+ if (!IsSoundChar(*pcht))
+ break;
+ pcht++;
+ }
+
+ return pcht;
+}
+
+
+inline bool TestSoundChar(const char *pch, char c)
+{
+ char *pcht = (char *)pch;
+
+ while ( 1 )
+ {
+ if (!IsSoundChar(*pcht))
+ break;
+ if (*pcht == c)
+ return true;
+ pcht++;
+ }
+
+ return false;
+}
+
+#endif // SOUNDCHARS_H
|