-
Notifications
You must be signed in to change notification settings - Fork 2
/
loopdub.h
105 lines (78 loc) · 1.82 KB
/
loopdub.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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef _LOOPDUB_H_
#define _LOOPDUB_H_
#include "platform.h"
#include <SDL.h>
#include "gui/scrobui.h"
//#include "portmidi/pm_common/portmidi.h"
//using namespace ScrobUI;
#include "def.h"
#include "loopob.h"
#include "sample.h"
#include "player.h"
#include "ld_midi.h"
#include "vumeter.h"
#include "program.h"
/*
** LoopDub class contains main program variables and functions
*/
class LoopDub
{
public:
LoopDub();
~LoopDub();
// functions
// main program loop //
int Run();
// callback for play buffer mixing routine
static void FillBuffers(void *param, int outTimeSample=0);
// Reads .loopdub.conf.
void LoadConfiguration();
// Sends all controller values to the MIDI output.
void SyncMidi();
// variables
int m_nBeats;
int m_nPos;
int m_nLength;
// one channel can have the keyboard at a time
int m_nKeysChannel;
// program list
ProgramChanger m_ProgramChanger;
// keep position & velocity for each key pressed (circular buffer)
struct {
bool on;
int position;
int velocity;
int note;
} m_Keys[MAX_KEYS];
// objects
Player m_Player;
MidiControl m_Midi;
LoopOb *m_pLoopOb[N_LOOPS];
Button *m_pMidiLearning;
Label *m_pButtonModeLabel;
Button *m_pMidiClock;
VUMeter *m_pVUMeter;
Slider *m_pVolumeSlider;
Button *m_pAutoCueButton;
Scrob *m_pLoopArea;
Scrob *m_pProgramArea;
Box *m_pBlankArea;
HMUTEX mutex;
// loading
int m_nLoadingSampleFor;
char m_strLoadingSample[1024];
bool updated;
char* m_strChangeToFolder;
char* m_strRecordPath;
FILE* m_fRecordFile;
// configuration parameters
int m_cfgDefaultVolume;
int m_cfgDefaultButton;
int m_cfgInternalSampleRate;
int m_cfgHardwareSampleRate;
const static int CFG_DEFAULT_DEFAULT_VOLUME = 100;
const static int CFG_DEFAULT_DEFAULT_BUTTON = 0;
};
/* One global LoopDub object */
extern LoopDub app;
#endif // _LOOPDUB_H_