-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAelPlayer.h
More file actions
64 lines (44 loc) · 1.29 KB
/
AelPlayer.h
File metadata and controls
64 lines (44 loc) · 1.29 KB
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
64
#ifndef __AEL_PLAYER__
#define __AEL_PLAYER__
#include "AelUtilities.h"
#include "AelMixer.h"
#include "RtAudio.h"
#include <thread>
using namespace std;
namespace Ael{
///////////////////////////////////////////////////////////////////////////////
// Classe AelPlayer
// Responsável pela reprodução de áudio da biblioteca
// Variáveis-Membro:
// AelMixer*, RtAudio, thread*, int*, int, float, STATUSPLAYER
// Funções-Membro:
// 2 Construtores
// Método start, pause, stop (estado de reprodução)
// Método tick (funcção callback)
/////////////////////////////////////////////////////////////////////////////
class AelPlayer {
public:
friend int tick(void*, void*, unsigned int, double, RtAudioStreamStatus, void*);
enum STATUSPLAYER { PLAYING, PAUSED, STOPPED };
AelPlayer(int n_channels=2, float samplerate=44100.0, int bufferFrames=512);
AelPlayer(AelMixer*);
void start();
void pause();
void stop();
AelMixer* getMixer(){ return mixerptr; }
static void tick(AelPlayer* player);
STATUSPLAYER getStatus() { return status; }
~AelPlayer();
private:
AelMixer* mixerptr;
RtAudio dac;
thread* threadptr;
int* frames;
int channels;
float sampleRate;
int bufferFrames;
STATUSPLAYER status;
void openStream();
};
}
#endif