Rewrote more headers, style updates in some

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32785 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-08-28 14:39:55 +00:00
parent 17a5db77c0
commit cb3f273dd2
6 changed files with 371 additions and 344 deletions

View File

@ -76,7 +76,8 @@ public:
status_t InitCheck() const; status_t InitCheck() const;
// Get info about the underlying file format. // Get info about the underlying file format.
status_t GetFileFormatInfo(media_file_format* mfi) const; status_t GetFileFormatInfo(
media_file_format* mfi) const;
// //
// These functions are for read-only access to a media file. // These functions are for read-only access to a media file.

View File

@ -1,31 +1,23 @@
/****************************************************************************** /*
* Copyright 2009, Haiku, Inc. All rights reserved.
File: PlaySound.h * Distributed under the terms of the MIT License.
*/
Description: Interface for a simple beep sound.
Copyright 1995-97, Be Incorporated
******************************************************************************/
#ifndef _PLAY_SOUND_H #ifndef _PLAY_SOUND_H
#define _PLAY_SOUND_H #define _PLAY_SOUND_H
#ifndef _BE_BUILD_H
#include <BeBuild.h>
#endif
#include <OS.h> #include <OS.h>
#include <Entry.h> #include <Entry.h>
typedef sem_id sound_handle; typedef sem_id sound_handle;
sound_handle play_sound(const entry_ref *soundRef,
bool mix, sound_handle play_sound(const entry_ref* soundRef, bool mix, bool queue,
bool queue, bool background);
bool background
);
status_t stop_sound(sound_handle handle); status_t stop_sound(sound_handle handle);
status_t wait_for_sound(sound_handle handle); status_t wait_for_sound(sound_handle handle);
#endif /* #ifndef _PLAY_SOUND_H*/
#endif // _PLAY_SOUND_H

View File

@ -1,47 +1,55 @@
/******************************************************************************* /*
/ * Copyright 2009, Haiku, Inc. All rights reserved.
/ File: RealtimeAlloc.h * Distributed under the terms of the MIT License.
/ */
/ Description: Allocation from separate "pools" of memory. Those pools #ifndef _REALTIME_ALLOC_H
/ will be locked in RAM if realtime allocators are turned
/ on in the BMediaRoster, so don't waste this memory unless
/ it's needed. Also, the shared pool is a scarce resource,
/ so it's better if you create your own pool for your own
/ needs and leave the shared pool for BMediaNode instances
/ and the needs of the Media Kit.
/
/ Copyright 1998-99, Be Incorporated, All Rights Reserved
/
*******************************************************************************/
#if !defined(_REALTIME_ALLOC_H)
#define _REALTIME_ALLOC_H #define _REALTIME_ALLOC_H
#include <SupportDefs.h> #include <SupportDefs.h>
/*! Allocation from separate "pools" of memory. Those pools will be locked
in RAM if realtime allocators are turned on in the BMediaRoster, so don't
waste this memory unless it's needed. Also, the shared pool is a scarce
resource, so it's better if you create your own pool for your own needs
and leave the shared pool for BMediaNode instances and the needs of the
Media Kit.
*/
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
typedef struct rtm_pool rtm_pool; typedef struct rtm_pool rtm_pool;
/* If out_pool is NULL, the default pool will be created if it isn't already. */ /* If out_pool is NULL, the default pool will be created if it isn't */
/* already. */
/* If the default pool is already created, it will return EALREADY. */ /* If the default pool is already created, it will return EALREADY. */
#if defined(__cplusplus) #if defined(__cplusplus)
status_t rtm_create_pool(rtm_pool ** out_pool, size_t total_size, const char * name=NULL);
#else
status_t rtm_create_pool(rtm_pool ** out_pool, size_t total_size, const char * name);
#endif
status_t rtm_delete_pool(rtm_pool * pool);
/* If NULL is passed for pool, the default pool is used (if created). */
void * rtm_alloc(rtm_pool * pool, size_t size);
status_t rtm_free(void * data);
status_t rtm_realloc(void ** data, size_t new_size);
status_t rtm_size_for(void * data);
status_t rtm_phys_size_for(void * data);
/* Return the default pool, or NULL if not yet initialized */ status_t rtm_create_pool(rtm_pool** out_pool, size_t total_size,
rtm_pool * rtm_default_pool(); const char* name = NULL);
#else
status_t rtm_create_pool(rtm_pool** out_pool, size_t total_size,
const char* name);
#endif
status_t rtm_delete_pool(rtm_pool* pool);
/* If NULL is passed for 'pool', the default pool is used if it has been */
/* created already. */
void* rtm_alloc(rtm_pool* pool, size_t size);
status_t rtm_free(void* data);
status_t rtm_realloc(void** data, size_t new_size);
status_t rtm_size_for(void* data);
status_t rtm_phys_size_for(void* data);
/* Return the default pool, or NULL if it has not yet been initialized. */
rtm_pool* rtm_default_pool();
#if defined(__cplusplus) #if defined(__cplusplus)
} }

View File

@ -1,11 +1,11 @@
/* /*
* Copyright 2009, Haiku Inc. All Rights Reserved. * Copyright 2009, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _SOUND_H #ifndef _SOUND_H
#define _SOUND_H #define _SOUND_H
#include <MediaDefs.h> #include <MediaDefs.h>
class BFile; class BFile;
@ -16,52 +16,54 @@ namespace BPrivate {
class BTrackReader; class BTrackReader;
}; };
class BSound { class BSound {
public: public:
BSound(void *data, size_t size, BSound(void* data, size_t size,
const media_raw_audio_format &format, const media_raw_audio_format& format,
bool freeWhenDone = false); bool freeWhenDone = false);
BSound(const entry_ref *soundFile, BSound(const entry_ref* soundFile,
bool loadIntoMemory = false); bool loadIntoMemory = false);
status_t InitCheck(); status_t InitCheck();
BSound * AcquireRef(); BSound* AcquireRef();
bool ReleaseRef(); bool ReleaseRef();
int32 RefCount() const; // unreliable! int32 RefCount() const; // unreliable!
virtual bigtime_t Duration() const; virtual bigtime_t Duration() const;
virtual const media_raw_audio_format &Format() const; virtual const media_raw_audio_format &Format() const;
virtual const void * Data() const; // returns NULL for files virtual const void* Data() const; // returns NULL for files
virtual off_t Size() const; virtual off_t Size() const;
virtual bool GetDataAt(off_t offset, virtual bool GetDataAt(off_t offset,
void *intoBuffer, size_t bufferSize, void* intoBuffer, size_t bufferSize,
size_t *outUsed); size_t* outUsed);
protected: protected:
BSound(const media_raw_audio_format &format); BSound(const media_raw_audio_format& format);
virtual status_t Perform(int32 code, ...); virtual status_t Perform(int32 code, ...);
private: private:
friend class DummyFriend; friend class DummyFriend;
virtual ~BSound(); virtual ~BSound();
public: public:
virtual status_t BindTo(BSoundPlayer *player, virtual status_t BindTo(BSoundPlayer* player,
const media_raw_audio_format &format); const media_raw_audio_format& format);
virtual status_t UnbindFrom(BSoundPlayer *player); virtual status_t UnbindFrom(BSoundPlayer* player);
private: private:
status_t _Reserved_Sound_0(void *); // BindTo status_t _Reserved_Sound_0(void*); // BindTo
status_t _Reserved_Sound_1(void *); // UnbindFrom status_t _Reserved_Sound_1(void*); // UnbindFrom
virtual status_t _Reserved_Sound_2(void *); virtual status_t _Reserved_Sound_2(void*);
virtual status_t _Reserved_Sound_3(void *); virtual status_t _Reserved_Sound_3(void*);
virtual status_t _Reserved_Sound_4(void *); virtual status_t _Reserved_Sound_4(void*);
virtual status_t _Reserved_Sound_5(void *); virtual status_t _Reserved_Sound_5(void*);
void * fData; private:
void* fData;
size_t fDataSize; size_t fDataSize;
BFile * fFile; BFile* fFile;
int32 fRefCount; int32 fRefCount;
status_t fStatus; status_t fStatus;
media_raw_audio_format fFormat; media_raw_audio_format fFormat;
@ -69,7 +71,7 @@ virtual status_t _Reserved_Sound_5(void *);
bool fFreeWhenDone; bool fFreeWhenDone;
bool fReserved[3]; bool fReserved[3];
BPrivate::BTrackReader *fTrackReader; BPrivate::BTrackReader* fTrackReader;
uint32 fReserved2[18]; uint32 fReserved2[18];
}; };

View File

@ -1,41 +1,35 @@
/****************************************************************************** /*
* Copyright 2009, Haiku, Inc. All rights reserved.
File: SoundFile.h * Distributed under the terms of the MIT License.
*/
Description: Interface for a format-insensitive sound file object.
Copyright 1995-97, Be Incorporated
******************************************************************************/
#ifndef _SOUND_FILE_H #ifndef _SOUND_FILE_H
#define _SOUND_FILE_H #define _SOUND_FILE_H
#ifndef _BE_BUILD_H
#include <BeBuild.h>
#endif
#include <MediaDefs.h>
#include <Entry.h> #include <Entry.h>
#include <File.h> #include <File.h>
#include <MediaDefs.h>
enum /* sound_format*/
{ B_UNKNOWN_FILE, // file formats
enum {
B_UNKNOWN_FILE,
B_AIFF_FILE, B_AIFF_FILE,
B_WAVE_FILE, B_WAVE_FILE,
B_UNIX_FILE }; B_UNIX_FILE
};
class BSoundFile { class BSoundFile {
public: public:
BSoundFile(); BSoundFile();
BSoundFile(const entry_ref *ref, BSoundFile(const entry_ref* ref,
uint32 open_mode); uint32 openMode);
virtual ~BSoundFile(); virtual ~BSoundFile();
status_t InitCheck() const; status_t InitCheck() const;
status_t SetTo(const entry_ref *ref, uint32 open_mode); status_t SetTo(const entry_ref* ref, uint32 openMode);
int32 FileFormat() const; int32 FileFormat() const;
int32 SamplingRate() const; int32 SamplingRate() const;
@ -48,33 +42,36 @@ public:
bool IsCompressed() const; bool IsCompressed() const;
int32 CompressionType() const; int32 CompressionType() const;
char *CompressionName() const; char* CompressionName() const;
virtual int32 SetFileFormat(int32 format); virtual int32 SetFileFormat(int32 format);
virtual int32 SetSamplingRate(int32 fps); virtual int32 SetSamplingRate(int32 fps);
virtual int32 SetChannelCount(int32 spf); virtual int32 SetChannelCount(int32 samplesPerFrame);
virtual int32 SetSampleSize(int32 bps); virtual int32 SetSampleSize(int32 bytesPerSample);
virtual int32 SetByteOrder(int32 bord); virtual int32 SetByteOrder(int32 byteOrder);
virtual int32 SetSampleFormat(int32 fmt); virtual int32 SetSampleFormat(int32 format);
virtual int32 SetCompressionType(int32 type); virtual int32 SetCompressionType(int32 type);
virtual char *SetCompressionName(char *name); virtual char* SetCompressionName(char* name);
virtual bool SetIsCompressed(bool tf); virtual bool SetIsCompressed(bool compressed);
virtual off_t SetDataLocation(off_t offset); virtual off_t SetDataLocation(off_t offset);
virtual off_t SetFrameCount(off_t count); virtual off_t SetFrameCount(off_t count);
size_t ReadFrames(char *buf, size_t count); size_t ReadFrames(char* buffer, size_t count);
size_t WriteFrames(char *buf, size_t count); size_t WriteFrames(char* buffer, size_t count);
virtual off_t SeekToFrame(off_t n); virtual off_t SeekToFrame(off_t index);
off_t FrameIndex() const; off_t FrameIndex() const;
off_t FramesRemaining() const; off_t FramesRemaining() const;
BFile *fSoundFile; BFile* fSoundFile;
private: private:
virtual void _ReservedSoundFile1(); virtual void _ReservedSoundFile1();
virtual void _ReservedSoundFile2(); virtual void _ReservedSoundFile2();
virtual void _ReservedSoundFile3(); virtual void _ReservedSoundFile3();
void _init_raw_stats();
status_t _ref_to_file(const entry_ref* ref);
int32 fFileFormat; int32 fFileFormat;
int32 fSamplingRate; int32 fSamplingRate;
@ -83,21 +80,20 @@ virtual void _ReservedSoundFile3();
int32 fByteOrder; int32 fByteOrder;
int32 fSampleFormat; int32 fSampleFormat;
off_t fByteOffset; /* offset to first sample */ off_t fByteOffset;
// offset to first sample
off_t fFrameCount; off_t fFrameCount;
off_t fFrameIndex; off_t fFrameIndex;
bool fIsCompressed; bool fIsCompressed;
int32 fCompressionType; int32 fCompressionType;
char *fCompressionName; char* fCompressionName;
status_t fCStatus; status_t fCStatus;
void _init_raw_stats(); BMediaFile* fMediaFile;
status_t _ref_to_file(const entry_ref *ref); BMediaTrack* fMediaTrack;
BMediaFile *fMediaFile;
BMediaTrack *fMediaTrack;
uint32 _reserved[2]; uint32 _reserved[2];
}; };
#endif // _SOUND_FILE_H
#endif /* #ifndef _SOUND_FILE_H*/

View File

@ -1,14 +1,16 @@
/* SoundPlayer.h */ /*
/* Copyright 1998 Be Incorporated. All rights reserved. */ * Copyright 2009, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
#if !defined(_SOUND_PLAYER_H) */
#ifndef _SOUND_PLAYER_H
#define _SOUND_PLAYER_H #define _SOUND_PLAYER_H
#include <MediaDefs.h> #include <exception>
#include <BufferProducer.h> #include <BufferProducer.h>
#include <Locker.h> #include <Locker.h>
#include <exception> #include <MediaDefs.h>
class BContinuousParameter; class BContinuousParameter;
@ -16,13 +18,15 @@ class BParameterWeb;
class BSound; class BSound;
class _SoundPlayNode; class _SoundPlayNode;
class sound_error : public std::exception { class sound_error : public std::exception {
const char * m_str_const; const char* m_str_const;
public: public:
sound_error(const char * str); sound_error(const char* string);
const char * what() const throw (); const char* what() const throw();
}; };
class BSoundPlayer { class BSoundPlayer {
friend class _SoundPlayNode; friend class _SoundPlayNode;
public: public:
@ -32,172 +36,196 @@ public:
B_SOUND_DONE B_SOUND_DONE
}; };
BSoundPlayer(const char* name = NULL,
void (*PlayBuffer)(void*, void* buffer,
size_t size,
const media_raw_audio_format& format)
= NULL,
void (*Notifier)(void*,
sound_player_notification what, ...)
= NULL,
void* cookie = NULL);
BSoundPlayer( BSoundPlayer(
const char * name = NULL, const media_raw_audio_format* format,
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format) = NULL, const char* name = NULL,
void (*Notifier)(void *, sound_player_notification what, ...) = NULL, void (*PlayBuffer)(void*, void* buffer,
void * cookie = NULL); size_t size,
const media_raw_audio_format& format)
= NULL,
void (*Notifier)(void*,
sound_player_notification what, ...)
= NULL,
void* cookie = NULL);
BSoundPlayer( BSoundPlayer(
const media_raw_audio_format * format, const media_node& toNode,
const char * name = NULL, const media_multi_audio_format* format
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format) = NULL, = NULL,
void (*Notifier)(void *, sound_player_notification what, ...) = NULL, const char* name = NULL,
void * cookie = NULL); const media_input* input = NULL,
BSoundPlayer( void (*PlayBuffer)(void*, void* buffer,
const media_node & toNode, size_t size,
const media_multi_audio_format * format = NULL, const media_raw_audio_format& format)
const char * name = NULL, = NULL,
const media_input * input = NULL, void (*Notifier)(void*,
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format) = NULL, sound_player_notification what, ...)
void (*Notifier)(void *, sound_player_notification what, ...) = NULL, = NULL,
void * cookie = NULL); void* cookie = NULL);
virtual ~BSoundPlayer(); virtual ~BSoundPlayer();
status_t InitCheck(); // new in R4.1 status_t InitCheck();
media_raw_audio_format Format() const; // new in R4.1 media_raw_audio_format Format() const;
status_t Start(); status_t Start();
void Stop( void Stop(bool block = true, bool flush = true);
bool block = true,
bool flush = true); typedef void (*BufferPlayerFunc)(void*, void*, size_t,
const media_raw_audio_format&);
typedef void (*BufferPlayerFunc)(void *, void *, size_t, const media_raw_audio_format &);
BufferPlayerFunc BufferPlayer() const; BufferPlayerFunc BufferPlayer() const;
void SetBufferPlayer( void SetBufferPlayer(void (*PlayBuffer)(void*,
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format)); void* buffer, size_t size,
typedef void (*EventNotifierFunc)(void *, sound_player_notification what, ...); const media_raw_audio_format& format));
typedef void (*EventNotifierFunc)(void*, sound_player_notification what,
...);
EventNotifierFunc EventNotifier() const; EventNotifierFunc EventNotifier() const;
void SetNotifier( void SetNotifier(void (*Notifier)(void*,
void (*Notifier)(void *, sound_player_notification what, ...)); sound_player_notification what, ...));
void * Cookie() const; void* Cookie() const;
void SetCookie( void SetCookie(void* cookie);
void * cookie); void SetCallbacks(void (*PlayBuffer)(void*,
void SetCallbacks( // atomic change void* buffer, size_t size,
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format) = NULL, const media_raw_audio_format& format)
void (*Notifier)(void *, sound_player_notification what, ...) = NULL, = NULL,
void * cookie = NULL); void (*Notifier)(void*,
sound_player_notification what, ...)
= NULL,
void* cookie = NULL);
typedef int32 play_id; typedef int32 play_id;
bigtime_t CurrentTime(); bigtime_t CurrentTime();
bigtime_t PerformanceTime(); bigtime_t PerformanceTime();
status_t Preroll(); status_t Preroll();
play_id StartPlaying( play_id StartPlaying(BSound* sound,
BSound * sound, bigtime_t atTime = 0);
bigtime_t at_time = 0); play_id StartPlaying(BSound* sound,
play_id StartPlaying( bigtime_t atTime,
BSound * sound, float withVolume);
bigtime_t at_time, status_t SetSoundVolume(play_id sound, float newVolume);
float with_volume); bool IsPlaying(play_id id);
status_t SetSoundVolume( status_t StopPlaying(play_id id);
play_id sound, // update only non-NULL values status_t WaitForSound(play_id id);
float new_volume);
bool IsPlaying(
play_id id);
status_t StopPlaying(
play_id id);
status_t WaitForSound(
play_id id);
float Volume(); /* 0 - 1.0 */ // On [0..1]
void SetVolume( /* 0 - 1.0 */ float Volume();
float new_volume); void SetVolume(float volume);
float VolumeDB( /* -xx - +xx (see GetVolumeInfo()) */
bool forcePoll = false); /* if false, cached value will be used if new enough */ // -xx - +xx (see GetVolumeInfo())
void SetVolumeDB( // If 'forcePoll' is false, a cached value will be used if new
float volume_dB); // enough.
status_t GetVolumeInfo( float VolumeDB(bool forcePoll = false);
media_node * out_node, void SetVolumeDB(float dB);
int32 * out_parameter_id, status_t GetVolumeInfo(media_node* _node,
float * out_min_dB, int32* _parameterID, float* _minDB,
float * out_max_dB); float* _maxDB);
bigtime_t Latency(); bigtime_t Latency();
virtual bool HasData(); virtual bool HasData();
void SetHasData( // this does more than just set a flag void SetHasData(bool hasData);
bool has_data);
// TODO: Needs Perform() method for FBC!
protected: protected:
void SetInitError( // new in R4.1 void SetInitError(status_t inError);
status_t in_error);
private: private:
static void _SoundPlayBufferFunc(void *cookie, void *buffer, size_t size, static void _SoundPlayBufferFunc(void* cookie,
const media_raw_audio_format &format); void* buffer, size_t size,
const media_raw_audio_format& format);
virtual status_t _Reserved_SoundPlayer_0(void *, ...); // FBC padding
virtual status_t _Reserved_SoundPlayer_1(void *, ...); virtual status_t _Reserved_SoundPlayer_0(void*, ...);
virtual status_t _Reserved_SoundPlayer_2(void *, ...); virtual status_t _Reserved_SoundPlayer_1(void*, ...);
virtual status_t _Reserved_SoundPlayer_3(void *, ...); virtual status_t _Reserved_SoundPlayer_2(void*, ...);
virtual status_t _Reserved_SoundPlayer_4(void *, ...); virtual status_t _Reserved_SoundPlayer_3(void*, ...);
virtual status_t _Reserved_SoundPlayer_5(void *, ...); virtual status_t _Reserved_SoundPlayer_4(void*, ...);
virtual status_t _Reserved_SoundPlayer_6(void *, ...); virtual status_t _Reserved_SoundPlayer_5(void*, ...);
virtual status_t _Reserved_SoundPlayer_7(void *, ...); virtual status_t _Reserved_SoundPlayer_6(void*, ...);
virtual status_t _Reserved_SoundPlayer_7(void*, ...);
_SoundPlayNode * fPlayerNode; private:
_SoundPlayNode* fPlayerNode;
struct _playing_sound { struct _playing_sound {
_playing_sound *next; _playing_sound* next;
off_t current_offset; off_t current_offset;
BSound *sound; BSound* sound;
play_id id; play_id id;
int32 delta; int32 delta;
int32 rate; int32 rate;
sem_id wait_sem; sem_id wait_sem;
float volume; float volume;
}; };
_playing_sound *fPlayingSounds;
_playing_sound* fPlayingSounds;
struct _waiting_sound { struct _waiting_sound {
_waiting_sound * next; _waiting_sound* next;
bigtime_t start_time; bigtime_t start_time;
BSound * sound; BSound* sound;
play_id id; play_id id;
int32 rate; int32 rate;
float volume; float volume;
}; };
_waiting_sound *fWaitingSounds;
void (*fPlayBufferFunc)(void * cookie, void * buffer, size_t size, const media_raw_audio_format & format); _waiting_sound* fWaitingSounds;
void (*fNotifierFunc)(void * cookie, sound_player_notification what, ...);
void (*fPlayBufferFunc)(void* cookie, void* buffer,
size_t size, const media_raw_audio_format& format);
void (*fNotifierFunc)(void* cookie, sound_player_notification what,
...);
BLocker fLocker; BLocker fLocker;
float fVolumeDB; float fVolumeDB;
media_input fMediaInput; // the system mixer media_input fMediaInput;
media_output fMediaOutput; // the player node // Usually the system mixer
void * fCookie; media_output fMediaOutput;
// The playback node
void* fCookie;
// Opaque handle passed to hooks
int32 fFlags; int32 fFlags;
status_t fInitStatus; // new in R4.1 status_t fInitStatus;
BContinuousParameter * fVolumeSlider; BContinuousParameter* fVolumeSlider;
bigtime_t fLastVolumeUpdate; bigtime_t fLastVolumeUpdate;
BParameterWeb *fParameterWeb; BParameterWeb* fParameterWeb;
uint32 _m_reserved[15]; uint32 _m_reserved[15];
void NotifySoundDone( private:
play_id sound, void NotifySoundDone(play_id sound, bool gotToPlay);
bool got_to_play);
void get_volume_slider(); void get_volume_slider();
void Init( void Init(const media_node* node,
const media_node * node, const media_multi_audio_format* format,
const media_multi_audio_format * format, const char* name,
const char * name, const media_input* input,
const media_input * input, void (*PlayBuffer)(void*, void* buffer,
void (*PlayBuffer)(void *, void * buffer, size_t size, const media_raw_audio_format & format),
void (*Notifier)(void *, sound_player_notification what, ...),
void * cookie);
// for B_STARTED and B_STOPPED, the argument is BSoundPlayer* (this)
// for B_SOUND_DONE, the arguments are play_id and true/false for whether it got to play data at all
virtual void Notify(
sound_player_notification what,
...);
// get data into the buffer to play -- this version will use the queued BSound system
virtual void PlayBuffer(
void * buffer,
size_t size, size_t size,
const media_raw_audio_format & format); const media_raw_audio_format& format),
void (*Notifier)(void*,
sound_player_notification what, ...),
void* cookie);
// For B_STARTED and B_STOPPED, the argument is BSoundPlayer* (this).
// For B_SOUND_DONE, the arguments are play_id and true/false for
// whether it got to play data at all.
virtual void Notify(sound_player_notification what,
...);
// Get data into the buffer to play -- this version will use the
// queued BSound system.
virtual void PlayBuffer(void* buffer, size_t size,
const media_raw_audio_format& format);
}; };
#endif // _SOUND_PLAYER_H
#endif /* _SOUND_PLAYER_H */