VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "ModMusic"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Private Declare Function BASS_MusicLoad64 Lib "bass.dll" Alias "BASS_MusicLoad" (ByVal mem As Long, ByVal file As Any, ByVal Offset As Long, ByVal offsethigh As Long, ByVal Length As Long, ByVal Flags As Long, ByVal Freq As Long) As Long
Private Declare Function BASS_MusicFree Lib "bass.dll" (ByVal Handle As Long) As Long

Private mHandles As Long

Sub Load(Filename As String, Optional Offset As Long = 0, Optional Length As Long = 0, Optional Flags As Long = 0, Optional Freq As Long = 0)

Dim file As Long

file = StrPtr(Filename)

mHandles = BASS_MusicLoad(BASS_FALSE, StrPtr(Filename), Offset, Length, Flags, Freq)

End Sub

Function Free() As Boolean
Free = BASS_MusicFree(mHandles)
End Function

Property Get Handle() As Long
Handle = mHandles
End Property

Private Function BASS_MusicLoad(ByVal mem As Long, ByVal file As Long, ByVal Offset As Long, ByVal Length As Long, ByVal Flags As Long, ByVal Freq As Long) As Long
BASS_MusicLoad = BASS_MusicLoad64(mem, file, Offset, 0, Length, Flags Or BASS_UNICODE, Freq)
End Function
