Advertisement
Guest User

Untitled

a guest
Jul 15th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. [Files]
  2. Source: "C:\Users\Madin\Desktop\Player\Splash.png"; DestDir: {tmp}; Flags: dontcopy
  3. Source: "C:\Users\Madin\Desktop\Player\isgsg.dll"; DestDir: {tmp}; Flags: dontcopy
  4. Source: "C:\Users\Madin\Desktop\Player\AudioFile.mp3"; Flags: dontcopy
  5. Source: "C:\Users\Madin\Desktop\Player\Bass.dll"; Flags: dontcopy
  6.  
  7.  
  8. [CODE]
  9. 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';
  10. procedure Splash();
  11. begin
  12. ExtractTemporaryFile('isgsg.dll');
  13. ExtractTemporaryFile('Splash.png');
  14. ShowSplashScreen(WizardForm.Handle,ExpandConstant( '{tmp}')+'\Splash.png',1000,3000,1000,0,255,False, $FFFFFF,10);
  15. end;
  16.  
  17. procedure InitializeWizard1();
  18. begin
  19. Splash();
  20. end;
  21.  
  22. [CustomMessages]
  23. SoundCtrlButtonCaptionSoundOn=Play
  24. SoundCtrlButtonCaptionSoundOff=Mute
  25.  
  26. [Code]
  27. const
  28. BASS_SAMPLE_LOOP = 4;
  29. BASS_ACTIVE_STOPPED = 0;
  30. BASS_ACTIVE_PLAYING = 1;
  31. BASS_ACTIVE_STALLED = 2;
  32. BASS_ACTIVE_PAUSED = 3;
  33. BASS_UNICODE = $80000000;
  34. BASS_CONFIG_GVOL_STREAM = 5;
  35. const
  36. #ifndef UNICODE
  37. EncodingFlag = 0;
  38. #else
  39. EncodingFlag = BASS_UNICODE;
  40. #endif
  41. type
  42. HSTREAM = DWORD;
  43.  
  44. function BASS_Init(device: LongInt; freq, flags: DWORD;
  45. win: HWND; clsid: Cardinal): BOOL;
  46. external 'BASS_Init@files:bass.dll stdcall';
  47. function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
  48. offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
  49. external 'BASS_StreamCreateFile@files:bass.dll stdcall';
  50. function BASS_Start: BOOL;
  51. external 'BASS_Start@files:bass.dll stdcall';
  52. function BASS_Pause: BOOL;
  53. external 'BASS_Pause@files:bass.dll stdcall';
  54. function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
  55. external 'BASS_ChannelPlay@files:bass.dll stdcall';
  56. function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
  57. external 'BASS_SetConfig@files:bass.dll stdcall';
  58. function BASS_ChannelIsActive(handle: DWORD): DWORD;
  59. external 'BASS_ChannelIsActive@files:bass.dll stdcall';
  60. function BASS_Free: BOOL;
  61. external 'BASS_Free@files:bass.dll stdcall';
  62.  
  63. var
  64. SoundStream: HSTREAM;
  65. SoundCtrlButton: TNewButton;
  66.  
  67. procedure SoundCtrlButtonClick(Sender: TObject);
  68. begin
  69. case BASS_ChannelIsActive(SoundStream) of
  70. BASS_ACTIVE_PLAYING:
  71. begin
  72. if BASS_Pause then
  73. SoundCtrlButton.Caption :=
  74. ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOn}');
  75. end;
  76. BASS_ACTIVE_PAUSED:
  77. begin
  78. if BASS_Start then
  79. SoundCtrlButton.Caption :=
  80. ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
  81. end;
  82. end;
  83. end;
  84.  
  85. procedure InitializeWizard2;
  86. begin
  87. ExtractTemporaryFile('AudioFile.mp3');
  88. if BASS_Init(-1, 44100, 0, 0, 0) then
  89. begin
  90. SoundStream := BASS_StreamCreateFile(False,
  91. ExpandConstant('{tmp}\AudioFile.mp3'), 0, 0, 0, 0,
  92. EncodingFlag or BASS_SAMPLE_LOOP);
  93. BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
  94. BASS_ChannelPlay(SoundStream, False);
  95.  
  96. SoundCtrlButton := TNewButton.Create(WizardForm);
  97. SoundCtrlButton.Parent := WizardForm;
  98. SoundCtrlButton.Left := 14;
  99. SoundCtrlButton.Top := WizardForm.ClientHeight -
  100. SoundCtrlButton.Height - 10;
  101. SoundCtrlButton.Width := 50;
  102. SoundCtrlButton.Caption :=
  103. ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
  104. SoundCtrlButton.OnClick := @SoundCtrlButtonClick;
  105. end;
  106. end;
  107.  
  108. procedure DeinitializeSetup;
  109. begin
  110. BASS_Free;
  111. end;
  112.  
  113. procedure InitializeWizard;
  114. begin
  115. InitializeWizard1;
  116. InitializeWizard2;
  117. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement