Re: Bass Library?

new topic     » goto parent     » topic index » view thread      » older message » newer message

hello thanks well i did made an attempt to convert the C/Cpp bass library header into a euphoria header (.e file) and then test it but i cheated to make a shortcut i used chatGPT to slowly convert the header from C/Cpp to euphoria each time a slice of the code (some 250 - 300 lines chunk each time)the result is a buggy header since GPT doesn't know well euphoria nor is accurate to-be-honest... but here is the code of the header I'm using "pastey" and also bringing the bassTest file i made converted from freebasic to euphoria...

include bass.e 
 
-- Call this once at the beginning of the program 
if BASS_GetVersion() < MAKELONG(2, 2) then 
    puts(1, "BASS version 2.2 or above required!") 
    abort(1) 
end if 
 
if BASS_Init(-1, 44100, 0, 0, 0) = 0 then 
    puts(1, "Could not initialize BASS") 
    abort(1) 
end if 
 
global HMUSIC g_BackgroundMusic 
 
procedure stopMusic(music) 
    if music = 0 then music = g_BackgroundMusic end if 
    if music then BASS_ChannelStop(music) 
end procedure 
 
procedure freeMusic(music) 
    if music = 0 then music = g_BackgroundMusic : g_BackgroundMusic = 0 end if 
    if music then BASS_MusicFree(music) 
end procedure 
 
function playMusic(soundfile) 
    if g_BackgroundMusic then  
        stopMusic(g_BackgroundMusic) 
        freeMusic(g_BackgroundMusic) 
        g_BackgroundMusic = 0 
    end if 
     
    object music = BASS_StreamCreateFile(0, soundfile, 0, 0, 0) 
     
    if music then  
        g_BackgroundMusic = music 
        BASS_ChannelPlay(music, 0) 
    end if 
     
    return music 
end function 
 
 
playMusic("test1.mp3") 
 
puts(1,"playing the test music file - mp3") 
 
wait_key() 
 
stopMusic() 
 
freeMusic() 
 
puts(1,"\n\ntest completed") 

the error I'm getting is :

/home/ronen/Documents/euphoria/bass_eu_header/bass.e:48 
<0076>:: expected to see an assignment after 'define', such as =, +=, -=, *=, /= or &= 
    type HMUSIC = atom,   -- MOD music handle 
        ^ 
 
 
Press Enter 

here is bass.e header code from pastey:

https://openeuphoria.org/pastey/358.wc

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu