about summary refs log tree commit diff
path: root/src/game/client/components/sounds.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/client/components/sounds.h')
-rw-r--r--src/game/client/components/sounds.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/game/client/components/sounds.h b/src/game/client/components/sounds.h
new file mode 100644
index 00000000..ce74b85e
--- /dev/null
+++ b/src/game/client/components/sounds.h
@@ -0,0 +1,36 @@
+#ifndef GAME_CLIENT_COMPONENTS_SOUNDS_H
+#define GAME_CLIENT_COMPONENTS_SOUNDS_H
+#include <game/client/component.h>
+
+class CSounds : public CComponent
+{
+	enum
+	{
+		QUEUE_SIZE = 32,
+	};
+	int m_aQueue[QUEUE_SIZE];
+	int m_QueuePos;
+	int64 m_QueueWaitTime;
+
+public:
+	// sound channels
+	enum
+	{
+		CHN_GUI=0,
+		CHN_MUSIC,
+		CHN_WORLD,
+		CHN_GLOBAL,
+	};
+
+	virtual void OnInit();
+	virtual void OnReset();
+	virtual void OnRender();
+	
+	void ClearQueue();
+	void Enqueue(int SetId);
+	void Play(int Channel, int SetId, float Vol, vec2 Pos);
+	void PlayAndRecord(int Channel, int SetId, float Vol, vec2 Pos);
+};
+
+
+#endif