blob: a74a025aabc4b02a7bf721e853f74032e65a7388 (
plain)
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
|
#ifndef NW4HBM_SND_TASK_MANAGER_H
#define NW4HBM_SND_TASK_MANAGER_H
#include "Task.h"
#include <revolution/mem.h>
#define TASK_NUM 128
namespace nw4hbm {
namespace snd {
namespace detail {
class TaskManager {
public:
typedef enum TaskPriority {
PRIORITY_LOW = 0,
PRIORITY_MIDDLE,
PRIORITY_HIGH,
PRIORITY_MAX
} TaskPriority;
public:
static TaskManager& GetInstance();
void AppendTask(Task* task, TaskPriority priority);
Task* PopTask(TaskPriority priority);
void Execute();
bool ExecuteSingle() NO_INLINE;
void CancelByTaskId(u32 taskId);
u32 GetTaskBufferSize();
void* Alloc();
void Free(void* ptr);
static u8 mTaskArea[0x2000 + 0x44];
private:
TaskManager();
/* 0x00 */ OSMutex mMutex;
/* 0x18 */ MEMHeapHandle mHeapHandle;
/* 0x1C */ Task* mCurrentTask;
/* 0x20 */ TaskList mTaskList[PRIORITY_MAX];
};
} // namespace detail
} // namespace snd
} // namespace nw4hbm
#endif
|