-
Notifications
You must be signed in to change notification settings - Fork 1
/
frmSwapChannelsDlg.pas
90 lines (74 loc) · 3.36 KB
/
frmSwapChannelsDlg.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
unit frmSwapChannelsDlg;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TSwapChannelsDlg = class(TForm)
Label1: TLabel;
txtPatternNum: TEdit;
udnPatternNum: TUpDown;
cmdOK: TButton;
cmdCancel: TButton;
procedure cmdOKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
SwapChannelsDlg: TSwapChannelsDlg;
implementation
uses frmSTMainWnd;
{$R *.dfm}
procedure TSwapChannelsDlg.cmdOKClick(Sender: TObject);
var
i: integer;
cSwap, cSwapSus: byte;
iSwapSVG: integer;
begin
STMainWnd.UndoPattern := STMainWnd.Song.Pattern[udnPatternNum.Position];
STMainWnd.UndoSvgPattern := STMainWnd.Song.SvgPatternData[udnPatternNum.Position];
for i := 1 to STMainWnd.Song.Pattern[udnPatternNum.Position].Length do
begin
cSwap := STMainWnd.Song.Pattern[udnPatternNum.Position].Chan[1][i];
cSwapSus := STMainWnd.Song.Pattern[udnPatternNum.Position].Sustain[1][i];
STMainWnd.Song.Pattern[udnPatternNum.Position].Chan[1][i] :=
STMainWnd.Song.Pattern[udnPatternNum.Position].Chan[2][i];
STMainWnd.Song.Pattern[udnPatternNum.Position].Chan[2][i] := cSwap;
// SVG Glis
iSwapSVG := STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Glissando[1][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Glissando[1][i] :=
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Glissando[2][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Glissando[2][i] := iSwapSVG;
// SVG Skew
iSwapSVG := STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Skew[1][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Skew[1][i] :=
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Skew[2][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Skew[2][i] := iSwapSVG;
// SVG SkewXOR
iSwapSVG := STMainWnd.Song.SvgPatternData[udnPatternNum.Position].SkewXOR[1][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].SkewXOR[1][i] :=
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].SkewXOR[2][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].SkewXOR[2][i] := iSwapSVG;
// SVG Arp
iSwapSVG := STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Arpeggio[1][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Arpeggio[1][i] :=
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Arpeggio[2][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Arpeggio[2][i] := iSwapSVG;
// SVG FX
iSwapSVG := STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Warp[1][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Warp[1][i] :=
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Warp[2][i];
STMainWnd.Song.SvgPatternData[udnPatternNum.Position].Warp[2][i] := iSwapSVG;
if (STMainWnd.Song.PreferredEngine <> 'P1S') and
(STMainWnd.Song.PreferredEngine <> 'P1D') then
begin
STMainWnd.Song.Pattern[udnPatternNum.Position].Sustain[1][i] :=
STMainWnd.Song.Pattern[udnPatternNum.Position].Sustain[2][i];
STMainWnd.Song.Pattern[udnPatternNum.Position].Sustain[2][i] := cSwapSus;
end;
end;
Self.ModalResult := mrOK;
end;
end.