//#define BASS_CurrentTime
#include "botva2.iss"
#include "BASS_Module.iss"
[Setup]
AppName=BadExample
AppVerName=BadExample
CreateAppDir=no
[Files]
Source: BASS_Files\*; DestDir: {tmp}; Flags: dontcopy
Source: Music.mp3; DestDir: {tmp}; Flags: dontcopy
[Code]
// Процедура для изменения громкости
// Можно добавить в сам модуль BASS_Module.iss
//------------------------------------------------------------------------------
procedure BASS_SetVolume(Pos: DWORD);
var
nLeft, bLeft, bTop, bWidth, bHeight: Integer;
begin
if (Pos >= 0) and (Pos <= 100) then begin
BASSChangePos(Pos);
nLeft:= BASS_VolBar.MinLeft + round(BASS_VolBar.BarWidth*BASS_Cfg.Volume/100);
if (nLeft<BASS_VolBar.MinLeft) then nLeft:= BASS_VolBar.MinLeft;
if (nLeft>BASS_VolBar.MaxLeft) then nleft:= BASS_VolBar.MaxLeft;
BtnGetPosition(BASS_VolBar.BarDote, bLeft, bTop, bWidth, bHeight);
BtnSetPosition(BASS_VolBar.BarDote, nLeft, bTop, bWidth, bHeight);
ImgApplyChanges(BASS_VolBar.Parent); // вроде не нужно, но навсякий написал
end;
end;
//------------------------------------------------------------------------------
procedure InitializeWizard;
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('CallbackCtrl.dll');
ExtractTemporaryFile('botva2.dll');
ExtractTemporaryFile('volmax.png');
ExtractTemporaryFile('volmin.png');
ExtractTemporaryFile('volpb.png');
ExtractTemporaryFile('volpbt.png');
ExtractTemporaryFile('voldote.png');
ExtractTemporaryFile('Music.mp3');
BASS_Init('{tmp}\Music.mp3');
BASS_CreateMediaPlayer(WizardForm, '{tmp}\volmax.png', '{tmp}\volmin.png', '{tmp}\volpb.png', '{tmp}\volpbt.png', '{tmp}\voldote.png', 20, 320, 150, True);
BASS_SetVolume(30);
end;
procedure DeinitializeSetup;
begin
BASS_DeInit;
gdipShutdown
end;