Commit da40563

Nick Faro committed on
Pegmode hex order list
commit da40563ca7a1eec4a2c0b256236cb0c048ec1eff parent 308612a
5 changed files +77−32
Modifiedhugesettings.pas +10−0
@@ -14,6 +14,7 @@ type
14 TTrackerSettings = class 14 TTrackerSettings = class
15 private 15 private
16 FDisplayRowNumbersAsHex: Boolean; 16 FDisplayRowNumbersAsHex: Boolean;
17 FDisplayOrderRowNumbersAsHex: Boolean;
17 FPreviewWhenBumping: Boolean; 18 FPreviewWhenBumping: Boolean;
18 FPreviewWhenPlacing: Boolean; 19 FPreviewWhenPlacing: Boolean;
19 SettingsFile: TINIFile; 20 SettingsFile: TINIFile;
@@ -21,6 +22,7 @@ type
21 FPatternEditorFontSize: Integer; 22 FPatternEditorFontSize: Integer;
22 FUseScopes, FUseCustomKeymap: Boolean; 23 FUseScopes, FUseCustomKeymap: Boolean;
23 24
25 procedure SetDisplayOrderRowNumbersAsHex(AValue: Boolean);
24 procedure SetDisplayRowNumbersAsHex(AValue: Boolean); 26 procedure SetDisplayRowNumbersAsHex(AValue: Boolean);
25 procedure SetPatternEditorFontSize(AValue: Integer); 27 procedure SetPatternEditorFontSize(AValue: Integer);
26 procedure SetPreviewWhenBumping(AValue: Boolean); 28 procedure SetPreviewWhenBumping(AValue: Boolean);
@@ -34,6 +36,7 @@ type
34 property PreviewWhenPlacing: Boolean read FPreviewWhenPlacing write SetPreviewWhenPlacing; 36 property PreviewWhenPlacing: Boolean read FPreviewWhenPlacing write SetPreviewWhenPlacing;
35 property PreviewWhenBumping: Boolean read FPreviewWhenBumping write SetPreviewWhenBumping; 37 property PreviewWhenBumping: Boolean read FPreviewWhenBumping write SetPreviewWhenBumping;
36 property DisplayRowNumbersAsHex: Boolean read FDisplayRowNumbersAsHex write SetDisplayRowNumbersAsHex; 38 property DisplayRowNumbersAsHex: Boolean read FDisplayRowNumbersAsHex write SetDisplayRowNumbersAsHex;
39 property DisplayOrderRowNumbersAsHex: Boolean read FDisplayOrderRowNumbersAsHex write SetDisplayOrderRowNumbersAsHex;
37 40
38 constructor Create; 41 constructor Create;
39 end; 42 end;
@@ -57,6 +60,12 @@ begin
57 SettingsFile.WriteBool('hUGETracker', 'DisplayRowNumbersAsHex', AValue); 60 SettingsFile.WriteBool('hUGETracker', 'DisplayRowNumbersAsHex', AValue);
58 end; 61 end;
59 62
63 procedure TTrackerSettings.SetDisplayOrderRowNumbersAsHex(AValue: Boolean);
64 begin
65 FDisplayOrderRowNumbersAsHex:=AValue;
66 SettingsFile.WriteBool('hUGETracker', 'DisplayOrderRowNumbersAsHex', AValue);
67 end;
68
60 procedure TTrackerSettings.SetPreviewWhenBumping(AValue: Boolean); 69 procedure TTrackerSettings.SetPreviewWhenBumping(AValue: Boolean);
61 begin 70 begin
62 FPreviewWhenBumping:=AValue; 71 FPreviewWhenBumping:=AValue;
@@ -91,6 +100,7 @@ begin
91 FPreviewWhenPlacing := SettingsFile.ReadBool('hUGETracker', 'PreviewWhenPlacing', True); 100 FPreviewWhenPlacing := SettingsFile.ReadBool('hUGETracker', 'PreviewWhenPlacing', True);
92 FPreviewWhenBumping := SettingsFile.ReadBool('hUGETracker', 'PreviewWhenBumping', False); 101 FPreviewWhenBumping := SettingsFile.ReadBool('hUGETracker', 'PreviewWhenBumping', False);
93 FDisplayRowNumbersAsHex := SettingsFile.ReadBool('hUGETracker', 'DisplayRowNumbersAsHex', False); 102 FDisplayRowNumbersAsHex := SettingsFile.ReadBool('hUGETracker', 'DisplayRowNumbersAsHex', False);
103 FDisplayOrderRowNumbersAsHex := SettingsFile.ReadBool('hUGETracker', 'DisplayOrderRowNumbersAsHex', False);
94 end; 104 end;
95 105
96 initialization 106 initialization
Modifiedoptions.lfm +22−27
@@ -1,22 +1,22 @@
1 object frmOptions: TfrmOptions 1 object frmOptions: TfrmOptions
2 Left = 1947 2 Left = 1741
3 Height = 683 3 Height = 732
4 Top = 135 4 Top = 120
5 Width = 927 5 Width = 927
6 BorderStyle = bsDialog 6 BorderStyle = bsDialog
7 Caption = 'Options' 7 Caption = 'Options'
8 ClientHeight = 683 8 ClientHeight = 732
9 ClientWidth = 927 9 ClientWidth = 927
10 OnClose = FormClose 10 OnClose = FormClose
11 OnCreate = FormCreate 11 OnCreate = FormCreate
12 Position = poMainFormCenter 12 Position = poMainFormCenter
13 LCLVersion = '2.0.12.0' 13 LCLVersion = '2.2.0.3'
14 object Button1: TButton 14 object Button1: TButton
15 AnchorSideRight.Side = asrBottom 15 AnchorSideRight.Side = asrBottom
16 AnchorSideBottom.Side = asrBottom 16 AnchorSideBottom.Side = asrBottom
17 Left = 791 17 Left = 791
18 Height = 25 18 Height = 25
19 Top = 644 19 Top = 693
20 Width = 123 20 Width = 123
21 Anchors = [akRight, akBottom] 21 Anchors = [akRight, akBottom]
22 Caption = 'OK' 22 Caption = 'OK'
@@ -27,7 +27,7 @@ object frmOptions: TfrmOptions
27 object KeymapGroupBox: TGroupBox 27 object KeymapGroupBox: TGroupBox
28 Left = 14 28 Left = 14
29 Height = 433 29 Height = 433
30 Top = 200 30 Top = 240
31 Width = 282 31 Width = 282
32 Caption = 'Custom key map' 32 Caption = 'Custom key map'
33 ClientHeight = 413 33 ClientHeight = 413
@@ -114,11 +114,11 @@ object frmOptions: TfrmOptions
114 end 114 end
115 object OptionsGroupBox: TGroupBox 115 object OptionsGroupBox: TGroupBox
116 Left = 14 116 Left = 14
117 Height = 184 117 Height = 224
118 Top = 8 118 Top = 8
119 Width = 298 119 Width = 298
120 Caption = 'Options' 120 Caption = 'Options'
121 ClientHeight = 164 121 ClientHeight = 204
122 ClientWidth = 294 122 ClientWidth = 294
123 TabOrder = 2 123 TabOrder = 2
124 object ScopesCheck: TCheckBox 124 object ScopesCheck: TCheckBox
@@ -175,6 +175,16 @@ object frmOptions: TfrmOptions
175 ParentFont = False 175 ParentFont = False
176 TabOrder = 4 176 TabOrder = 4
177 end 177 end
178 object DisplayOrderHexRowNumbersCheck: TCheckBox
179 Left = 14
180 Height = 19
181 Top = 168
182 Width = 270
183 Alignment = taLeftJustify
184 Caption = 'Display order numbers in hexadecimal notation'
185 ParentFont = False
186 TabOrder = 5
187 end
178 end 188 end
179 object CustomizationGroupBox: TGroupBox 189 object CustomizationGroupBox: TGroupBox
180 Left = 320 190 Left = 320
@@ -191,7 +201,6 @@ object frmOptions: TfrmOptions
191 Top = 14 201 Top = 14
192 Width = 119 202 Width = 119
193 Caption = 'Pattern editor font size' 203 Caption = 'Pattern editor font size'
194 ParentColor = False
195 ParentFont = False 204 ParentFont = False
196 end 205 end
197 object FontSizeSpinner: TSpinEdit 206 object FontSizeSpinner: TSpinEdit
@@ -220,7 +229,6 @@ object frmOptions: TfrmOptions
220 Top = 40 229 Top = 40
221 Width = 79 230 Width = 79
222 Caption = 'Note text color' 231 Caption = 'Note text color'
223 ParentColor = False
224 end 232 end
225 object InstrumentTextColorButton: TColorButton 233 object InstrumentTextColorButton: TColorButton
226 Left = 155 234 Left = 155
@@ -288,7 +296,6 @@ object frmOptions: TfrmOptions
288 Top = 72 296 Top = 72
289 Width = 111 297 Width = 111
290 Caption = 'Instrument text color' 298 Caption = 'Instrument text color'
291 ParentColor = False
292 end 299 end
293 object Label4: TLabel 300 object Label4: TLabel
294 Left = 14 301 Left = 14
@@ -296,7 +303,6 @@ object frmOptions: TfrmOptions
296 Top = 104 303 Top = 104
297 Width = 114 304 Width = 114
298 Caption = 'Misc. effect text color' 305 Caption = 'Misc. effect text color'
299 ParentColor = False
300 end 306 end
301 object Label5: TLabel 307 object Label5: TLabel
302 Left = 14 308 Left = 14
@@ -304,7 +310,6 @@ object frmOptions: TfrmOptions
304 Top = 136 310 Top = 136
305 Width = 113 311 Width = 113
306 Caption = 'Pitch effect text color' 312 Caption = 'Pitch effect text color'
307 ParentColor = False
308 end 313 end
309 object Label6: TLabel 314 object Label6: TLabel
310 Left = 14 315 Left = 14
@@ -312,7 +317,6 @@ object frmOptions: TfrmOptions
312 Top = 168 317 Top = 168
313 Width = 126 318 Width = 126
314 Caption = 'Volume effect text color' 319 Caption = 'Volume effect text color'
315 ParentColor = False
316 end 320 end
317 object Label7: TLabel 321 object Label7: TLabel
318 Left = 14 322 Left = 14
@@ -320,7 +324,6 @@ object frmOptions: TfrmOptions
320 Top = 200 324 Top = 200
321 Width = 130 325 Width = 130
322 Caption = 'Panning effect text color' 326 Caption = 'Panning effect text color'
323 ParentColor = False
324 end 327 end
325 object Label8: TLabel 328 object Label8: TLabel
326 Left = 14 329 Left = 14
@@ -328,7 +331,6 @@ object frmOptions: TfrmOptions
328 Top = 232 331 Top = 232
329 Width = 113 332 Width = 113
330 Caption = 'Song effect text color' 333 Caption = 'Song effect text color'
331 ParentColor = False
332 end 334 end
333 object BackgroundColorButton: TColorButton 335 object BackgroundColorButton: TColorButton
334 Left = 155 336 Left = 155
@@ -386,7 +388,6 @@ object frmOptions: TfrmOptions
386 Top = 264 388 Top = 264
387 Width = 64 389 Width = 64
388 Caption = 'Background' 390 Caption = 'Background'
389 ParentColor = False
390 end 391 end
391 object Label10: TLabel 392 object Label10: TLabel
392 Left = 14 393 Left = 14
@@ -394,7 +395,6 @@ object frmOptions: TfrmOptions
394 Top = 296 395 Top = 296
395 Width = 63 396 Width = 63
396 Caption = 'Highlighted' 397 Caption = 'Highlighted'
397 ParentColor = False
398 end 398 end
399 object Label11: TLabel 399 object Label11: TLabel
400 Left = 14 400 Left = 14
@@ -402,7 +402,6 @@ object frmOptions: TfrmOptions
402 Top = 328 402 Top = 328
403 Width = 44 403 Width = 44
404 Caption = 'Selected' 404 Caption = 'Selected'
405 ParentColor = False
406 end 405 end
407 object Label12: TLabel 406 object Label12: TLabel
408 Left = 14 407 Left = 14
@@ -410,7 +409,6 @@ object frmOptions: TfrmOptions
410 Top = 360 409 Top = 360
411 Width = 87 410 Width = 87
412 Caption = 'Every fourth row' 411 Caption = 'Every fourth row'
413 ParentColor = False
414 end 412 end
415 object Label13: TLabel 413 object Label13: TLabel
416 Left = 14 414 Left = 14
@@ -418,7 +416,6 @@ object frmOptions: TfrmOptions
418 Top = 392 416 Top = 392
419 Width = 102 417 Width = 102
420 Caption = 'Every sixteenth row' 418 Caption = 'Every sixteenth row'
421 ParentColor = False
422 end 419 end
423 object DotsColorButton: TColorButton 420 object DotsColorButton: TColorButton
424 Left = 155 421 Left = 155
@@ -446,7 +443,6 @@ object frmOptions: TfrmOptions
446 Top = 424 443 Top = 424
447 Width = 24 444 Width = 24
448 Caption = 'Dots' 445 Caption = 'Dots'
449 ParentColor = False
450 end 446 end
451 object Label15: TLabel 447 object Label15: TLabel
452 Left = 14 448 Left = 14
@@ -454,7 +450,6 @@ object frmOptions: TfrmOptions
454 Top = 456 450 Top = 456
455 Width = 42 451 Width = 42
456 Caption = 'Dividers' 452 Caption = 'Dividers'
457 ParentColor = False
458 end 453 end
459 object Button6: TButton 454 object Button6: TButton
460 Left = 56 455 Left = 56
@@ -486,16 +481,16 @@ object frmOptions: TfrmOptions
486 end 481 end
487 object Panel1: TPanel 482 object Panel1: TPanel
488 Left = 632 483 Left = 632
489 Height = 618 484 Height = 657
490 Top = 8 485 Top = 8
491 Width = 280 486 Width = 280
492 BevelWidth = 3 487 BevelWidth = 3
493 ClientHeight = 618 488 ClientHeight = 657
494 ClientWidth = 280 489 ClientWidth = 280
495 TabOrder = 4 490 TabOrder = 4
496 object SampleTrackerGridPanel: TPanel 491 object SampleTrackerGridPanel: TPanel
497 Left = 3 492 Left = 3
498 Height = 612 493 Height = 651
499 Top = 3 494 Top = 3
500 Width = 274 495 Width = 274
501 Align = alClient 496 Align = alClient
Modifiedoptions.pas +3−0
@@ -22,6 +22,7 @@ type
22 Button6: TButton; 22 Button6: TButton;
23 Button7: TButton; 23 Button7: TButton;
24 Button8: TButton; 24 Button8: TButton;
25 DisplayOrderHexRowNumbersCheck: TCheckBox;
25 NoteTextColorButton: TColorButton; 26 NoteTextColorButton: TColorButton;
26 OpenDialog2: TOpenDialog; 27 OpenDialog2: TOpenDialog;
27 Panel1: TPanel; 28 Panel1: TPanel;
@@ -182,6 +183,7 @@ begin
182 TrackerSettings.PreviewWhenPlacing := PreviewWhenPlacingCheck.Checked; 183 TrackerSettings.PreviewWhenPlacing := PreviewWhenPlacingCheck.Checked;
183 TrackerSettings.PreviewWhenBumping := PreviewWhenBumpingCheck.Checked; 184 TrackerSettings.PreviewWhenBumping := PreviewWhenBumpingCheck.Checked;
184 TrackerSettings.DisplayRowNumbersAsHex := DisplayHexRowNumbersCheck.Checked; 185 TrackerSettings.DisplayRowNumbersAsHex := DisplayHexRowNumbersCheck.Checked;
186 TrackerSettings.DisplayOrderRowNumbersAsHex := DisplayOrderHexRowNumbersCheck.Checked;
185 end; 187 end;
186 188
187 procedure TfrmOptions.FormCreate(Sender: TObject); 189 procedure TfrmOptions.FormCreate(Sender: TObject);
@@ -203,6 +205,7 @@ begin
203 PreviewWhenPlacingCheck.Checked := TrackerSettings.PreviewWhenPlacing; 205 PreviewWhenPlacingCheck.Checked := TrackerSettings.PreviewWhenPlacing;
204 PreviewWhenBumpingCheck.Checked := TrackerSettings.PreviewWhenBumping; 206 PreviewWhenBumpingCheck.Checked := TrackerSettings.PreviewWhenBumping;
205 DisplayHexRowNumbersCheck.Checked := TrackerSettings.DisplayRowNumbersAsHex; 207 DisplayHexRowNumbersCheck.Checked := TrackerSettings.DisplayRowNumbersAsHex;
208 DisplayOrderHexRowNumbersCheck.Checked := TrackerSettings.DisplayOrderRowNumbersAsHex;
206 209
207 SamplePatternMap := TPatternMap.Create; 210 SamplePatternMap := TPatternMap.Create;
208 SamplePattern := SamplePatternMap.GetOrCreateNew(0); 211 SamplePattern := SamplePatternMap.GetOrCreateNew(0);
Modifiedtracker.lfm +4−4
@@ -1,7 +1,7 @@
1 object frmTracker: TfrmTracker 1 object frmTracker: TfrmTracker
2 Left = 1514 2 Left = 1857
3 Height = 654 3 Height = 654
4 Top = 192 4 Top = 477
5 Width = 1232 5 Width = 1232
6 AllowDropFiles = True 6 AllowDropFiles = True
7 Caption = 'hUGETracker' 7 Caption = 'hUGETracker'
@@ -62,10 +62,10 @@ object frmTracker: TfrmTracker
62 Height = 522 62 Height = 522
63 Top = 0 63 Top = 0
64 Width = 1034 64 Width = 1034
65 ActivePage = InstrumentTabSheet 65 ActivePage = PatternTabSheet
66 Align = alClient 66 Align = alClient
67 ParentFont = False 67 ParentFont = False
68 TabIndex = 2 68 TabIndex = 1
69 TabOrder = 0 69 TabOrder = 0
70 object GeneralTabSheet: TTabSheet 70 object GeneralTabSheet: TTabSheet
71 Caption = 'General' 71 Caption = 'General'
Modifiedtracker.pas +38−1
@@ -23,6 +23,23 @@ const
23 LM_FD = LM_USER + 0; 23 LM_FD = LM_USER + 0;
24 24
25 type 25 type
26
27 { TStringGrid
28
29 An interposer class which adds the ability to draw the row
30 auto-numbering in hex notation.
31 }
32
33 TStringGrid = class(Grids.TStringGrid)
34 procedure DrawCellAutonumbering(aCol, aRow: Integer; aRect: TRect;
35 const aValue: string); override;
36 private
37 FDrawHexAutonumbering: Boolean;
38 procedure SetDrawHexAutonumbering(AValue: Boolean);
39 public
40 property DrawHexAutonumbering: Boolean read FDrawHexAutonumbering write SetDrawHexAutonumbering;
41 end;
42
26 { TfrmTracker } 43 { TfrmTracker }
27 44
28 TfrmTracker = class(TForm) 45 TfrmTracker = class(TForm)
@@ -505,6 +522,24 @@ implementation
505 522
506 {$R *.lfm} 523 {$R *.lfm}
507 524
525 { TStringGrid }
526
527 procedure TStringGrid.SetDrawHexAutonumbering(AValue: Boolean);
528 begin
529 if FDrawHexAutonumbering=AValue then Exit;
530 FDrawHexAutonumbering:=AValue;
531 Invalidate;
532 end;
533
534 procedure TStringGrid.DrawCellAutonumbering(aCol, aRow: Integer; aRect: TRect;
535 const aValue: string);
536 begin
537 if FDrawHexAutonumbering then
538 inherited DrawCellAutonumbering(aCol, aRow, aRect, IntToHex(Int8(StrToInt(aValue))))
539 else
540 inherited DrawCellAutonumbering(aCol, aRow, aRect, aValue);
541 end;
542
508 { TfrmTracker } 543 { TfrmTracker }
509 procedure TfrmTracker.UpdateUIAfterLoad(FileName: String = ''); 544 procedure TfrmTracker.UpdateUIAfterLoad(FileName: String = '');
510 var 545 var
@@ -1426,8 +1461,9 @@ begin
1426 // Initialize order table (InitializeSong creates the default order table) 1461 // Initialize order table (InitializeSong creates the default order table)
1427 CopyOrderMatrixToOrderGrid; 1462 CopyOrderMatrixToOrderGrid;
1428 1463
1429 // Manually resize the fixed column in the order editor 1464 // Manually resize the fixed column in the order editor, set hex option
1430 OrderEditStringGrid.ColWidths[0]:=50; 1465 OrderEditStringGrid.ColWidths[0]:=50;
1466 OrderEditStringGrid.DrawHexAutonumbering := TrackerSettings.DisplayOrderRowNumbersAsHex;
1431 1467
1432 // Get the emulator ready to make sound... 1468 // Get the emulator ready to make sound...
1433 EnableSound; 1469 EnableSound;
@@ -2259,6 +2295,7 @@ begin
2259 2295
2260 TrackerGrid.FontSize := TrackerSettings.PatternEditorFontSize; 2296 TrackerGrid.FontSize := TrackerSettings.PatternEditorFontSize;
2261 RowNumberStringGrid.DefaultRowHeight := TrackerGrid.RowHeight; 2297 RowNumberStringGrid.DefaultRowHeight := TrackerGrid.RowHeight;
2298 OrderEditStringGrid.DrawHexAutonumbering := TrackerSettings.DisplayOrderRowNumbersAsHex;
2262 2299
2263 ScopesOn := TrackerSettings.UseScopes; 2300 ScopesOn := TrackerSettings.UseScopes;
2264 2301