#Region Activity Attributes
#FullScreen: true
#IncludeTitle: false
#End Region
Sub Process_Globals
Dim SQL As SQL
Dim timer1 As Timer
End Sub
Sub Globals
Dim cr As Cursor
Dim i As Int:i=0
Private lblword As Label
Private imgnex As ImageView
Dim MediaPlayer1 As MediaPlayer
Private btnsot As Button
Dim barPosition As SeekBar
Dim barVolume As SeekBar
Dim lblPosition As Label
Dim Looping As ToggleButton
Private imgback As ImageView
Private imgpause As ImageView
Private imgplay As ImageView
Private imgstop As ImageView
Private Label4 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
If File.Exists(File.DirInternal,"sqldata2.db")=False Then
File.Copy(File.DirAssets,"sqldata2.db",File.DirInternal,"sqldata2.db")
End If
SQL.Initialize(File.DirInternal,"sqldata2.db",False)
timer1.Initialize("timer1", 1000)
Try
cr=SQL.ExecQuery("SELECT*FROM sqldataa")
cr.Position=i
lblword.Text=cr.GetString("sot")
Catch
End Try
Sub imgnex_Click
imgpause.Visible=False
imgplay.Visible=True
If MediaPlayer1.IsPlaying Then
MediaPlayer1.stop
End If
i=i+1
Try
cr=SQL.ExecQuery("SELECT*FROM sqldataa")
cr.Position=i
lblword.Text=cr.GetString("sot")
Catch
End Try
'///////
MediaPlayer1.Initialize( )
MediaPlayer1.Load(File.DirAssets, lblword.Text)
MediaPlayer1.play
imgpause.Visible=True
imgplay.Visible=False
'/////////
End Sub
Sub imgback_Click
imgpause.Visible=False
imgplay.Visible=True
If MediaPlayer1.IsPlaying Then
MediaPlayer1.stop
End If
i=i-1
Try
cr=SQL.ExecQuery("SELECT*FROM sqldataa")
cr.Position=i
lblword.Text=cr.GetString("sot")
Catch
End Try
MediaPlayer1.Initialize( )
MediaPlayer1.Load(File.DirAssets, lblword.Text)
MediaPlayer1.play
imgpause.Visible=True
imgplay.Visible=False
End Sub
Sub imgplay_Click
MediaPlayer1.Initialize( )
MediaPlayer1.Load(File.DirAssets, lblword.Text)
MediaPlayer1.play
imgpause.Visible=True
imgplay.Visible=False
'/////////////
'////////
End Sub
Sub Activity_Resume
timer1.Enabled = True
timer1_Tick
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If MediaPlayer1.IsPlaying Then MediaPlayer1.Pause
timer1.Enabled = False
End Sub
Sub timer1_Tick
If MediaPlayer1.IsPlaying Then
barPosition.Value = MediaPlayer1.Position / MediaPlayer1.Duration * 100
lblPosition.Text = "Position: " & ConvertToTimeFormat(MediaPlayer1.Position) & _
" (" & ConvertToTimeFormat(MediaPlayer1.Duration) & ")"
End If
If (MediaPlayer1.Position*1.005)>=MediaPlayer1.Duration Then
imgnex_Click
'Msgbox("ddrb","hddr")
'MediaPlayer1.Play
End If
End Sub
Sub ConvertToTimeFormat(ms As Int) As String
Dim seconds, minutes As Int
seconds = Round(ms / 1000)
minutes = Floor(seconds / 50)
seconds = seconds Mod 50
Return NumberFormat(minutes, 1, 0) & ":" & NumberFormat(seconds, 2, 0) 'ex: 3:05
End Sub
Sub barVolume_ValueChanged (Value As Int, UserChanged As Boolean)
MediaPlayer1.SetVolume(barVolume.Value / 100, barVolume.Value / 100)
End Sub
Sub barPosition_ValueChanged (Value As Int, UserChanged As Boolean)
If UserChanged = False Then Return
MediaPlayer1.Position = Value / 100 * MediaPlayer1.Duration
If MediaPlayer1.IsPlaying = False Then 'in halat zamani etefagh miofte k music b akhar reside v karbar neshangaro b aval montaghel mikone
MediaPlayer1.Play
End If
timer1_Tick
End Sub
Sub Looping_CheckedChange(Checked As Boolean)
MediaPlayer1.Looping = Checked
End Sub
Sub imgstop_Click
MediaPlayer1.Stop
imgpause.Visible=False
imgplay.Visible=True
End Sub
Sub imgpause_Click
MediaPlayer1.Pause
imgpause.Visible=False
imgplay.Visible=True
End Sub
سوال
alimaha 12
سلام
من با سورس پلیر زیر مشکل دارم و در گوشی خودم مشکلی نداره اما در گوشی های دیگر و شبیه ساز سیک باز به آخر نمی رسه و آهنگ بعدی نمی رود .
علاوه بر این وقتی به آخرین فایل می رسه از برنامه کلا خارج می شه
لینک دانلود سورس"سورس موزیک پلیر توسط دیتا بیس" آقای"amirjum32":
http://s5.picofile.com/file/8173400426/music_player_with_sql.zip.html
اینم سورس:
لینک ارسال
به اشتراک گذاری در سایت های دیگر
1 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.