Commit 4bd68f6

Nick committed on
First whack at tracker GUI
commit 4bd68f60ec9435e64415edccaec897eab77cba65 parent 22e9673
8 changed files +754−8
ModifiedGBEmu.lpi +28−4
@@ -13,8 +13,15 @@
13 <SessionStorage Value="InProjectDir"/> 13 <SessionStorage Value="InProjectDir"/>
14 <MainUnit Value="0"/> 14 <MainUnit Value="0"/>
15 <Title Value="GBEmu"/> 15 <Title Value="GBEmu"/>
16 <Scaled Value="True"/>
16 <UseAppBundle Value="False"/> 17 <UseAppBundle Value="False"/>
17 <ResourceType Value="res"/> 18 <ResourceType Value="res"/>
19 <UseXPManifest Value="True"/>
20 <XPManifest>
21 <DpiAware Value="True"/>
22 <TextName Value="SuperDisk.UGE.HugeTracker"/>
23 <TextDesc Value="The ultimate soundtracking and composing tool for Gameboy!"/>
24 </XPManifest>
18 <Icon Value="0"/> 25 <Icon Value="0"/>
19 </General> 26 </General>
20 <BuildModes Count="1"> 27 <BuildModes Count="1">
@@ -36,15 +43,18 @@
36 </Mode0> 43 </Mode0>
37 </Modes> 44 </Modes>
38 </RunParams> 45 </RunParams>
39 <RequiredPackages Count="2"> 46 <RequiredPackages Count="3">
40 <Item1> 47 <Item1>
41 <PackageName Value="BGRABitmapPack"/> 48 <PackageName Value="LazControls"/>
42 </Item1> 49 </Item1>
43 <Item2> 50 <Item2>
44 <PackageName Value="LCL"/> 51 <PackageName Value="BGRABitmapPack"/>
45 </Item2> 52 </Item2>
53 <Item3>
54 <PackageName Value="LCL"/>
55 </Item3>
46 </RequiredPackages> 56 </RequiredPackages>
47 <Units Count="11"> 57 <Units Count="13">
48 <Unit0> 58 <Unit0>
49 <Filename Value="GBEmu.lpr"/> 59 <Filename Value="GBEmu.lpr"/>
50 <IsPartOfProject Value="True"/> 60 <IsPartOfProject Value="True"/>
@@ -95,6 +105,20 @@
95 <IsPartOfProject Value="True"/> 105 <IsPartOfProject Value="True"/>
96 <HasResources Value="True"/> 106 <HasResources Value="True"/>
97 </Unit10> 107 </Unit10>
108 <Unit11>
109 <Filename Value="tracker.pas"/>
110 <IsPartOfProject Value="True"/>
111 <ComponentName Value="frmTracker"/>
112 <ResourceBaseClass Value="Form"/>
113 <UnitName Value="Tracker"/>
114 </Unit11>
115 <Unit12>
116 <Filename Value="about.pas"/>
117 <IsPartOfProject Value="True"/>
118 <ComponentName Value="frmAbout"/>
119 <ResourceBaseClass Value="Form"/>
120 <UnitName Value="About"/>
121 </Unit12>
98 </Units> 122 </Units>
99 </ProjectOptions> 123 </ProjectOptions>
100 <CompilerOptions> 124 <CompilerOptions>
ModifiedGBEmu.lpr +4−2
@@ -6,6 +6,7 @@ uses
6 Forms, 6 Forms,
7 Interfaces, 7 Interfaces,
8 UnitMain in 'UnitMain.pas' {frmGameboy}, 8 UnitMain in 'UnitMain.pas' {frmGameboy},
9 Tracker in 'Tracker.pas',
9 debugger in 'Debugger\debugger.pas', 10 debugger in 'Debugger\debugger.pas',
10 gfx in 'GPU\gfx.pas', 11 gfx in 'GPU\gfx.pas',
11 machine in 'CPU\machine.pas', 12 machine in 'CPU\machine.pas',
@@ -22,8 +23,9 @@ uses
22 23
23 begin 24 begin
24 Application.Initialize; 25 Application.Initialize;
25 Application.CreateForm(TfrmGameboy, frmGameboy); 26 {Application.CreateForm(TfrmGameboy, frmGameboy);
26 Application.CreateForm(TfrmDebug, frmDebug); 27 Application.CreateForm(TfrmDebug, frmDebug);
27 Application.CreateForm(TfrmMapview, frmMapview); 28 Application.CreateForm(TfrmMapview, frmMapview);}
29 Application.CreateForm(TfrmTracker, frmTracker);
28 Application.Run; 30 Application.Run;
29 end. 31 end.
ModifiedUnitMain.lfm +2−2
@@ -1,7 +1,7 @@
1 object frmGameboy: TfrmGameboy 1 object frmGameboy: TfrmGameboy
2 Left = 3306 2 Left = 1254
3 Height = 236 3 Height = 236
4 Top = 338 4 Top = 1002
5 Width = 212 5 Width = 212
6 Caption = 'Gameboy' 6 Caption = 'Gameboy'
7 ClientHeight = 216 7 ClientHeight = 216
Addedabout.lfm +9−0
@@ -0,0 +1,9 @@
1 object frmAbout: TfrmAbout
2 Left = 1143
3 Height = 350
4 Top = 371
5 Width = 420
6 Caption = 'About'
7 Position = poScreenCenter
8 LCLVersion = '2.0.2.0'
9 end
Addedabout.pas +26−0
@@ -0,0 +1,26 @@
1 unit About;
2
3 {$mode delphi}
4
5 interface
6
7 uses
8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs;
9
10 type
11 TfrmAbout = class(TForm)
12 private
13
14 public
15
16 end;
17
18 var
19 frmAbout: TfrmAbout;
20
21 implementation
22
23 {$R *.lfm}
24
25 end.
26
Addedtracker.lfm +536−0
@@ -0,0 +1,536 @@
1 object frmTracker: TfrmTracker
2 Left = 497
3 Height = 930
4 Top = 131
5 Width = 1178
6 Caption = 'hUGETracker'
7 ClientHeight = 910
8 ClientWidth = 1178
9 Menu = MainMenu1
10 LCLVersion = '2.0.2.0'
11 object TreeView1: TTreeView
12 Left = 0
13 Height = 685
14 Top = 202
15 Width = 193
16 Align = alLeft
17 ReadOnly = True
18 TabOrder = 0
19 Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
20 Items.Data = {
21 F9FFFFFF020004000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF020000000000
22 000001080000005061747465726E73FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
23 00000000000000000800000042696E676F677573FFFFFFFFFFFFFFFFFFFFFFFF
24 FFFFFFFF00000000000000000008000000426C6172676F676FFFFFFFFFFFFFFF
25 FFFFFFFFFFFFFFFFFF0000000000000000000B000000496E737472756D656E74
26 73FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000050000005761
27 766573FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000008000000
28 526F7574696E6573
29 }
30 end
31 object Splitter1: TSplitter
32 Left = 193
33 Height = 685
34 Top = 202
35 Width = 5
36 end
37 object Panel1: TPanel
38 Left = 198
39 Height = 685
40 Top = 202
41 Width = 980
42 Align = alClient
43 BevelOuter = bvNone
44 ClientHeight = 685
45 ClientWidth = 980
46 TabOrder = 2
47 object PageControl1: TPageControl
48 Left = 0
49 Height = 685
50 Top = 0
51 Width = 980
52 ActivePage = InstrumentTabSheet
53 Align = alClient
54 TabIndex = 2
55 TabOrder = 0
56 object GeneralTabSheet: TTabSheet
57 Caption = 'General'
58 end
59 object PatternTabSheet: TTabSheet
60 Caption = 'Patterns'
61 end
62 object InstrumentTabSheet: TTabSheet
63 Caption = 'Instruments'
64 ClientHeight = 657
65 ClientWidth = 972
66 object PaintBox1: TPaintBox
67 Left = 0
68 Height = 321
69 Top = 336
70 Width = 972
71 Align = alClient
72 Color = clBlack
73 ParentColor = False
74 OnPaint = PaintBox1Paint
75 end
76 object Panel3: TPanel
77 Left = 0
78 Height = 336
79 Top = 0
80 Width = 972
81 Align = alTop
82 Caption = 'Panel3'
83 ClientHeight = 336
84 ClientWidth = 972
85 TabOrder = 0
86 object GroupBox1: TGroupBox
87 Left = 8
88 Height = 136
89 Top = 8
90 Width = 320
91 Caption = 'Instrument'
92 ClientHeight = 116
93 ClientWidth = 316
94 TabOrder = 0
95 object InstrumentNumberSpinner: TSpinEdit
96 Left = 80
97 Height = 23
98 Top = 0
99 Width = 176
100 MaxValue = 15
101 MinValue = 1
102 TabOrder = 0
103 Value = 1
104 end
105 object Label1: TLabel
106 Left = 8
107 Height = 15
108 Top = 8
109 Width = 58
110 Caption = 'Instrument'
111 ParentColor = False
112 end
113 object Label2: TLabel
114 Left = 8
115 Height = 15
116 Top = 34
117 Width = 32
118 Caption = 'Name'
119 ParentColor = False
120 end
121 object InstrumentNameEdit: TEdit
122 Left = 80
123 Height = 23
124 Top = 26
125 Width = 176
126 TabOrder = 1
127 end
128 object Label3: TLabel
129 Left = 8
130 Height = 15
131 Top = 61
132 Width = 24
133 Caption = 'Type'
134 ParentColor = False
135 end
136 object InstrumentTypeCombobox: TComboBox
137 Left = 80
138 Height = 23
139 Top = 53
140 Width = 176
141 ItemHeight = 15
142 ItemIndex = 0
143 Items.Strings = (
144 'Square'
145 'Wave'
146 'Noise'
147 )
148 Style = csDropDownList
149 TabOrder = 2
150 Text = 'Square'
151 end
152 object LengthEnabledCheckbox: TCheckBox
153 Left = 8
154 Height = 19
155 Top = 84
156 Width = 57
157 Caption = 'Length'
158 TabOrder = 3
159 end
160 object LengthSpinner: TSpinEdit
161 Left = 80
162 Height = 23
163 Top = 80
164 Width = 50
165 MaxValue = 63
166 TabOrder = 4
167 end
168 object TrackBar1: TTrackBar
169 Left = 136
170 Height = 25
171 Top = 80
172 Width = 172
173 Max = 63
174 Position = 0
175 TabOrder = 5
176 end
177 end
178 object GroupBox2: TGroupBox
179 Left = 344
180 Height = 136
181 Top = 8
182 Width = 297
183 Caption = 'Envelope'
184 ClientHeight = 116
185 ClientWidth = 293
186 TabOrder = 1
187 object Label4: TLabel
188 Left = 8
189 Height = 15
190 Top = 6
191 Width = 46
192 Caption = 'Start vol.'
193 ParentColor = False
194 end
195 object EnvelopeStartTrackbar: TTrackBar
196 Left = 96
197 Height = 25
198 Top = -2
199 Width = 194
200 Max = 15
201 Position = 0
202 TabOrder = 0
203 end
204 object Label5: TLabel
205 Left = 8
206 Height = 15
207 Top = 40
208 Width = 48
209 Caption = 'Direction'
210 ParentColor = False
211 end
212 object DirectionComboBox: TComboBox
213 Left = 104
214 Height = 23
215 Top = 34
216 Width = 176
217 ItemHeight = 15
218 ItemIndex = 1
219 Items.Strings = (
220 'Up'
221 'Down'
222 )
223 Style = csDropDownList
224 TabOrder = 1
225 Text = 'Down'
226 end
227 object Label6: TLabel
228 Left = 8
229 Height = 15
230 Top = 64
231 Width = 41
232 Caption = 'Change'
233 ParentColor = False
234 end
235 object EnvelopeSizeTrackbar: TTrackBar
236 Left = 96
237 Height = 25
238 Top = 64
239 Width = 194
240 Max = 15
241 Position = 0
242 TabOrder = 2
243 end
244 end
245 object GroupBox3: TGroupBox
246 Left = 8
247 Height = 169
248 Top = 152
249 Width = 320
250 Caption = 'Square'
251 ClientHeight = 149
252 ClientWidth = 316
253 TabOrder = 2
254 object Label7: TLabel
255 Left = 8
256 Height = 15
257 Top = 16
258 Width = 61
259 Caption = 'Sweep time'
260 ParentColor = False
261 end
262 object ComboBox1: TComboBox
263 Left = 104
264 Height = 23
265 Hint = 'How long to sweep'
266 Top = 8
267 Width = 200
268 ItemHeight = 15
269 ItemIndex = 0
270 Items.Strings = (
271 'Off - no frequency change'
272 '7.8 ms (1/128Hz)'
273 '15.6 ms (2/128Hz)'
274 '23.4 ms (3/128Hz)'
275 '31.3 ms (4/128Hz)'
276 '39.1 ms (5/128Hz)'
277 '46.9 ms (6/128Hz)'
278 '54.7 ms (7/128Hz)'
279 )
280 ParentShowHint = False
281 ShowHint = True
282 Style = csDropDownList
283 TabOrder = 0
284 Text = 'Off - no frequency change'
285 end
286 object DirectionComboBox1: TComboBox
287 Left = 104
288 Height = 23
289 Hint = 'The direction of the sweep'
290 Top = 40
291 Width = 200
292 ItemHeight = 15
293 ItemIndex = 1
294 Items.Strings = (
295 'Up'
296 'Down'
297 )
298 ParentShowHint = False
299 ShowHint = True
300 Style = csDropDownList
301 TabOrder = 1
302 Text = 'Down'
303 end
304 object Label8: TLabel
305 Left = 8
306 Height = 15
307 Top = 48
308 Width = 48
309 Caption = 'Direction'
310 ParentColor = False
311 end
312 object Label9: TLabel
313 Left = 8
314 Height = 15
315 Top = 84
316 Width = 20
317 Caption = 'Size'
318 ParentColor = False
319 end
320 object TrackBar2: TTrackBar
321 Left = 104
322 Height = 25
323 Hint = 'How much to change the frequency on each sweep step'
324 Top = 74
325 Width = 200
326 Position = 0
327 ParentShowHint = False
328 ShowHint = True
329 TabOrder = 2
330 end
331 object Label10: TLabel
332 Left = 8
333 Height = 15
334 Top = 120
335 Width = 25
336 Caption = 'Duty'
337 ParentColor = False
338 end
339 object DirectionComboBox2: TComboBox
340 Left = 104
341 Height = 23
342 Hint = 'Which duty cycle to use (changes timbre of wave)'
343 Top = 112
344 Width = 200
345 ItemHeight = 15
346 ItemIndex = 2
347 Items.Strings = (
348 '12.5%'
349 '25%'
350 '50% (square)'
351 '75%'
352 )
353 ParentShowHint = False
354 ShowHint = True
355 Style = csDropDownList
356 TabOrder = 3
357 Text = '50% (square)'
358 end
359 end
360 object GroupBox4: TGroupBox
361 Left = 344
362 Height = 169
363 Top = 152
364 Width = 297
365 Caption = 'Wave'
366 ClientHeight = 149
367 ClientWidth = 293
368 TabOrder = 3
369 object Label11: TLabel
370 Left = 8
371 Height = 15
372 Top = 16
373 Width = 40
374 Caption = 'Volume'
375 ParentColor = False
376 end
377 object TrackBar3: TTrackBar
378 Left = 96
379 Height = 25
380 Top = 8
381 Width = 184
382 Position = 0
383 TabOrder = 0
384 end
385 object Label12: TLabel
386 Left = 8
387 Height = 15
388 Top = 48
389 Width = 55
390 Caption = 'Waveform'
391 ParentColor = False
392 end
393 object ComboBox2: TComboBox
394 Left = 104
395 Height = 23
396 Top = 40
397 Width = 176
398 ItemHeight = 15
399 Style = csDropDownList
400 TabOrder = 1
401 end
402 object Panel4: TPanel
403 Left = 8
404 Height = 50
405 Top = 80
406 Width = 272
407 BevelOuter = bvLowered
408 ClientHeight = 50
409 ClientWidth = 272
410 TabOrder = 2
411 object PaintBox2: TPaintBox
412 Left = 1
413 Height = 48
414 Top = 1
415 Width = 270
416 Align = alClient
417 Color = clBlack
418 ParentColor = False
419 OnPaint = PaintBox2Paint
420 end
421 end
422 end
423 object GroupBox5: TGroupBox
424 Left = 656
425 Height = 169
426 Top = 152
427 Width = 297
428 Caption = 'Noise'
429 ClientHeight = 149
430 ClientWidth = 293
431 TabOrder = 4
432 object Label13: TLabel
433 Left = 8
434 Height = 15
435 Top = 16
436 Width = 55
437 Caption = 'Frequency'
438 ParentColor = False
439 end
440 object TrackBar4: TTrackBar
441 Left = 88
442 Height = 25
443 Top = 6
444 Width = 196
445 Position = 0
446 TabOrder = 0
447 end
448 object CheckBox1: TCheckBox
449 Left = 8
450 Height = 19
451 Top = 80
452 Width = 215
453 Alignment = taLeftJustify
454 Caption = '7 bit counter (more tone-like output)'
455 TabOrder = 1
456 end
457 object TrackBar5: TTrackBar
458 Left = 88
459 Height = 25
460 Top = 40
461 Width = 196
462 Position = 0
463 TabOrder = 2
464 end
465 object Label14: TLabel
466 Left = 8
467 Height = 15
468 Top = 48
469 Width = 71
470 Caption = 'Dividing ratio'
471 ParentColor = False
472 end
473 object Button1: TButton
474 Left = 8
475 Height = 25
476 Top = 110
477 Width = 276
478 Caption = 'Randomize'
479 TabOrder = 3
480 end
481 end
482 end
483 end
484 object CommentsTabSheet: TTabSheet
485 Caption = 'Comments'
486 end
487 object RoutinesTabSheet: TTabSheet
488 Caption = 'Routines'
489 end
490 end
491 end
492 object CoolBar1: TCoolBar
493 Left = 0
494 Height = 24
495 Top = 0
496 Width = 1178
497 Bands = <
498 item
499 end>
500 end
501 object Panel2: TPanel
502 Left = 0
503 Height = 178
504 Top = 24
505 Width = 1178
506 Align = alTop
507 BevelOuter = bvNone
508 TabOrder = 4
509 end
510 object StatusBar1: TStatusBar
511 Left = 0
512 Height = 23
513 Top = 887
514 Width = 1178
515 Panels = <>
516 end
517 object MainMenu1: TMainMenu
518 left = 928
519 top = 32
520 object MenuItem1: TMenuItem
521 Caption = 'File'
522 end
523 object MenuItem2: TMenuItem
524 Caption = 'Edit'
525 end
526 object MenuItem3: TMenuItem
527 Caption = 'Help'
528 object MenuItem4: TMenuItem
529 Caption = 'Example Songs'
530 end
531 object MenuItem5: TMenuItem
532 Caption = 'About hUGETracker'
533 end
534 end
535 end
536 end
Addedtracker.pas +149−0
@@ -0,0 +1,149 @@
1 unit Tracker;
2
3 {$mode delphi}
4
5 interface
6
7 uses
8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, ComCtrls,
9 Menus, Spin, StdCtrls, ExtendedNotebook;
10
11 type
12 TInstrumentType = (Square, Wave, Noise);
13 TDutyType = 0..3;
14 TSweepType = (Up, Down);
15 TStepWidth = (Fifteen, Seven);
16
17 TInstrument = record
18 //Type_: TInstrumentType;
19 Length: Integer;
20 // Highmask
21 LengthEnabled: Boolean;
22
23 InitialVolume: Integer;
24 VolSweepDirection: TSweepType;
25 VolSweepAmount: Integer;
26
27 case Type_: TInstrumentType of
28 Square: (
29 // NR10
30 SweepTime: Integer;
31 SweepIncDec: TSweepType;
32 SweepShift: Integer;
33
34 // NR11
35 Duty: TDutyType;
36 );
37 Wave: (
38 // NR32
39 OutputLevel: Integer;
40 // Wave
41 Waveform: Integer;
42 );
43 Noise: (
44 // NR42
45 ShiftClockFreq: Integer;
46 CounterStep: TStepWidth;
47 DividingRatio: Integer;
48 );
49 end;
50
51 { TfrmTracker }
52
53 TfrmTracker = class(TForm)
54 Button1: TButton;
55 CheckBox1: TCheckBox;
56 ComboBox1: TComboBox;
57 ComboBox2: TComboBox;
58 DirectionComboBox1: TComboBox;
59 DirectionComboBox2: TComboBox;
60 GroupBox3: TGroupBox;
61 GroupBox4: TGroupBox;
62 GroupBox5: TGroupBox;
63 Label10: TLabel;
64 Label11: TLabel;
65 Label12: TLabel;
66 Label13: TLabel;
67 Label14: TLabel;
68 Label7: TLabel;
69 Label8: TLabel;
70 Label9: TLabel;
71 LengthEnabledCheckbox: TCheckBox;
72 InstrumentTypeCombobox: TComboBox;
73 DirectionComboBox: TComboBox;
74 CoolBar1: TCoolBar;
75 InstrumentNameEdit: TEdit;
76 GroupBox1: TGroupBox;
77 GroupBox2: TGroupBox;
78 Label1: TLabel;
79 Label2: TLabel;
80 Label3: TLabel;
81 Label4: TLabel;
82 Label5: TLabel;
83 Label6: TLabel;
84 MainMenu1: TMainMenu;
85 MenuItem1: TMenuItem;
86 MenuItem2: TMenuItem;
87 MenuItem3: TMenuItem;
88 MenuItem4: TMenuItem;
89 MenuItem5: TMenuItem;
90 PageControl1: TPageControl;
91 PaintBox1: TPaintBox;
92 PaintBox2: TPaintBox;
93 Panel1: TPanel;
94 Panel2: TPanel;
95 InstrumentNumberSpinner: TSpinEdit;
96 LengthSpinner: TSpinEdit;
97 Panel3: TPanel;
98 Panel4: TPanel;
99 Splitter1: TSplitter;
100 PatternTabSheet: TTabSheet;
101 InstrumentTabSheet: TTabSheet;
102 GeneralTabSheet: TTabSheet;
103 CommentsTabSheet: TTabSheet;
104 RoutinesTabSheet: TTabSheet;
105 StatusBar1: TStatusBar;
106 EnvelopeStartTrackbar: TTrackBar;
107 EnvelopeSizeTrackbar: TTrackBar;
108 TrackBar1: TTrackBar;
109 TrackBar2: TTrackBar;
110 TrackBar3: TTrackBar;
111 TrackBar4: TTrackBar;
112 TrackBar5: TTrackBar;
113 TreeView1: TTreeView;
114 procedure PaintBox1Paint(Sender: TObject);
115 procedure PaintBox2Paint(Sender: TObject);
116 private
117
118
119 public
120
121 end;
122
123 var
124 frmTracker: TfrmTracker;
125
126 implementation
127
128 {$R *.lfm}
129
130 { TfrmTracker }
131
132 procedure TfrmTracker.PaintBox2Paint(Sender: TObject);
133 begin
134 with PaintBox2.Canvas do begin
135 Brush.Color := clBlack;
136 Clear;
137 end;
138 end;
139
140 procedure TfrmTracker.PaintBox1Paint(Sender: TObject);
141 begin
142 with PaintBox1.Canvas do begin
143 Brush.Color := clBlack;
144 Clear;
145 end;
146 end;
147
148 end.
149