many stuffs
This commit is contained in:
parent
ce81cbd9d8
commit
a88fce53e2
27 changed files with 4343 additions and 16 deletions
|
|
@ -10,13 +10,44 @@ namespace fishbone {
|
|||
#include <fishbone/machdep.h>
|
||||
#include <fishbone/mixer.h>
|
||||
|
||||
#ifdef _FISHBONE
|
||||
#if defined(FISHBONE_SOUND_USE_SDL2)
|
||||
typedef size_t FISHBONE_SOUNDDRV_HANDLE;
|
||||
#endif
|
||||
#else
|
||||
typedef void* FISHBONE_SOUNDDRV_HANDLE;
|
||||
#endif
|
||||
|
||||
namespace fishbone {
|
||||
class SoundDriver {
|
||||
FISHBONE_SOUNDDRV_HANDLE sound;
|
||||
|
||||
public:
|
||||
SoundDriver();
|
||||
~SoundDriver();
|
||||
|
||||
fishbone::Mixer mixer;
|
||||
};
|
||||
|
||||
class SoundLoader {
|
||||
public:
|
||||
SoundLoader();
|
||||
~SoundLoader();
|
||||
|
||||
virtual Sound* open(void* buffer, size_t size);
|
||||
virtual int read(Sound* sound, short* buffer, size_t frames);
|
||||
};
|
||||
|
||||
class Sound {
|
||||
SoundLoader* loader;
|
||||
|
||||
public:
|
||||
Sound(SoundLoader* loader);
|
||||
|
||||
int read(short* buffer, size_t frames);
|
||||
|
||||
int rate;
|
||||
int channels;
|
||||
};
|
||||
}; // namespace fishbone
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue