/
ASScheduler.h
61 lines (48 loc) · 1.49 KB
/
ASScheduler.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
#pragma once
#include "ActionScript.h"
#include <list>
class CASScheduleItem
{
public:
int m_iID;
CActionScript * m_pScript;
DWORD m_dwTimeStamp;
DWORD m_dwInterval; // 0=Immediate
int m_iCount; // -1=infinite (if m_dwInterval > 0 )
bool m_bPreLaunch;
CASScheduleItem( LPCTSTR szScript, bool bContext );
~CASScheduleItem();
};
extern bool g_bSchedulerInit;
typedef list<CASScheduleItem *> TScriptSchedule;
DWORD ActionScriptSchedHandlerProc( LPVOID pParam );
void InitializeActionScriptScheduler( void );
bool RemoveScheduledScript( int iID );
//CASScheduleItem * PopNextScheduledScript( void );
DWORD GetNextScheduledTime( void );
CASScheduleItem * PopNextScheduledScript( int * piCount );
int ScheduleScript( LPCTSTR szScript, DWORD dwInterval, int iCount, bool bPrelaunch, bool bContext );
// int ScheduleScript( LPCTSTR szScript, DWORD dwInterval, int iCount, bool bPrelaunch );
// bool RemoveScheduledScript( int iID );
// CASScheduleItem * PopNextScheduledScript( void );
// DWORD GetNextScheduledTime( void );
class CScriptScheduleInfo
{
public:
HANDLE m_hScriptScheduleEvent;
HANDLE m_hThread;
CRITICAL_SECTION m_ScriptScheduleCS;
TScriptSchedule m_ActionScriptSchedule;
bool m_bContinueScripts;
int m_iID;
bool m_bInitialized;
CScriptScheduleInfo() :
m_hScriptScheduleEvent(NULL),
m_hThread(NULL),
m_bContinueScripts(true),
m_iID(1),
m_bInitialized(false)
{
// InitializeCriticalSection(&m_ScriptScheduleCS);
};
}; // g_ScriptSchedule;