-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaudioengine.h
40 lines (35 loc) · 849 Bytes
/
audioengine.h
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
#ifndef CAUDIOENGINE_H
#define CAUDIOENGINE_H
#include "sn76489/sn76489.h"
#include "portaudio.h"
#include <QThread>
#include <QDebug>
#include <QTimer>
#include "adsrenvelope.h"
#include "sequencer.h"
class CAudioEngine : public QObject
{
Q_OBJECT
public:
CAudioEngine();
~CAudioEngine();
void noteOn();
void noteOff();
void playSong();
void stopSong();
void pauseSong();
void timerCallback();
CADSREnvelope toneEnvelope[4];
QThread sequencerThread;
CSequencer *sequencer;
void setNote(int channel, QString note, int octave);
void setChannelVolume(int channel, int volume);
private:
PaStream *stream;
QTimer *timer;
void GenerateNTSCScale();
void GeneratePALScale();
public slots:
void recieveNote(QString note, int octave, int velocity);
};
#endif // CAUDIOENGINE_H