@@ -16,12 +16,6 @@ type |
| 16 |
{ TfrmTracker } |
16 |
{ TfrmTracker } |
| 17 |
|
17 |
|
| 18 |
TfrmTracker = class(TForm) |
18 |
TfrmTracker = class(TForm) |
| 19 |
Edit1: TEdit; |
|
|
| 20 |
Edit2: TEdit; |
|
|
| 21 |
Edit3: TEdit; |
|
|
| 22 |
Edit4: TEdit; |
|
|
| 23 |
Edit5: TEdit; |
|
|
| 24 |
Edit6: TEdit; |
|
|
| 25 |
IncrementCurrentInstrumentAction: TAction; |
19 |
IncrementCurrentInstrumentAction: TAction; |
| 26 |
DecrementCurrentInstrumentAction: TAction; |
20 |
DecrementCurrentInstrumentAction: TAction; |
| 27 |
GotoGeneralAction: TAction; |
21 |
GotoGeneralAction: TAction; |
@@ -35,6 +29,8 @@ type |
| 35 |
InsertRowForAllAction: TAction; |
29 |
InsertRowForAllAction: TAction; |
| 36 |
InsertRowAction: TAction; |
30 |
InsertRowAction: TAction; |
| 37 |
MenuItem39: TMenuItem; |
31 |
MenuItem39: TMenuItem; |
|
|
32 |
NoiseMacroPaintbox: TPaintBox; |
|
|
33 |
Panel6: TPanel; |
| 38 |
StopAction: TAction; |
34 |
StopAction: TAction; |
| 39 |
PlayOrderAction: TAction; |
35 |
PlayOrderAction: TAction; |
| 40 |
PlayCursorAction: TAction; |
36 |
PlayCursorAction: TAction; |
@@ -54,7 +50,6 @@ type |
| 54 |
ImageList2: TImageList; |
50 |
ImageList2: TImageList; |
| 55 |
GBSaveDialog: TSaveDialog; |
51 |
GBSaveDialog: TSaveDialog; |
| 56 |
Label13: TLabel; |
52 |
Label13: TLabel; |
| 57 |
Label25: TLabel; |
|
|
| 58 |
MenuItem10: TMenuItem; |
53 |
MenuItem10: TMenuItem; |
| 59 |
MenuItem16: TMenuItem; |
54 |
MenuItem16: TMenuItem; |
| 60 |
MenuItem23: TMenuItem; |
55 |
MenuItem23: TMenuItem; |
@@ -107,8 +102,6 @@ type |
| 107 |
TrackerGridPopup: TPopupMenu; |
102 |
TrackerGridPopup: TPopupMenu; |
| 108 |
StartVolTrackbar: TTrackBar; |
103 |
StartVolTrackbar: TTrackBar; |
| 109 |
EnvChangeTrackbar: TTrackBar; |
104 |
EnvChangeTrackbar: TTrackBar; |
| 110 |
ShiftClockTrackbar: TTrackBar; |
|
|
| 111 |
DivRatioTrackbar: TTrackBar; |
|
|
| 112 |
LengthTrackbar: TTrackBar; |
105 |
LengthTrackbar: TTrackBar; |
| 113 |
SweepSizeTrackbar: TTrackBar; |
106 |
SweepSizeTrackbar: TTrackBar; |
| 114 |
ToolButton5: TToolButton; |
107 |
ToolButton5: TToolButton; |
@@ -194,7 +187,6 @@ type |
| 194 |
SongInformationGroupbox: TGroupBox; |
187 |
SongInformationGroupbox: TGroupBox; |
| 195 |
Label15: TLabel; |
188 |
Label15: TLabel; |
| 196 |
Label16: TLabel; |
189 |
Label16: TLabel; |
| 197 |
RandomizeNoiseButton: TButton; |
|
|
| 198 |
SevenBitCounterCheckbox: TCheckBox; |
190 |
SevenBitCounterCheckbox: TCheckBox; |
| 199 |
SweepTimeCombobox: TComboBox; |
191 |
SweepTimeCombobox: TComboBox; |
| 200 |
RoutineSynedit: TSynEdit; |
192 |
RoutineSynedit: TSynEdit; |
@@ -210,7 +202,6 @@ type |
| 210 |
Label10: TLabel; |
202 |
Label10: TLabel; |
| 211 |
Label11: TLabel; |
203 |
Label11: TLabel; |
| 212 |
Label12: TLabel; |
204 |
Label12: TLabel; |
| 213 |
Label14: TLabel; |
|
|
| 214 |
Label7: TLabel; |
205 |
Label7: TLabel; |
| 215 |
Label8: TLabel; |
206 |
Label8: TLabel; |
| 216 |
Label9: TLabel; |
207 |
Label9: TLabel; |
@@ -255,7 +246,6 @@ type |
| 255 |
procedure DeleteRowForAllActionExecute(Sender: TObject); |
246 |
procedure DeleteRowForAllActionExecute(Sender: TObject); |
| 256 |
procedure DeleteRowForAllActionUpdate(Sender: TObject); |
247 |
procedure DeleteRowForAllActionUpdate(Sender: TObject); |
| 257 |
procedure Duty1VisualizerClick(Sender: TObject); |
248 |
procedure Duty1VisualizerClick(Sender: TObject); |
| 258 |
procedure Edit1Change(Sender: TObject); |
|
|
| 259 |
procedure FileSaveAs1BeforeExecute(Sender: TObject); |
249 |
procedure FileSaveAs1BeforeExecute(Sender: TObject); |
| 260 |
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); |
250 |
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean); |
| 261 |
procedure FormDropFiles(Sender: TObject; const FileNames: array of String); |
251 |
procedure FormDropFiles(Sender: TObject; const FileNames: array of String); |
@@ -273,6 +263,13 @@ type |
| 273 |
procedure InsertRowForAllActionUpdate(Sender: TObject); |
263 |
procedure InsertRowForAllActionUpdate(Sender: TObject); |
| 274 |
procedure MenuItem37Click(Sender: TObject); |
264 |
procedure MenuItem37Click(Sender: TObject); |
| 275 |
procedure MenuItem38Click(Sender: TObject); |
265 |
procedure MenuItem38Click(Sender: TObject); |
|
|
266 |
procedure NoiseMacroPaintboxMouseDown(Sender: TObject; |
|
|
267 |
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
|
|
268 |
procedure NoiseMacroPaintboxMouseMove(Sender: TObject; Shift: TShiftState; |
|
|
269 |
X, Y: Integer); |
|
|
270 |
procedure NoiseMacroPaintboxMouseUp(Sender: TObject; Button: TMouseButton; |
|
|
271 |
Shift: TShiftState; X, Y: Integer); |
|
|
272 |
procedure NoiseMacroPaintboxPaint(Sender: TObject); |
| 276 |
procedure PlayCursorActionExecute(Sender: TObject); |
273 |
procedure PlayCursorActionExecute(Sender: TObject); |
| 277 |
procedure PlayOrderActionExecute(Sender: TObject); |
274 |
procedure PlayOrderActionExecute(Sender: TObject); |
| 278 |
procedure ScrollBox1MouseWheelDown(Sender: TObject; Shift: TShiftState; |
275 |
procedure ScrollBox1MouseWheelDown(Sender: TObject; Shift: TShiftState; |
@@ -297,7 +294,6 @@ type |
| 297 |
procedure ArtistEditChange(Sender: TObject); |
294 |
procedure ArtistEditChange(Sender: TObject); |
| 298 |
procedure CommentMemoChange(Sender: TObject); |
295 |
procedure CommentMemoChange(Sender: TObject); |
| 299 |
procedure DirectionComboBoxChange(Sender: TObject); |
296 |
procedure DirectionComboBoxChange(Sender: TObject); |
| 300 |
procedure DivRatioSpinnerChange(Sender: TObject); |
|
|
| 301 |
procedure DutyComboboxChange(Sender: TObject); |
297 |
procedure DutyComboboxChange(Sender: TObject); |
| 302 |
procedure EnvChangeSpinnerChange(Sender: TObject); |
298 |
procedure EnvChangeSpinnerChange(Sender: TObject); |
| 303 |
procedure EnvelopePaintboxPaint(Sender: TObject); |
299 |
procedure EnvelopePaintboxPaint(Sender: TObject); |
@@ -353,7 +349,6 @@ type |
| 353 |
procedure OctaveSpinEditChange(Sender: TObject); |
349 |
procedure OctaveSpinEditChange(Sender: TObject); |
| 354 |
procedure RoutineNumberSpinnerChange(Sender: TObject); |
350 |
procedure RoutineNumberSpinnerChange(Sender: TObject); |
| 355 |
procedure RoutineSyneditChange(Sender: TObject); |
351 |
procedure RoutineSyneditChange(Sender: TObject); |
| 356 |
procedure ShiftClockSpinnerChange(Sender: TObject); |
|
|
| 357 |
procedure PlayStartActionExecute(Sender: TObject); |
352 |
procedure PlayStartActionExecute(Sender: TObject); |
| 358 |
procedure StepSpinEditChange(Sender: TObject); |
353 |
procedure StepSpinEditChange(Sender: TObject); |
| 359 |
procedure StopActionExecute(Sender: TObject); |
354 |
procedure StopActionExecute(Sender: TObject); |
@@ -385,7 +380,6 @@ type |
| 385 |
procedure WaveEditPaintBoxMouseUp(Sender: TObject; Button: TMouseButton; |
380 |
procedure WaveEditPaintBoxMouseUp(Sender: TObject; Button: TMouseButton; |
| 386 |
Shift: TShiftState; X, Y: Integer); |
381 |
Shift: TShiftState; X, Y: Integer); |
| 387 |
procedure WaveEditPaintBoxPaint(Sender: TObject); |
382 |
procedure WaveEditPaintBoxPaint(Sender: TObject); |
| 388 |
procedure RandomizeNoiseButtonClick(Sender: TObject); |
|
|
| 389 |
procedure InstrumentTypeComboboxChange(Sender: TObject); |
383 |
procedure InstrumentTypeComboboxChange(Sender: TObject); |
| 390 |
procedure LengthEnabledCheckboxChange(Sender: TObject); |
384 |
procedure LengthEnabledCheckboxChange(Sender: TObject); |
| 391 |
procedure PaintBox1Paint(Sender: TObject); |
385 |
procedure PaintBox1Paint(Sender: TObject); |
@@ -407,7 +401,7 @@ type |
| 407 |
LoadedFileName: String; |
401 |
LoadedFileName: String; |
| 408 |
|
402 |
|
| 409 |
PreviewingInstrument: Integer; |
403 |
PreviewingInstrument: Integer; |
| 410 |
DrawingWave: Boolean; |
404 |
DrawingWave, DrawingMacro: Boolean; |
| 411 |
Playing: Boolean; |
405 |
Playing: Boolean; |
| 412 |
LoadingFile: Boolean; |
406 |
LoadingFile: Boolean; |
| 413 |
SaveSucceeded: Boolean; |
407 |
SaveSucceeded: Boolean; |
@@ -1069,7 +1063,7 @@ begin |
| 1069 |
end; |
1063 |
end; |
| 1070 |
|
1064 |
|
| 1071 |
itNoise: begin |
1065 |
itNoise: begin |
| 1072 |
ShiftClockTrackbar.Position := CI^.ShiftClockFreq; |
1066 |
{ShiftClockTrackbar.Position := CI^.ShiftClockFreq; |
| 1073 |
DivRatioTrackbar.Position := CI^.DividingRatio; |
1067 |
DivRatioTrackbar.Position := CI^.DividingRatio; |
| 1074 |
SevenBitCounterCheckbox.Checked := CI^.CounterStep = swSeven; |
1068 |
SevenBitCounterCheckbox.Checked := CI^.CounterStep = swSeven; |
| 1075 |
|
1069 |
|
@@ -1078,7 +1072,7 @@ begin |
| 1078 |
Edit3.Text := IntToStr(CI^.NoiseMacro[2]); |
1072 |
Edit3.Text := IntToStr(CI^.NoiseMacro[2]); |
| 1079 |
Edit4.Text := IntToStr(CI^.NoiseMacro[3]); |
1073 |
Edit4.Text := IntToStr(CI^.NoiseMacro[3]); |
| 1080 |
Edit5.Text := IntToStr(CI^.NoiseMacro[4]); |
1074 |
Edit5.Text := IntToStr(CI^.NoiseMacro[4]); |
| 1081 |
Edit6.Text := IntToStr(CI^.NoiseMacro[5]); |
1075 |
Edit6.Text := IntToStr(CI^.NoiseMacro[5]);} |
| 1082 |
end; |
1076 |
end; |
| 1083 |
end; |
1077 |
end; |
| 1084 |
|
1078 |
|
@@ -1202,18 +1196,6 @@ begin |
| 1202 |
LoadInstrument(CurrentInstrumentBank, InstrumentNumberSpinner.Value); |
1196 |
LoadInstrument(CurrentInstrumentBank, InstrumentNumberSpinner.Value); |
| 1203 |
end; |
1197 |
end; |
| 1204 |
|
1198 |
|
| 1205 |
procedure TfrmTracker.RandomizeNoiseButtonClick(Sender: TObject); |
|
|
| 1206 |
begin |
|
|
| 1207 |
ShiftClockTrackbar.Position := 0; |
|
|
| 1208 |
DivRatioTrackbar.Position := Random(Round(DivRatioTrackbar.Max)); |
|
|
| 1209 |
SevenBitCounterCheckbox.Checked := Random <= 0.5; |
|
|
| 1210 |
LengthEnabledCheckbox.Checked := Random <= 0.5; |
|
|
| 1211 |
LengthTrackbar.Position := Random(Round(LengthTrackbar.Max)); |
|
|
| 1212 |
|
|
|
| 1213 |
PreviewInstrument(NotesToFreqs.KeyData[RandomRange(LOWEST_NOTE, HIGHEST_NOTE)], |
|
|
| 1214 |
UnmodInst(CurrentInstrumentBank, InstrumentNumberSpinner.Value)); |
|
|
| 1215 |
end; |
|
|
| 1216 |
|
|
|
| 1217 |
procedure TfrmTracker.FormCreate(Sender: TObject); |
1199 |
procedure TfrmTracker.FormCreate(Sender: TObject); |
| 1218 |
var |
1200 |
var |
| 1219 |
PUI: PtrUint; |
1201 |
PUI: PtrUint; |
@@ -1644,6 +1626,55 @@ begin |
| 1644 |
HexWaveEditEditingDone(nil); |
1626 |
HexWaveEditEditingDone(nil); |
| 1645 |
end; |
1627 |
end; |
| 1646 |
|
1628 |
|
|
|
1629 |
procedure TfrmTracker.NoiseMacroPaintboxMouseDown(Sender: TObject; |
|
|
1630 |
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
|
|
1631 |
begin |
|
|
1632 |
DrawingMacro := True; |
|
|
1633 |
end; |
|
|
1634 |
|
|
|
1635 |
procedure TfrmTracker.NoiseMacroPaintboxMouseMove(Sender: TObject; |
|
|
1636 |
Shift: TShiftState; X, Y: Integer); |
|
|
1637 |
var |
|
|
1638 |
MacroIdx, Val: Integer; |
|
|
1639 |
begin |
|
|
1640 |
if DrawingMacro then begin |
|
|
1641 |
MacroIdx := EnsureRange(Trunc((X/NoiseMacroPaintbox.Width) * 6), 0, 5); |
|
|
1642 |
Val := EnsureRange(Floor((Y/NoiseMacroPaintbox.Height) * 63), 0, 63) - 31; |
|
|
1643 |
|
|
|
1644 |
CurrentInstrument^.NoiseMacro[MacroIdx] := Val; |
|
|
1645 |
NoiseMacroPaintbox.Invalidate; |
|
|
1646 |
end; |
|
|
1647 |
end; |
|
|
1648 |
|
|
|
1649 |
procedure TfrmTracker.NoiseMacroPaintboxMouseUp(Sender: TObject; |
|
|
1650 |
Button: TMouseButton; Shift: TShiftState; X, Y: Integer); |
|
|
1651 |
begin |
|
|
1652 |
DrawingMacro := False; |
|
|
1653 |
end; |
|
|
1654 |
|
|
|
1655 |
procedure TfrmTracker.NoiseMacroPaintboxPaint(Sender: TObject); |
|
|
1656 |
var |
|
|
1657 |
BarWidth, BarStep: Double; |
|
|
1658 |
I: Integer; |
|
|
1659 |
begin |
|
|
1660 |
BarWidth := (NoiseMacroPaintbox.Width / 6); // TODO: change this constant? |
|
|
1661 |
BarStep := (NoiseMacroPaintbox.Height / 63); |
|
|
1662 |
with NoiseMacroPaintbox.Canvas do begin |
|
|
1663 |
Brush.Color := clGameboyBlack; |
|
|
1664 |
Clear; |
|
|
1665 |
|
|
|
1666 |
for I := Low(TNoiseMacro) to High(TNoiseMacro) do begin |
|
|
1667 |
Brush.Color := clGameboyMidGreen; |
|
|
1668 |
FillRect( |
|
|
1669 |
Trunc(I*BarWidth), |
|
|
1670 |
NoiseMacroPaintbox.Height div 2, |
|
|
1671 |
Trunc((I+1)*BarWidth), |
|
|
1672 |
Ceil((NoiseMacroPaintbox.Height / 2) + (CurrentInstrument^.NoiseMacro[I] * BarStep)) |
|
|
1673 |
); |
|
|
1674 |
end; |
|
|
1675 |
end; |
|
|
1676 |
end; |
|
|
1677 |
|
| 1647 |
procedure TfrmTracker.PlayCursorActionExecute(Sender: TObject); |
1678 |
procedure TfrmTracker.PlayCursorActionExecute(Sender: TObject); |
| 1648 |
begin |
1679 |
begin |
| 1649 |
if GetPreviewReady then begin |
1680 |
if GetPreviewReady then begin |
@@ -1746,24 +1777,6 @@ begin |
| 1746 |
snd[Section.OriginalIndex+1].ChannelOFF := Section.ImageIndex = 0; |
1777 |
snd[Section.OriginalIndex+1].ChannelOFF := Section.ImageIndex = 0; |
| 1747 |
end; |
1778 |
end; |
| 1748 |
|
1779 |
|
| 1749 |
procedure TfrmTracker.Edit1Change(Sender: TObject); |
|
|
| 1750 |
begin |
|
|
| 1751 |
if Sender = Edit1 then |
|
|
| 1752 |
CurrentInstrument^.NoiseMacro[0] := StrToInt(Edit1.Text) |
|
|
| 1753 |
else if Sender = Edit2 then |
|
|
| 1754 |
CurrentInstrument^.NoiseMacro[1] := StrToInt(Edit2.Text) |
|
|
| 1755 |
else if Sender = Edit3 then |
|
|
| 1756 |
CurrentInstrument^.NoiseMacro[2] := StrToInt(Edit3.Text) |
|
|
| 1757 |
else if Sender = Edit4 then |
|
|
| 1758 |
CurrentInstrument^.NoiseMacro[3] := StrToInt(Edit4.Text) |
|
|
| 1759 |
else if Sender = Edit5 then |
|
|
| 1760 |
CurrentInstrument^.NoiseMacro[4] := StrToInt(Edit5.Text) |
|
|
| 1761 |
else if Sender = Edit6 then |
|
|
| 1762 |
CurrentInstrument^.NoiseMacro[5] := StrToInt(Edit6.Text) |
|
|
| 1763 |
else |
|
|
| 1764 |
ShowMessage('couldnt assign macro value'); |
|
|
| 1765 |
end; |
|
|
| 1766 |
|
|
|
| 1767 |
procedure TfrmTracker.PasteActionExecute(Sender: TObject); |
1780 |
procedure TfrmTracker.PasteActionExecute(Sender: TObject); |
| 1768 |
begin |
1781 |
begin |
| 1769 |
PostMessage(Screen.ActiveControl.Handle, LM_PASTE, 0, 0); |
1782 |
PostMessage(Screen.ActiveControl.Handle, LM_PASTE, 0, 0); |
@@ -1784,11 +1797,6 @@ begin |
| 1784 |
Song.Routines[RoutineNumberSpinner.Value] := RoutineSynedit.Text; |
1797 |
Song.Routines[RoutineNumberSpinner.Value] := RoutineSynedit.Text; |
| 1785 |
end; |
1798 |
end; |
| 1786 |
|
1799 |
|
| 1787 |
procedure TfrmTracker.ShiftClockSpinnerChange(Sender: TObject); |
|
|
| 1788 |
begin |
|
|
| 1789 |
CurrentInstrument^.ShiftClockFreq := Round(ShiftClockTrackbar.Position); |
|
|
| 1790 |
end; |
|
|
| 1791 |
|
|
|
| 1792 |
procedure TfrmTracker.PlayStartActionExecute(Sender: TObject); |
1800 |
procedure TfrmTracker.PlayStartActionExecute(Sender: TObject); |
| 1793 |
begin |
1801 |
begin |
| 1794 |
if GetPreviewReady then begin |
1802 |
if GetPreviewReady then begin |
@@ -1808,11 +1816,6 @@ begin |
| 1808 |
HaltPlayback; |
1816 |
HaltPlayback; |
| 1809 |
end; |
1817 |
end; |
| 1810 |
|
1818 |
|
| 1811 |
procedure TfrmTracker.DivRatioSpinnerChange(Sender: TObject); |
|
|
| 1812 |
begin |
|
|
| 1813 |
CurrentInstrument^.DividingRatio := Round(DivRatioTrackbar.Position); |
|
|
| 1814 |
end; |
|
|
| 1815 |
|
|
|
| 1816 |
procedure TfrmTracker.DutyComboboxChange(Sender: TObject); |
1819 |
procedure TfrmTracker.DutyComboboxChange(Sender: TObject); |
| 1817 |
begin |
1820 |
begin |
| 1818 |
CurrentInstrument^.Duty := DutyComboBox.ItemIndex; |
1821 |
CurrentInstrument^.Duty := DutyComboBox.ItemIndex; |