This repository was archived by the owner on Jan 19, 2022. It is now read-only.
forked from z00m128/vortextracker25
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExportWavOpts.pas
More file actions
123 lines (100 loc) · 2.41 KB
/
Copy pathExportWavOpts.pas
File metadata and controls
123 lines (100 loc) · 2.41 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
unit ExportWavOpts;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls, AY;
type
TExportOptions = class(TForm)
Chip: TRadioGroup;
SampleRate: TRadioGroup;
GroupBox1: TGroupBox;
ExportNumLoops: TLabel;
LoopRepeats: TUpDown;
LpRepeat: TEdit;
Label1: TLabel;
Button1: TButton;
Button2: TButton;
BitRate: TRadioGroup;
Channels: TRadioGroup;
ExportSelected: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function GetSampleRate: Integer;
function GetBitRate: Integer;
function GetNumChannels: Integer;
function GetChip: ChTypes;
function GetRepeats: Integer;
end;
var
ExportOptions: TExportOptions;
implementation
uses main;
{$R *.dfm}
procedure TExportOptions.FormCreate(Sender: TObject);
begin
SampleRate.ItemIndex := ExportSampleRate;
BitRate.ItemIndex := ExportBitRate;
Channels.ItemIndex := ExportChannels;
Chip.ItemIndex := ExportChip;
LoopRepeats.Position := ExportRepeats;
end;
function TExportOptions.GetSampleRate: Integer;
begin
Result := 44100;
case ExportSampleRate of
0: Result := 22050;
1: Result := 44100;
2: Result := 48000;
3: Result := 88200;
4: Result := 96000;
5: Result := 192000;
end;
end;
function TExportOptions.GetBitRate: Integer;
begin
Result := 16;
case ExportBitRate of
0: Result := 16;
1: Result := 24;
2: Result := 32;
end;
end;
function TExportOptions.GetNumChannels: Integer;
begin
Result := 2;
case ExportChannels of
0: Result := 1;
1: Result := 2;
end;
end;
function TExportOptions.GetChip: ChTypes;
begin
Result := YM_Chip;
case ExportChip of
0: Result := AY_Chip;
1: Result := YM_Chip;
end;
end;
function TExportOptions.GetRepeats: Integer;
begin
Result := ExportRepeats;
end;
procedure TExportOptions.Button1Click(Sender: TObject);
begin
ExportSampleRate := SampleRate.ItemIndex;
ExportBitRate := BitRate.ItemIndex;
ExportChannels := Channels.ItemIndex;
ExportChip := Chip.ItemIndex;
ExportRepeats := LoopRepeats.Position;
ModalResult := mrOk;
end;
procedure TExportOptions.Button2Click(Sender: TObject);
begin
ModalResult := mrCancel;
end;
end.