Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 05-11-2014, 00:47
Dante1995 Dante1995 is offline
Banned
 
Join Date: Feb 2014
Location: Black Hole
Posts: 297
Thanks: 116
Thanked 479 Times in 162 Posts
Dante1995 is on a distinguished road
Quote:
Originally Posted by minh_k43sj View Post
great
you can add music background to scrip ?
Code:
[Files]
Source: File\Bass.dll; DestDir: {tmp}; Flags: dontcopy deleteafterinstall noencryption nocompression
Source: File\music.mp3; DestDir: {tmp}; Flags: dontcopy deleteafterinstall noencryption nocompression

[ Code]
type
HSTREAM = DWORD;

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; offset: DWORD; length: DWORD; flags: DWORD): HSTREAM;
external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
function BASS_Start(): Boolean;
external 'BASS_Start@files:BASS.dll stdcall delayload';
function BASS_Pause(): Boolean;
external 'BASS_Pause@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';


const
BASS_SAMPLE_LOOP = 4;

var
MusicButton: TButton;
Name: string;
i : Integer;

procedure MusicButtonOnClick(Sender: TObject);
begin
if MusicButton.Caption = 'Music On' then
begin
MusicButton.Caption := 'Music Off';
BASS_Pause;
end else 
begin                                                
MusicButton.Caption := 'Music On';
BASS_Start;
end;
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('music.mp3');
if BASS_Init(-1, 44100, 0, 0, 0) then
begin
BASS_Start;
Name:=ExpandConstant('{tmp}\music.mp3');
i:=BASS_StreamCreateFile(FALSE, PAnsiChar(Name), 0, 0, 4);
if i <> 0 then
begin
BASS_ChannelPlay(i, True);
end;

MusicButton := TNewButton.Create(WizardForm);
MusicButton.Parent := WizardForm;
MusicButton.SetBounds(4,337,131,20);
MusicButton.Caption := 'Music On';
MusicButton.OnClick:=@MusicButtonOnClick;
end;
end;

procedure DeinitializeSetup();
begin
BASS_Stop;
BASS_Free;
end;
Reply With Quote
The Following 2 Users Say Thank You to Dante1995 For This Useful Post:
Andrey167 (05-11-2014), minh_k43sj (05-11-2014)
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inno Setup: Additional Libraries altef_4 Conversion Tutorials 50 21-10-2020 09:59
Blackbox Inno Setup Script Kurutucu Conversion Tutorials 1190 18-08-2019 22:43
INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup REV0 Conversion Tutorials 51 26-03-2015 06:57
Copy file with Inno Setup Script emrahcey Software 1 02-07-2010 08:24



All times are GMT -7. The time now is 00:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com