-
Notifications
You must be signed in to change notification settings - Fork 0
/
dat.h
69 lines (62 loc) · 1.02 KB
/
dat.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
typedef struct Chunk Chunk;
typedef struct Dot Dot;
typedef struct Buf Buf;
typedef struct Track Track;
typedef struct Punkt Punkt;
typedef struct Rekt Rekt;
typedef intptr ssize;
struct Punkt{
int x;
int y;
};
struct Rekt{
Punkt min;
Punkt max;
};
enum{
Rate = 44100,
WriteRate = 25,
WriteDelay = Rate / WriteRate, /* 1764 default delay */
Sampsz = 2 * 2,
Outsz = WriteDelay * Sampsz,
Chunksz = Sampsz * Rate,
};
#pragma incomplete Buf
struct Chunk{
Buf *b;
usize boff;
usize len;
Chunk *left;
Chunk *right;
};
// FIXME: some stuff goes in track
struct Dot{
ssize trk;
usize from;
usize to;
usize cur;
usize off;
usize totalsz;
Chunk *norris;
};
struct Track{
Dot;
Rekt;
// FIXME: both for samples:
vlong len;
s16int *graph[2];
};
extern Dot *current;
extern usize ntracks;
extern Track *tracks;
extern QLock lsync;
enum{
Drawcur,
Drawrender,
Drawall,
};
extern int stereo;
extern int debug, paused;
extern int debugdraw;
#define MIN(x,y) ((x) < (y) ? (x) : (y))
#define MAX(x,y) ((x) > (y) ? (x) : (y))