Code: Select all
;
; Bassmod (music module) test for OS X (should work on other OS as well)
;
#LibraryPath = ""/Users/fred/Desktop/bassmod20-osx Folder/" ; Put your library path here
#BASS_DEVICE_NOSYNC = 16
If OpenLibrary(0, #LibraryPath + "libbassmod.dylib")
If CallCFunction(0, "BASSMOD_GetVersion") >= 2
If CallCFunction(0, "BASSMOD_Init", -1, 44100, #BASS_DEVICE_NOSYNC)
Filename$ = OpenFileRequester("Choose a module to play", "", "", 0)
CallCFunction(0, "BASSMOD_MusicFree") ; free the current mod
If CallCFunction(0, "BASSMOD_MusicLoad", #FALSE, Filename$, 0, 0, 0)
CallCFunction(0, "BASSMOD_MusicPlay")
MessageRequester("Info", "Playing the module !")
EndIf
CallCFunction(0, "BASSMOD_Free")
Else
MessageRequester("Error", "Can't initialize the device")
EndIf
Else
MessageRequester("Error", "Bassmod library version too old (< 2)")
EndIf
Else
MessageRequester("Error", "Can't open the bassmod library")
EndIf