blob: 5ea2cf2019c5a756f89c553d55f6bc6a47d0b955 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#ifndef __JIN_SOURCE_SDL_H
#define __JIN_SOURCE_SDL_H
#include "../source.h"
namespace jin
{
namespace audio
{
class SDLSource : public Source
{
public:
SDLSource() {}
~SDLSource() {}
void generateSamples(Uint8* streamIn, int len);
/* ISource interface */
void play() override;
void stop() override;
void pause() override;
void resume() override;
void rewind() override;
void isStopped() const override;
void isPaused() const override;
void isFinished() const override;
void setPitch(float pitch) override;
void setVolume(float volume) override;
bool setLoop(bool loop) override;
void setRate(float rate) override;
private:
typedef struct Command
{
typedef enum Action
{
Nothing = 0,
Play,
Stop,
Pause,
Resume,
Rewind,
SetVolume,
};
Action action;
union {
int _integer;
bool _boolean;
const char* _string;
} parameter;
};
Command command;
};
}
}
#endif
|