File: undo.h

package info (click to toggle)
hivelytracker 0+git20180223-3
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,092 kB
  • sloc: ansic: 19,601; objc: 434; cpp: 175; makefile: 88
file content (236 lines) | stat: -rwxr-xr-x 4,732 bytes parent folder | download
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236

enum
{
  UNT_POSITIONNR = 0,
  UNT_RESTART,
  UNT_TRACKLEN,
  UNT_SUBSONGS,
  UNT_SSPOS,
  UNT_CHANNELS,
  UNT_MIXGAIN,
  UNT_SPMUL,

  UNT_ENV_AFRAMES,
  UNT_ENV_AVOLUME,
  UNT_ENV_DFRAMES,
  UNT_ENV_DVOLUME,
  UNT_ENV_SFRAMES,
  UNT_ENV_RFRAMES,
  UNT_ENV_RVOLUME,

  UNT_PLE,

  UNT_PLE_NOTE,
  UNT_PLE_WAVEFORM,
  UNT_PLE_FIXED,
  UNT_PLE_FX0,
  UNT_PLE_FX1,
  UNT_PLE_FXPARAM0,
  UNT_PLE_FXPARAM1,  

  UNT_PLS_SPEED,
  UNT_PLS_LENGTH,

  UNT_INS_VOLUME,
  UNT_INS_WAVELENGTH,
  UNT_INS_FILTERLOWERLIMIT,
  UNT_INS_FILTERUPPERLIMIT,
  UNT_INS_FILTERSPEED,
  UNT_INS_SQUARELOWERLIMIT,
  UNT_INS_SQUAREUPPERLIMIT,
  UNT_INS_SQUARESPEED,
  UNT_INS_VIBRATODELAY,
  UNT_INS_VIBRATOSPEED,
  UNT_INS_VIBRATODEPTH,
  UNT_INS_HARDCUTRELEASE,
  UNT_INS_HARDCUTRELEASEFRAMES,    

  UNT_TRACK,

  UNT_STP_NOTE,
  UNT_STP_INSTRUMENT,
  UNT_STP_NOTEANDINS,
  UNT_STP_FX,
  UNT_STP_FXPARAM,
  UNT_STP_FXANDPARAM,
  UNT_STP_FXB,
  UNT_STP_FXBPARAM,
  UNT_STP_FXBANDPARAM,
  
  UNT_POS_TRACK,
  UNT_POS_TRANS,
  UNT_POS_REGION,
  
  // Strings are treated differently
  UNT_STRING_SONGNAME,
  UNT_STRING_INSNAME,
  UNT_STRING_INSNAME2
};

struct undonode
{
  struct Node  un_ln;
  uint32       un_size;
  uint16       un_type;
  void        *un_data;
};

struct udat_env_w
{
  struct ahx_envelope *ptr;
  int32 insnum;
  int16 before;
  int16 after;
};

struct udat_ple_w
{
  struct ahx_plsentry *ptr;
  struct ahx_instrument *pins;
  int32 insnum;
  int32 pcurx, pcury, ptop;
  int16 before;
  int16 after;
};

struct udat_ple_b
{
  struct ahx_plsentry *ptr;
  struct ahx_instrument *pins;
  int32 insnum;
  int32 pcurx, pcury, ptop;
  int8 before;
  int8 after;
};

struct udat_pls_w
{
  struct ahx_plist *ptr;
  int32 insnum;
  int16 before;
  int16 after;
};

struct udat_ins_b
{
  struct ahx_instrument *ptr;
  int32 insnum;
  uint8 before;
  uint8 after;
};

struct udat_stp_b
{
  struct ahx_step *ptr;
  uint16 posnr;
  uint8  notenr;
  int32  tracked_curs;
  int32  curlch;
  uint8  before;
  uint8  after;
};

struct udat_stp_w
{
  struct ahx_step *ptr;
  uint16 posnr;
  uint8  notenr;
  int32  tracked_curs;
  int32  curlch;
  uint16  before;
  uint16  after;
};

struct udat_track
{
  int32 track;
  uint16 posnr;
  uint8  notenr;
  int32  tracked_curs;
  int32  curlch;
  struct ahx_step before[64];
  struct ahx_step after[64];
};

struct udat_pos_b
{
  struct ahx_position *ptr;
  int32 chan;
  uint16 posnr;
  int32 posed_curs;
  int32 curlch;
  uint8 before;
  uint8 after;
};

struct udat_pos_region
{
  uint16 posnr;
  int32 posed_curs;
  int32 curlch;
  int32 left,  pos;
  int32 chans, rows;
  uint8 *before;
  uint8 *after;
};

struct udat_whole_plist
{
  struct ahx_plsentry *ptr;
  int32 insnum;
  struct ahx_plsentry before[256];
  struct ahx_plsentry after[256];
};

struct udat_string
{
  TEXT *ptr;
  int32 extra;
  TEXT *before;
  TEXT *after;
};

struct udat_tune_b
{
  uint8 before;
  uint8 after;
};

struct udat_tune_w
{
  int16 before;
  int16 after;
};

struct udat_subsongpos
{
  int32 subsong;
  uint16 before;
  uint16 after;
};

void setbefore_posregion( struct ahx_tune *at, int32 left, int32 pos, int32 chans, int32 rows );
void setafter_posregion( struct ahx_tune *at, int32 left, int32 pos, int32 chans, int32 rows );
void setbefore_track( struct ahx_tune *at, int32 trk );
void setafter_track( struct ahx_tune *at, int32 trk );
void setbefore_plist( struct ahx_tune *at, struct ahx_plsentry *ptr );
void setafter_plist( struct ahx_tune *at, struct ahx_plsentry *ptr );
void setbefore_string( struct ahx_tune *at, TEXT *ptr );
void setafter_string( int32 which, struct ahx_tune *at, TEXT *ptr );

void modify_env_w( struct ahx_tune *at, struct ahx_envelope *ptr, uint32 field, int16 new );
void modify_ins_b( struct ahx_tune *at, struct ahx_instrument *ptr, uint32 field, uint8 new );
void modify_ple_b( struct ahx_tune *at, struct ahx_instrument *ins, struct ahx_plsentry *ptr, uint32 field, int8 new );
void modify_ple_w( struct ahx_tune *at, struct ahx_instrument *ins, struct ahx_plsentry *ptr, uint32 field, int16 new );
void modify_pls_w( struct ahx_tune *at, struct ahx_plist *ptr, uint32 field, int16 new );
void modify_stp_b( struct ahx_tune *at, struct ahx_step *ptr, uint32 field, int8 new );
void modify_stp_w( struct ahx_tune *at, struct ahx_step *ptr, uint32 field, int16 new );
void modify_pos_b( struct ahx_tune *at, struct ahx_position *ptr, int32 chan, uint32 field, int8 new );
void modify_tune_b( struct ahx_tune *at, uint32 field, int8 new );
void modify_tune_w( struct ahx_tune *at, uint32 field, int16 new );
void modify_sspos( struct ahx_tune *at, int16 new );

void undo( struct ahx_tune *at );
void redo( struct ahx_tune *at );

void free_undolists( struct ahx_tune *at );