nilsen Posted June 14, 2008 Posted June 14, 2008 (edited) Hi!Can anybody help me ? i need to use bassmod.dll or minifmod.dlli wonder how the code should look like Edited July 23, 2008 by nilsen
ragdog Posted June 15, 2008 Posted June 15, 2008 (edited) hihere is a small example [Files]Source: "C:\BASSMOD.dll"; DestDir: "{tmp}"; Flags: dontcopySource: "C:\music.mod"; DestDir: "{tmp}"; Flags: dontcopy[Code]const BASS_MUSIC_LOOP = 4;function BASSMOD_Init(device: Integer; freq, flags: DWORD): Boolean;external 'BASSMOD_Init@files:BASSMOD.dll stdcall delayload';procedure BASSMOD_MusicFree();external 'BASSMOD_MusicFree@files:BASSMOD.dll stdcall delayload';function BASSMOD_MusicLoad(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): Boolean;external 'BASSMOD_MusicLoad@files:BASSMOD.dll stdcall delayload';function BASSMOD_MusicPlay(): Boolean;external 'BASSMOD_MusicPlay@files:BASSMOD.dll stdcall delayload';procedure BASSMOD_Free();external 'BASSMOD_Free@files:BASSMOD.dll stdcall delayload';procedure InitializeWizard();var hMod: Integer; Name1: string;begin ExtractTemporaryFile(ExpandConstant('BASSMOD.dll')); ExtractTemporaryFile(ExpandConstant('music.mod')); if not BASSMOD_Init(-1,44100,0) then begin MsgBox('BASSMOD не смогла инициализироваться, проигрывание музыки невозможно.', mbInformation, MB_OK) BASSMOD_Free; end; begin Name1:=ExpandConstant('{tmp}\music.mod'); BASSMOD_MusicFree; if BASSMOD_MusicLoad(FALSE, PChar(Name1), 0, 0, BASS_MUSIC_LOOP) then BASSMOD_MusicPlay;end;end;you can find mor by google with bassmod inno setup or soru_example.txt Edited June 15, 2008 by ragdog
nilsen Posted June 15, 2008 Author Posted June 15, 2008 Thank You ragdog it's working fine !Another question i have.When i use code for minifmod.dll like this:[Files]Source: "MiniFMOD.dll"; DestDir: "{tmp}"; Flags:dontcopySource: "music.XM"; DestDir: "{tmp}"; Flags:dontcopy[Code]const MB_ICONINFORMATION = $40; function SongLoadFromFile(FileName: PChar): Integer;external 'SongLoadFromFile@files:minifmod.dll cdecl delayload';procedure SongPlay(hMod: Integer);external 'SongPlay@files:minifmod.dll cdecl delayload'; procedure InitializeWizard();var hMod: Integer; Name1: string;begin ExtractTemporaryFile(ExpandConstant('MiniFMOD.dll')); ExtractTemporaryFile(ExpandConstant('music.XM')); Name1:=ExpandConstant('{tmp}\music.XM'); hMod := SongLoadFromFile(PChar(Name1)); SongPlay(hMod); end;Problem is when i use this code and cancel installation or finish installation,i've got message error from windows "setup\uninstall error" Zone alarm shows application "MyProgram.tmp". What is wrong?
HVC Posted June 15, 2008 Posted June 15, 2008 (edited) Just add code to the appropriate handlers to:1) Stop playing the music.2) Release the used handles.3) Delete the temporary files. Edited June 15, 2008 by HVC
nilsen Posted June 15, 2008 Author Posted June 15, 2008 Just add code to the appropriate handlers to:1) Stop playing the music.2) Release the used handles.3) Delete the temporary files.I don't know how to do it,could You show me how should i modify the code? i'm just learning. Thanks in advanced
ragdog Posted June 15, 2008 Posted June 15, 2008 @nilsenhmm you can find all by googlehere is a quick example for innosetup fmodgreetsragdoginno_fmod.rar
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now