Page 1 of 1

BassMod example

Posted: Thu Jan 26, 2006 12:14 pm
by Fred
Hello, here is a small example using the bassmod lib found here: http://www.un4seen.com/files/bassmod20-osx.zip . It needs PB OS X v3.94d which should be available soon.

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

Posted: Thu Jan 26, 2006 1:41 pm
by SEO
@Fred
Nice to hear that next version is on the road...
But, could you add an simple text file 'ReleaseNotes' so we could check what you fixed and news ??
Regards,
SEO

Posted: Thu Jan 26, 2006 1:51 pm
by Kale
SEO wrote:@Fred
Nice to hear that next version is on the road...
But, could you add an simple text file 'ReleaseNotes' so we could check what you fixed and news ??
Regards,
SEO
http://www.purebasic.com/news.php3

Posted: Thu Jan 26, 2006 1:55 pm
by SEO
Old news.. http://www.purebasic.com/news.php3
Oct 2005, there ar later releases...

Posted: Thu Jan 26, 2006 3:01 pm
by Fred
No problem for the file, i will add it.