-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpxk.H
173 lines (159 loc) · 3.33 KB
/
pxk.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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*
* pxk.H
*
* Created on: 12 Feb 2014
* Author: vvd
*/
#ifndef PXK_H_
#define PXK_H_
#include <map>
#include <vector>
#include <string>
#include "ui.H"
#include "data.H"
/**
* Enum for the three MIDI modes
*/
enum
{
OMNI, POLY, MULTI
};
/**
* Enum for the various copy commands of the device
*/
enum
{
C_PRESET = 0x20,
C_PRESET_COMMON,
C_ARP,
C_FX,
C_PRESET_LINK,
C_LAYER,
C_LAYER_COMMON,
C_LAYER_FILTER,
C_LAYER_LFO,
C_LAYER_ENVELOPE,
C_LAYER_PATCHCORD,
C_ARP_PATTERN,
C_SETUP,
SAVE_PRESET
};
class PXK
{
/*
* general
*/
public:
std::vector<std::string> status_message;
private:
char device_id;
volatile bool synchronized;
public:
void ConnectPorts();
bool Synchronize();
void Loading(bool upload = false);
void log_add(const unsigned char*, const unsigned int, unsigned char) const;
bool Synchronized() const;
/// maps controller values to CC widget numbers (device -> UI)
std::map<int, int> cc_to_ctrl;
private:
/// maps CC widget numbers to actual controller values (UI -> device)
std::map<int, int> ctrl_to_cc;
unsigned char nak_count;
public:
void incoming_generic_name(const unsigned char*);
void incoming_ACK(int);
void incoming_NAK(int);
// void incoming_ERROR(int, int);
void widget_callback(int, int, int layer = -2);
void cc_callback(int, int);
void display_status(const char*);
void Join();
/*
* device specific
*/
public:
int device_code; // PXK device code
int member_code; // 2 = AUDITY
private:
char os_rev[5]; // OS revision
int user_presets; // available user presets
void create_device_info();
public:
bool inquired;
void Inquire(int);
void incoming_inquiry_data(const unsigned char*);
void incoming_hardware_config(const unsigned char*);
/*
* setup specific
*/
public:
// these are used by lot's of widgets
Setup_Dump* setup;
const Setup_Dump* setup_copy;
char selected_channel;
char selected_preset_rom;
int selected_preset;
private:
char selected_multisetup;
unsigned char* setup_names;
bool setup_names_changed;
bool cc_changed;
void update_fx_values(int, int) const;
void update_cc_sliders();
void update_control_map();
void set_setup_name(unsigned char, const unsigned char*);
void save_setup_names(bool force = false) const;
public:
char midi_mode;
char selected_fx_channel;
const Setup_Dump* setup_init;
void save_setup(int, const char*);
void incoming_setup_dump(const unsigned char*, int);
unsigned char load_setup_names(unsigned char);
void load_setup();
void store_play_as_initial();
/*
* rom specific
*/
private:
char rom_index[5];
const char* get_name(int) const;
public:
ROM* rom[5];
unsigned char roms; // number of roms
unsigned char get_rom_index(char) const;
/*
* preset specific
*/
private:
int mute_volume[4]; // volume of muted voices
bool is_solo[4];
int test_checksum(const unsigned char*, int, int);
bool randomizing;
public:
Preset_Dump* preset;
const Preset_Dump* preset_copy;
void show_preset();
int selected_layer;
void mute(int state, int layer);
void solo(int state, int layer);
void incoming_preset_dump(const unsigned char*, int);
void load_export(const char*);
void start_over();
void randomize();
/*
* arp specific
*/
private:
public:
Arp_Dump* arp;
void incoming_arp_dump(const unsigned char*, int);
public:
/// CTOR
PXK();
void Boot(bool, int __id = -1);
/// DTOR
~PXK();
};
#endif /* PXK_H_ */