Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Setup]
- AppName=Play music with bass
- AppVerName=Play music with bass v2.4.xx
- DefaultDirName={pf}\My Program
- DefaultGroupName=My Program
- [Languages]
- Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl"
- [Files]
- Source: "BASS.dll"; DestDir: "{tmp}"; Flags: dontcopy noencryption nocompression
- Source: "sound.mp3"; DestDir: "{tmp}"; Flags: dontcopy noencryption nocompression
- [Icons]
- Name: "{group}\Unistall;"; IconFilename: "{app}\unins000.exe"; Filename: "{app}\unins000.exe"
- [Code]
- const
- BASS_SAMPLE_LOOP = 4;
- var
- mp3Handle: HWND;
- mp3Name: String;
- function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean; external 'BASS_Init@files:BASS.dll stdcall delayload';
- function BASS_StreamCreateFile(mem: BOOL; f: PAnsiChar; offset1: DWORD; offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): DWORD; external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
- function BASS_Start: Boolean; external 'BASS_Start@files:BASS.dll stdcall delayload';
- function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean; external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';
- function BASS_Stop: Boolean; external 'BASS_Stop@files:BASS.dll stdcall delayload';
- function BASS_Free: Boolean; external 'BASS_Free@files:BASS.dll stdcall delayload';
- function InitializeSetup(): Boolean;
- begin
- ExtractTemporaryFile('BASS.dll');
- ExtractTemporaryFile('sound.mp3');
- mp3Name := ExpandConstant('{tmp}\sound.mp3');
- BASS_Init(-1, 44100, 0, 0, 0);
- mp3Handle := BASS_StreamCreateFile(FALSE, PAnsiChar(mp3Name), 0, 0, 0, 0, BASS_SAMPLE_LOOP);
- BASS_Start();
- BASS_ChannelPlay(mp3Handle, False);
- Result := True;
- end;
- procedure DeinitializeSetup();
- begin
- BASS_Stop();
- BASS_Free();
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement