2010-04-13 13:48:02 +04:00
|
|
|
/*
|
2020-01-14 13:06:00 +03:00
|
|
|
* Copyright 2020 Haiku, Inc. All Rights Reserved.
|
2010-04-13 13:48:02 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Author:
|
|
|
|
* Christopher ML Zumwalt May (zummy@users.sf.net)
|
|
|
|
*/
|
2020-01-14 13:06:00 +03:00
|
|
|
|
2002-10-06 15:31:21 +04:00
|
|
|
#ifndef _STREAMINGGAMESOUND_H
|
|
|
|
#define _STREAMINGGAMESOUND_H
|
|
|
|
|
|
|
|
|
2002-08-11 02:38:37 +04:00
|
|
|
#include <GameSound.h>
|
|
|
|
#include <Locker.h>
|
2020-01-14 13:06:00 +03:00
|
|
|
#include <SupportDefs.h>
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2002-10-06 15:31:21 +04:00
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
class BStreamingGameSound : public BGameSound
|
|
|
|
{
|
2002-08-11 02:38:37 +04:00
|
|
|
public:
|
2020-01-14 13:06:00 +03:00
|
|
|
BStreamingGameSound(size_t bufferFrameCount,
|
|
|
|
const gs_audio_format* format,
|
|
|
|
size_t bufferCount = 2,
|
|
|
|
BGameSoundDevice* device = NULL);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
virtual ~BStreamingGameSound();
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
virtual BGameSound* Clone() const;
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-25 23:35:34 +03:00
|
|
|
typedef void (*hook)(void* cookie, void* buffer, size_t byteCount,
|
|
|
|
BStreamingGameSound* me);
|
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
virtual status_t SetStreamHook(hook h, void* cookie);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
virtual void FillBuffer(void* buffer, size_t byteCount);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
virtual status_t SetAttributes(gs_attribute* attributes,
|
|
|
|
size_t attributeCount);
|
|
|
|
|
|
|
|
virtual status_t Perform(int32 selector, void* data);
|
|
|
|
|
2002-08-11 02:38:37 +04:00
|
|
|
protected:
|
2020-01-14 13:06:00 +03:00
|
|
|
BStreamingGameSound(BGameSoundDevice* device);
|
2010-04-13 13:48:02 +04:00
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
virtual status_t SetParameters(size_t bufferFrameCount,
|
|
|
|
const gs_audio_format* format,
|
|
|
|
size_t bufferCount);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
bool Lock();
|
|
|
|
void Unlock();
|
2002-08-11 02:38:37 +04:00
|
|
|
|
|
|
|
private:
|
2020-01-14 13:06:00 +03:00
|
|
|
BStreamingGameSound();
|
|
|
|
BStreamingGameSound(const BStreamingGameSound& other);
|
|
|
|
BStreamingGameSound&
|
|
|
|
operator=(const BStreamingGameSound& other);
|
|
|
|
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_0(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_1(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_2(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_3(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_4(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_5(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_6(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_7(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_8(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_9(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_10(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_11(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_12(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_13(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_14(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_15(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_16(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_17(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_18(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_19(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_20(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_21(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_22(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BStreamingGameSound_23(int32 arg, ...);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
private:
|
2020-01-14 13:06:00 +03:00
|
|
|
hook fStreamHook;
|
|
|
|
void* fStreamCookie;
|
|
|
|
BLocker fLock;
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
uint32 _reserved[12];
|
2002-08-11 02:38:37 +04:00
|
|
|
};
|
|
|
|
|
2020-01-14 13:06:00 +03:00
|
|
|
#endif
|