-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSlice.h
54 lines (40 loc) · 1.05 KB
/
Slice.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
#ifndef SLICE_H
#define SLICE_H
#include <stdio.h>
#include <malloc.h>
#include "AudioObject.h"
//Definition of Envelope
struct Envelope {
float attack_t;
float decay_v, decay_t;
float sustain_v, sustain_t;
float release_t;
};
struct Playback {
char * state;
int pos;
struct Playback *next;
};
//Definition of Slice
struct Slice {
char * playmode; // Straight, reverse,
int pos;
int length;
int isPlaying;
float * stream;
struct Slice *next ;
struct Slice *previous;
struct Envelope envelope;
int index;
int key;
struct AudioObject source;
struct Playback playback;
}EmptySlice;
int SliceCreate( struct AudioObject Object, char * mode, int Pos, int Size, int key);
int SliceDelete(int index);
int SliceResize(int index, int pos, int size);
int SliceAutoSlice( struct AudioObject Object, char * mode, int div);
float * SliceGenerateSample(struct Slice * slice, int nframe, int speed);
float SliceVolume(struct Slice * slice, int pos);
int SliceStartPlayback(struct Slice * slice);
#endif