2010-04-13 13:48:02 +04:00
|
|
|
/*
|
2020-01-08 10:48: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.
|
|
|
|
*/
|
2002-10-06 15:31:21 +04:00
|
|
|
#ifndef _PUSHGAMESOUND_H
|
|
|
|
#define _PUSHGAMESOUND_H
|
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
|
2002-10-06 15:31:21 +04:00
|
|
|
#include <StreamingGameSound.h>
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-08 10:48:00 +03:00
|
|
|
|
2011-08-28 17:47:07 +04:00
|
|
|
class BList;
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
class BPushGameSound : public BStreamingGameSound {
|
2002-08-11 02:38:37 +04:00
|
|
|
public:
|
2020-01-08 10:48:00 +03:00
|
|
|
BPushGameSound(size_t inBufferFrameCount,
|
|
|
|
const gs_audio_format* format,
|
|
|
|
size_t inBufferCount = 2,
|
|
|
|
BGameSoundDevice* device = NULL);
|
|
|
|
virtual ~BPushGameSound();
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-08 10:48:00 +03:00
|
|
|
enum lock_status {
|
|
|
|
lock_failed = -1,
|
|
|
|
lock_ok = 0,
|
|
|
|
lock_ok_frames_dropped
|
|
|
|
};
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-08 10:48:00 +03:00
|
|
|
virtual lock_status LockNextPage(void** _pagePtr, size_t* _pageSize);
|
|
|
|
virtual status_t UnlockPage(void* pagePtr);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-08 10:48:00 +03:00
|
|
|
virtual lock_status LockForCyclic(void** _basePtr, size_t* _size);
|
|
|
|
virtual status_t UnlockCyclic();
|
|
|
|
virtual size_t CurrentPosition();
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-08 10:48:00 +03:00
|
|
|
virtual BGameSound* Clone() const;
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-08 10:48:00 +03:00
|
|
|
virtual status_t Perform(int32 selector, void* data);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
|
|
|
protected:
|
2020-01-08 10:48:00 +03:00
|
|
|
BPushGameSound(BGameSoundDevice* device);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-08 10:48: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-08 10:48:00 +03:00
|
|
|
virtual status_t SetStreamHook(void (*hook)(void* inCookie,
|
|
|
|
void* buffer, size_t byteCount,
|
|
|
|
BStreamingGameSound* me),
|
|
|
|
void* cookie);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-08 10:48:00 +03:00
|
|
|
virtual void FillBuffer(void* buffer, size_t byteCount);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
|
|
|
private:
|
2020-01-08 10:48:00 +03:00
|
|
|
BPushGameSound();
|
|
|
|
BPushGameSound(const BPushGameSound& other);
|
|
|
|
BPushGameSound& operator=(const BPushGameSound& other);
|
|
|
|
|
|
|
|
bool BytesReady(size_t* bytes);
|
|
|
|
|
|
|
|
virtual status_t _Reserved_BPushGameSound_0(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_1(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_2(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_3(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_4(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_5(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_6(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_7(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_8(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_9(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_10(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_11(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_12(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_13(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_14(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_15(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_16(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_17(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_18(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_19(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_20(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_21(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_22(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BPushGameSound_23(int32 arg, ...);
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
private:
|
2020-01-08 10:48:00 +03:00
|
|
|
sem_id fLock;
|
|
|
|
BList* fPageLocked;
|
|
|
|
size_t fLockPos;
|
2002-08-11 02:38:37 +04:00
|
|
|
|
2020-01-08 10:48:00 +03:00
|
|
|
size_t fPlayPos;
|
|
|
|
char* fBuffer;
|
|
|
|
|
|
|
|
size_t fPageSize;
|
|
|
|
int32 fPageCount;
|
|
|
|
size_t fBufferSize;
|
|
|
|
|
|
|
|
uint32 _reserved[12];
|
|
|
|
};
|
2010-04-13 13:48:02 +04:00
|
|
|
|
2020-01-08 10:48:00 +03:00
|
|
|
#endif
|