forked from jr8ppg/MorseRunner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
QrnStn.pas
46 lines (35 loc) · 1.12 KB
/
QrnStn.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
//------------------------------------------------------------------------------
//This Source Code Form is subject to the terms of the Mozilla Public
//License, v. 2.0. If a copy of the MPL was not distributed with this
//file, You can obtain one at http://mozilla.org/MPL/2.0/.
//------------------------------------------------------------------------------
unit QrnStn;
interface
uses
SysUtils, Classes, Station, RndFunc, Ini, CallLst, QuickAvg, SndTypes,
Math;
type
TQrnStation = class(TStation)
public
constructor CreateStation;
procedure ProcessEvent(AEvent: TStationEvent); override;
end;
implementation
constructor TQrnStation.CreateStation;
var
i: integer;
Dur: integer;
begin
inherited Create(nil);
Dur := SecondsToBlocks(Random) * Ini.BufSize;
SetLength(Envelope, Dur);
Amplitude := 1E5*Power(10, 2*Random);
for i:=0 to High(Envelope) do
if Random < 0.01 then Envelope[i] := (Random-0.5) * Amplitude;
State := stSending;
end;
procedure TQrnStation.ProcessEvent(AEvent: TStationEvent);
begin
if AEvent = evMsgSent then Free;
end;
end.