procedure TAudioVolume.SetAppVolume(Value: boolean);
begin
if Value = FAppVolume
then
exit;
FAppVolume := Value;
if FAppVolume
then
begin
FGroupBox.Caption := '
Application';
pbAppMeter := TProgressBar.Create(self);
pbAppMeter.Parent := FGroupBox.Parent;
pbAppMeter.Orientation := pbVertical;
pbAppMeter.Max := 100;
pbAppMeter.Min := 0;
pbAppMeter.Smooth := true;
lblAppPeak := TLabel.Create(self);
lblAppPeak.Parent := FGroupBox.Parent;
lblAppPeak.Caption := '
M';
pbAppMeterL := TProgressBar.Create(self);
pbAppMeterL.Parent := FGroupBox.Parent;
pbAppMeterL.Orientation := pbVertical;
pbAppMeterL.Max := 100;
pbAppMeterL.Min := 0;
pbAppMeterL.Smooth := true;
lblAppPeakL := TLabel.Create(self);
lblAppPeakL.Parent := FGroupBox.Parent;
lblAppPeakL.Caption := '
L';
tbAppVolume := TTrackBar.Create(self);
tbAppVolume.Parent := FGroupBox.Parent;
tbAppVolume.Orientation := trVertical;
tbAppVolume.Max := 32;
tbAppVolume.Min := 0;
tbAppVolume.TickStyle := tsAuto;
tbAppVolume.Frequency := 3;
tbAppVolume.Position := 0;
cbAppMute := TCheckbox.Create(self);
cbAppMute.Parent := FGroupBox.Parent;
cbAppMute.Caption := '
Mute';
pbAppMeterR := TProgressBar.Create(self);
pbAppMeterR.Parent := FGroupBox.Parent;
pbAppMeterR.Orientation := pbVertical;
pbAppMeterR.Max := 100;
pbAppMeterR.Min := 0;
pbAppMeterR.Smooth := true;
lblAppPeakR := TLabel.Create(self);
lblAppPeakR.Parent := FGroupBox.Parent;
lblAppPeakR.Caption := '
R';
tbAppVolume.Position := round((1.0 - GetVolume) * tbAppVolume.Max);
tbAppVolume.OnChange := tbAppVolumeChange;
cbAppMute.Checked := IsMuted;
cbAppMute.OnClick := cbAppMuteClick;
PostMessage(
Handle, WM_SIZE, 0, 0);
end;
end;