$INCLUDE "RAPIDQ.INC"
$OPTION ICON "Närke.ico"
$TYPECHECK ON
DECLARE FUNCTION ModPlug_CreateEx LIB "npmod32" ALIAS "ModPlug_CreateEx" (lpszArgs AS STRING) AS LONG
DECLARE FUNCTION ModPlug_Destroy LIB "npmod32" ALIAS "ModPlug_Destroy" (BYVAL pPlugin AS LONG) AS LONG
DECLARE FUNCTION ModPlug_SetWindow LIB "npmod32" ALIAS "ModPlug_SetWindow" (BYVAL pPlugin AS LONG, hwnd AS INTEGER) AS LONG
DECLARE FUNCTION ModPlug_Load LIB "npmod32" ALIAS "ModPlug_Load"(BYVAL pPlugin AS LONG, lpszFileName AS STRING) AS LONG
DECLARE FUNCTION ModPlug_Play LIB "npmod32" ALIAS "ModPlug_Play" (BYVAL pPlugin AS LONG) AS LONG
DECLARE FUNCTION ModPlug_Stop LIB "npmod32" ALIAS "ModPlug_Stop" (BYVAL pPlugin AS LONG) AS LONG
DECLARE FUNCTION ModPlug_SetCurrentPosition LIB "npmod32" ALIAS "ModPlug_SetCurrentPosition" (BYVAL plugin AS LONG, nPos AS LONG) AS LONG
DECLARE FUNCTION ModPlug_GetCurrentPosition LIB "npmod32" ALIAS "ModPlug_GetCurrentPosition" (BYVAL plugin AS LONG) AS LONG
DECLARE FUNCTION ModPlug_GetVersion LIB "npmod32" ALIAS "ModPlug_GetVersion" () AS LONG
DECLARE FUNCTION ShellAbout LIB "shell32" ALIAS "ShellAboutA" (hwnd AS LONG, szApp AS STRING, szOtherStuff AS STRING, hIcon AS LONG) AS LONG
DECLARE SUB playit_Click()
DECLARE SUB stopit_Click()
DECLARE SUB exitit_Click()
DECLARE SUB Form_Unload()
DECLARE SUB MakePlayer()
CREATE Form AS QFORM
CAPTION = SPACE$(30) + "Modplayer 2003"
Width = 276
Height = 125
Center
borderstyle =3
onclose = Form_Unload
icon = "NÄRKE.ICO"
CREATE PlayIt AS QBUTTON
CAPTION = "Play"
Left = 8
Top = 60
Width = 60
Height=25
Showhint=1
OnClick = playit_Click
Hint = "Play The Mod Fle"
END CREATE
CREATE StopIt AS QBUTTON
CAPTION = "Stop"
Left = 106
Top = 60
Width = 60
Height=25
ShowHint = 1
Onclick = stopit_Click
Hint = "Stop Playing"
TabOrder = 1
END CREATE
CREATE ExitIt AS QBUTTON
CAPTION = "Quit"
Left = 204
Top = 60
Width = 60
Width = 60
Height=25
ShowHint = 1
Onclick=stopit_Click
Hint = "Exit The Program"
TabOrder = 2
END CREATE
END CREATE
DIM IsPlaying AS INTEGER
DIM WndProc AS LONG
DIM RetVal AS LONG
DIM ModFileName$
DIM X AS LONG
DIM ModFile(4) AS STRING
ModFile(1)="2LTL2IGN.MOD"
ModFile(2)="SWING.MOD"
ModFile(3)="BLAKWHIT.S3M"
ModFile(4)="SEADOGMEDLEY.XM"
DIM ModIndex AS INTEGER
ModIndex=1
DIM Startup AS INTEGER
Startup=False
SUB playit_Click
IF StartUP=False THEN
Startup=True
MakePlayer
END IF
IF IsPlaying=True THEN
StopIt_Click
IsPlaying=False
END IF
ModFileName$=ModFile(ModIndex)
X = ModPlug_Load(RetVal, ModFileName$)
X = ModPlug_Play(RetVal)
IsPlaying = True
ModIndex=ModIndex+1
IF ModIndex >4 THEN
ModIndex=1
END IF
END SUB
SUB stopit_Click
X = ModPlug_Stop(RetVal)
END SUB
SUB exitit_Click
X = ModPlug_Destroy(RetVal)
Form_Unload
END SUB
SUB Form_Unload
X = ModPlug_Destroy(RetVal)
END
END SUB
SUB MakePlayer
RetVal = ModPlug_CreateEx("noloop|true")
WndProc=Form.handle
X = ModPlug_SetWindow(RetVal, WndProc)
END SUB
Form.SHOWMODAL
|