提交 bceda0a0 编写于 作者: 若苗瞬's avatar 若苗瞬 😶

select song will be like select name list, via a dialog, instead of a fixed filename.

上级 38af514d
此差异已折叠。
...@@ -54,6 +54,7 @@ type ...@@ -54,6 +54,7 @@ type
procedure LoadListPermissionRequestResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray); procedure LoadListPermissionRequestResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray);
procedure LoadSongPermissionRequestResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray); procedure LoadSongPermissionRequestResult(Sender: TObject; const APermissions: TClassicStringDynArray; const AGrantResults: TClassicPermissionStatusDynArray);
procedure MyListFile(ASelectedItem: String); procedure MyListFile(ASelectedItem: String);
procedure MySongFile(ASelectedItem: String);
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
...@@ -256,13 +257,13 @@ begin ...@@ -256,13 +257,13 @@ begin
// Edit1.Text:=opd_names.FileName; // Edit1.Text:=opd_names.FileName;
// end; // end;
// LoadList(Edit1.Text); // LoadList(Edit1.Text);
if fmSelect = nil then if fmSelect = nil then
begin begin
Application.CreateForm(TfmSelect, fmSelect); Application.CreateForm(TfmSelect, fmSelect);
fmSelect.Callback := MyListFile; fmSelect.Callback := MyListFile;
end; end;
fmSelect.Show; fmSelect.Show;
fmSelect.CD(ExtractFilePath(Edit1.Text)); fmSelect.CD(ExtractFilePath(Edit1.Text));
end end
else else
TDialogService.ShowMessage('Cannot load list, the required permissions are not granted'); TDialogService.ShowMessage('Cannot load list, the required permissions are not granted');
...@@ -275,16 +276,23 @@ begin ...@@ -275,16 +276,23 @@ begin
(AGrantResults[0] = TPermissionStatus.Granted) and (AGrantResults[0] = TPermissionStatus.Granted) and
(AGrantResults[1] = TPermissionStatus.Granted) then (AGrantResults[1] = TPermissionStatus.Granted) then
begin begin
if opd_music.Execute then // if opd_music.Execute then
begin // begin
musicName:=opd_music.FileName; // musicName:=opd_music.FileName;
end; // end;
if FileExists(musicName) then // if FileExists(musicName) then
begin // begin
MediaPlayer1.Stop; // MediaPlayer1.Stop;
MediaPlayer1.FileName:=musicName; // MediaPlayer1.FileName:=musicName;
MediaPlayer1.Play; // MediaPlayer1.Play;
end; // end;
if fmSelect2 = nil then
begin
Application.CreateForm(TfmSelect, fmSelect2);
fmSelect2.Callback := MySongFile;
end;
fmSelect2.Show;
fmSelect2.CD(ExtractFilePath(musicName));
end end
else else
TDialogService.ShowMessage('Cannot load song, the required permissions are not granted'); TDialogService.ShowMessage('Cannot load song, the required permissions are not granted');
...@@ -296,4 +304,11 @@ begin ...@@ -296,4 +304,11 @@ begin
// //
end; end;
procedure TForm5.MySongFile(ASelectedItem: String);
begin
MediaPlayer1.Stop;
MediaPlayer1.FileName:=ASelectedItem;
MediaPlayer1.Play;
end;
end. end.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<MainSource>pro_Lottery.dpr</MainSource> <MainSource>pro_Lottery.dpr</MainSource>
<Base>True</Base> <Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config> <Config Condition="'$(Config)'==''">Release</Config>
<Platform Condition="'$(Platform)'==''">Android64</Platform> <Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>32769</TargetedPlatforms> <TargetedPlatforms>32769</TargetedPlatforms>
<AppType>Application</AppType> <AppType>Application</AppType>
</PropertyGroup> </PropertyGroup>
...@@ -217,9 +217,9 @@ ...@@ -217,9 +217,9 @@
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<Icon_MainIcon>res\ICON\cia.ico</Icon_MainIcon> <Icon_MainIcon>res\ICON\cia.ico</Icon_MainIcon>
<VerInfo_Release>8</VerInfo_Release> <VerInfo_Release>8</VerInfo_Release>
<VerInfo_Build>39</VerInfo_Build> <VerInfo_Build>40</VerInfo_Build>
<VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion> <VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
<VerInfo_Keys>CompanyName=奥诚科技;FileDescription=奥诚科技新春年会大抽奖;FileVersion=1.0.8.39;InternalName=ac_lattery.exe;LegalCopyright=AC;LegalTrademarks=AC;OriginalFilename=pro_lattery.exe;ProgramID=com.ac.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0;Comments=</VerInfo_Keys> <VerInfo_Keys>CompanyName=奥诚科技;FileDescription=奥诚科技新春年会大抽奖;FileVersion=1.0.8.40;InternalName=ac_lattery.exe;LegalCopyright=AC;LegalTrademarks=AC;OriginalFilename=pro_lattery.exe;ProgramID=com.ac.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0;Comments=</VerInfo_Keys>
<Icns_MainIcns>res\ICON\cia_48.icns</Icns_MainIcns> <Icns_MainIcns>res\ICON\cia_48.icns</Icns_MainIcns>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''"> <PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
...@@ -1390,6 +1390,7 @@ ...@@ -1390,6 +1390,7 @@
<Platforms> <Platforms>
<Platform value="Android">False</Platform> <Platform value="Android">False</Platform>
<Platform value="Android64">True</Platform> <Platform value="Android64">True</Platform>
<Platform value="Linux64">False</Platform>
<Platform value="Win32">True</Platform> <Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform> <Platform value="Win64">False</Platform>
</Platforms> </Platforms>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<BorlandProject> <BorlandProject>
<Transactions> <Transactions>
<Transaction>1899-12-30 00:00:00.000.173,=C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Lottery\Unit1.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.274,=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas</Transaction> <Transaction>1899-12-30 00:00:00.000.274,=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.748,=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas</Transaction> <Transaction>1899-12-30 00:00:00.000.748,=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.964,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas</Transaction> <Transaction>1899-12-30 00:00:00.000.964,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.168,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas</Transaction> <Transaction>1899-12-30 00:00:00.000.168,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.173,=C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Lottery\Unit1.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.060,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect_Sample.pas</Transaction> <Transaction>1899-12-30 00:00:00.000.060,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.pas=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect_Sample.pas</Transaction>
<Transaction>1899-12-30 00:00:00.000.168,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.fmx=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.fmx</Transaction> <Transaction>1899-12-30 00:00:00.000.168,D:\WorksProNew\Personal\RAD_XE10\ac_lottery\Unit2.fmx=D:\WorksProNew\Personal\RAD_XE10\ac_lottery\ufmSelect.fmx</Transaction>
<Transaction>1899-12-30 00:00:00.000.111,C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Lottery\pro_Lottery.dproj=C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Project1.dproj</Transaction> <Transaction>1899-12-30 00:00:00.000.111,C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Lottery\pro_Lottery.dproj=C:\Users\Shion\Documents\Embarcadero\Studio\Projects\Project1.dproj</Transaction>
......
无法预览此类型文件
...@@ -35,6 +35,7 @@ type ...@@ -35,6 +35,7 @@ type
var var
fmSelect: TfmSelect; fmSelect: TfmSelect;
fmSelect2: TfmSelect;
implementation implementation
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册