forked from shokunin000/te120
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoundchars.h
68 lines (54 loc) · 2.16 KB
/
soundchars.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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