MP3 PLAYER & PLAYLIST

cs_vbprog Messages postés 21 Date d'inscription samedi 30 novembre 2002 Statut Membre Dernière intervention 21 janvier 2003 - 21 janv. 2003 à 17:54
elmasplus Messages postés 9 Date d'inscription dimanche 1 décembre 2002 Statut Membre Dernière intervention 3 janvier 2011 - 31 août 2012 à 08:48
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/4999-mp3-player-playlist

elmasplus Messages postés 9 Date d'inscription dimanche 1 décembre 2002 Statut Membre Dernière intervention 3 janvier 2011
31 août 2012 à 08:48
Petit erreur de ma part......
Cette c'est la bone !!!
J'ai oublie de changer le valeur dans les volumes de mediaplayer1 et mediaplayer2.
En plus ça marche bien avec une valeur de -1500 pour le debut.
C'est dans le code.

Amicalement,
Lluis Mas
--------------------------

Private Sub Timer2_Timer()
'calcul de la durée du mp3
min2play = Int(MediaPlayer1.Duration / 60)
sec = Int(min2play * 60)
sec2play = Int(MediaPlayer1.Duration - sec)
Shape2.FillStyle = 1
Shape1.FillStyle = 0
If sec2play < 10 Then
sec2play = "0" & sec2play
End If
'calcul pour le compte a rebour du mp3

minrest = Int((MediaPlayer1.Duration - MediaPlayer1.CurrentPosition) / 60)
secr = Int(minrest * 60)
secrest = Int((MediaPlayer1.Duration - MediaPlayer1.CurrentPosition)) - secr

If secrest < 10 Then
secrest = "0" & secrest
End If
Label9 = MediaPlayer1.FileName
Label3 = "...Lecture"
Label5 = "Durée : " & minrest & "'" & secrest & " / " & min2play & "'" & sec2play

'code pour le mixage player1/player2
If minrest = 0 Then
If secrest = 0 Then
Label9 = ""
Label3 = "En attente ..."
Label5 = ""
Timer2.Enabled = False
End If
If Image4.Visible = True Then
If secrest + 0 = Text3.Text Then
List2.Enabled = True
If List2.ListCount <> 0 Then
List2.ListIndex = List2.ListIndex + 1
MediaPlayer2.FileName = List2.Text
'
DoEvents
xvolum = MediaPlayer1.Volume
yvolum = -1500
'Stop
Timer5.Enabled = True
Timer6.Enabled = True
MediaPlayer2.Play
Label4 = "...Lecture"
List3.AddItem List2
DoEvents
Call Sup_element
End If
End If
End If
End If
End Sub

Private Sub Timer3_Timer()

'calcul de la durée du mp3
min2play2 = Int(MediaPlayer2.Duration / 60)
sec2 = Int(min2play2 * 60)
sec2play2 = Int(MediaPlayer2.Duration - sec2)
Shape2.FillStyle = 0
Shape1.FillStyle = 1
If sec2play2 < 10 Then
sec2play2 = "0" & sec2play2
End If

'calcul pour le compte a rebour du mp3
minrest2 = Int((MediaPlayer2.Duration - MediaPlayer2.CurrentPosition) / 60)
secr2 = Int(minrest2 * 60)
secrest2 = Int((MediaPlayer2.Duration - MediaPlayer2.CurrentPosition)) - secr2

If secrest2 < 10 Then
secrest2 = "0" & secrest2
End If

'affichage des resultats du calcul
Label10 = MediaPlayer2.FileName
Label4 = "...Lecture"
Label6 = "Durée : " & minrest2 & "'" & secrest2 & " / " & min2play2 & "'" & sec2play2

'code pour le mixage player1/player2
If minrest2 = 0 Then
If secrest2 = 0 Then
Label10 = ""
Label4 = "En attente ..."
Label6 = ""
Timer3.Enabled = False
End If
If Image4.Visible = True Then
If secrest2 + 0 = Text3.Text Then
List2.Enabled = True
If List2.ListCount <> 0 Then
List2.ListIndex = List2.ListIndex + 1
MediaPlayer1.FileName = List2.Text
'
xvolum = -1500
yvolum = MediaPlayer2.Volume
'Stop
Timer6.Enabled = True
Timer5.Enabled = True
MediaPlayer1.Play
Label3 = "...Lecture"
List3.AddItem List2
Call Sup_element
End If
End If
End If
End If
End Sub
elmasplus Messages postés 9 Date d'inscription dimanche 1 décembre 2002 Statut Membre Dernière intervention 3 janvier 2011
31 août 2012 à 08:11
'calcul pour le compte a rebour du mp3

minrest = Int((MediaPlayer1.Duration - MediaPlayer1.CurrentPosition) / 60)
secr = Int(minrest * 60)
secrest = Int((MediaPlayer1.Duration - MediaPlayer1.CurrentPosition)) - secr

If secrest < 10 Then
secrest = "0" & secrest
End If
Label9 = MediaPlayer1.FileName
Label3 = "...Lecture"
Label5 = "Durée : " & minrest & "'" & secrest & " / " & min2play & "'" & sec2play

'code pour le mixage player1/player2
If minrest = 0 Then
If secrest = 0 Then
Label9 = ""
Label3 = "En attente ..."
Label5 = ""
Timer2.Enabled = False
End If
If Image4.Visible = True Then
If secrest + 0 = Text3.Text Then
List2.Enabled = True
If List2.ListCount <> 0 Then
List2.ListIndex = List2.ListIndex + 1
MediaPlayer2.FileName = List2.Text
'
DoEvents
xvolum = MediaPlayer1.Volume
yvolum = -4000
'Stop
Timer5.Enabled = True
MediaPlayer2.Play
Label4 = "...Lecture"
List3.AddItem List2
DoEvents
Call Sup_element
End If
End If
End If
End If
End Sub

Private Sub Timer3_Timer()

'calcul de la durée du mp3
min2play2 = Int(MediaPlayer2.Duration / 60)
sec2 = Int(min2play2 * 60)
sec2play2 = Int(MediaPlayer2.Duration - sec2)
Shape2.FillStyle = 0
Shape1.FillStyle = 1
If sec2play2 < 10 Then
sec2play2 = "0" & sec2play2
End If

'calcul pour le compte a rebour du mp3
minrest2 = Int((MediaPlayer2.Duration - MediaPlayer2.CurrentPosition) / 60)
secr2 = Int(minrest2 * 60)
secrest2 = Int((MediaPlayer2.Duration - MediaPlayer2.CurrentPosition)) - secr2

If secrest2 < 10 Then
secrest2 = "0" & secrest2
End If

'affichage des resultats du calcul
Label10 = MediaPlayer2.FileName
Label4 = "...Lecture"
Label6 = "Durée : " & minrest2 & "'" & secrest2 & " / " & min2play2 & "'" & sec2play2

'code pour le mixage player1/player2
If minrest2 = 0 Then
If secrest2 = 0 Then
Label10 = ""
Label4 = "En attente ..."
Label6 = ""
Timer3.Enabled = False
End If
If Image4.Visible = True Then
If secrest2 + 0 = Text3.Text Then
List2.Enabled = True
If List2.ListCount <> 0 Then
List2.ListIndex = List2.ListIndex + 1
MediaPlayer1.FileName = List2.Text
'
xvolum = -4000
yvolum = MediaPlayer1.Volume
'Stop
Timer6.Enabled = True
MediaPlayer1.Play
Label3 = "...Lecture"
List3.AddItem List2
Call Sup_element
End If
End If
End If
End If
End Sub

Private Sub Timer5_Timer()
tfinal = tfinal - 1
'For xvolum = 0 To -6000 Step -1000
xvolum = xvolum - ttrans
yvolum = yvolum + ttrans
If yvolum >= 0 Then
yvolum = 0
tfinal = -1
End If
volum1 = Val(xvolum)
volum2 = Val(yvolum)
Label11.Caption = xvolum
MediaPlayer1.Volume = volum1
MediaPlayer2.Volume = volum2

If tfinal <= 0 Then
Timer5.Enabled = False
tfinal = Int(tfosa / ttrans)
End If'If xvolum -6000 Then Timer5.Enabled False

End Sub

Private Sub Timer6_Timer()
tfinal = tfinal - 1
'For xvolum = 0 To -6000 Step -1000
xvolum = xvolum + ttrans
yvolum = yvolum - ttrans
If xvolum >= 0 Then
xvolum = 0
tfinal = -1
End If
If yvolum <= -4000 Then
yvolum = -4000
tfinal = -1
End If
volum1 = Val(xvolum)
volum2 = Val(yvolum)
Label11.Caption = xvolum
MediaPlayer1.Volume = volum1
MediaPlayer2.Volume = volum2

If tfinal <= 0 Then
Timer6.Enabled = False
tfinal = Int(tfosa / ttrans)
End If

End Sub
cs_vbprog Messages postés 21 Date d'inscription samedi 30 novembre 2002 Statut Membre Dernière intervention 21 janvier 2003
21 janv. 2003 à 17:54
Bonjour !
c moi vbprog :-)
ton petit soft est bien fait bravo...
j' aimerait savoir comment tu as fait the play list ?
Merci pour ta reponse et bon courage.
Rejoignez-nous