by Lisa Giordano » Sat Aug 30, 2008 12:33 pm
Questo esempio funziona perfettamente, l'inconveniente è che nella function giro(), SndPlaySound( "Accordi\Beat68.wav", 1 ) viene interrotta da SndPlaySound( "Accordi\"+aFile[t]+".wav", 1 ).
Io vorrei invece che rimanesse in esecuzione SndPlaySound( "Accordi\Beat68.wav", 1 ) in un loop, e che che nello tempo girasse
For t=1 to Len(aFile)
SndPlaySound( "Accordi\"+aFile[t]+".wav", 1 )
inkey(1)
Next t
#include "Fivewin.ch"
************************************************************************
Function Test()
Local oWnd, oMenu, oImg
Local oWC,oBar,oCursor
Local aFile:={}
DEFINE WINDOW oWnd FROM 0,0 TO 30,100 MENU oMenu TITLE "Virtual Guitar" MDI
DEFINE BUTTONBAR oBar SIZE 50,30 3DLOOK CURSOR oCursor OF oWnd
DEFINE BUTTON OF oBar PROMPT "Do+" ACTION(SndPlaySound( "Accordi\C+.wav", 1 ),aadd(aFile,"C+")) GROUP
DEFINE BUTTON OF oBar PROMPT "Re-" ACTION(SndPlaySound( "Accordi\D-.wav", 1 ),aadd(aFile,"D-")) GROUP
DEFINE BUTTON OF oBar PROMPT "Mi-" ACTION(SndPlaySound( "Accordi\E-.wav", 1 ),aadd(aFile,"E-")) GROUP
DEFINE BUTTON OF oBar PROMPT "Mi+" ACTION(SndPlaySound( "Accordi\E+.wav", 1 ),aadd(aFile,"E+")) GROUP
DEFINE BUTTON OF oBar PROMPT "Fa+" ACTION(SndPlaySound( "Accordi\F+.wav", 1 ),aadd(aFile,"F+")) GROUP
DEFINE BUTTON OF oBar PROMPT "Sol+" ACTION(SndPlaySound( "Accordi\G+.wav", 1 ),aadd(aFile,"G+")) GROUP
DEFINE BUTTON OF oBar PROMPT "La-" ACTION(SndPlaySound( "Accordi\A-.wav", ),aadd(aFile,"A-")) GROUP
DEFINE BUTTON OF oBar PROMPT " " GROUP
DEFINE BUTTON OF oBar PROMPT "Nuovo" ACTION (aFile:={}) GROUP
DEFINE BUTTON OF oBar PROMPT "Giro" ACTION (Giro(aFile)) GROUP
DEFINE BUTTON OF oBar PROMPT "Esci" ACTION (oWnd:End()) GROUP
ACTIVATE WINDOW oWnd
return nil
**********************************************************
Function Giro(aFile)
Local t,i
SndPlaySound( "Accordi\Beat68.wav", 1 )
For t=1 to Len(aFile)
SndPlaySound( "Accordi\"+aFile[t]+".wav", 1 )
inkey(1)
Next t
return nil
Ciao grazie