diff options
Diffstat (limited to 'src/libjin/audio/sdl/source.h')
-rw-r--r-- | src/libjin/audio/sdl/source.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/libjin/audio/sdl/source.h b/src/libjin/audio/sdl/source.h index d97590e..29a3676 100644 --- a/src/libjin/audio/sdl/source.h +++ b/src/libjin/audio/sdl/source.h @@ -35,10 +35,10 @@ namespace audio void pause() override; void resume() override; void rewind() override; - void isStopped() const override; - void isPaused() const override; - void isFinished() const override; + bool isStopped() const override; + bool isPaused() const override; void setPitch(float pitch) override; + // Ͻ void setVolume(float volume) override; bool setLoop(bool loop) override; void setRate(float rate) override; @@ -50,25 +50,29 @@ namespace audio void loadWAV(void* mem, int size); void loadOGG(void* mem, int size); - inline bool is(int state) { return (status & state) == state; } + inline bool is(int state) const { return (status.state & state) == state; } struct { - const void* data; // Ƶ - int length; // dataֽڳ - void* end; // dataβ = (unsigned char*)data + length + const void* data; // Ƶ + int size; // dataֽڳ + const void* end; // dataβ = (unsigned char*)data + size int rate; // Ƶ unsigned char bitdepth; // ÿsampleıس - int samples; // sample = length / (bitdepth / 8) + int samples; // sample = size / (bitdepth / 8) unsigned char channel; // channel12 char silence; // 0 } raw; /* Procedure controller variable */ - int pos; // ǰŵλ - int pitch; // pitch - int status; // ǰ״̬ - bool loop; // loop or not + struct + { + int pos; // ǰŵλ + int pitch; // pitch + int state; // ǰ״̬ + bool loop; // loop or not + int volume; // + } status; }; |