@@ -60,8 +60,8 @@ type |
| 60 |
procedure KeyUp(var Key: Word; Shift: TShiftState); override; |
60 |
procedure KeyUp(var Key: Word; Shift: TShiftState); override; |
| 61 |
private |
61 |
private |
| 62 |
function GetSelection: TSelection; |
62 |
function GetSelection: TSelection; |
| 63 |
procedure PerformPaste(Paste: TSelection); overload; |
63 |
procedure PerformPaste(Paste: TSelection; Mix: Boolean = False); overload; |
| 64 |
procedure PerformPaste(Paste: TSelection; Where: TSelectionPos); overload; |
64 |
procedure PerformPaste(Paste: TSelection; Where: TSelectionPos; Mix: Boolean = False); overload; |
| 65 |
procedure PerformCopy; |
65 |
procedure PerformCopy; |
| 66 |
procedure DoPaste(var Msg: TLMessage); message LM_PASTE; |
66 |
procedure DoPaste(var Msg: TLMessage); message LM_PASTE; |
| 67 |
procedure DoCopy(var Msg: TLMessage); message LM_COPY; |
67 |
procedure DoCopy(var Msg: TLMessage); message LM_COPY; |
@@ -147,6 +147,7 @@ type |
| 147 |
procedure DoUndo; |
147 |
procedure DoUndo; |
| 148 |
procedure DoRedo; |
148 |
procedure DoRedo; |
| 149 |
procedure DoRepeatPaste; |
149 |
procedure DoRepeatPaste; |
|
|
150 |
procedure DoMixPaste; |
| 150 |
procedure TransposeSelection(Semitones: Integer); |
151 |
procedure TransposeSelection(Semitones: Integer); |
| 151 |
procedure IncrementSelection(Note, Instrument, Volume, EffectCode, EffectParam: Integer); |
152 |
procedure IncrementSelection(Note, Instrument, Volume, EffectCode, EffectParam: Integer); |
| 152 |
procedure InterpolateSelection; |
153 |
procedure InterpolateSelection; |
@@ -513,15 +514,25 @@ begin |
| 513 |
end; |
514 |
end; |
| 514 |
end; |
515 |
end; |
| 515 |
|
516 |
|
| 516 |
procedure TTrackerGrid.PerformPaste(Paste: TSelection; Where: TSelectionPos); |
517 |
procedure TTrackerGrid.PerformPaste(Paste: TSelection; Where: TSelectionPos; Mix: Boolean = False); |
| 517 |
procedure OverlayCell(var Cell1: TCell; const Cell2: TSelectedCell); |
518 |
procedure OverlayCell(var Cell1: TCell; const Cell2: TSelectedCell); |
| 518 |
begin |
519 |
begin |
| 519 |
if cpNote in Cell2.Parts then Cell1.Note := Cell2.Cell.Note; |
520 |
if cpNote in Cell2.Parts then |
| 520 |
if cpInstrument in Cell2.Parts then Cell1.Instrument := Cell2.Cell.Instrument; |
521 |
if (not Mix) or (Mix and (Cell2.Cell.Note <> NO_NOTE)) then |
| 521 |
if cpEffectCode in Cell2.Parts then Cell1.EffectCode:=Cell2.Cell.EffectCode; |
522 |
Cell1.Note := Cell2.Cell.Note; |
| 522 |
if cpEffectParams in Cell2.Parts then |
523 |
|
| 523 |
Cell1.EffectParams.Value := Cell2.Cell.EffectParams.Value; |
524 |
if cpInstrument in Cell2.Parts then |
| 524 |
end; |
525 |
if (not Mix) or (Mix and (Cell2.Cell.Instrument <> 0)) then |
|
|
526 |
Cell1.Instrument := Cell2.Cell.Instrument; |
|
|
527 |
|
|
|
528 |
if cpEffectCode in Cell2.Parts then |
|
|
529 |
if (not Mix) or (Mix and (Cell2.Cell.EffectCode <> 0)) then |
|
|
530 |
Cell1.EffectCode := Cell2.Cell.EffectCode; |
|
|
531 |
|
|
|
532 |
if cpEffectParams in Cell2.Parts then |
|
|
533 |
if (not Mix) or (Mix and (Cell2.Cell.EffectParams.Value <> 0)) then |
|
|
534 |
Cell1.EffectParams.Value := Cell2.Cell.EffectParams.Value; |
|
|
535 |
end; |
| 525 |
var |
536 |
var |
| 526 |
X, Y: Integer; |
537 |
X, Y: Integer; |
| 527 |
begin |
538 |
begin |
@@ -544,9 +555,9 @@ begin |
| 544 |
end; |
555 |
end; |
| 545 |
end; |
556 |
end; |
| 546 |
|
557 |
|
| 547 |
procedure TTrackerGrid.PerformPaste(Paste: TSelection); |
558 |
procedure TTrackerGrid.PerformPaste(Paste: TSelection; Mix: Boolean = False); |
| 548 |
begin |
559 |
begin |
| 549 |
PerformPaste(Paste, Cursor); |
560 |
PerformPaste(Paste, Cursor, Mix); |
| 550 |
end; |
561 |
end; |
| 551 |
|
562 |
|
| 552 |
procedure TTrackerGrid.PerformCopy; |
563 |
procedure TTrackerGrid.PerformCopy; |
@@ -581,6 +592,24 @@ begin |
| 581 |
EndUndoAction; |
592 |
EndUndoAction; |
| 582 |
end; |
593 |
end; |
| 583 |
|
594 |
|
|
|
595 |
procedure TTrackerGrid.DoMixPaste; |
|
|
596 |
begin |
|
|
597 |
BeginUndoAction; |
|
|
598 |
|
|
|
599 |
try |
|
|
600 |
PerformPaste(GetPastedCells, True); |
|
|
601 |
except |
|
|
602 |
on E: EClipboardFormatException do begin |
|
|
603 |
WriteLn(StdErr, '[WARNING] ', E.Message); |
|
|
604 |
RevertUndoAction; |
|
|
605 |
Exit |
|
|
606 |
end; |
|
|
607 |
end; |
|
|
608 |
|
|
|
609 |
Invalidate; |
|
|
610 |
EndUndoAction; |
|
|
611 |
end; |
|
|
612 |
|
| 584 |
procedure TTrackerGrid.DoPaste(var Msg: TLMessage); |
613 |
procedure TTrackerGrid.DoPaste(var Msg: TLMessage); |
| 585 |
begin |
614 |
begin |
| 586 |
BeginUndoAction; |
615 |
BeginUndoAction; |