Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Files]
- Source: "C:\Users\Madin\Desktop\Player\Splash.png"; DestDir: {tmp}; Flags: dontcopy
- Source: "C:\Users\Madin\Desktop\Player\isgsg.dll"; DestDir: {tmp}; Flags: dontcopy
- Source: "C:\Users\Madin\Desktop\Player\AudioFile.mp3"; Flags: dontcopy
- Source: "C:\Users\Madin\Desktop\Player\Bass.dll"; Flags: dontcopy
- [CODE]
- procedure ShowSplashScreen(p1:HWND;p2:AnsiString;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10 :integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';
- procedure Splash();
- begin
- ExtractTemporaryFile('isgsg.dll');
- ExtractTemporaryFile('Splash.png');
- ShowSplashScreen(WizardForm.Handle,ExpandConstant( '{tmp}')+'\Splash.png',1000,3000,1000,0,255,False, $FFFFFF,10);
- end;
- procedure InitializeWizard1();
- begin
- Splash();
- end;
- [CustomMessages]
- SoundCtrlButtonCaptionSoundOn=Play
- SoundCtrlButtonCaptionSoundOff=Mute
- [Code]
- const
- BASS_SAMPLE_LOOP = 4;
- BASS_ACTIVE_STOPPED = 0;
- BASS_ACTIVE_PLAYING = 1;
- BASS_ACTIVE_STALLED = 2;
- BASS_ACTIVE_PAUSED = 3;
- BASS_UNICODE = $80000000;
- BASS_CONFIG_GVOL_STREAM = 5;
- const
- #ifndef UNICODE
- EncodingFlag = 0;
- #else
- EncodingFlag = BASS_UNICODE;
- #endif
- type
- HSTREAM = DWORD;
- function BASS_Init(device: LongInt; freq, flags: DWORD;
- win: HWND; clsid: Cardinal): BOOL;
- external 'BASS_Init@files:bass.dll stdcall';
- function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
- offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
- external 'BASS_StreamCreateFile@files:bass.dll stdcall';
- function BASS_Start: BOOL;
- external 'BASS_Start@files:bass.dll stdcall';
- function BASS_Pause: BOOL;
- external 'BASS_Pause@files:bass.dll stdcall';
- function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
- external 'BASS_ChannelPlay@files:bass.dll stdcall';
- function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
- external 'BASS_SetConfig@files:bass.dll stdcall';
- function BASS_ChannelIsActive(handle: DWORD): DWORD;
- external 'BASS_ChannelIsActive@files:bass.dll stdcall';
- function BASS_Free: BOOL;
- external 'BASS_Free@files:bass.dll stdcall';
- var
- SoundStream: HSTREAM;
- SoundCtrlButton: TNewButton;
- procedure SoundCtrlButtonClick(Sender: TObject);
- begin
- case BASS_ChannelIsActive(SoundStream) of
- BASS_ACTIVE_PLAYING:
- begin
- if BASS_Pause then
- SoundCtrlButton.Caption :=
- ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOn}');
- end;
- BASS_ACTIVE_PAUSED:
- begin
- if BASS_Start then
- SoundCtrlButton.Caption :=
- ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
- end;
- end;
- end;
- procedure InitializeWizard2;
- begin
- ExtractTemporaryFile('AudioFile.mp3');
- if BASS_Init(-1, 44100, 0, 0, 0) then
- begin
- SoundStream := BASS_StreamCreateFile(False,
- ExpandConstant('{tmp}\AudioFile.mp3'), 0, 0, 0, 0,
- EncodingFlag or BASS_SAMPLE_LOOP);
- BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
- BASS_ChannelPlay(SoundStream, False);
- SoundCtrlButton := TNewButton.Create(WizardForm);
- SoundCtrlButton.Parent := WizardForm;
- SoundCtrlButton.Left := 14;
- SoundCtrlButton.Top := WizardForm.ClientHeight -
- SoundCtrlButton.Height - 10;
- SoundCtrlButton.Width := 50;
- SoundCtrlButton.Caption :=
- ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
- SoundCtrlButton.OnClick := @SoundCtrlButtonClick;
- end;
- end;
- procedure DeinitializeSetup;
- begin
- BASS_Free;
- end;
- procedure InitializeWizard;
- begin
- InitializeWizard1;
- InitializeWizard2;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement