BFileGameSound: allow initializing from a BDataIO
There is no reason to not allow this, and it makes it possible to load data from eg. a BResource instead of a file, which is very useful. Remove some unused members in the class and dead code, and fix style issues. Change-Id: I94cbd0c13c469ea80f55028cf33dfde2de4365ef Reviewed-on: https://review.haiku-os.org/c/haiku/+/2001 Reviewed-by: Stephan Aßmus <[email protected]>
This commit is contained in:
committed by
Stephan Aßmus
parent
041bbff9b0
commit
69f814cded
@@ -11,6 +11,8 @@
|
||||
|
||||
#include <StreamingGameSound.h>
|
||||
|
||||
#include <DataIO.h>
|
||||
|
||||
|
||||
struct entry_ref;
|
||||
struct _gs_media_tracker;
|
||||
@@ -25,6 +27,9 @@ public:
|
||||
BFileGameSound(const char* file,
|
||||
bool looping = true,
|
||||
BGameSoundDevice* device = NULL);
|
||||
BFileGameSound(BDataIO* data,
|
||||
bool looping = true,
|
||||
BGameSoundDevice* device = NULL);
|
||||
|
||||
virtual ~BFileGameSound();
|
||||
|
||||
@@ -52,7 +57,7 @@ private:
|
||||
BFileGameSound& operator=(const BFileGameSound& other);
|
||||
// not implemented
|
||||
|
||||
status_t Init(const entry_ref* file);
|
||||
status_t Init(BDataIO* data);
|
||||
|
||||
bool Load();
|
||||
bool Read(void* buffer, size_t bytes);
|
||||
@@ -95,14 +100,17 @@ private:
|
||||
size_t fBufferSize;
|
||||
size_t fPlayPosition;
|
||||
|
||||
thread_id fReadThread;
|
||||
port_id fPort;
|
||||
|
||||
_gs_ramp* fPausing;
|
||||
bool fPaused;
|
||||
float fPauseGain;
|
||||
|
||||
BDataIO* fDataSource;
|
||||
|
||||
#ifdef B_HAIKU_64_BIT
|
||||
uint32 _reserved[9];
|
||||
#else
|
||||
uint32 _reserved[10];
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user