-
Notifications
You must be signed in to change notification settings - Fork 8
/
oamlGodotModule.h
75 lines (62 loc) · 1.81 KB
/
oamlGodotModule.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
#ifndef __OAML_GODOT_MODULE_H__
#define __OAML_GODOT_MODULE_H__
#include "servers/audio_server.h"
#include "servers/audio/audio_stream.h"
#include "oaml.h"
#include "scene/main/node.h"
class oamlGodotModule : public Node {
GDCLASS(oamlGodotModule, Node)
int sp_get_channel_count() const;
bool mix(AudioFrame *p_buffer, int p_frames);
void _mix_audio();
static void _mix_audios(void *self) { reinterpret_cast<oamlGodotModule *>(self)->_mix_audio(); }
protected:
Vector<AudioFrame> mix_buffer;
Mutex *lock;
RID streamRid;
oamlApi *oaml;
void set_mix_rate(int p_rate);
static void _bind_methods();
public:
oamlGodotModule();
~oamlGodotModule();
// Return codes
enum {
OAML_OK = 0,
OAML_ERROR = -1,
OAML_NOT_FOUND = -2
};
void AddTension(int value);
void ClearConditions();
void EnableDynamicCompressor(bool enable = true, double thresholdDb = -3.0, double ratio = 4.0);
float GetLayerGain(String layer);
int GetLayerRandomChance(String layer);
String GetPlayingInfo();
int GetTension();
String GetVersion();
float GetVolume();
int Init(String defsFilename);
int InitString(String defs);
int ReadDefsFile(String defsFilename);
bool IsPaused();
bool IsPlaying();
bool IsTrackPlaying(String name);
void LoadState(String state);
void LoadTrack(String name);
float LoadTrackProgress(String name);
void Pause();
int PlayTrack(String name);
int PlayTrackWithStringRandom(String str);
int PlayTrackByGroupRandom(String group);
int PlayTrackByGroupAndSubgroupRandom(String group, String subgroup);
void Resume();
void SetMainLoopCondition(int value);
void SetCondition(int id, int value);
void SetLayerGain(String layer, float gain);
void SetLayerRandomChance(String layer, int randomChance);
void SetTension(int value);
void SetVolume(float vol);
void StopPlaying();
String SaveState();
};
#endif