blob: 1bdb5b5da2c6aad258ab3b6d664886a6df8e6cb6 (
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
#ifndef __DRUMGIZMO_DRUMGIZMO_H__
#define __DRUMGIZMO_DRUMGIZMO_H__
#include <string>
#include <list>
#include "audiooutputengine.h"
#include "audioinputengine.h"
#include "events.h"
#include "audiofile.h"
#include "drumkit.h"
#define MAX_NUM_CHANNELS 512
class DrumGizmo {
public:
DrumGizmo(AudioOutputEngine *outputengine,
AudioInputEngine *inputengine);
~DrumGizmo();
bool loadkit(const std::string &kitfile);
bool init(bool preload = true);
void run();
void run(size_t pos, sample_t *samples, size_t nsamples);
void stop();
void getSamples(int ch, int pos, sample_t *s, size_t sz);
bool isRunning() { return is_running; }
private:
bool is_running;
AudioOutputEngine *oe;
AudioInputEngine *ie;
std::list< Event* > activeevents[MAX_NUM_CHANNELS];
std::map<std::string, AudioFile *> audiofiles;
#ifdef TEST_DRUMGIZMO
public:
#endif
DrumKit kit;
};
#endif
|