fishbowl/engine/include/fishbone/mixer.h

32 lines
605 B
C
Raw Permalink Normal View History

2026-05-25 07:25:59 +09:00
#ifndef __FISHBONE_MIXER_H__
#define __FISHBONE_MIXER_H__
namespace fishbone {
class Mixer;
};
2026-05-25 12:39:31 +09:00
#include <fishbone/machdep.h>
#include <fishbone/sound.h>
2026-05-27 16:03:38 +09:00
#include <fishbone/thread.h>
2026-05-25 12:39:31 +09:00
2026-05-25 07:25:59 +09:00
namespace fishbone {
class Mixer {
2026-05-27 21:36:15 +09:00
fishbone::Mutex* mutex;
2026-05-27 16:03:38 +09:00
public:
Mixer();
~Mixer();
void read(short* buffer, size_t frames);
fishbone::Sound* open(const char* path);
2026-05-27 23:51:37 +09:00
void lock();
void unlock();
2026-05-27 16:03:38 +09:00
static const int rate = 44100;
2026-05-25 12:39:31 +09:00
std::vector<fishbone::SoundLoader*> loaders;
2026-05-27 16:03:38 +09:00
std::vector<fishbone::Sound*> sounds;
2026-05-28 14:07:42 +09:00
float position[3];
2026-05-25 07:25:59 +09:00
};
2026-05-25 12:12:03 +09:00
}; // namespace fishbone
2026-05-25 07:25:59 +09:00
#endif