Guidance
指路人
g.yi.org
software / rapidq / Examples / Audio & Video / NPMOD32 / Modspel.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     $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()

' žžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžž
' ž Programmed By Bernt Figaro, Sweden ž
' ž €€€€€€€ The Hook Software €€€€€€€€ ž
' ž                                    ž
' ž Tx a lot to dakodamc@yahoo.com for ž
' ž the hwnd syntax !                  ž
' ž Sweden 8-26-2003                   ž
' žžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžžž

     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
'Stop playing
       StopIt_Click
       IsPlaying=False
      END IF

      ModFileName$=ModFile(ModIndex)


' This next step loads the MOD.
      X = ModPlug_Load(RetVal, ModFileName$)
'If all goes well, you can now play the MOD.
      X = ModPlug_Play(RetVal)

      IsPlaying = True

'Rotate Index string forward
      ModIndex=ModIndex+1
      IF ModIndex >4 THEN
       ModIndex=1
      END IF

     END SUB

     SUB stopit_Click
'Stop the plugin.
      X = ModPlug_Stop(RetVal)
     END SUB

     SUB exitit_Click
'Now, destroy the plugin window...
      X = ModPlug_Destroy(RetVal)
      Form_Unload
     END SUB


     SUB Form_Unload
'Now, destroy the plugin window...
      X = ModPlug_Destroy(RetVal)
      END
     END SUB

     SUB MakePlayer
' EXTREMELY IMPORTANT FIRST STEP
' In order to get a MOD playing, you have to
' first create the plugin.
' Note that this does not actually
' display the plugin.
' However, this returned value is so important
' that we give it variable RetVal.
' The MOD can be of any type that the ModPlug Player supports.
' (MOD/S3M/IT/XM/669...)
      RetVal = ModPlug_CreateEx("noloop|true")
' This next step gives the newly-created plugin
' a window hWnd to use.
' This return value isn't important;
' therefore, we give it variable x.
      WndProc=Form.handle
      X = ModPlug_SetWindow(RetVal, WndProc)
'remember to include full path if MOD is not in app directory
     END SUB

     Form.SHOWMODAL


掌柜推荐
 
 
¥289.00 ·
 
 
¥1,080.00 ·
 
 
¥1,380.00 ·
 
 
¥638.00 ·
 
 
¥1,290.00 ·
 
 
¥1,420.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:42:58