BASS and MaxGUI

BlitzMax Modules Forums/Brucey's Modules/BASS and MaxGUI

The application keeps freezing when I try to set the slider range. What am I doing wrong?

Strict
Import maxgui.drivers
Import bah.bass

If Not TBass.Init(-1,44100,0,Null,Null)
	Print "Unable to start BASS."
	End
EndIf

Global file:TStream=ReadStream("music.mp3")
Global song:TBassStream=New TBassStream.CreateTStream(file,0,0)
If Not song End

Global window:TGadget=CreateWindow(AppTitle,0,0,640,480,Null)
Global slider:TGadget=CreateSlider(10,10,ClientWidth(window)-20,24,window,SLIDER_HORIZONTAL|SLIDER_TRACKBAR)

Global songlength:Long=song.GetLength(BASS_POS_BYTE)

SetSliderRange(slider,1,songlength)

Repeat
	WaitEvent()
	Select EventID()
		Case event_windowclose
			Select EventSource()
				Case window
					TBass.Free()
					End
			EndSelect
	EndSelect
Forever