forked from sears2424/Source-PlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchoreochannel.h
95 lines (72 loc) · 2.43 KB
/
choreochannel.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef CHOREOCHANNEL_H
#define CHOREOCHANNEL_H
#ifdef _WIN32
#pragma once
#endif
#include "tier1/utlvector.h"
#include "tier1/utlrbtree.h"
class CChoreoEvent;
class CChoreoActor;
class CChoreoScene;
class CUtlBuffer;
class IChoreoStringPool;
//-----------------------------------------------------------------------------
// Purpose: A channel is owned by an actor and contains zero or more events
//-----------------------------------------------------------------------------
class CChoreoChannel
{
public:
// Construction
CChoreoChannel( void );
CChoreoChannel( const char *name );
// Assignment
CChoreoChannel& operator=(const CChoreoChannel& src );
// Serialization
void SaveToBuffer( CUtlBuffer& buf, CChoreoScene *pScene, IChoreoStringPool *pStringPool );
bool RestoreFromBuffer( CUtlBuffer& buf, CChoreoScene *pScene, CChoreoActor *pActor, IChoreoStringPool *pStringPool );
// Accessors
void SetName( const char *name );
const char *GetName( void );
// Iterate children
int GetNumEvents( void );
CChoreoEvent *GetEvent( int event );
// Manipulate children
void AddEvent( CChoreoEvent *event );
void RemoveEvent( CChoreoEvent *event );
int FindEventIndex( CChoreoEvent *event );
void RemoveAllEvents();
CChoreoActor *GetActor( void );
void SetActor( CChoreoActor *actor );
void SetActive( bool active );
bool GetActive( void ) const;
// Compute true start/end times for gesture events in this channel, factoring in "null" gestures as needed
void ReconcileGestureTimes();
// Compute master/slave, count, endtime info for close captioning data
void ReconcileCloseCaption();
bool IsMarkedForSave() const { return m_bMarkedForSave; }
void SetMarkedForSave( bool mark ) { m_bMarkedForSave = mark; }
void MarkForSaveAll( bool mark );
bool GetSortedCombinedEventList( char const *cctoken, CUtlRBTree< CChoreoEvent * >& sorted );
private:
// Initialize fields
void Init( void );
enum
{
MAX_CHANNEL_NAME = 128,
};
CChoreoActor *m_pActor;
// Channels are just named
char m_szName[ MAX_CHANNEL_NAME ];
// All of the events for this channel
CUtlVector < CChoreoEvent * > m_Events;
bool m_bActive;
// Purely for save/load
bool m_bMarkedForSave;
};
#endif // CHOREOCHANNEL_H