BassMod example

Mac OSX specific forum
Fred
Administrator
Administrator
Posts: 16620
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

BassMod example

Post 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
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post 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
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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
--Kale

Image
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

Old news.. http://www.purebasic.com/news.php3
Oct 2005, there ar later releases...
Fred
Administrator
Administrator
Posts: 16620
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

No problem for the file, i will add it.
Post Reply