Commit c9ffb9a

Nick committed on
WIP Effect editor
commit c9ffb9a70713aaa9bc3ebf66de3070d582f24f35 parent dbd79a4
6 changed files +484−22
ModifiedGBEmu.lpi +2−1
@@ -174,7 +174,8 @@
174 <Unit21> 174 <Unit21>
175 <Filename Value="effecteditor.pas"/> 175 <Filename Value="effecteditor.pas"/>
176 <IsPartOfProject Value="True"/> 176 <IsPartOfProject Value="True"/>
177 <ComponentName Value="Form1"/> 177 <ComponentName Value="frmEffectEditor"/>
178 <HasResources Value="True"/>
178 <ResourceBaseClass Value="Form"/> 179 <ResourceBaseClass Value="Form"/>
179 </Unit21> 180 </Unit21>
180 </Units> 181 </Units>
Modifiedeffecteditor.lfm +302−13
@@ -1,28 +1,317 @@
1 object Form1: TForm1 1 object frmEffectEditor: TfrmEffectEditor
2 Left = 713 2 Left = 825
3 Height = 400 3 Height = 416
4 Top = 494 4 Top = 226
5 Width = 729 5 Width = 684
6 Caption = 'Form1' 6 Caption = 'Effect Editor'
7 ClientHeight = 400 7 ClientHeight = 416
8 ClientWidth = 729 8 ClientWidth = 684
9 DesignTimePPI = 168 9 DesignTimePPI = 168
10 LCLVersion = '2.0.6.0' 10 LCLVersion = '2.0.6.0'
11 object ComboBox1: TComboBox 11 object ComboBox1: TComboBox
12 Left = 120 12 Left = 136
13 Height = 38 13 Height = 38
14 Top = 24 14 Top = 16
15 Width = 368 15 Width = 530
16 ItemHeight = 30 16 ItemHeight = 30
17 ItemIndex = 0
18 Items.Strings = (
19 '0 - Arpeggio'
20 '1 - Portamento up'
21 '2 - Portamento down'
22 '3 - Tone Portamento'
23 '4 - Vibrato'
24 '5 - Set Master Volume'
25 '6 - Call Routine'
26 '7 - Note Delay'
27 '8 - Set Panning'
28 '9 - Set Duty Cycle'
29 'A - Volume Slide'
30 'B - Position Jump'
31 'C - Set Volume'
32 'D - Pattern Break'
33 'E - Note Cut'
34 'F - Set Speed'
35 )
36 OnChange = ComboBox1Change
17 Style = csDropDownList 37 Style = csDropDownList
18 TabOrder = 0 38 TabOrder = 0
39 Text = '0 - Arpeggio'
19 end 40 end
20 object Label1: TLabel 41 object Label1: TLabel
21 Left = 8 42 Left = 24
22 Height = 30 43 Height = 30
23 Top = 32 44 Top = 24
24 Width = 99 45 Width = 99
25 Caption = 'Effect type' 46 Caption = 'Effect type'
26 ParentColor = False 47 ParentColor = False
27 end 48 end
49 object Notebook1: TNotebook
50 Left = 24
51 Height = 320
52 Top = 80
53 Width = 642
54 PageIndex = 5
55 TabOrder = 1
56 object OneParamPage: TPage
57 object OneParamTrackBar: TTrackBar
58 Left = 32
59 Height = 44
60 Top = 72
61 Width = 584
62 Max = 255
63 OnChange = OneParamTrackBarChange
64 Position = 0
65 TabOrder = 0
66 end
67 object Value: TLabel
68 Left = 32
69 Height = 30
70 Top = 16
71 Width = 584
72 Alignment = taCenter
73 AutoSize = False
74 Caption = 'Value'
75 ParentColor = False
76 end
77 end
78 object TwoParamsPage: TPage
79 object TwoParamsTrackBar1: TTrackBar
80 Left = 32
81 Height = 44
82 Top = 72
83 Width = 584
84 Max = 15
85 OnChange = OneParamTrackBarChange
86 Position = 0
87 TabOrder = 0
88 end
89 object TwoParamsTrackBar2: TTrackBar
90 Left = 32
91 Height = 44
92 Top = 136
93 Width = 584
94 Max = 15
95 OnChange = OneParamTrackBarChange
96 Position = 0
97 TabOrder = 1
98 end
99 object Value1: TLabel
100 Left = 32
101 Height = 30
102 Top = 16
103 Width = 584
104 Alignment = taCenter
105 AutoSize = False
106 Caption = 'Value1'
107 ParentColor = False
108 end
109 end
110 object VibratoPage: TPage
111 object VibratoRateRadioGroup: TRadioGroup
112 Left = 0
113 Height = 320
114 Top = -8
115 Width = 188
116 AutoFill = True
117 Caption = 'Rate'
118 ChildSizing.LeftRightSpacing = 6
119 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
120 ChildSizing.EnlargeVertical = crsHomogenousChildResize
121 ChildSizing.ShrinkHorizontal = crsScaleChilds
122 ChildSizing.ShrinkVertical = crsScaleChilds
123 ChildSizing.Layout = cclLeftToRightThenTopToBottom
124 ChildSizing.ControlsPerLine = 1
125 ClientHeight = 285
126 ClientWidth = 184
127 Items.Strings = (
128 '1.0'
129 '0.5'
130 '0.25'
131 '0.125'
132 '0.0625'
133 )
134 TabOrder = 0
135 end
136 object VibratoDepthTrackBar: TTrackBar
137 Left = 200
138 Height = 44
139 Top = 48
140 Width = 448
141 Max = 15
142 Position = 0
143 TabOrder = 1
144 end
145 object Label2: TLabel
146 Left = 392
147 Height = 30
148 Top = 0
149 Width = 57
150 Caption = 'Depth'
151 ParentColor = False
152 end
153 end
154 object MasterVolumePage: TPage
155 object Value2: TLabel
156 Left = 32
157 Height = 30
158 Top = 32
159 Width = 584
160 Alignment = taCenter
161 AutoSize = False
162 Caption = 'Value2'
163 ParentColor = False
164 end
165 object LeftVolumeTrackBar: TTrackBar
166 Left = 32
167 Height = 44
168 Top = 88
169 Width = 584
170 Max = 7
171 OnChange = OneParamTrackBarChange
172 Position = 0
173 TabOrder = 0
174 end
175 object RightVolumeTrackBar: TTrackBar
176 Left = 32
177 Height = 44
178 Top = 152
179 Width = 584
180 Max = 7
181 OnChange = OneParamTrackBarChange
182 Position = 0
183 TabOrder = 1
184 end
185 end
186 object PanningPage: TPage
187 object LeftPanCheckGroup: TCheckGroup
188 Left = 0
189 Height = 320
190 Top = 0
191 Width = 316
192 AutoFill = True
193 Caption = 'Left'
194 ChildSizing.LeftRightSpacing = 6
195 ChildSizing.TopBottomSpacing = 6
196 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
197 ChildSizing.EnlargeVertical = crsHomogenousChildResize
198 ChildSizing.ShrinkHorizontal = crsScaleChilds
199 ChildSizing.ShrinkVertical = crsScaleChilds
200 ChildSizing.Layout = cclLeftToRightThenTopToBottom
201 ChildSizing.ControlsPerLine = 1
202 ClientHeight = 285
203 ClientWidth = 312
204 TabOrder = 0
205 object CheckBox1: TCheckBox
206 Left = 6
207 Height = 69
208 Top = 6
209 Width = 300
210 Caption = 'Duty 1'
211 TabOrder = 0
212 end
213 object CheckBox2: TCheckBox
214 Left = 6
215 Height = 69
216 Top = 75
217 Width = 300
218 Caption = 'Duty 2'
219 TabOrder = 1
220 end
221 object CheckBox3: TCheckBox
222 Left = 6
223 Height = 69
224 Top = 144
225 Width = 300
226 Caption = 'Wave'
227 TabOrder = 2
228 end
229 object CheckBox4: TCheckBox
230 Left = 6
231 Height = 66
232 Top = 213
233 Width = 300
234 Caption = 'Noise'
235 TabOrder = 3
236 end
237 end
238 object RightPanCheckGroup: TCheckGroup
239 Left = 320
240 Height = 320
241 Top = 0
242 Width = 316
243 AutoFill = True
244 Caption = 'Right'
245 ChildSizing.LeftRightSpacing = 6
246 ChildSizing.TopBottomSpacing = 6
247 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
248 ChildSizing.EnlargeVertical = crsHomogenousChildResize
249 ChildSizing.ShrinkHorizontal = crsScaleChilds
250 ChildSizing.ShrinkVertical = crsScaleChilds
251 ChildSizing.Layout = cclLeftToRightThenTopToBottom
252 ChildSizing.ControlsPerLine = 1
253 ClientHeight = 285
254 ClientWidth = 312
255 TabOrder = 1
256 object CheckBox5: TCheckBox
257 Left = 6
258 Height = 69
259 Top = 6
260 Width = 300
261 Caption = 'Duty 1'
262 TabOrder = 0
263 end
264 object CheckBox6: TCheckBox
265 Left = 6
266 Height = 69
267 Top = 75
268 Width = 300
269 Caption = 'Duty 2'
270 TabOrder = 1
271 end
272 object CheckBox7: TCheckBox
273 Left = 6
274 Height = 69
275 Top = 144
276 Width = 300
277 Caption = 'Wave'
278 TabOrder = 2
279 end
280 object CheckBox8: TCheckBox
281 Left = 6
282 Height = 66
283 Top = 213
284 Width = 300
285 Caption = 'Noise'
286 TabOrder = 3
287 end
288 end
289 end
290 object DutyCyclePage: TPage
291 object DutyRadioGroup: TRadioGroup
292 Left = 96
293 Height = 296
294 Top = 0
295 Width = 424
296 AutoFill = True
297 Caption = 'Duty Cycle'
298 ChildSizing.LeftRightSpacing = 6
299 ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
300 ChildSizing.EnlargeVertical = crsHomogenousChildResize
301 ChildSizing.ShrinkHorizontal = crsScaleChilds
302 ChildSizing.ShrinkVertical = crsScaleChilds
303 ChildSizing.Layout = cclLeftToRightThenTopToBottom
304 ChildSizing.ControlsPerLine = 1
305 ClientHeight = 261
306 ClientWidth = 420
307 Items.Strings = (
308 '12.5% ( _-------_-------_------- )'
309 '25% ( __------__------__------ )'
310 '50% ( ____----____----____---- ) (Square)'
311 '75% ( ______--______--______-- )'
312 )
313 TabOrder = 0
314 end
315 end
316 end
28 end 317 end
Modifiedeffecteditor.pas +178−5
@@ -5,27 +5,200 @@ unit effecteditor;
5 interface 5 interface
6 6
7 uses 7 uses
8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls; 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
9 ComCtrls, hugeDatatypes;
9 10
10 type 11 type
11 12
12 { TForm1 } 13 { TfrmEffectEditor }
13 14
14 TForm1 = class(TForm) 15 TfrmEffectEditor = class(TForm)
16 CheckBox1: TCheckBox;
17 CheckBox2: TCheckBox;
18 CheckBox3: TCheckBox;
19 CheckBox4: TCheckBox;
20 CheckBox5: TCheckBox;
21 CheckBox6: TCheckBox;
22 CheckBox7: TCheckBox;
23 CheckBox8: TCheckBox;
24 LeftPanCheckGroup: TCheckGroup;
25 RightPanCheckGroup: TCheckGroup;
15 ComboBox1: TComboBox; 26 ComboBox1: TComboBox;
16 Label1: TLabel; 27 Label1: TLabel;
28 Label2: TLabel;
29 VibratoRateRadioGroup: TRadioGroup;
30 DutyRadioGroup: TRadioGroup;
31 TwoParamsTrackBar1: TTrackBar;
32 TwoParamsTrackBar2: TTrackBar;
33 VibratoDepthTrackBar: TTrackBar;
34 LeftVolumeTrackBar: TTrackBar;
35 RightVolumeTrackBar: TTrackBar;
36 Value: TLabel;
37 Notebook1: TNotebook;
38 OneParamPage: TPage;
39 MasterVolumePage: TPage;
40 DutyCyclePage: TPage;
41 PanningPage: TPage;
42 OneParamTrackBar: TTrackBar;
43 Value1: TLabel;
44 Value2: TLabel;
45 VibratoPage: TPage;
46 TwoParamsPage: TPage;
47 procedure ComboBox1Change(Sender: TObject);
48 procedure OneParamTrackBarChange(Sender: TObject);
17 private 49 private
50 Cell: PCell;
18 51
19 public 52 procedure LoadEffect;
20 53
54 procedure fx0;
55 procedure fx1;
56 procedure fx2;
57 procedure fx3;
58 procedure fx4;
59 procedure fx5;
60 procedure fx6;
61 procedure fx7;
62 procedure fx8;
63 procedure fx9;
64 procedure fxA;
65 procedure fxB;
66 procedure fxC;
67 procedure fxD;
68 procedure fxE;
69 procedure fxF;
70 public
71 constructor Create(Cell_: PCell); reintroduce;
21 end; 72 end;
22 73
23 var 74 var
24 Form1: TForm1; 75 frmEffectEditor: TfrmEffectEditor;
25 76
26 implementation 77 implementation
27 78
28 {$R *.lfm} 79 {$R *.lfm}
29 80
81 { TfrmEffectEditor }
82
83 procedure TfrmEffectEditor.ComboBox1Change(Sender: TObject);
84 begin
85 Cell^.EffectCode := ComboBox1.ItemIndex;
86 LoadEffect;
87 end;
88
89 procedure TfrmEffectEditor.OneParamTrackBarChange(Sender: TObject);
90 begin
91 Cell^.EffectParams.Value := OneParamTrackBar.Position;
92 end;
93
94 procedure TfrmEffectEditor.LoadEffect;
95 begin
96 case Cell^.EffectCode of
97 $0: fx0;
98 $1: fx1;
99 $2: fx2;
100 $3: fx3;
101 $4: fx4;
102 $5: fx5;
103 $6: fx6;
104 $7: fx7;
105 $8: fx8;
106 $9: fx9;
107 $A: fxA;
108 $B: fxB;
109 $C: fxC;
110 $D: fxD;
111 $E: fxE;
112 $F: fxF;
113 end;
114 end;
115
116 procedure TfrmEffectEditor.fx0;
117 begin
118
119 end;
120
121 procedure TfrmEffectEditor.fx1;
122 begin
123
124 end;
125
126 procedure TfrmEffectEditor.fx2;
127 begin
128
129 end;
130
131 procedure TfrmEffectEditor.fx3;
132 begin
133
134 end;
135
136 procedure TfrmEffectEditor.fx4;
137 begin
138
139 end;
140
141 procedure TfrmEffectEditor.fx5;
142 begin
143
144 end;
145
146 procedure TfrmEffectEditor.fx6;
147 begin
148
149 end;
150
151 procedure TfrmEffectEditor.fx7;
152 begin
153
154 end;
155
156 procedure TfrmEffectEditor.fx8;
157 begin
158
159 end;
160
161 procedure TfrmEffectEditor.fx9;
162 begin
163
164 end;
165
166 procedure TfrmEffectEditor.fxA;
167 begin
168
169 end;
170
171 procedure TfrmEffectEditor.fxB;
172 begin
173
174 end;
175
176 procedure TfrmEffectEditor.fxC;
177 begin
178
179 end;
180
181 procedure TfrmEffectEditor.fxD;
182 begin
183
184 end;
185
186 procedure TfrmEffectEditor.fxE;
187 begin
188
189 end;
190
191 procedure TfrmEffectEditor.fxF;
192 begin
193
194 end;
195
196 constructor TfrmEffectEditor.Create(Cell_: PCell);
197 begin
198 Self.Cell := Cell_;
199 ComboBox1.ItemIndex := Cell^.EffectCode;
200 LoadEffect;
201 end;
202
30 end. 203 end.
31 204
Modifiedhugedatatypes.pas +1−0
@@ -25,6 +25,7 @@ type
25 EffectCode: Integer; 25 EffectCode: Integer;
26 EffectParams: TEffectParams; 26 EffectParams: TEffectParams;
27 end; 27 end;
28 PCell = ^TCell;
28 29
29 TPattern = packed array[0..63] of TCell; 30 TPattern = packed array[0..63] of TCell;
30 PPattern = ^TPattern; 31 PPattern = ^TPattern;
Modifiedtracker.pas +1−1
@@ -10,7 +10,7 @@ uses
10 Song, EmulationThread, Utils, Constants, sound, vars, machine, 10 Song, EmulationThread, Utils, Constants, sound, vars, machine,
11 about_hugetracker, TrackerGrid, lclintf, lmessages, Buttons, Grids, DBCtrls, 11 about_hugetracker, TrackerGrid, lclintf, lmessages, Buttons, Grids, DBCtrls,
12 ECProgressBar, HugeDatatypes, LCLType, RackCtls, Codegen, 12 ECProgressBar, HugeDatatypes, LCLType, RackCtls, Codegen,
13 SymParser; 13 SymParser, effecteditor;
14 14
15 type 15 type
16 { TfrmTracker } 16 { TfrmTracker }
Modifiedtrackergrid.pas +0−2
@@ -141,8 +141,6 @@ type
141 141
142 implementation 142 implementation
143 143
144 uses Tracker; // hack
145
146 { TSelectionEnumerator } 144 { TSelectionEnumerator }
147 145
148 constructor TSelectionEnumerator.Create(Grid: TPatternGrid; Cursor, 146 constructor TSelectionEnumerator.Create(Grid: TPatternGrid; Cursor,