Music playing thru GUI
Author |
Message |
chrispaks
|
Posted: Sun May 22, 2005 2:03 pm Post subject: Music playing thru GUI |
|
|
I want it to play Metallica - Fuel from a GUI, but I need help in making it work
heres what I Got
Quote:
proc PlayFuel
Music.PlayFile ("Fuel.mp3")
end PlayFuel
%Music Buttons
Fuel := GUI.CreateButton (5, 500 - 125, 120, "Fuel", PlayFuel)
Do I have to put a fork in or something?
OR do you need more code because im missing something?
EDIT: It works, but how do I get it to stop playing with a button thats designed to make it stop? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Delos
|
Posted: Sun May 22, 2005 2:07 pm Post subject: (No subject) |
|
|
GUI is strange. To make it run, you need to following at the end of your code:
|
|
|
|
|
|
MysticVegeta
|
Posted: Sun May 22, 2005 2:11 pm Post subject: (No subject) |
|
|
code: | import GUI
procedure PlayFuel
Music.PlayFileLoop ("Fuel.mid")
end PlayFuel
%Music Buttons
var Fuel := GUI.CreateButton (5, 500 - 125, 120, "Fuel", PlayFuel)
var qut := GUI.CreateButton (5, 300, 120, "STOP!", GUI.Quit)
loop
exit when GUI.ProcessEvent
end loop
Music.PlayFileStop
|
|
|
|
|
|
|
chrispaks
|
Posted: Sun May 22, 2005 8:17 pm Post subject: (No subject) |
|
|
MysticVegeta wrote: code: | import GUI
procedure PlayFuel
Music.PlayFileLoop ("Fuel.mid")
end PlayFuel
%Music Buttons
var Fuel := GUI.CreateButton (5, 500 - 125, 120, "Fuel", PlayFuel)
var qut := GUI.CreateButton (5, 300, 120, "STOP!", GUI.Quit)
loop
exit when GUI.ProcessEvent
end loop
Music.PlayFileStop
|
is there a way to make it stop, since im gonna have options of the program and stuff... its a huge thing where i need a button to stop it, not exit the program |
|
|
|
|
|
Delos
|
Posted: Sun May 22, 2005 9:41 pm Post subject: (No subject) |
|
|
Yes. Since you've started the play with a Music. command, you can use another Music. command to stop it. I believe it is Music.PlayFileStop(). Look it up. |
|
|
|
|
|
MysticVegeta
|
Posted: Mon May 23, 2005 9:32 am Post subject: (No subject) |
|
|
Making a different procedure can do it
code: | import GUI
procedure PlayFuel
Music.PlayFileLoop ("music/Fuel.mp3")
end PlayFuel
procedure stop
Music.PlayFileStop
end stop
%Music Buttons
var Fuel := GUI.CreateButton (5, 500 - 125, 120, "Fuel", PlayFuel)
var sto := GUI.CreateButton (5, 325, 120, "Sound Stop", stop)
var qut := GUI.CreateButton (5, 350, 120, "Exit", GUI.Quit)
loop
exit when GUI.ProcessEvent
end loop
Music.PlayFileStop
|
|
|
|
|
|
|
|
|