1/*
2 *  Copyright 2001-2002, Haiku Inc. All Rights Reserved.
3 *  Distributed under the terms of the MIT License.
4 *
5 * Author:
6 *		Christopher ML Zumwalt May (zummy@users.sf.net)
7 */
8#ifndef _STREAMINGGAMESOUND_H
9#define _STREAMINGGAMESOUND_H
10
11
12#include <SupportDefs.h>
13#include <GameSound.h>
14#include <Locker.h>
15
16
17class BStreamingGameSound : public BGameSound {
18public:
19								BStreamingGameSound(size_t bufferFrameCount,
20									const gs_audio_format* format,
21									size_t bufferCount = 2,
22									BGameSoundDevice* device = NULL);
23
24	virtual						~BStreamingGameSound();
25
26	virtual	BGameSound*			Clone() const;
27
28	virtual	status_t			SetStreamHook(void (*hook)(void* cookie,
29										void* buffer, size_t byteCount,
30										BStreamingGameSound* me),
31									void* cookie);
32	virtual	void				FillBuffer(void* buffer, size_t byteCount);
33
34	virtual	status_t			SetAttributes(gs_attribute* attributes,
35									size_t attributeCount);
36
37	virtual	status_t 			Perform(int32 selector, void* data);
38
39protected:
40								BStreamingGameSound(BGameSoundDevice* device);
41
42	virtual status_t			SetParameters(size_t bufferFrameCount,
43									const gs_audio_format* format,
44								 	size_t bufferCount);
45
46			bool				Lock();
47			void				Unlock();
48
49private:
50								BStreamingGameSound();
51								BStreamingGameSound(
52									const BStreamingGameSound& other);
53			BStreamingGameSound& operator=(const BStreamingGameSound& other);
54									// not implemented
55
56	virtual	status_t			_Reserved_BStreamingGameSound_0(int32 arg,...);
57	virtual	status_t			_Reserved_BStreamingGameSound_1(int32 arg,...);
58	virtual	status_t			_Reserved_BStreamingGameSound_2(int32 arg,...);
59	virtual	status_t			_Reserved_BStreamingGameSound_3(int32 arg,...);
60	virtual	status_t			_Reserved_BStreamingGameSound_4(int32 arg,...);
61	virtual	status_t			_Reserved_BStreamingGameSound_5(int32 arg,...);
62	virtual	status_t			_Reserved_BStreamingGameSound_6(int32 arg,...);
63	virtual	status_t			_Reserved_BStreamingGameSound_7(int32 arg,...);
64	virtual	status_t			_Reserved_BStreamingGameSound_8(int32 arg,...);
65	virtual	status_t			_Reserved_BStreamingGameSound_9(int32 arg,...);
66	virtual	status_t			_Reserved_BStreamingGameSound_10(int32 arg,...);
67	virtual	status_t			_Reserved_BStreamingGameSound_11(int32 arg,...);
68	virtual	status_t			_Reserved_BStreamingGameSound_12(int32 arg,...);
69	virtual	status_t			_Reserved_BStreamingGameSound_13(int32 arg,...);
70	virtual	status_t			_Reserved_BStreamingGameSound_14(int32 arg,...);
71	virtual	status_t			_Reserved_BStreamingGameSound_15(int32 arg,...);
72	virtual	status_t			_Reserved_BStreamingGameSound_16(int32 arg,...);
73	virtual	status_t			_Reserved_BStreamingGameSound_17(int32 arg,...);
74	virtual	status_t			_Reserved_BStreamingGameSound_18(int32 arg,...);
75	virtual	status_t			_Reserved_BStreamingGameSound_19(int32 arg,...);
76	virtual	status_t			_Reserved_BStreamingGameSound_20(int32 arg,...);
77	virtual	status_t			_Reserved_BStreamingGameSound_21(int32 arg,...);
78	virtual	status_t			_Reserved_BStreamingGameSound_22(int32 arg,...);
79	virtual	status_t			_Reserved_BStreamingGameSound_23(int32 arg,...);
80
81private:
82			void				(*fStreamHook)(void* cookie, void* buffer,
83									size_t bytes, BStreamingGameSound* sound);
84			void*				fStreamCookie;
85			BLocker				fLock;
86
87			uint32				_reserved[12];
88};
89
90
91#endif	// _STREAMING_GAME_SOUND_H
92