-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathProgramVector.h
More file actions
99 lines (86 loc) · 3.01 KB
/
ProgramVector.h
File metadata and controls
99 lines (86 loc) · 3.01 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
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef __PROGRAM_VECTOR_H
#define __PROGRAM_VECTOR_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define OWL_PEDAL_HARDWARE 0x11
#define OWL_MODULAR_LEGACY_HARDWARE 0x12
#define OWL_RACK_HARDWARE 0x13
#define PRISM_HARDWARE 0x14
#define PLAYER_HARDWARE 0x15
#define TESSERACT_HARDWARE 0x16
#define ALCHEMIST_HARDWARE 0x17
#define WIZARD_HARDWARE 0x18
#define MAGUS_HARDWARE 0x19
#define EFFECTSBOX_HARDWARE 0x1a
#define WAVETABLE_HARDWARE 0x1b
#define NOCTUA_HARDWARE 0x1c
#define BIOSIGNALS_HARDWARE 0x1d
#define LICH_HARDWARE 0x1e
#define WITCH_HARDWARE 0x1f
#define OWL_MODULAR_HARDWARE 0x20 /* This is not a new device, but a way to distinguish firmware */
#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_24B24 0x18
#define AUDIO_FORMAT_24B32 0x20
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;
#ifdef USE_LEGACY_FIRMWARE
/*
* This function is currently used to determine if it's necessary to handle inverting
* ADC values. This is only required for running under legacy firmware (OwlWare) on
* Owl Modular.
*/
inline bool isLegacyFirmware() const {
return hardware_version == OWL_MODULAR_LEGACY_HARDWARE;
}
#endif
} 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 */