• R/O
  • SSH
  • HTTPS

bad-mp3player: Commit


Commit MetaInfo

Revision4 (tree)
Time2015-08-01 08:39:46
Authoryamat0jp

Log Message

タブレットが文鎮化してしまったのでAndroid開発はこれで終了

誠に悔やまれます

Change Summary

Incremental Difference

--- gtp1000.dpr (revision 3)
+++ gtp1000.dpr (revision 4)
@@ -7,7 +7,6 @@
77 Unit2 in 'Unit2.pas' {Form2},
88 Unit3 in 'Unit3.pas' {Form3},
99 Unit4 in 'Unit4.pas';
10-
1110 {$R *.res}
1211
1312 begin
--- Unit1.pas (revision 3)
+++ Unit1.pas (revision 4)
@@ -46,11 +46,13 @@
4646 procedure Action4Execute(Sender: TObject);
4747 procedure Action6Execute(Sender: TObject);
4848 procedure Action5Execute(Sender: TObject);
49+ procedure TrackBar2Change(Sender: TObject);
4950 private
5051 { private 宣言 }
5152 public
5253 { public 宣言 }
5354 th: TThread;
55+ procedure PlayMusic(Number: integer);
5456 end;
5557
5658 var
@@ -122,14 +124,16 @@
122124 MediaPlayer1.Stop;
123125 Action4.Text := 'Play';
124126 end
125- else
127+ else if ListView1.ItemCount > 0 then
126128 begin
127- if (ListView1.ItemCount > 0) and (ListView1.ItemIndex = -1) then
129+ if ListView1.ItemIndex = -1 then
130+ PlayMusic(0)
131+ else
128132 begin
129- ListView1.ItemIndex := 0;
130- MediaPlayer1.FileName := ListView1.Items[0].Detail;
133+ MediaPlayer1.FileName := ListView1.Items[ListView1.ItemIndex].Detail;
131134 TrackBar2.Max := MediaPlayer1.Duration;
132- TrackBar2.Value := 0;
135+ MediaPlayer1.CurrentTime := Trunc(TrackBar2.Value);
136+ MediaPlayer1.Play;
133137 end;
134138 MediaPlayer1.Play;
135139 Action4.Text := 'Stop';
@@ -138,16 +142,28 @@
138142
139143 procedure TForm1.Action5Execute(Sender: TObject);
140144 begin
141- MediaPlayer1.CurrentTime := MediaPlayer1.CurrentTime -
142- MediaTimeScale div 1000;
143- TrackBar2.Value := MediaPlayer1.CurrentTime;
145+ if MediaPlayer1.CurrentTime < MediaTimeScale div 10000 then
146+ if ListView1.ItemCount > 0 then
147+ PlayMusic(ListView1.ItemIndex - 1)
148+ else
149+ begin
150+ MediaPlayer1.Stop;
151+ MediaPlayer1.CurrentTime := 0;
152+ TrackBar2.Value := 0;
153+ Action4.Text := 'Play';
154+ end;
144155 end;
145156
146157 procedure TForm1.Action6Execute(Sender: TObject);
158+var
159+ i: integer;
147160 begin
148- MediaPlayer1.CurrentTime := MediaPlayer1.CurrentTime +
149- MediaTimeScale div 1000;
150- TrackBar2.Value := MediaPlayer1.CurrentTime;
161+ if ListView1.ItemIndex < ListView1.ItemCount - 1 then
162+ begin
163+ i := ListView1.ItemIndex + 1;
164+ ListView1.ItemIndex := i;
165+ PlayMusic(i);
166+ end;
151167 end;
152168
153169 procedure TForm1.FormDestroy(Sender: TObject);
@@ -185,13 +201,20 @@
185201 Action1Execute(Sender);
186202 Exit;
187203 end;
188- Volume := TrackBar1.Value;
189- TrackBar2.Max := Duration;
190- TrackBar2.Value := 0;
191- Play;
204+ PlayMusic(ListView1.ItemIndex);
192205 end;
193206 end;
194207
208+procedure TForm1.PlayMusic(Number: integer);
209+begin
210+ ListView1.ItemIndex := Number;
211+ MediaPlayer1.FileName := ListView1.Items[Number].Detail;
212+ TrackBar2.Max := MediaPlayer1.Duration;
213+ TrackBar2.Value := 0;
214+ Action4.Text := 'Stop';
215+ MediaPlayer1.Play;
216+end;
217+
195218 procedure TForm1.SpeedButton1Click(Sender: TObject);
196219 begin
197220 Form2.Show;
@@ -210,7 +233,7 @@
210233 begin
211234 Stop;
212235 Clear;
213- FileName := ListView1.Items.Item[ListView1.ItemIndex].Detail;
236+ FileName := ListView1.Items[ListView1.ItemIndex].Detail;
214237 Volume := TrackBar1.Value;
215238 Play;
216239 end;
@@ -225,4 +248,11 @@
225248 MediaPlayer1.Volume := TrackBar1.Value;
226249 end;
227250
251+procedure TForm1.TrackBar2Change(Sender: TObject);
252+begin
253+ if (TrackBar2.Value < MediaPlayer1.CurrentTime) or
254+ (TrackBar2.Value > MediaPlayer1.CurrentTime + MediaTimeScale div 800) then
255+ MediaPlayer1.CurrentTime := Trunc(TrackBar2.Value);
256+end;
257+
228258 end.
--- gtp1000.dproj (revision 3)
+++ gtp1000.dproj (revision 4)
@@ -5,8 +5,8 @@
55 <FrameworkType>FMX</FrameworkType>
66 <MainSource>gtp1000.dpr</MainSource>
77 <Base>True</Base>
8- <Config Condition="'$(Config)'==''">Release</Config>
9- <Platform Condition="'$(Platform)'==''">Android</Platform>
8+ <Config Condition="'$(Config)'==''">Debug</Config>
9+ <Platform Condition="'$(Platform)'==''">Win32</Platform>
1010 <TargetedPlatforms>95</TargetedPlatforms>
1111 <AppType>Application</AppType>
1212 </PropertyGroup>
@@ -248,7 +248,9 @@
248248 <Form>Form3</Form>
249249 <FormType>fmx</FormType>
250250 </DCCReference>
251- <DCCReference Include="Unit4.pas"/>
251+ <DCCReference Include="Unit4.pas">
252+ <Form>$R *.res</Form>
253+ </DCCReference>
252254 <BuildConfiguration Include="Release">
253255 <Key>Cfg_2</Key>
254256 <CfgParent>Base</CfgParent>
@@ -294,9 +296,9 @@
294296 <Overwrite>true</Overwrite>
295297 </Platform>
296298 </DeployFile>
297- <DeployFile LocalName="$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png" Configuration="Release" Class="Android_SplashImage470">
299+ <DeployFile LocalName="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png" Configuration="Release" Class="Android_LauncherIcon72">
298300 <Platform Name="Android">
299- <RemoteName>splash_image.png</RemoteName>
301+ <RemoteName>ic_launcher.png</RemoteName>
300302 <Overwrite>true</Overwrite>
301303 </Platform>
302304 </DeployFile>
@@ -517,9 +519,9 @@
517519 <Overwrite>true</Overwrite>
518520 </Platform>
519521 </DeployFile>
520- <DeployFile LocalName="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png" Configuration="Release" Class="Android_LauncherIcon72">
522+ <DeployFile LocalName="$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png" Configuration="Release" Class="Android_SplashImage470">
521523 <Platform Name="Android">
522- <RemoteName>ic_launcher.png</RemoteName>
524+ <RemoteName>splash_image.png</RemoteName>
523525 <Overwrite>true</Overwrite>
524526 </Platform>
525527 </DeployFile>
@@ -861,7 +863,7 @@
861863 <ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
862864 </Deployment>
863865 <Platforms>
864- <Platform value="Android" ActiveMobileDevice="333495355FDD00EC">True</Platform>
866+ <Platform value="Android" ActiveMobileDevice="AVD_for_Galaxy_Nexus_by_Google">True</Platform>
865867 <Platform value="iOSDevice">True</Platform>
866868 <Platform value="iOSSimulator" ActiveMobileDevice="iPhone">True</Platform>
867869 <Platform value="OSX32">True</Platform>
Show on old repository browser