Jump to content
Korean Random


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Noob

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. здравствуйте а можно заменить иконку ноты милодии заменить на другую #define USE_BASS [Files] #ifdef USE_BASS Source: {#Way}\bass.dll; flags: dontcopy; #endif [Code] const LB_ITEMFROMPOINT = $01A9; #ifdef UNICODE #define A "W" #define Phrase "#$266B" #else #define A "A" #define Phrase "'(пример)'" #endif type TComponentSound = record SoundName: String; Index: Integer; end; HSTREAM = Longword; var iSound: array of TComponentSound; sndCompOldProc: TNotifyEvent; #ifdef USE_BASS BASS_Handle: HWND; #endif function GetCursorPos(var lpPoint: TPoint): BOOL; external 'GetCursorPos@user32.dll stdcall'; function MapWindowPoints(hWndFrom, hWndTo: HWND; var lpPoints: TPoint; cPoints: UINT): Integer; external 'MapWindowPoints@user32.dll stdcall'; #ifdef USE_BASS function BASS_Init(device: LongInt; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean; external 'BASS_Init@files:BASS.dll stdcall delayload'; function BASS_StreamCreateFile(mem: BOOL; f: PAnsiChar; offset1, offset2, length1, length2: DWORD; flags: DWORD): HSTREAM; external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload'; function BASS_StreamFree(handle: HSTREAM): BOOL; external 'BASS_StreamFree@files:BASS.dll stdcall delayload'; function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean; external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload'; function BASS_Start(): Boolean; external 'BASS_Start@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'; #else function sndPlaySound(lpszSoundName: String; fuSound: UINT): BOOL; external 'sndPlaySound{#A}@winmm.dll stdcall'; #endif #ifdef USE_BASS procedure bassPlaySound(Filename: AnsiString); begin if (BASS_Handle <> -1) then begin BASS_Stop(); BASS_StreamFree(BASS_Handle); BASS_Handle:= -1; end; BASS_Handle:= BASS_StreamCreateFile(false, PAnsiChar(Filename), 0, 0, 0, 0, 0); BASS_Start(); BASS_ChannelPlay(BASS_Handle, false); end; #endif procedure PlaySound(Sender: TObject); var i, f, lParam, ids: Integer; p: TPoint; s: String; box: TNewCheckListBox; begin box:= TNewCheckListBox(Sender); GetCursorPos(p); MapWindowPoints(0, box.Handle, p, 1); lParam:= p.x or (p.y shl 16); i:= SendMessage(WizardForm.ComponentsList.Handle, LB_ITEMFROMPOINT, 0, lParam); if ((i shr 16) = 1) or ((i and $FFFF) < 0) then Exit; i:= i and $FFFF; if (i < 0) or (i >= box.Items.Count) then Exit; ids:= i; f:= -1; for i:= 0 to GetArrayLength(iSound)-1 do begin if (ids = iSound[i].Index) then begin f:= i; Break; end; end; if (f < 0) then Exit; s:= box.ItemCaption[ids]; if (Pos({#Phrase}, s) <= 0) then Exit; if FileExists(iSound[f].SoundName) then #ifdef USE_BASS bassPlaySound(iSound[f].SoundName); #else sndPlaySound(iSound[f].SoundName, 0); #endif if (sndCompOldProc <> nil) then sndCompOldProc(Sender); end; procedure AddItemSound(AIndex: Integer; AFilename: String); var i: Integer; begin i:= GetArrayLength(iSound); SetArrayLength(iSound, i+1); iSound[i].Index:= AIndex-1; iSound[i].SoundName:= ExpandConstant(AFilename); WizardForm.ComponentsList.ItemCaption[AIndex-1]:= WizardForm.ComponentsList.ItemCaption[AIndex-1] + ' '+{#Phrase}; end; procedure InitializeWizard10(); begin #ifdef USE_BASS BASS_Init(-1, 44100, 0, 0, 0); BASS_Start(); BASS_Handle:= -1; #endif WizardForm.ComponentsList.Width := ScaleX(483); WizardForm.ComponentsList.Height := ScaleY(270); sndCompOldProc:= WizardForm.ComponentsList.OnClick; WizardForm.ComponentsList.OnClick:= @PlaySound; ExtractTemporaryFile('Озвучка Фрагов в бою.mp3'); AddItemSound(2, '{tmp}\Озвучка Фрагов в бою.mp3'); end; #ifdef USE_BASS procedure DeinitializeSetup(); begin BASS_Stop(); BASS_Free(); end; #endif
  • Create New...