#include "FiveWin.ch"
MEMVAR oApp
STATIC oWnd, oFnt, oCur, oIco, aFile, oPla[60], oRec[60], aAlias, aLSnd[60], aLOpn[60], oTmr[60]
//----------------------------------------------------------------------------//
FUNCTION Main()
REQUEST HB_LANG_ESWIN
HB_LANGSELECT( 'ESWIN' )
SET CENTURY ON
SET EPOCH TO 2000
SET DATE FORMAT TO "DD-MM-YYYY"
SET DECIMALS TO 2
REQUEST DBFCDX
RDDSETDEFAULT ("DBFCDX")
aFile:= {}
aAlias:= {}
oApp:= MisDatos()
CreaDBF()
FileIni()
DEFINE ICON oIco RESOURCE "00"
DEFINE CURSOR oCur RESOURCE "MANO"
DEFINE FONT oFnt NAME "Times New Roman" SIZE 0,-14
DEFINE WINDOW oWnd FROM -10,-10 TO -5, -5 TITLE oApp:MiAppName + " | " + oApp:Describe + " -- " + oApp:Derechos ICON oIco
oWnd:bInit:= {|| Samplers(), oWnd:END()}
ACTIVATE WINDOW oWnd
RELEASE All
Hb_GCAll( .T. )
SetProcess( -1, -1, -1 )
CLEAR MEMORY
PostQuitMessage( 0 )
__QUIT()
RETURN Nil
//----------------------------------------------------------------------------//
STATIC FUNCTION Samplers()
LOCAL oDlg, oFld
SETKEY( VK_F1, { || MSGInfo("Teclas para Usar:"+CRLF+CRLF+"< F2 > Abrir Carpeta de Efectos para Agregar más de Sonido."+CRLF+CRLF+;
"Estas Funciones Requiere Reiniciar el Programa"+CRLF+CRLF+;
"< F4 > Ejecutar el Programa en Segundo Plano."+CRLF+;
"< F5 > Ejecutar el Programa Siempre Visible.",oApp:MiAppName) } )
SETKEY( VK_F2, { || IF(ISDIR(LEFT(oApp:cDirSound,LEN(oApp:cDirSound) - 1)) == .T., (WinExec("Explorer.exe " + oApp:cDirSound)),(MSGStop("La carpeta "+ oApp:cDirSound + " No existe..", oApp:MiAppName))) } )
SETKEY( VK_F4, { || DejaIni(oApp:cDirApp+"SAMPLES.INI","GENERAL","Visible",0), MSGInfo("Para que el Cambio se Efectue Reinicie el Programa",oApp:MiAppName + " Ventana Normal") } )
SETKEY( VK_F5, { || DejaIni(oApp:cDirApp+"SAMPLES.INI","GENERAL","Visible",1), MSGInfo("Para que el Cambio se Efectue Reinicie el Programa",oApp:MiAppName + " Siempre Visible") } )
DEFINE DIALOG oDlg RESOURCE "PAGINA0" TITLE oApp:MiAppName + " | " + oApp:Describe + " -- " + oApp:Derechos ICON oIco TRANSPARENT
REDEFINE FOLDEREX oFld ID 101 OF oDlg PROMPT "Fiestas 1", "Fiestas 2", "Fiestas 3";
BITMAPS "FIESTA1", "FIESTA2", "FIESTA3";
DIALOGS "PAGINA1", "PAGINA2", "PAGINA3" ROUND 5
oFld:lTransparent := .T.
oFld:nFolderHeight := 28
oFld:nSeparator := 80
oFld:bClrText := {|| GetSysColor(2) }
oFld:bAction := {|| oFld:aDialogs[1]:Refresh(), oFld:aDialogs[2]:Refresh(), oFld:aDialogs[3]:Refresh() }
oFld:lStretch:= .F.
oFld:oFont := oFnt
oDlg:lHelpIcon:= .F.
Pagina1(oFld)
Pagina2(oFld)
Pagina3(oFld)
oDlg:bInit:= {|| oDlg:Move(oApp:nTop,oApp:nRight), IF(oApp:lOnTop == .T.,(SetWindowPos(oDlg:hWnd,-1,0,0,0,0,3)),(SysRefresh())), CargaSnds()}
oDlg:bMoved:= {|| oDlg:CoorsUpdate(), DejaIni(oApp:cDirApp+"SAMPLES.INI","GENERAL","Arriba",(oDlg:nTop - 130)), DejaIni(oApp:cDirApp+"SAMPLES.INI","GENERAL","Derecha",(oDlg:nLeft - 75))}
ACTIVATE DIALOG oDlg VALID (Self, MsgYesNo("¿ Deseas Salir ?",oApp:MiAppName))
WHILE oFnt:nCount > 0
oFnt:END()
ENDDO
MCISendStr("STOP ALL",0, oWnd:hWnd)
MCISendStr("CLOSE ALL",0, oWnd:hWnd)
RETURN Nil
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
STATIC FUNCTION Pagina1(oFld)
LOCAL N,oBrush
DEFINE BRUSH oBrush RESOURCE "BMP1"
REDEFINE BUTTONBMP oPla[1] ID 201 OF oFld:aDialogs[1] ACTION BtnPlaySnd(1,.F.)
REDEFINE BUTTONBMP oPla[2] ID 202 OF oFld:aDialogs[1] ACTION BtnPlaySnd(2,.F.)
REDEFINE BUTTONBMP oPla[3] ID 203 OF oFld:aDialogs[1] ACTION BtnPlaySnd(3,.F.)
REDEFINE BUTTONBMP oPla[4] ID 204 OF oFld:aDialogs[1] ACTION BtnPlaySnd(4,.F.)
REDEFINE BUTTONBMP oPla[5] ID 205 OF oFld:aDialogs[1] ACTION BtnPlaySnd(5,.F.)
REDEFINE BUTTONBMP oPla[6] ID 206 OF oFld:aDialogs[1] ACTION BtnPlaySnd(6,.F.)
REDEFINE BUTTONBMP oPla[7] ID 207 OF oFld:aDialogs[1] ACTION BtnPlaySnd(7,.F.)
REDEFINE BUTTONBMP oPla[8] ID 208 OF oFld:aDialogs[1] ACTION BtnPlaySnd(8,.F.)
REDEFINE BUTTONBMP oPla[9] ID 209 OF oFld:aDialogs[1] ACTION BtnPlaySnd(9,.F.)
REDEFINE BUTTONBMP oPla[10] ID 210 OF oFld:aDialogs[1] ACTION BtnPlaySnd(10,.F.)
REDEFINE BUTTONBMP oPla[11] ID 211 OF oFld:aDialogs[1] ACTION BtnPlaySnd(11,.F.)
REDEFINE BUTTONBMP oPla[12] ID 212 OF oFld:aDialogs[1] ACTION BtnPlaySnd(12,.F.)
REDEFINE BUTTONBMP oPla[13] ID 213 OF oFld:aDialogs[1] ACTION BtnPlaySnd(13,.F.)
REDEFINE BUTTONBMP oPla[14] ID 214 OF oFld:aDialogs[1] ACTION BtnPlaySnd(14,.F.)
REDEFINE BUTTONBMP oPla[15] ID 215 OF oFld:aDialogs[1] ACTION BtnPlaySnd(15,.F.)
REDEFINE BUTTONBMP oPla[16] ID 216 OF oFld:aDialogs[1] ACTION BtnPlaySnd(16,.F.)
REDEFINE BUTTONBMP oPla[17] ID 217 OF oFld:aDialogs[1] ACTION BtnPlaySnd(17,.F.)
REDEFINE BUTTONBMP oPla[18] ID 218 OF oFld:aDialogs[1] ACTION BtnPlaySnd(18,.F.)
REDEFINE BUTTONBMP oPla[19] ID 219 OF oFld:aDialogs[1] ACTION BtnPlaySnd(19,.F.)
REDEFINE BUTTONBMP oPla[20] ID 220 OF oFld:aDialogs[1] ACTION BtnPlaySnd(20,.F.)
REDEFINE BUTTONBMP oRec[1] RESOURCE "RECORD" ID 301 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(1)
REDEFINE BUTTONBMP oRec[2] RESOURCE "RECORD" ID 302 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(2)
REDEFINE BUTTONBMP oRec[3] RESOURCE "RECORD" ID 303 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(3)
REDEFINE BUTTONBMP oRec[4] RESOURCE "RECORD" ID 304 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(4)
REDEFINE BUTTONBMP oRec[5] RESOURCE "RECORD" ID 305 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(5)
REDEFINE BUTTONBMP oRec[6] RESOURCE "RECORD" ID 306 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(6)
REDEFINE BUTTONBMP oRec[7] RESOURCE "RECORD" ID 307 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(7)
REDEFINE BUTTONBMP oRec[8] RESOURCE "RECORD" ID 308 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(8)
REDEFINE BUTTONBMP oRec[9] RESOURCE "RECORD" ID 309 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(9)
REDEFINE BUTTONBMP oRec[10] RESOURCE "RECORD" ID 310 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(10)
REDEFINE BUTTONBMP oRec[11] RESOURCE "RECORD" ID 311 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(11)
REDEFINE BUTTONBMP oRec[12] RESOURCE "RECORD" ID 312 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(12)
REDEFINE BUTTONBMP oRec[13] RESOURCE "RECORD" ID 313 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(13)
REDEFINE BUTTONBMP oRec[14] RESOURCE "RECORD" ID 314 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(14)
REDEFINE BUTTONBMP oRec[15] RESOURCE "RECORD" ID 315 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(15)
REDEFINE BUTTONBMP oRec[16] RESOURCE "RECORD" ID 316 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(16)
REDEFINE BUTTONBMP oRec[17] RESOURCE "RECORD" ID 317 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(17)
REDEFINE BUTTONBMP oRec[18] RESOURCE "RECORD" ID 318 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(18)
REDEFINE BUTTONBMP oRec[19] RESOURCE "RECORD" ID 319 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(19)
REDEFINE BUTTONBMP oRec[20] RESOURCE "RECORD" ID 320 OF oFld:aDialogs[1] ACTION BtnGuardaSnd(20)
FOR N:= 1 TO 20
oPla[N]:SetFont(oFnt)
oPla[N]:oCursor:= oCur
oPla[N]:cTooltip:= "Reproducir Efecto Grabado en " + ALLTRIM(STR(N))
NEXT
FOR N:= 1 TO 20
oRec[N]:oCursor:= oCur
oRec[N]:cTooltip:= "Grabar Efecto en el Boton " + ALLTRIM(STR(N))
NEXT
oFld:aDialogs[1]:SetBrush( oBrush )
RELEASE BRUSH oBrush
RETURN Nil
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
STATIC FUNCTION Pagina2(oFld)
LOCAL N,oBrush
DEFINE BRUSH oBrush RESOURCE "BMP2"
REDEFINE BUTTONBMP oPla[21] TEXTRIGHT ID 201 OF oFld:aDialogs[2] ACTION BtnPlaySnd(21,.F.)
REDEFINE BUTTONBMP oPla[22] TEXTRIGHT ID 202 OF oFld:aDialogs[2] ACTION BtnPlaySnd(22,.F.)
REDEFINE BUTTONBMP oPla[23] TEXTRIGHT ID 203 OF oFld:aDialogs[2] ACTION BtnPlaySnd(23,.F.)
REDEFINE BUTTONBMP oPla[24] TEXTRIGHT ID 204 OF oFld:aDialogs[2] ACTION BtnPlaySnd(24,.F.)
REDEFINE BUTTONBMP oPla[25] TEXTRIGHT ID 205 OF oFld:aDialogs[2] ACTION BtnPlaySnd(25,.F.)
REDEFINE BUTTONBMP oPla[26] TEXTRIGHT ID 206 OF oFld:aDialogs[2] ACTION BtnPlaySnd(26,.F.)
REDEFINE BUTTONBMP oPla[27] TEXTRIGHT ID 207 OF oFld:aDialogs[2] ACTION BtnPlaySnd(27,.F.)
REDEFINE BUTTONBMP oPla[28] TEXTRIGHT ID 208 OF oFld:aDialogs[2] ACTION BtnPlaySnd(28,.F.)
REDEFINE BUTTONBMP oPla[29] TEXTRIGHT ID 209 OF oFld:aDialogs[2] ACTION BtnPlaySnd(29,.F.)
REDEFINE BUTTONBMP oPla[30] TEXTRIGHT ID 210 OF oFld:aDialogs[2] ACTION BtnPlaySnd(30,.F.)
REDEFINE BUTTONBMP oPla[31] TEXTRIGHT ID 211 OF oFld:aDialogs[2] ACTION BtnPlaySnd(31,.F.)
REDEFINE BUTTONBMP oPla[32] TEXTRIGHT ID 212 OF oFld:aDialogs[2] ACTION BtnPlaySnd(32,.F.)
REDEFINE BUTTONBMP oPla[33] TEXTRIGHT ID 213 OF oFld:aDialogs[2] ACTION BtnPlaySnd(33,.F.)
REDEFINE BUTTONBMP oPla[34] TEXTRIGHT ID 214 OF oFld:aDialogs[2] ACTION BtnPlaySnd(34,.F.)
REDEFINE BUTTONBMP oPla[35] TEXTRIGHT ID 215 OF oFld:aDialogs[2] ACTION BtnPlaySnd(35,.F.)
REDEFINE BUTTONBMP oPla[36] TEXTRIGHT ID 216 OF oFld:aDialogs[2] ACTION BtnPlaySnd(36,.F.)
REDEFINE BUTTONBMP oPla[37] TEXTRIGHT ID 217 OF oFld:aDialogs[2] ACTION BtnPlaySnd(37,.F.)
REDEFINE BUTTONBMP oPla[38] TEXTRIGHT ID 218 OF oFld:aDialogs[2] ACTION BtnPlaySnd(38,.F.)
REDEFINE BUTTONBMP oPla[39] TEXTRIGHT ID 219 OF oFld:aDialogs[2] ACTION BtnPlaySnd(39,.F.)
REDEFINE BUTTONBMP oPla[40] TEXTRIGHT ID 220 OF oFld:aDialogs[2] ACTION BtnPlaySnd(40,.F.)
REDEFINE BUTTONBMP oRec[21] RESOURCE "RECORD" ID 301 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(21)
REDEFINE BUTTONBMP oRec[22] RESOURCE "RECORD" ID 302 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(22)
REDEFINE BUTTONBMP oRec[23] RESOURCE "RECORD" ID 303 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(23)
REDEFINE BUTTONBMP oRec[24] RESOURCE "RECORD" ID 304 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(24)
REDEFINE BUTTONBMP oRec[25] RESOURCE "RECORD" ID 305 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(25)
REDEFINE BUTTONBMP oRec[26] RESOURCE "RECORD" ID 306 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(26)
REDEFINE BUTTONBMP oRec[27] RESOURCE "RECORD" ID 307 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(27)
REDEFINE BUTTONBMP oRec[28] RESOURCE "RECORD" ID 308 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(28)
REDEFINE BUTTONBMP oRec[29] RESOURCE "RECORD" ID 309 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(29)
REDEFINE BUTTONBMP oRec[30] RESOURCE "RECORD" ID 310 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(30)
REDEFINE BUTTONBMP oRec[31] RESOURCE "RECORD" ID 311 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(31)
REDEFINE BUTTONBMP oRec[32] RESOURCE "RECORD" ID 312 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(32)
REDEFINE BUTTONBMP oRec[33] RESOURCE "RECORD" ID 313 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(33)
REDEFINE BUTTONBMP oRec[34] RESOURCE "RECORD" ID 314 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(34)
REDEFINE BUTTONBMP oRec[35] RESOURCE "RECORD" ID 315 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(35)
REDEFINE BUTTONBMP oRec[36] RESOURCE "RECORD" ID 316 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(36)
REDEFINE BUTTONBMP oRec[37] RESOURCE "RECORD" ID 317 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(37)
REDEFINE BUTTONBMP oRec[38] RESOURCE "RECORD" ID 318 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(38)
REDEFINE BUTTONBMP oRec[39] RESOURCE "RECORD" ID 319 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(39)
REDEFINE BUTTONBMP oRec[40] RESOURCE "RECORD" ID 320 OF oFld:aDialogs[2] ACTION BtnGuardaSnd(40)
FOR N:= 21 TO 40
oPla[N]:SetFont(oFnt)
oPla[N]:oCursor:= oCur
oPla[N]:cTooltip:= "Reproducir Efecto Grabado en " + ALLTRIM(STR(N))
NEXT
FOR N:= 21 TO 40
oRec[N]:oCursor:= oCur
oRec[N]:cTooltip:= "Grabar Efecto en el Boton " + ALLTRIM(STR(N))
NEXT
oFld:aDialogs[2]:SetBrush( oBrush )
RELEASE BRUSH oBrush
RETURN Nil
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
STATIC FUNCTION Pagina3(oFld)
LOCAL N,oBrush
DEFINE BRUSH oBrush RESOURCE "BMP3"
REDEFINE BUTTONBMP oPla[41] TEXTRIGHT ID 201 OF oFld:aDialogs[3] ACTION BtnPlaySnd(41,.F.)
REDEFINE BUTTONBMP oPla[42] TEXTRIGHT ID 202 OF oFld:aDialogs[3] ACTION BtnPlaySnd(42,.F.)
REDEFINE BUTTONBMP oPla[43] TEXTRIGHT ID 203 OF oFld:aDialogs[3] ACTION BtnPlaySnd(43,.F.)
REDEFINE BUTTONBMP oPla[44] TEXTRIGHT ID 204 OF oFld:aDialogs[3] ACTION BtnPlaySnd(44,.F.)
REDEFINE BUTTONBMP oPla[45] TEXTRIGHT ID 205 OF oFld:aDialogs[3] ACTION BtnPlaySnd(45,.F.)
REDEFINE BUTTONBMP oPla[46] TEXTRIGHT ID 206 OF oFld:aDialogs[3] ACTION BtnPlaySnd(46,.F.)
REDEFINE BUTTONBMP oPla[47] TEXTRIGHT ID 207 OF oFld:aDialogs[3] ACTION BtnPlaySnd(47,.F.)
REDEFINE BUTTONBMP oPla[48] TEXTRIGHT ID 208 OF oFld:aDialogs[3] ACTION BtnPlaySnd(48,.F.)
REDEFINE BUTTONBMP oPla[49] TEXTRIGHT ID 209 OF oFld:aDialogs[3] ACTION BtnPlaySnd(49,.F.)
REDEFINE BUTTONBMP oPla[50] TEXTRIGHT ID 210 OF oFld:aDialogs[3] ACTION BtnPlaySnd(50,.F.)
REDEFINE BUTTONBMP oPla[51] TEXTRIGHT ID 211 OF oFld:aDialogs[3] ACTION BtnPlaySnd(51,.F.)
REDEFINE BUTTONBMP oPla[52] TEXTRIGHT ID 212 OF oFld:aDialogs[3] ACTION BtnPlaySnd(52,.F.)
REDEFINE BUTTONBMP oPla[53] TEXTRIGHT ID 213 OF oFld:aDialogs[3] ACTION BtnPlaySnd(53,.F.)
REDEFINE BUTTONBMP oPla[54] TEXTRIGHT ID 214 OF oFld:aDialogs[3] ACTION BtnPlaySnd(54,.F.)
REDEFINE BUTTONBMP oPla[55] TEXTRIGHT ID 215 OF oFld:aDialogs[3] ACTION BtnPlaySnd(55,.F.)
REDEFINE BUTTONBMP oPla[56] TEXTRIGHT ID 216 OF oFld:aDialogs[3] ACTION BtnPlaySnd(56,.F.)
REDEFINE BUTTONBMP oPla[57] TEXTRIGHT ID 217 OF oFld:aDialogs[3] ACTION BtnPlaySnd(57,.F.)
REDEFINE BUTTONBMP oPla[58] TEXTRIGHT ID 218 OF oFld:aDialogs[3] ACTION BtnPlaySnd(58,.F.)
REDEFINE BUTTONBMP oPla[59] TEXTRIGHT ID 219 OF oFld:aDialogs[3] ACTION BtnPlaySnd(59,.F.)
REDEFINE BUTTONBMP oPla[60] TEXTRIGHT ID 220 OF oFld:aDialogs[3] ACTION BtnPlaySnd(60,.F.)
REDEFINE BUTTONBMP oRec[41] RESOURCE "RECORD" ID 301 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(41)
REDEFINE BUTTONBMP oRec[42] RESOURCE "RECORD" ID 302 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(42)
REDEFINE BUTTONBMP oRec[43] RESOURCE "RECORD" ID 303 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(43)
REDEFINE BUTTONBMP oRec[44] RESOURCE "RECORD" ID 304 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(44)
REDEFINE BUTTONBMP oRec[45] RESOURCE "RECORD" ID 305 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(45)
REDEFINE BUTTONBMP oRec[46] RESOURCE "RECORD" ID 306 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(46)
REDEFINE BUTTONBMP oRec[47] RESOURCE "RECORD" ID 307 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(47)
REDEFINE BUTTONBMP oRec[48] RESOURCE "RECORD" ID 308 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(48)
REDEFINE BUTTONBMP oRec[49] RESOURCE "RECORD" ID 309 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(49)
REDEFINE BUTTONBMP oRec[50] RESOURCE "RECORD" ID 310 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(50)
REDEFINE BUTTONBMP oRec[51] RESOURCE "RECORD" ID 311 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(51)
REDEFINE BUTTONBMP oRec[52] RESOURCE "RECORD" ID 312 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(52)
REDEFINE BUTTONBMP oRec[53] RESOURCE "RECORD" ID 313 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(53)
REDEFINE BUTTONBMP oRec[54] RESOURCE "RECORD" ID 314 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(54)
REDEFINE BUTTONBMP oRec[55] RESOURCE "RECORD" ID 315 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(55)
REDEFINE BUTTONBMP oRec[56] RESOURCE "RECORD" ID 316 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(56)
REDEFINE BUTTONBMP oRec[57] RESOURCE "RECORD" ID 317 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(57)
REDEFINE BUTTONBMP oRec[58] RESOURCE "RECORD" ID 318 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(58)
REDEFINE BUTTONBMP oRec[59] RESOURCE "RECORD" ID 319 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(59)
REDEFINE BUTTONBMP oRec[60] RESOURCE "RECORD" ID 320 OF oFld:aDialogs[3] ACTION BtnGuardaSnd(60)
FOR N:= 41 TO 60
oPla[N]:SetFont(oFnt)
oPla[N]:oCursor:= oCur
oPla[N]:cTooltip:= "Reproducir Efecto Grabado en " + ALLTRIM(STR(N))
NEXT
FOR N:= 41 TO 60
oRec[N]:oCursor:= oCur
oRec[N]:cTooltip:= "Grabar Efecto en el Boton " + ALLTRIM(STR(N))
NEXT
oFld:aDialogs[3]:SetBrush( oBrush )
RELEASE BRUSH oBrush
RETURN Nil
//----------------------------------------------------------------------------//
STATIC FUNCTION CreaDBF()
LOCAL N
IF !FILE(oApp:cDirApp+"SAMPLES.DBF")
DBCREATE(oApp:cDirApp+"SAMPLES.DBF", { { "BOTON", "N", 02, 00},;
{ "ETIQUETA", "C", 15, 00},;
{ "ARCHIVO" , "C", 50, 00} })
DBUSEAREA(.T.,,oApp:cDirApp+"SAMPLES.DBF","CARGAR")
FOR N:= 1 TO 60
(CARGAR->(DBGOBOTTOM()))
(CARGAR->(DBAPPEND()))
CARGAR->BOTON:= N
(CARGAR->(DBCOMMIT()))
NEXT
DBCLOSEALL()
ENDIF
IF !ISDIR(oApp:cDirSound)
lMKDIR(oApp:cDirSound)
ENDIF
RETURN Nil
//----------------------------------------------------------------------------//
STATIC FUNCTION FileIni()
LOCAL nHandle
LOCAL cCFGFile:= oApp:cDirApp+"SAMPLES.INI"
LOCAL cScrip:= "[GENERAL]"+CRLF+;
"Visible=1"+CRLF+;
"Arriba=0"+CRLF+;
"Derecha=0"
IF !FILE(cCFGFile)
nHandle:= FCREATE(cCFGFile)
SysRefresh()
SysWait(0.1)
FWRITE(nHandle, cScrip)
SysRefresh()
SysWait(0.1)
FCLOSE(nHandle)
SysRefresh()
SysWait(0.1)
ENDIF
IF FILE(cCFGFile)
oApp:lOnTop:= IF(VAL(TraeIni(cCFGFile,"GENERAL","Visible")) == 1,(.T.),(.F.))
oApp:nTop:= VAL(TraeIni(cCFGFile,"GENERAL","Arriba"))
oApp:nRight:= VAL(TraeIni(cCFGFile,"GENERAL","Derecha"))
ENDIF
RETURN Nil
//----------------------------------------------------------------------------//
STATIC FUNCTION CargaSnds()
LOCAL N, nRec
IF FILE(oApp:cDirApp+"SAMPLES.DBF")
DBUSEAREA(.T.,,oApp:cDirApp+"SAMPLES.DBF","SONIDOS")
(SONIDOS->(DBGOTOP()))
nRec:= (SONIDOS->(LASTREC()))
FOR N:= 1 TO nRec
AADD(aAlias, "SND"+ALLTRIM(STRZERO(N,2)))
AADD(aFile, ALLTRIM(SONIDOS->ARCHIVO))
aLSnd[N]:= .F.
aLOpn[N]:= .F.
IF FILE(oApp:cDirSound + ALLTRIM(SONIDOS->ARCHIVO))
oPla[N]:LoadBitmap("PLAY")
oPla[N]:SetText(SPACE(5)+StrCapFirst(ALLTRIM(SONIDOS->ETIQUETA)))
oPla[N]:cPosText:= "TEXTRIGHT"
oPla[N]:Refresh()
ELSE
oPla[N]:LoadBitmap("PAUSE")
oPla[N]:SetText(" Vacio")
oPla[N]:cPosText:= "TEXTRIGHT"
oPla[N]:Disable()
oPla[N]:Refresh()
ENDIF
(SONIDOS->(DBSKIP()))
NEXT
DBCLOSEALL()
ENDIF
RETURN Nil
//----------------------------------------------------------------------------//
STATIC FUNCTION BtnPlaySnd(nBtn)
LOCAL cFile:= oApp:cDirSound+aFile[nBtn]
LOCAL nSec:= 0
LOCAL nMili
IF FILE(cFile)
IF aLSnd[nBtn] == .F.
oPla[nBtn]:LoadBitmap("STOP")
oPla[nBtn]:Refresh()
IF aLOpn[nBtn] == .F.
aLOpn[nBtn]:= .T.
SysRefresh()
MCISendStr("OPEN " + LFN2SFN(cFile) + " TYPE MPEGVIDEO ALIAS MP3" + aAlias[nBtn],, oWnd:hWnd )
MCISendStr("SET MP3" + aAlias[nBtn] + " TIME FORMAT MILLSECONDS",, oWnd:hWnd )
MCISendStr("STATUS MP3" + aAlias[nBtn] + " LENGTH",@nSec,0, oWnd:hWnd )
nMili:= VAL(nSec)
ENDIF
SysRefresh()
MCISendStr("PLAY MP3" + aAlias[nBtn] + " FROM 0",, oWnd:hWnd )
aLSnd[nBtn]:= .T.
DEFINE TIMER oTmr[nBtn] INTERVAL nMili OF oWnd ACTION (oPla[nBtn]:LoadBitmap("PLAY"),;
oPla[nBtn]:Refresh(),;
SysRefresh(),;
MCISendStr("STOP MP3" + aAlias[nBtn],0, oWnd:hWnd),;
SysRefresh(),;
MCISendStr("CLOSE MP3" + aAlias[nBtn],0, oWnd:hWnd),;
aLSnd[nBtn]:= .F. ,;
aLOpn[nBtn]:= .F. ,;
oTmr[nBtn]:DEACTIVATE(),;
oTmr[nBtn]:END())
oTmr[nBtn]:ACTIVATE()
ELSEIF aLSnd[nBtn] == .T.
oPla[nBtn]:LoadBitmap("PLAY")
oPla[nBtn]:Refresh()
SysRefresh()
MCISendStr("STOP MP3" + aAlias[nBtn],0, oWnd:hWnd)
SysRefresh()
MCISendStr("CLOSE MP3" + aAlias[nBtn],0, oWnd:hWnd)
aLSnd[nBtn]:= .F.
aLOpn[nBtn]:= .F.
oTmr[nBtn]:DEACTIVATE()
oTmr[nBtn]:END()
ENDIF
ELSE
MSGAlert("El Archivo no existe: "+ cFile, oApp:MiAppName )
ENDIF
RETURN Nil
//----------------------------------------------------------------------------//
STATIC FUNCTION BtnGuardaSnd(nBtn)
LOCAL cLabel
LOCAL cFile:= cGetFile("Archivo de Sonido en MP3 (*.mp3)|*.mp3|", "Agregar Archivo al Sampler", 1, oApp:cDirSound)
IF !EMPTY(cFile) .AND. FILE(cFile) .AND. cFileExt(cFile) == "mp3"
cLabel:= PonLabel()
DBUSEAREA(.T.,,oApp:cDirApp+"SAMPLES.DBF","EDITAR")
(EDITAR->(DBGOTO(nBtn)))
EDITAR->ARCHIVO:= ALLTRIM(cFileNoPath(cFile))
EDITAR->ETIQUETA:= cLabel
(EDITAR->(DBCOMMIT()))
DBCLOSEALL()
ADEL(aFile,nBtn)
SysRefresh()
AFILL(aFile,cFileNoPath(cFile),nBtn)
SysRefresh()
oPla[nBtn]:LoadBitmap("PLAY")
oPla[nBtn]:SetText(SPACE(5)+StrCapFirst(ALLTRIM(cLabel)))
oPla[nBtn]:cPosText:= "TEXTRIGHT"
oPla[nBtn]:Enable()
oPla[nBtn]:Refresh()
ENDIF
RETURN Nil
//----------------------------------------------------------------------------//
STATIC FUNCTION PonLabel()
LOCAL oDlg, oGet, oBtn, oCur
LOCAL cNombr:= SPACE(15)
LOCAL lSalir:= .F.
DEFINE CURSOR oCur RESOURCE "MANO"
DEFINE DIALOG oDlg RESOURCE "LABEL" TITLE "Etiqueta" ICON oIco
REDEFINE GET oGet VAR cNombr ID 101 OF oDlg PICTURE "@!" VALID(ChaceLbl(cNombr,oGet))
REDEFINE BUTTONBMP oBtn RESOURCE "OK" TEXTRIGHT ID 102 OF oDlg ACTION (lSalir:= .T., oDlg:END())
oDlg:lHelpIcon:= .F.
oBtn:oCursor:= oCur
oGet:Refresh()
ACTIVATE DIALOG oDlg CENTERED VALID(Self, lSalir)
RETURN cNombr
//----------------------------------------------------------------------------//
STATIC FUNCTION ChaceLbl(cVar,oGet)
LOCAL lVal
IF EMPTY(ALLTRIM(cVar))
lVal:= .F.
MSGStop("La Etiqueta No puede quedar Vacia",oApp:MiAppName)
oGet:SetFocus()
ELSEIF LEN(ALLTRIM(cVar)) <= 3
lVal:= .F.
MSGStop("La Etiqueta es muy Corta",oApp:MiAppName)
oGet:SetFocus()
ELSEIF LEN(ALLTRIM(cVar)) >= 4
lVal:= .T.
ENDIF
RETURN lVal
//-----------------------------------------------------------------------------------------------------------------//
STATIC FUNCTION DejaIni(cFile,cSeccion,cEntry,vDato)
LOCAL oIni
INI oIni FILE (cFile)
SET SECTION cSeccion ENTRY cEntry TO vDato OF oIni
ENDINI
RETURN Nil
//-----------------------------------------------------------------------------------------------------------------//
STATIC FUNCTION TraeIni(cFile,cSeccion,cEntry)
LOCAL oIni,vGet
INI oIni FILE (cFile)
GET vGet SECTION cSeccion ENTRY cEntry OF oIni
ENDINI
RETURN vGet
//-----------------------------------------------------------------------------------------------------------------//
CLASS MisDatos
DATA Derechos INIT "SOLDISODFT Software Copyright © 1998-2015"
DATA MiAppName INIT "MiSamplers"
DATA Describe INIT "Administrador de Efectos de Sonido"
DATA Propiedad INIT "Víctor Daniel Cuatecatl León"
DATA cDirApp INIT cFilePath(GetModuleFileName(GetInstance()))
DATA cDirSound INIT cFilePath(GetModuleFileName(GetInstance()))+"SAMPLES\"
DATA lOnTop INIT .F.
DATA nTop INIT 0
DATA nRight INIT 0
ENDCLASS
FUNCTION HelpIndex()
//Para Deshabilitar la ayuda del Api de Windows con la tecla F1
RETURN Nil
DLL32 FUNCTION SetProcess( hWnd AS LONG, nMinWorkingSpace AS LONG, nMaxWorkingSpace AS LONG ) AS LONG PASCAL FROM "SetProcessWorkingSetSize" LIB "Kernel32.dll"