Skip to content

Commit

Permalink
Merge fixes for Issue #31, #32, #33, #34 into main branch (#35)
Browse files Browse the repository at this point in the history
Fix several small bugs on original VE3NEA code base:
- Fixes #31
- Fixes #32
- Fixes #33
- Fixes #34

Will be merged into FD prototype after this is merged into main.
  • Loading branch information
w7sst authored Sep 29, 2022
2 parents 18e5824 + aa97f5d commit 8a19732
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
4 changes: 3 additions & 1 deletion Contest.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
interface

uses
SysUtils, SndTypes, Station, StnColl, MyStn, Math, Ini,
SysUtils, SndTypes, Station, StnColl, MyStn, Math, Ini, System.Classes,
MovAvg, Mixers, VolumCtl, RndFunc, TypInfo, DxStn, DxOper, Log;

type
Expand Down Expand Up @@ -80,9 +80,11 @@ constructor TContest.Create;
destructor TContest.Destroy;
begin
Me.Free;
FreeAndNil(Stations);
Filt.Free;
Filt2.Free;
Modul.Free;
FreeAndNil(Agc);
inherited;
end;

Expand Down
1 change: 0 additions & 1 deletion Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ procedure TMainForm.FormDestroy(Sender: TObject);
end;



procedure TMainForm.AlSoundOut1BufAvailable(Sender: TObject);
begin
if AlSoundOut1.Enabled then
Expand Down
3 changes: 1 addition & 2 deletions QrmStn.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
interface

uses
SysUtils, Classes, Station, RndFunc, Ini, CallLst, QuickAvg, SndTypes,
Math;
SysUtils, Classes, Station, RndFunc, Ini, CallLst;

type
TQrmStation = class(TStation)
Expand Down
2 changes: 1 addition & 1 deletion QrnStn.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
interface

uses
SysUtils, Classes, Station, RndFunc, Ini, CallLst, QuickAvg, SndTypes,
SysUtils, Classes, Station, RndFunc, Ini, CallLst,
Math;

type
Expand Down
7 changes: 7 additions & 0 deletions Qsb.pas
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ TQsb = class
public
QsbLevel: Single;
constructor Create;
destructor Destroy; override;
procedure ApplyTo(Arr: TSingleArray);
property Bandwidth: Single read FBandwidth write SetBandwidth;
end;
Expand All @@ -37,6 +38,12 @@ constructor TQsb.Create;
Bandwidth := 0.1;
end;

destructor TQsb.Destroy;
begin
FreeAndNil(Filt);
inherited;
end;

function TQsb.NewGain: Single;
begin
with Filt.Filter(RndUniform, RndUniform) do
Expand Down
14 changes: 7 additions & 7 deletions VCL/Mixers.pas
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function TDownMixer.Mix(Data: TSingleArray): TComplexArray;
var
i: integer;
begin
Integer(Result) := 0;
Result := nil;
SetLength(Result, Length(Data));
if Phase > TWO_PI then Phase := Phase - TWO_PI * Trunc(Phase/TWO_PI);

Expand All @@ -110,7 +110,7 @@ function TDownMixer.Mix(Data: TComplexArray): TComplexArray;
i: integer;
Sn, Cs, rr, ii: Single;
begin
Integer(Result) := 0;
Result := nil;
SetLength(Result, Length(Data));
if Phase > TWO_PI then Phase := Phase - TWO_PI*Trunc(Phase/TWO_PI);

Expand Down Expand Up @@ -242,7 +242,7 @@ function TModulator.Modulate(Data: TReImArrays): TSingleArray;
var
i: integer;
begin
Integer(Result) := 0;
Result := nil;
SetLength(Result, Length(Data.Re));
for i:=0 to High(Result) do
begin
Expand All @@ -256,7 +256,7 @@ function TModulator.Modulate(Data: TSingleArray): TSingleArray;
var
i: integer;
begin
Integer(Result) := 0;
Result := nil;
SetLength(Result, Length(Data));
for i:=0 to High(Result) do
begin
Expand All @@ -270,7 +270,7 @@ function TModulator.Modulate(Data: TComplexArray): TSingleArray;
var
i: integer;
begin
Integer(Result) := 0;
Result := nil;
SetLength(Result, Length(Data));
for i:=0 to High(Result) do
begin
Expand All @@ -294,7 +294,7 @@ function TFastDownMixer.Mix(Data: TComplexArray): TComplexArray;
var
i: integer;
begin
Integer(Result) := 0;
Result := nil;
SetLength(Result, Length(Data));

for i:=0 to High(Data) do
Expand Down Expand Up @@ -329,7 +329,7 @@ function TFastDownMixer.Mix(Data: TSingleArray): TComplexArray;
var
i: integer;
begin
Integer(Result) := 0;
Result := nil;
SetLength(Result, Length(Data));

for i:=0 to High(Data) do
Expand Down
1 change: 1 addition & 0 deletions VCL/VolmSldr.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
System.Types,
Math, PermHint;

type
Expand Down

0 comments on commit 8a19732

Please sign in to comment.