-
Notifications
You must be signed in to change notification settings - Fork 13
/
Awful.h
1725 lines (1475 loc) · 43.7 KB
/
Awful.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
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//#if !defined(AFX_AWFUL_H__722DB30A_BAF1_4CAF_A33F_F6E145D206E2__INCLUDED_)
//#define AFX_AWFUL_H__722DB30A_BAF1_4CAF_A33F_F6E145D206E2__INCLUDED_
#ifndef _AWFUL_H_INCLUDED_
#define _AWFUL_H_INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define _WIN32_WINNT 0x0500
//Find out wich platform we build for
#if (defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WINNT))
#define USE_WIN32 1
#else
#ifdef LINUX
#define USE_LINUX 1
#else
#define USE_MAC 1
#endif
#endif
//Set various defines
#define SPLASH_SCREEN TRUE
#define START_SCAN_VST TRUE
#define USE_JUCE_AUDIO
#define USE_JUCE
#define USE_OLD_JUCE
#define RELEASEBUILD TRUE
#include "sndfile.h"
#include <windows.h>
#include <portaudio.h>
#include "math.h"
#include "Awful_logger.h"
#include "winreg.h"
#include "winuser.h"
#ifdef USE_OLD_JUCE
#include "juce_amalgamated.h"
#else
#include "juce_amalgamated_NewestMerged.h"
#endif
#include "Awful_JuceComponents.h"
#include "Awful_renderer.h"
////#include "awful_sf2.h"
////////////
/// Global constants
// Grid X and Y size in cells:
#define GRID_X_SIZE (158)
#define GRID_Y_SIZE (65)
#define MAX_PREVIEW_ELEMENTS (50)
#define MAX_GRID_ELEMENTS (1000)
#define MAX_PATTERNS (1000)
#define MAX_FILENAME_LENGTH (30)
#define MAX_NAME_STRING (256)
#define MAX_PATH_STRING (260)
#define MAX_ALIAS_STRING (10)
#ifndef USER_TIMER_MINIMUM
#define USER_TIMER_MINIMUM (0)
#endif
#define CURSOR_TIMER (1)
#define CURSOR1_TIMER (2)
#define PLAYBACK_TIMER (3)
#define DBCLICK_TIMER (USER_TIMER_MINIMUM + 4)
#define HINT_TIMER (USER_TIMER_MINIMUM + 5)
#define IDLE_EFFECT_TIMER (USER_TIMER_MINIMUM + 6)
#define SCROLL_TIMER (USER_TIMER_MINIMUM + 7)
#define MAX_SAMPLENAME_LENGTH (100)
#define MAX_PATTERNNAME_LENGTH (100)
#define MAX_SAMPLES (100)
#define MAX_PARAMS (100)
#define MAX_TRACKS (1000)
#define MAX_PERCENT_INTEGER_DIGITS (3)
#define MAX_PERCENT_FLOAT_DIGITS (3)
#define MAX_SCOPES (1)
#define MAX_BUFF_SIZE (16896) // this max buffer is equal to max samples
#define MAX_PARAM_NAME (100)
#define MAX_PRESET_NAME (256)
#define DECLICK_COUNT (128) // should not be greater than 256 or too small
#define RAMP_COUNT (128)
#define DEFAULT_BUFFER_SIZE (2048)
#define NUM_MIXCHANNELS (32)
#define NUM_MIXER_COLUMNS (1)
#define NUM_MIXER_ROWS (1)
#define NUM_MASTER_CELLS (1)
#define NUM_PATTERN_TRACKS (120)
#define NUM_PIANOROLL_LINES (120)
#define ENVPOINT_TOUCH_RADIUS (5)
#define LOCAL_PLUGIN_FOLDER ("Plugins\\")
#define USER_SAVED_PRESET_PATH ("Presets\\")
#define SAMPLES_PATH ("Samples\\")
#define PROJECTS_PATH ("Projects\\")
#define RENDERING_DEFAULT_FOLDER ("Rendered\\")
#define VST_EXT_PATH_1 ("C:\\Program Files\\Steinberg\\VstPlugins\\")
#define VST_EXT_PATH_2 ("C:\\Program Files\\VstPlugins\\")
#define PLUGIN_LIST_FILENAME ("vst_fxlist.lst")
#define PLUGIN_LIST_FILENAME_XML ("vst_fxlist.xml")
#define MITEM_HEIGHT (18)
#define DIVIDER_HEIGHT (10)
#define PCSLIDERHEIGHT (21)
#define BrwEntryHeight (14)
#define CLEANUP_MESSAGE (0x8001)
#define StepSeqLineHeight (15)
#define ON (1)
#define OFF (0)
#define PI_F (3.14159265f)
// for 6 dB max
//#define VolRange (1.41253754f)
//#define InvVolRange (0.70794578f)
// for 3 dB max
//#define VolRange (1.18850222f)
//#define InvVolRange (0.84139514f)
// for 4 dB max
//#define VolRange (1.25892541f)
//#define InvVolRange (0.79432823f)
// for 6 dB max
#define VolRange (1.41421356f)
#define InvVolRange (0.70710678f)
#define LATENCY_MSEC (2000)
#define SAMPLE_RATE (44100)
//#define FRAMES_PER_BUFFER (paFramesPerBufferUnspecified)
#define MAX_TXTBUFF_LEN 250
#define Note_Font_Height 8
#define SlideHeight 6
#define SmpHeight 6
#define EnvHeading 9
#define Sample_Font_Height 11.0
#define Params_Font_Height 10.0
#define HINT_TIMER_INTERVAL (300) //0.3 second
#define WT_SIZE 32768
//This macros makes fourCC code
#define MAKE_FOURCC(a,b,c,d) \
((((long)a) << 24) | (((long)b) << 16) | (((long)c) << 8) | (((long)d) << 0))
class Playback;
class Object;
class Eff;
class Gain;
class Send;
class CFilter;
class CFilter3;
class XDelay;
class CReverb;
class CChorus;
class Element;
class NoteInstance;
class GenNote;
class Samplent;
class Slide;
class Muter;
class Txt;
class Reverse;
class SlideNote;
class Pattern;
class Command;
class Break;
class Vibrate;
class Repeat;
class Transpose;
class Frequencer;
class Semitones;
class Note;
class PEdit;
class Percent;
class Digits;
class DigitStr;
class Envelope;
class TString;
class ValueString;
class Control;
class ScrollBard;
class SliderBase;
class Butt;
class ButtFix;
class Knob;
class SliderBase;
class SliderHVol;
class SliderHPan;
class SliderParam;
class OutPin;
class InPin;
class InPin_Bus;
class MenuItem;
class Menu;
class Numba;
class Aux;
class Panel;
class CtrlPanel;
class Browser;
class InstrPanel;
class Mixcell;
class Mixer;
class ParamSet;
class Parameter;
class Preset;
class Vol;
class Pan;
class Len;
class BoolParam;
class Level;
class FrequencyParameter;
class Toggle;
class Event;
class Instrument;
class Sample;
class CGenerator;
class Sine;
class Osc;
class Saw;
class Synth;
class Trk;
class Lane;
class StaticArea;
class VSTGenerator;
/* VST Specific classes declaration */
class VSTCollection;
class CVSTPlugin;
class VSTEffect;
/************************************/
class CPluginList;
class Renderer;
class AwfulMidiWrapper;
class AwfulMidiInputCallback;
class VU;
class Paramcell;
// Structs
class Trigger;
struct PreviewSlot;
struct TrkBunch;
class AwfulWindow;
class ChildWindow;
class ConfigWindow;
class RenderWindow;
class SampleWindow;
class SynthWindow;
class SynthComponent;
class Cursor;
class Mouse;
class UndoManagerC;
class MixChannel;
class ProjectData;
class ParamModule;
class ScanThread;
class LogParam;
class ProjectData
{
public:
bool newproj;
char projname[MAX_NAME_STRING];
//char projpath[MAX_PATH_STRING];
String projpath;
File* file;
void Init();
void SetName(String name);
};
typedef short int16; //----int16
typedef long tframe;
/*
enum input_flags
{
mouse_left = 1,
mouse_right = 2,
kbd_shift = 4,
kbd_ctrl = 8,
kbd_alt = 16
};*/
enum keys
{
// ASCII set. Should be supported everywhere
key_backspace = 8,
key_tab = 9,
key_clear = 12,
key_return = 13,
key_pause = 19,
key_escape = 27,
// Keypad
key_delete = 127,
key_kp0 = 256,
key_kp1 = 257,
key_kp2 = 258,
key_kp3 = 259,
key_kp4 = 260,
key_kp5 = 261,
key_kp6 = 262,
key_kp7 = 263,
key_kp8 = 264,
key_kp9 = 265,
key_kp_period = 266,
key_kp_divide = 267,
key_kp_multiply = 268,
key_kp_minus = 269,
key_kp_plus = 270,
key_kp_enter = 271,
key_kp_equals = 272,
// Arrow-keys and stuff
key_up = 273,
key_down = 274,
key_right = 275,
key_left = 276,
key_insert = 277,
key_home = 278,
key_end = 279,
key_page_up = 280,
key_page_down = 281,
// Functional keys. You'd better avoid using
// f11...f15 in your applications if you want
// the applications to be portable
key_f1 = 282,
key_f2 = 283,
key_f3 = 284,
key_f4 = 285,
key_f5 = 286,
key_f6 = 287,
key_f7 = 288,
key_f8 = 289,
key_f9 = 290,
key_f10 = 291,
key_f11 = 292,
key_f12 = 293,
key_f13 = 294,
key_f14 = 295,
key_f15 = 296,
// The possibility of using these keys is
// very restricted. Actually it's guaranteed
// only in win32_api and win32_sdl implementations
key_numlock = 300,
key_capslock = 301,
key_scrollock = 302,
// Phew!
end_of_key_codes
};
typedef enum
{
CMode_TxtDefault,
CMode_ElemEdit,
CMode_ElemParamEdit,
CMode_JustParamEdit,
CMode_FastMode,
CMode_FastBrushMode,
CMode_NotePlacing,
CMode_Sliding,
CMODE_UNKNOWN = 0xFFFF
}CursMode;
typedef enum
{
CType_UnderVert,
CType_Vertical,
CType_Underline,
CType_InstanceNote,
CType_SlideNote,
CType_Quad,
CType_None
}CursType;
typedef enum MouseMode
{
MOUSE_ON_GRID = 0x1, // Normal arrow mode
MOUSE_GRID_X1 = 0x2, // Resizing left grid border
MOUSE_GRID_X2 = 0x4, // Resizing right grid border
MOUSE_GRID_Y1 = 0x8, // Resizing upper grid border
MOUSE_GRID_Y2 = 0x10, // Resizing lower grid border (between grid and Aux).
MOUSE_SELECTING = 0x20,
MOUSE_RESIZE = 0x40,
MOUSE_ENVELOPING = 0x80,
MOUSE_CONTROLLING = 0x100,
MOUSE_AUXING = 0x200,
MOUSE_LINING = 0x400,
MOUSE_INSTRUMENTING = 0x800,
MOUSE_UPPER_TRACK_EDGE = 0x1000,
MOUSE_LOWER_TRACK_EDGE = 0x2000,
MOUSE_BROWSING = 0x4000,
MOUSE_ON_GENBROWSER_EDGE = 0x8000,
MOUSE_DRAG_N_DROPPING = 0x10000,
MOUSE_MIXING = 0x20000,
MOUSE_TRACKING = 0x40000,
MOUSE_LANEAUXING = 0x80000,
MOUSE_BRUSHING = 0x100000,
MOUSE_LOWAUXEDGE = 0x200000,
MOUSE_DELETING = 0x400000,
MOUSE_AUXAUXING = 0x800000,
MOUSE_AUXMIXING = 0x1000000,
MOUSE_BPMING = 0x2000000,
MOUSE_GRID_X22 = 0x4000000,
MOUSE_SLIDING = 0x8000000,
MOUSE_LOOPING = 0x10000000,
MOUSE_ON_MIXBROWSER_EDGE = 0x20000000
}MouseMode;
typedef enum BorderType
{
BorderType_GRIDX1,
BorderType_GRIDX2,
BorderType_GRIDY1,
BorderType_GRIDY2,
BorderType_GRIDX22
}BorderType;
typedef enum ParamType
{
Param_Pan,
Param_Vol,
Param_Pitch,
Param_Len,
Param_Note,
Param_Semitones,
Param_Env,
Param_TString,
Param_FX,
Param_Frequency,
Param_Bool,
Param_Default,
Param_Default_Bipolar
}ParamType;
typedef enum InstrType
{
Instr_Sample,
Instr_Generator,
Instr_Synth,
Instr_SoundFont,
Instr_VSTPlugin
}InstrType;
typedef enum ElemType
{
El_Pattern,
El_TextString,
El_Samplent,
El_GenNote,
El_Command,
El_Mute,
El_Break,
El_SlideNote,
El_Slider,
El_Reverse,
El_Repeat,
El_Vibrate,
El_Transpose,
EL_UNKNOWN = 0xFFFF
}ElemType;
typedef enum Symbol
{
Symbol_Mute,
Symbol_Break,
Symbol_Slider,
Symbol_Repeat,
Symbol_Reflect,
Symbol_Vibrate,
Symbol_Volume,
Symbol_Panning,
Symbol_Local,
Symbol_Track,
Symbol_Command,
Symbol_Transpose,
Symbol_Bookmark,
SYMBOL_UNKNOWN = 0xFFFF
}Symbol;
typedef enum ModuleSubType
{
ModSubtype_Default = 1,
ModSubtype_Gain,
ModSubtype_Send,
ModSubtype_Filter,
ModSubtype_CFilter,
ModSubtype_CFilter2,
ModSubtype_CFilter3,
ModSubtype_Equalizer1,
ModSubtype_Equalizer3,
ModSubtype_GraphicEQ,
ModSubtype_XDelay,
ModSubtype_Reverb,
ModSubtype_Tremolo,
ModSubtype_Compressor,
ModSubtype_Chorus,
ModSubtype_Flanger,
ModSubtype_Phaser,
ModSubtype_WahWah,
ModSubtype_BitCrusher,
ModSubtype_Distortion,
ModSubtype_Stereo,
ModSubtype_Generator,
ModSubtype_Synth1,
ModSubtype_Sinenoise,
ModSubtype_Sample,
ModSubtype_VSTPlugin = 100
}ModuleSubType;
typedef struct AliasRecord
{
ModuleSubType type;
char alias[MAX_NAME_STRING];
AliasRecord* prev;
AliasRecord* next;
}AliasRecord;
typedef enum
{
PState_Ready,
PState_Playing,
PState_Stopped,
PState_Inactive,
PState_Free
}PrevState;
typedef enum
{
TgState_Initial,
TgState_Sustain,
TgState_Release,
TgState_SoftFinish,
TgState_Finished
}TgState;
typedef enum
{
Loc_UNKNOWN,
Loc_MainGrid,
Loc_SmallGrid,
Loc_StaticGrid,
Loc_Other
}Loc;
typedef enum CmdType
{
Cmd_Default,
Cmd_Vol,
Cmd_Pan,
Cmd_Mute,
Cmd_Unmute,
Cmd_Solo,
Cmd_Unsolo,
Cmd_Bypass,
Cmd_Unbypass,
Cmd_Len,
Cmd_Offs,
Cmd_Envelope,
Cmd_VolEnv,
Cmd_PanEnv,
Cmd_LocVolEnv,
Cmd_LocPanEnv,
Cmd_PitchEnv,
Cmd_ParamEnv
}CmdType;
typedef enum EnvType
{
Env_Volume,
Env_Panning,
Env_Pitch,
Env_Special
}EnvType;
typedef enum ResizeElem
{
Resize_GridElem,
Resize_AuxPattRange,
Resize_Envelope,
Resize_Waveform,
Resize_Lane
}ResizeElem;
typedef enum ToggleType
{
Toggle_Default,
Toggle_Mute,
Toggle_Mute1, // Small size
Toggle_Solo,
Toggle_Solo1, // Small size
Toggle_AutoPatt,
Toggle_MixBypass,
Toggle_EnvFold,
Toggle_EnvTime,
Toggle_AutoSwitch,
Toggle_RelSwitch,
Toggle_EffFold,
Toggle_EffBypass,
Toggle_EffWindow
}ToggleType;
typedef enum NumbaType
{
Numba_BPM,
Numba_TPB,
Numba_BPB,
Numba_Octave,
Numba_relOctave
}NumbaType;
typedef enum SelMode
{
Sel_Usual,
Sel_Tracks,
Sel_Pattern,
Sel_Fragment
}SelMode;
typedef enum BrushMode
{
Brush_Default,
Brush_Pattern,
Brush_Envelope
}BrushMode;
typedef enum EnvAction
{
ENVUSUAL, // Usual hovering
ENVPOINTING, // Mouse on point (moving or hovering)
ENVSUSTAINING, // Sustain position changing
ENVDELETING, // Points deletion
ENVDRAWMOVE, // Freehand draw
ENVLINEMOVE // Freehand line draw
}EnvAction;
typedef enum DragType
{
Drag_Instrument_Alias,
Drag_MixCell_Content,
Drag_MixChannel_Index,
Drag_Instrument_File,
Drag_Effect_File,
Drag_Command,
Drag_MixChannel_Effect
}DragType;
typedef enum
{
LEFT_X,
RIGHT_X,
TOP_Y,
BOTTOM_Y
}RectEdge;
typedef enum
{
Ctrl_Slider,
Ctrl_Knob,
Ctrl_Snob,
Ctrl_Button,
Ctrl_ButtFix,
Ctrl_HScrollBar,
Ctrl_VScrollBar,
Ctrl_Toggle,
Ctrl_Fold,
Ctrl_InPin_Point,
Ctrl_OutPin_Point,
Ctrl_InPin_Bus,
Ctrl_Menu,
Ctrl_MenuItem,
Ctrl_MenuDivider
}ControlType;
typedef enum
{
Panel_Main,
Panel_Instruments,
Panel_Mixer,
Panel_MixCell,
Panel_Browser,
Panel_Window,
Panel_Aux,
Panel_List,
Panel_Static,
Panel_Number,
Panel_MixChannel
}PanelType;
typedef enum
{
ParamEdit_Loop,
ParamEdit_Open,
ParamEdit_Block,
ParamEdit_BlockLeft,
ParamEdit_BlockRight
}ParamEditMode;
typedef enum LenType
{
Len_Percent,
Len_Ticks,
Len_Seconds
}LenType;
typedef enum
{
Patt_Grid,
Patt_Pianoroll,
Patt_StepSeq
}PattType;
typedef struct DragData
{
DragType drag_type;
void* drag_stuff;
int instr_len;
float instr_vol;
float instr_pan;
int drag_len;
int drag_index;
int dragcount;
bool tsop;
}DragData;
typedef struct Area
{
int x1;
int y1;
int x2;
int y2;
}Area;
typedef struct Scope
{
Pattern* pt;
Instrument* instr;
bool for_track;
Trk* trkdata;
Mixcell* mixcell;
bool local;
Eff* eff;
}Scope;
typedef struct Vibe
{
float freq;
float range;
}Vibe;
typedef union comm_val
{
float n_vol;
float n_len;
float n_offs;
float n_pan;
Vibe vib;
}comm_val;
typedef enum VStrType
{
VStr_Hz,
VStr_fHz,
VStr_fHz1,
VStr_kHz,
VStr_Percent,
VStr_beat,
VStr_second,
VStr_msec,
VStr_msec2,
VStr_dB,
VStr_oct,
VStr_String,
VStr_Integer,
VStr_Default,
VStr_Beats,
VStr_Semitones,
VStr_DryWet
}VStrType;
typedef union VStrVal
{
float hz;
float n_val;
int percent;
int integer;
float dB;
float ms;
float sec;
float semitones;
float beats;
char str[100];
}VStr_val;
typedef struct EnvPnt
{
float x;
float y_norm;
float cff;
bool deleted;
bool suspoint;
bool big;
EnvPnt* next;
EnvPnt* prev;
}EnvPnt;
typedef union len_val
{
int percent;
float ticks;
int sec;
int beats;
int times;
long frames;
}len_val;
typedef enum FType
{
FTYPE_UNKNOWN = 0x1,
FType_Directory = 0x2,
FType_System = 0x4,
FType_Wave = 0x8,
FType_MP3 = 0x10,
FType_OGG = 0x20,
FType_SoundFont = 0x40,
FType_DXiPlugins = 0x80,
FType_VST = 0x100,
FType_Native = 0x200,
FType_Delimiter = 0x400,
FType_Projects = 0x800,
FType_LevelDirectory = 0x1000,
FType_DiskSelector = 0x2000,
FType_DiskDrive = 0x4000
}FType;
typedef enum BEType
{
BEType_Common,
BEType_Delimiter
}BEType;
typedef enum EType
{
Etype_Usual,
EType_Subtitle,
ETYPE_UNKNOWN
}EType;
typedef enum DirType
{
Dir_Nodir,
Dir_Usual,
Dir_Level,
Dir_Selector,
Dir_Drive,
Dir_Files,
Dir_VST
}DirType;
typedef enum MItemType
{
MItem_Divider,
MItem_CreateAutomation,
MItem_MountPianoRoll,
MItem_UnmountPianoRoll,
MItem_DrawPicture,
MItem_Load,
MItem_Delete,
MItem_ShowVolumeLane,
MItem_ShowPanLane,
MItem_HideVolumeLane,
MItem_HidePanLane,
MItem_AddElement,
MItem_ShowDefinition,
MItem_DeleteDefinition,
MItem_DeletePreset,
MItem_DeleteProject,
MItem_OpenProject,
MItem_ReScanFast,
MItem_ReScanFull,
MItem_File,
MItem_Edit,
MItem_View,
MItem_Help,
MItem_New,
MItem_Open,
MItem_Save,
MItem_SaveAs,
MItem_SaveNewVersion,
MItem_Render,
MItem_Exit,
MItem_Custom,
MItem_CreateUsualPattern,
MItem_CreatePianorollPattern,
MItem_CreatePianorollPatternForInstrument,
MItem_BindInstrumentToCurrentPattern,
MItem_CreateEnvelope,
MItem_CreateCommand,
MItem_ResetControl,
MItem_EditAutoPattern,
MItem_DeleteInstrument,
MItem_CloneInstrument,
MItem_BindInstrument,
MItem_DedicatePianoRoll,
MItem_HideAll,
MItem_ShowAll,
MItem_FullScreen,
MItem_Undo,
MItem_Redo,
MItem_LoadInstrumentPlugin,
MItem_LoadEffectPlugin,
MItem_LoadProject,
MItem_LoadSample,
MItem_InsertTrack,
MItem_DeleteTrack,
MItem_CleanSong,
MItem_Preferences,
MItem_Contents,
MItem_HotKeys,
MItem_About,
MItem_None,
MItem_Step16,
MItem_Step13,
MItem_Step14,
MItem_Step12,
MItem_Step,
MItem_Beat,
MItem_Bar,
MItem_Cut,
MItem_Copy,
MItem_Paste,
MItem_SelectAll,
MItem_Unbunch,
MItem_Unbind,
MItem_LoadAsInstrument,
MItem_CleanMixCell,
MItem_DeleteEffect,
MItem_SetMixCellToGain,
MItem_SetMixCellToSend,
MItem_SetMixCellToEQ1,
MItem_SetMixCellToEQ3,
MItem_SetMixCellToGraphicEQ,
MItem_SetMixCellToBlank,
MItem_SetMixCellToDelay,
MItem_SetMixCellToTremolo,
MItem_SetMixCellToFilter,
MItem_SetMixCellToCompressor,
MItem_SetMixCellToReverb,
MItem_SetMixCellToChorus,