-
Notifications
You must be signed in to change notification settings - Fork 24
/
file.h
43 lines (37 loc) · 972 Bytes
/
file.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
#include <sndfile.h>
#include <dirent.h>
#define MAXSAMPLES 1024
#define MAXFILES 4096
#define MAXPATHSIZE 256
typedef struct {
char name[MAXPATHSIZE];
SF_INFO *info;
float *items;
int *onsets;
} t_sample;
typedef struct {
unsigned int max_frames;
unsigned int frames;
unsigned int now;
int loops;
unsigned int chunksz;
unsigned int since_chunk;
unsigned int chunk_n;
float *items;
float *in;
//fvec_t *in;
//fvec_t *ibuf;
unsigned int win_s;
unsigned int hop_s;
unsigned int samplerate;
unsigned int channels;
int initialised;
} t_loop;
int wav_filter (const struct dirent *d);
extern void file_set_samplerate(int s);
extern t_sample *file_get(char *samplename, const char *sampleroot);
extern t_sample *file_get_from_cache(char *samplename);
t_loop *new_loop(float seconds);
void free_loop(t_loop*);
extern int file_count_samples(char *set, const char *sampleroot);
extern void file_preload_samples(const char *sampleroot);