Skip to content

Commit 77aa28f

Browse files
committed
kabcorp last typed thing
1 parent 8a77225 commit 77aa28f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/trackergrid.pas

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ TTrackerGrid = class(TCustomControl)
112112
Performed: TUndoDeque;
113113
Recall: TRedoStack;
114114

115+
LastFxParam: array [0..15] of Byte;
116+
115117
FHighlightedRow: Integer;
116118
FFontSize: Integer;
117119
procedure SetFontSize(AValue: Integer);
@@ -327,6 +329,8 @@ constructor TTrackerGrid.Create(
327329
PatternMap: TPatternMap;
328330
NumColumns: Integer;
329331
NumRows: Integer);
332+
var
333+
I: Integer;
330334
begin
331335
inherited Create(AOwner);
332336

@@ -348,6 +352,9 @@ constructor TTrackerGrid.Create(
348352
Performed := TUndoDeque.Create;
349353
Recall := TRedoStack.Create;
350354

355+
for I := Low(LastFxParam) to High(LastFxParam) do
356+
LastFxParam[I] := Byte(0);
357+
351358
DoubleBuffered := True;
352359
ControlStyle := ControlStyle + [csCaptureMouse, csClickEvents, csDoubleClicks];
353360
Self.Parent := Parent;
@@ -1081,7 +1088,11 @@ procedure TTrackerGrid.InputEffectCode(Key: Word);
10811088
EffectCode := 0;
10821089
EffectParams.Value := 0;
10831090
end
1084-
else KeycodeToHexNumber(Key, EffectCode);
1091+
else begin
1092+
KeycodeToHexNumber(Key, EffectCode);
1093+
if EffectParams.Value = 0 then
1094+
EffectParams.Value := LastFxParam[EffectCode];
1095+
end;
10851096

10861097
Invalidate;
10871098
EndUndoAction;
@@ -1097,8 +1108,10 @@ procedure TTrackerGrid.InputEffectParams(Key: Word);
10971108
EffectCode := 0;
10981109
EffectParams.Value := 0;
10991110
end
1100-
else if KeycodeToHexNumber(Key, Temp) then
1111+
else if KeycodeToHexNumber(Key, Temp) then begin
11011112
EffectParams.Value := ((EffectParams.Value mod $10) * $10) + Temp;
1113+
LastFxParam[EffectCode] := EffectParams.Value;
1114+
end;
11021115

11031116
Invalidate;
11041117
EndUndoAction;

0 commit comments

Comments
 (0)