ttw_fmx_v10/frames/fNotify.pas

89 lines
2.5 KiB
Plaintext

unit fNotify;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes,
System.Variants, uSoundManager,
FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
FMX.Edit, FMX.Controls.Presentation;
type
TfrNotify = class(TFrame)
chEnNotify: TSwitch;
Label43: TLabel;
tbNotifyVolume: TTrackBar;
edtNotifyFileName: TEdit;
btnNotifyOpen: TButton;
btnNotifyCheck: TButton;
cbNotifyFileAgain1: TCheckBox;
btnNotifyCheckMod: TButton;
btnNotifyOpenMod: TButton;
edtNotifyFileNameMod: TEdit;
tbNotifyVolumeMod: TTrackBar;
Label50: TLabel;
chEnNotifyMod: TSwitch;
chEnNotifyVip: TSwitch;
Label51: TLabel;
tbNotifyVolumeVip: TTrackBar;
edtNotifyFileNameVip: TEdit;
btnNotifyOpenVip: TButton;
btnNotifyCheckVip: TButton;
cbNotifyFileAgain2: TCheckBox;
cbNotifyFileAgain3: TCheckBox;
btnNotifyCheckSub: TButton;
btnNotifyOpenSub: TButton;
edtNotifyFileNameSub: TEdit;
tbNotifyVolumeSub: TTrackBar;
Label52: TLabel;
chEnNotifySub: TSwitch;
OpenDialog1: TOpenDialog;
procedure btnNotifyOpenClick(Sender: TObject);
procedure btnNotifyCheckClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
implementation
{$R *.fmx}
procedure TfrNotify.btnNotifyCheckClick(Sender: TObject);
var sm:TSongMachine;
begin
sm:=TSongMachine.Create;
try
if TButton(Sender).Name = 'btnNotifyCheck' then
sm.PlayPublic(edtNotifyFileName.Text, tbNotifyVolume.Value.ToString);
if TButton(Sender).Name = 'btnNotifyCheckMod' then
sm.PlayPublic(edtNotifyFileNameMod.Text, tbNotifyVolumeMod.Value.ToString);
if TButton(Sender).Name = 'btnNotifyCheckVip' then
sm.PlayPublic(edtNotifyFileNameVip.Text, tbNotifyVolumeVip.Value.ToString);
if TButton(Sender).Name = 'btnNotifyCheckSub' then
sm.PlayPublic(edtNotifyFileNameSub.Text, tbNotifyVolumeSub.Value.ToString);
finally
sm.Free;
end;
end;
procedure TfrNotify.btnNotifyOpenClick(Sender: TObject);
begin
if OpenDialog1.Execute then
begin
if TButton(Sender).Name = 'btnNotify' then
edtNotifyFileName.Text := OpenDialog1.FileName;
if TButton(Sender).Name = 'btnNotifyMod' then
edtNotifyFileNameMod.Text := OpenDialog1.FileName;
if TButton(Sender).Name = 'btnNotifyVip' then
edtNotifyFileNameVip.Text := OpenDialog1.FileName;
if TButton(Sender).Name = 'btnNotifySub' then
edtNotifyFileNameSub.Text := OpenDialog1.FileName;
end;
end;
end.