2010-04-13 13:48:02 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2001-2002, Haiku Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Author:
|
|
|
|
* Christopher ML Zumwalt May (zummy@users.sf.net)
|
|
|
|
*/
|
2002-10-06 15:31:21 +04:00
|
|
|
#ifndef _FILEGAMESOUND_H
|
|
|
|
#define _FILEGAMESOUND_H
|
|
|
|
|
|
|
|
|
2002-08-11 02:38:37 +04:00
|
|
|
#include <StreamingGameSound.h>
|
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
|
2007-10-16 00:13:55 +04:00
|
|
|
struct entry_ref;
|
2002-10-06 15:31:21 +04:00
|
|
|
struct _gs_media_tracker;
|
|
|
|
struct _gs_ramp;
|
|
|
|
|
2007-10-16 00:13:55 +04:00
|
|
|
|
|
|
|
class BFileGameSound : public BStreamingGameSound {
|
2002-08-11 02:38:37 +04:00
|
|
|
public:
|
2010-04-13 13:48:02 +04:00
|
|
|
BFileGameSound(const entry_ref* file,
|
|
|
|
bool looping = true,
|
|
|
|
BGameSoundDevice* device = NULL);
|
|
|
|
BFileGameSound(const char* file,
|
|
|
|
bool looping = true,
|
|
|
|
BGameSoundDevice* device = NULL);
|
|
|
|
|
|
|
|
virtual ~BFileGameSound();
|
|
|
|
|
|
|
|
virtual BGameSound* Clone() const;
|
|
|
|
|
|
|
|
virtual status_t StartPlaying();
|
|
|
|
virtual status_t StopPlaying();
|
|
|
|
status_t Preload();
|
|
|
|
// if you have stopped and want to start quickly again
|
|
|
|
|
|
|
|
virtual void FillBuffer(void* buffer, size_t byteCount);
|
|
|
|
virtual status_t Perform(int32 selector, void* data);
|
|
|
|
virtual status_t SetPaused(bool isPaused, bigtime_t rampTime);
|
|
|
|
|
2002-10-06 15:31:21 +04:00
|
|
|
enum {
|
|
|
|
B_NOT_PAUSED,
|
|
|
|
B_PAUSE_IN_PROGRESS,
|
|
|
|
B_PAUSED
|
|
|
|
};
|
2010-04-13 13:48:02 +04:00
|
|
|
int32 IsPaused();
|
2002-08-11 02:38:37 +04:00
|
|
|
|
|
|
|
private:
|
2010-04-13 13:48:02 +04:00
|
|
|
BFileGameSound();
|
|
|
|
BFileGameSound(const BFileGameSound& other);
|
|
|
|
BFileGameSound& operator=(const BFileGameSound& other);
|
|
|
|
// not implemented
|
|
|
|
|
|
|
|
status_t Init(const entry_ref* file);
|
|
|
|
|
|
|
|
bool Load();
|
|
|
|
bool Read(void* buffer, size_t bytes);
|
|
|
|
|
|
|
|
status_t _Reserved_BFileGameSound_0(int32 arg, ...);
|
|
|
|
// SetPaused(bool paused, bigtime_t ramp);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_1(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_2(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_3(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_4(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_5(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_6(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_7(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_8(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_9(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_10(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_11(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_12(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_13(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_14(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_15(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_16(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_17(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_18(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_19(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_20(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_21(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_22(int32 arg, ...);
|
|
|
|
virtual status_t _Reserved_BFileGameSound_23(int32 arg, ...);
|
|
|
|
|
|
|
|
private:
|
|
|
|
_gs_media_tracker* fAudioStream;
|
|
|
|
|
2002-10-06 15:31:21 +04:00
|
|
|
bool fStopping;
|
|
|
|
bool fLooping;
|
|
|
|
char fReserved;
|
2010-04-13 13:48:02 +04:00
|
|
|
char* fBuffer;
|
|
|
|
|
2002-10-06 15:31:21 +04:00
|
|
|
size_t fFrameSize;
|
|
|
|
size_t fBufferSize;
|
|
|
|
size_t fPlayPosition;
|
2014-06-12 00:44:48 +04:00
|
|
|
|
2002-10-06 15:31:21 +04:00
|
|
|
thread_id fReadThread;
|
|
|
|
port_id fPort;
|
2014-06-12 00:44:48 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
_gs_ramp* fPausing;
|
2002-10-06 15:31:21 +04:00
|
|
|
bool fPaused;
|
|
|
|
float fPauseGain;
|
2010-04-13 13:48:02 +04:00
|
|
|
|
|
|
|
uint32 _reserved[9];
|
2002-08-11 02:38:37 +04:00
|
|
|
};
|
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
|
2007-10-16 00:13:55 +04:00
|
|
|
#endif // _FILEGAMESOUND_H
|