aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/audio/SDL/je_sdl_audio.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-01-12 21:48:33 +0800
committerchai <chaifix@163.com>2019-01-12 21:48:33 +0800
commit8b00d67febf133e89f6a0bfabc41feed555dc4a9 (patch)
treefe48ef17c250afa40c2588300fcdb5920dba6951 /src/libjin/audio/SDL/je_sdl_audio.h
parenta907c39756ef6b368d06643afa491c49a9044a8e (diff)
*去掉文件前缀je_
Diffstat (limited to 'src/libjin/audio/SDL/je_sdl_audio.h')
-rw-r--r--src/libjin/audio/SDL/je_sdl_audio.h136
1 files changed, 0 insertions, 136 deletions
diff --git a/src/libjin/audio/SDL/je_sdl_audio.h b/src/libjin/audio/SDL/je_sdl_audio.h
deleted file mode 100644
index 5db1698..0000000
--- a/src/libjin/audio/SDL/je_sdl_audio.h
+++ /dev/null
@@ -1,136 +0,0 @@
-#ifndef __JE_AUDIO_SDL_H__
-#define __JE_AUDIO_SDL_H__
-#include "../../core/je_configuration.h"
-#if defined(jin_audio) && (jin_audio == jin_audio_sdl)
-
-#include <vector>
-
-#include "../je_audio_manager.h"
-
-#include "je_sdl_source.h"
-
-namespace JinEngine
-{
- namespace Audio
- {
- namespace SDL
- {
-
-#define SDLAUDIO_BITDEPTH 16
-#define SDLAUDIO_BYTEDEPTH (SDLAUDIO_BITDEPTH >> 3)
-#define SDLAUDIO_CHANNELS 2
-
- ///
- /// Audio system SDL implementation.
- ///
- class SDLAudio : public AudioManager<SDLAudio>
- {
- public:
- ///
- /// SDL audio setting.
- ///
- struct Setting : SettingBase
- {
- public:
- int samplerate; // Ƶ
- int samples; // sample<=samplerate
- };
-
- ///
- /// SDL audio constructor.
- ///
- SDLAudio() {};
-
- ///
- /// SDL audio destructor.
- ///
- ~SDLAudio() {};
-
- ///
- /// Play all sources whose state is playing.
- ///
- void play() override;
-
- ///
- /// Stop and remove all sources from the queue.
- ///
- void stop() override;
-
- ///
- /// Pause audio.
- ///
- void pause() override;
-
- ///
- /// Resume audio.
- ///
- void resume() override;
-
- ///
- /// Set global audio volume.
- ///
- void setVolume(float volume) override;
-
- ///
- /// Process all commands in the queue.
- ///
- void processCommands();
-
- ///
- /// Process all sources.
- ///
- /// @param buffer Source buffer.
- /// @param len Source length.
- ///
- void processSources(void* buffer, size_t len);
-
- ///
- /// Process audio buffer.
- ///
- /// @param buffer Audio stream buffer.
- /// @param len Length of stream buffer.
- ///
- void processBuffer(void* buffer, size_t len);
-
- ///
- /// Goon process.
- ///
- /// @return True if sucessful, otherwise return false.
- ///
- bool goOnProcess();
-
- ///
- /// Lock audio device.
- ///
- void lock();
-
- ///
- /// Unlock audio device.
- ///
- void unlock();
-
- private:
- ///
- /// Initialize audio system.
- ///
- /// @param setting Audio setting.
- ///
- bool startSystem(const SettingBase* setting) override;
-
- ///
- /// Quit audio system.
- ///
- void quitSystem() override;
-
- // Audio device id.
- unsigned int audioDevice;
-
- };
-
- } // namespace SDL
- } // namespace Audio
-} // namespace JinEngine
-
-#endif // (jin_audio) && (jin_audio == jin_audio_sdl)
-
-#endif // __JE_AUDIO_SDL_H__ \ No newline at end of file