Page 1 of 1

Include TristarSoundMonitor Musix

Posted: Sat Apr 29, 2006 1:22 am
by xperience2003
tsm is a sound (modul) format for tiny intros (and/or games)

test exe (10kb)
www.games-mafia.de/puretsm.exe

under v4 its very easy to import the replayer lib

Code: Select all

;tsm music fun  xp^tristar/deviance/secretly!
;
;pure v4

 import "dsound.lib"  
    _DirectSoundCreate() as "_DirectSoundCreate@12"
 endimport
 
 import "TSMReplay.obj"
   TSM_Init(a.l,b.l) as "_TSM_Init@12"  ;musix-memory, winhandle 
   TSM_Stop() as "_TSM_Stop@0"
   TSM_Play() as "_TSM_Play@0"
  endimport

If OpenWindow(0, 100, 200, 195,260,"PureBla",#PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
hDC = GetForegroundWindow_()

TSM_Init(?musix, hDC)

  Repeat
    TSM_Play()  ;call the player
   
    If WindowEvent() = #PB_Event_CloseWindow 
      Quit = 1
    EndIf
  Sleep_(1)
  Until Quit = 1
  
  TSM_Stop()
EndIf
End   

datasection
musix: includebinary "Wizardry.TSM" ;simply include
enddatasection
complete system here
www.games-mafia.de/puretsm.rar

-------------------------------

..for purebasic <=3.94

Code: Select all

; tsm music fun  xp^tristar/deviance/secretly!
 
!JMP doneInit
  !extrn _TSM_Init@12
  !extrn _TSM_Stop@0
  !extrn _TSM_Play@0
  
  !section '.drectve' drectve hidden
  !DB 'c:\LinkStuff\TSMReplay.obj c:\LinkStuff\dsound.lib'
  !section '.text' code readable executable
!doneInit:

TSM_Init.l    : !MOV [v_TSM_Init], _TSM_Init@12
TSM_Play.l    : !MOV [v_TSM_Play], _TSM_Play@0
TSM_Stop.l    : !MOV [v_TSM_Stop], _TSM_Stop@0
 
tuneadr.l = ?tune
hwnd = GetForegroundWindow_()
!PUSH dword [v_hwnd]
!PUSH dword [v_tuneadr]
!CALL [v_TSM_Init]

Repeat
  !CALL [v_TSM_Play]
  Delay(1)
Until GetAsyncKeyState_(#VK_ESCAPE)

!CALL [v_TSM_Stop]

End
;
DataSection
  tune:
  IncludeBinary "c:\LinkStuff\wizardry.TSM"
EndDataSection 
have fun =)

Posted: Sat Apr 29, 2006 1:57 am
by va!n
sweet :wink:

Posted: Sat Apr 29, 2006 11:26 am
by THCM
Nice!