forked from RebelTechnology/OwlProgram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgramVector.h
More file actions
87 lines (74 loc) · 2.48 KB
/
ProgramVector.h
File metadata and controls
87 lines (74 loc) · 2.48 KB
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
#ifndef __PROGRAM_VECTOR_H
#define __PROGRAM_VECTOR_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define OWL_PEDAL_HARDWARE 0x11
#define OWL_MODULAR_HARDWARE 0x12
#define OWL_RACK_HARDWARE 0x13
#define PRISM_HARDWARE 0x14
#define PLAYER_HARDWARE 0x15
#define PROGRAM_VECTOR_CHECKSUM_V11 0x40
#define PROGRAM_VECTOR_CHECKSUM_V12 0x50
#define PROGRAM_VECTOR_CHECKSUM_V13 0x51
#define CHECKSUM_ERROR_STATUS -10
#define OUT_OF_MEMORY_ERROR_STATUS -20
#define CONFIGURATION_ERROR_STATUS -30
#define AUDIO_FORMAT_24B16 0x10
#define AUDIO_FORMAT_24B16_2X 0x12
#define AUDIO_FORMAT_24B16_4X 0x14
#define AUDIO_FORMAT_24B16_6X 0x16
#define AUDIO_FORMAT_24B16_8X 0x18
#define AUDIO_FORMAT_24B32 0x20
#define AUDIO_FORMAT_24B32_2X 0x22
#define AUDIO_FORMAT_24B32_4X 0x24
#define AUDIO_FORMAT_24B32_6X 0x26
#define AUDIO_FORMAT_24B32_8X 0x28
#define AUDIO_FORMAT_FORMAT_MASK 0xf0
#define AUDIO_FORMAT_CHANNEL_MASK 0x0f
typedef enum {
AUDIO_IDLE_STATUS = 0,
AUDIO_READY_STATUS,
AUDIO_PROCESSING_STATUS,
AUDIO_EXIT_STATUS,
AUDIO_ERROR_STATUS
} ProgramVectorAudioStatus;
typedef struct {
uint8_t* location;
uint32_t size;
} MemorySegment;
typedef struct {
uint8_t checksum;
uint8_t hardware_version;
int32_t* audio_input;
int32_t* audio_output;
uint8_t audio_format;
uint16_t audio_blocksize;
uint32_t audio_samplingrate;
int16_t* parameters;
uint8_t parameters_size;
uint16_t buttons;
int8_t error;
void (*registerPatch)(const char* name, uint8_t inputChannels, uint8_t outputChannels);
void (*registerPatchParameter)(uint8_t id, const char* name);
void (*programReady)(void);
void (*programStatus)(ProgramVectorAudioStatus status);
int (*serviceCall)(int service, void** params, int len);
uint32_t cycles_per_block;
uint32_t heap_bytes_used;
char* message;
void (*setButton)(uint8_t id, uint16_t state, uint16_t samples);
void (*setPatchParameter)(uint8_t id, int16_t value);
void (*buttonChangedCallback)(uint8_t bid, uint16_t state, uint16_t samples);
MemorySegment* heapLocations;
} ProgramVector;
#define CHECKSUM_ERROR_STATUS -10
#define OUT_OF_MEMORY_ERROR_STATUS -20
#define CONFIGURATION_ERROR_STATUS -30
extern ProgramVector programVector;
#define getProgramVector() (&programVector)
#ifdef __cplusplus
}
#endif
#endif /* __PROGRAM_VECTOR_H */