1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
Option Explicit
Private Const SND_APPLICATION = &H80 ' look for application specific association
Private Const SND_ALIAS = &H10000 ' name is a WIN.INI [sounds] entry
Private Const SND_ALIAS_ID = &H110000 ' name is a WIN.INI [sounds] entry identifier
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_FILENAME = &H20000 ' name is a file name
Private Const SND_LOOP = &H8 ' loop the sound until next sndPlaySound
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file
Private Const SND_NODEFAULT = &H2 ' silence not default, if sound not found
Private Const SND_NOSTOP = &H10 ' don't stop any currently playing sound
Private Const SND_NOWAIT = &H2000 ' don't wait if the driver is busy
Private Const SND_PURGE = &H40 ' purge non-static events for task
Private Const SND_RESOURCE = &H40004 ' name is a resource name or atom
Private Const SND_SYNC = &H0 ' play synchronously (default)
Dim D As String
Dim DE As String
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwflags As Long) As Long
Private Sub Form_Load()
DE = Time
Dim dif1 As String
dif1 = DateDiff("s", DE, Time) 'renvoit la difference en seconde
Timer1.Enabled = True
Timer1.Interval = 1
PlaySound App.Path & "\12 Le Turc Généreux.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
D = Time 'prend l'heure
Label3.Caption = 149
Me.Caption = dif1
End Sub
Private Sub Timer1_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 149 Then PlaySound App.Path & "\14 Air pour les Esclaves.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son 152
If diff > 149 Then D = Time 'reactualise l'heure
If diff > 149 Then Timer2.Enabled = True
If diff > 149 Then Timer1.Enabled = False
If diff > 149 Then Label3.Caption = 138
Label1.Caption = "Le Turc Généreux"
Label2.Caption = "Rameau"
End Sub
Private Sub Timer10_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 102 Then PlaySound App.Path & "\10 Chaconne.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
If diff > 102 Then D = Time 'reactualise l'heure
If diff > 102 Then Timer11.Enabled = True
If diff > 102 Then Timer10.Enabled = False
If diff > 102 Then Label3.Caption = 550
Label1.Caption = "air vif"
Label2.Caption = "Francoeur"
End Sub
Private Sub Timer11_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 550 Then PlaySound App.Path & "\12 Le Turc Généreux.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
If diff > 550 Then D = Time 'reactualise l'heure
If diff > 549 Then Timer1.Enabled = True
If diff > 550 Then Timer11.Enabled = False
If diff > 550 Then Label3.Caption = 149
Label1.Caption = "Chaconne"
End Sub
Private Sub Timer2_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 138 Then PlaySound App.Path & "\15 Rigaudon.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
If diff > 138 Then D = Time 'reactualise l'heure
If diff > 138 Then Timer4.Enabled = True
If diff > 138 Then Timer2.Enabled = False
If diff > 138 Then Label3.Caption = 61
Label1.Caption = " Air pour les Esclaves"
End Sub
Private Sub Timer3_Timer()
Dim diff As String
Dim dif1 As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
dif1 = DateDiff("s", DE, Time) 'renvoit la difference en seconde
If dif1 >= Me.Caption Then Label3.Caption = Label3.Caption - 1 'Temps de la chanson qui reste
If dif1 >= Me.Caption Then Me.Caption = dif1 + 1 'séquencage du calcul du temps resant pour éviter le sintillement, ta form à pour titre le temps total de puis qu'il est lancé
Label4.Caption = diff 'temps de puis le début de la chanson
End Sub
Private Sub Timer4_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 61 Then PlaySound App.Path & "\18 Gavotte.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
If diff > 61 Then D = Time 'reactualise l'heure
If diff > 61 Then Timer5.Enabled = True
If diff > 61 Then Timer4.Enabled = False
If diff > 61 Then Label3.Caption = 127
Label1.Caption = "Rigaudon"
End Sub
Private Sub Timer5_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 127 Then PlaySound App.Path & "\19 Rondeau.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
If diff > 127 Then D = Time 'reactualise l'heure
If diff > 127 Then Timer6.Enabled = True
If diff > 127 Then Timer5.Enabled = False
If diff > 127 Then Label3.Caption = 142
Label1.Caption = "gavotte"
End Sub
Private Sub Timer6_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 142 Then PlaySound App.Path & "\Concerto Grosso 1er mvt.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
If diff > 142 Then D = Time 'reactualise l'heure
If diff > 142 Then Timer7.Enabled = True
If diff > 142 Then Timer6.Enabled = False
If diff > 142 Then Label3.Caption = 245
Label1.Caption = "rondeau"
End Sub
Private Sub Timer7_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 245 Then PlaySound App.Path & "\Concerto Grosso 2e mvt.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
If diff > 245 Then D = Time 'reactualise l'heure
If diff > 245 Then Timer8.Enabled = True
If diff > 245 Then Timer7.Enabled = False
If diff > 245 Then Label3.Caption = 198
Label1.Caption = "Concerto Grosso"
Label2.Caption = "Corelli"
End Sub
Private Sub Timer8_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 198 Then PlaySound App.Path & "\Concerto Grosso 3e mvt.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
If diff > 198 Then D = Time 'reactualise l'heure
If diff > 198 Then Timer9.Enabled = True
If diff > 198 Then Timer8.Enabled = False
If diff > 198 Then Label3.Caption = 392
End Sub
Private Sub Timer9_Timer()
Dim diff As String
diff = DateDiff("s", D, Time) 'renvoit la difference en seconde
If diff > 392 Then PlaySound App.Path & "\06 Air Vif.wav", ByVal 0&, SND_FILENAME Or SND_ASYNC
'lance le son
If diff > 392 Then D = Time 'reactualise l'heure
If diff > 392 Then Timer10.Enabled = True
If diff > 392 Then Timer9.Enabled = False
If diff > 392 Then Label3.Caption = 102
End Sub |
Partager