Bonjour ,
En postant il y a quelque secondes sur le fofo pour savoir comment faire une pause avec le plugin VLC ( le 2 ) ,
j'ai trouvé ce code où tout est dedans .
Pour le moment , je le met telquel ( manque de temps ) car des personnes l'utilise donc .....
Je ferais une analyse et test demain sut toute les fonctions .
Le code vb ( ou vb.net je ne sais pas les dissociés ) est :
Notez que ce code ne peut PAS être utilsé telquel dans SZ .
Ce code contient toutes les commandes indispensables pour réaliser un lecteur !
Pause , suivent , précédent et bien d'autre . Mon lecteur progresse super bien !
Cordialement ,
Le réparateur de PC
En postant il y a quelque secondes sur le fofo pour savoir comment faire une pause avec le plugin VLC ( le 2 ) ,
j'ai trouvé ce code où tout est dedans .
Pour le moment , je le met telquel ( manque de temps ) car des personnes l'utilise donc .....
Je ferais une analyse et test demain sut toute les fonctions .
Le code vb ( ou vb.net je ne sais pas les dissociés ) est :
- Code:
Public Class Form1
Dim clock As Boolean
Dim xpsf As String
Dim pause As Integer
Dim check As Integer
Dim song As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Start()
Timer2.Start()
check = 0
End Sub
Private Sub AxVLCPlugin21_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxVLCPlugin21.Enter
If My.Computer.FileSystem.FileExists(My.Computer.FileSystem.CurrentDirectory + "\Song.mp3") Then
AxVLCPlugin21.playlist.add(My.Computer.FileSystem.CurrentDirectory + "\Song.mp3", "title", "creator")
AxVLCPlugin21.playlist.play()
pause = 1
song = 1
Else
Button3.Text = "Play"
song = 0
pause = 0
TrackBar1.Enabled = False
End If
End Sub
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
For Each track As String In OpenFileDialog1.FileNames
If track.EndsWith(".xpsf") Then
AxVLCPlugin21.playlist.playItem(1)
Else
If song = 0 Then
AxVLCPlugin21.playlist.add(track, "title")
AxVLCPlugin21.playlist.play()
pause = 1
song = 1
Else
AxVLCPlugin21.playlist.add(track, "title")
End If
End If
Next
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If song = AxVLCPlugin21.playlist.items.count Then
MsgBox("No more songs in the Database. Please use the Import button.", MsgBoxStyle.DefaultButton1, "No More Songs!")
Else
song = song + 1
AxVLCPlugin21.playlist.stop()
AxVLCPlugin21.playlist.next()
pause = 1
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
OpenFileDialog1.Filter = "Music Files|*.mp3;*.mid;*.occ;*.mp4;*.avi;*.mpeg;*.flv;*.wmv|XPSF|*.xpsf|All Files|*.mp3;*.mid;*.occ;*.mp4;*.avi;*.mpeg;*.xpsf"
OpenFileDialog1.ShowDialog()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If song = 1 Then
'blah
Else
If song > 0 Then
song = song - 1
AxVLCPlugin21.playlist.stop()
AxVLCPlugin21.playlist.prev()
pause = 1
End If
End If
End Sub
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If song > 0 Then
If AxVLCPlugin21.playlist.isPlaying Then
AxVLCPlugin21.playlist.togglePause()
pause = 0
check = 0
Else
If pause = 0 And TrackBar1.Value < 98 And song > 0 Then
TrackBar1.Enabled = True
AxVLCPlugin21.playlist.play()
Button3.Text = "Pause"
pause = 1
check = 0
Else
If song = AxVLCPlugin21.playlist.items.count Then
MsgBox("No more songs in the Database. Please use the Import button.", MsgBoxStyle.DefaultButton1, "No More Songs!")
Else
TrackBar1.Enabled = True
AxVLCPlugin21.playlist.stop()
AxVLCPlugin21.playlist.next()
Button3.Text = "Pause"
pause = 1
check = 0
End If
End If
End If
End If
End Sub
Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll
'AxVLCPlugin21.input.Time = TrackBar1.TickFrequency)
Timer1.Interval = 200
check = 1
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If pause = 1 And song > 0 Then
If AxVLCPlugin21.input.Time > 10 And check = 0 And AxVLCPlugin21.playlist.isPlaying Then
TrackBar1.Value = ((AxVLCPlugin21.input.Time * 100) / AxVLCPlugin21.input.Length)
Timer1.Interval = 100
Else
If TrackBar1.Value > 5 And TrackBar1.Value < 95 And AxVLCPlugin21.playlist.isPlaying And check = 1 Then
AxVLCPlugin21.input.Time = ((TrackBar1.Value * AxVLCPlugin21.input.Length) / 100)
check = 0
Else
If TrackBar1.Value < 11 And check = 1 Then
AxVLCPlugin21.input.Time = 50
check = 0
End If
If TrackBar1.Value > 94 And check = 1 Then
check = 0
End If
End If
End If
End If
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
MsgBox(AxVLCPlugin21.input.Time)
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
If song > 0 Then
If AxVLCPlugin21.playlist.isPlaying Then
pause = 1
Button3.Text = "Pause"
Timer2.Interval = 100
TrackBar1.Enabled = True
Else
pause = 0
Button3.Text = "Play"
Timer2.Interval = 100
TrackBar1.Enabled = False
End If
End If
End Sub
Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.Scroll
AxVLCPlugin21.Volume = TrackBar2.Value
If TrackBar2.Value > 0 Then
If AxVLCPlugin21.Volume = 98 Then
AxVLCPlugin21.Volume = 100
TrackBar2.Value = 100
Label1.Text = Str(TrackBar2.Value) + "%"
Else
Label1.Text = Str(TrackBar2.Value) + "%"
End If
Else
Label1.Text = "Mute"
End If
End Sub
End Class
Notez que ce code ne peut PAS être utilsé telquel dans SZ .
Ce code contient toutes les commandes indispensables pour réaliser un lecteur !
Pause , suivent , précédent et bien d'autre . Mon lecteur progresse super bien !
Cordialement ,
Le réparateur de PC