

Code : Tout sélectionner
LecteursCD=InitCDAudio()
ChargerImage1=LoadImage(1,"Play.bmp")
ChargerImage2=LoadImage(2,"Stop.bmp")
ChargerImage3=LoadImage(3,"Pause.bmp")
ChargerImage4=LoadImage(4,"Ms.bmp")
ChargerImage5=LoadImage(5,"Mp.bmp")
ChargerImage6=LoadImage(6,"Eject.bmp")
piste=1
a=1
If ChargerImage1=0 Or ChargerImage2=0 Or ChargerImage3=0 Or ChargerImage4=0 Or ChargerImage5=0 Or ChargerImage6=0
MessageRequester("Erreur","Impossible de charger les images",#PB_MessageRequester_OK)
EndIf
If LecteursCD=0
MessageRequester("Erreur","Il n'existe aucun lecteur CD",#PB_MessageRequester_OK)
EndIf
If OpenWindow(0,1,1,360,200,#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget,"Base")
If CreateGadgetList(WindowID(0))
ButtonImageGadget(1,1,1,60,60,UseImage(4))
EndIf
If CreateGadgetList(WindowID(0))
ButtonImageGadget(2,60,1,60,60,UseImage(2))
EndIf
If CreateGadgetList(WindowID(0))
ButtonImageGadget(3,120,1,60,60,UseImage(1))
EndIf
If CreateGadgetList(WindowID(0))
ButtonImageGadget(4,180,1,60,60,UseImage(3))
EndIf
If CreateGadgetList(WindowID(0))
ButtonImageGadget(5,240,1,60,60,UseImage(5))
EndIf
If CreateGadgetList(WindowID(0))
ButtonImageGadget(6,300,1,60,60,UseImage(6))
EndIf
EndIf
Repeat
EventID.l=WaitWindowEvent()
Select EventGadgetID()
Case 3
CurrentTrack = GetGadgetState(4)+1
PlayCDAudio(CurrentTrack, CurrentTrack)
Case 2
StopCDAudio()
Case 6
EjectCDAudio(1)
EndSelect
If EventID=#PB_Event_CloseWindow
Quit=1
EndIf
Until Quit=1
End
