загрузка в новый гит с мелкими правками

This commit is contained in:
2025-12-12 07:23:21 +03:00
parent 2518f9326e
commit b9343e93f0
20 changed files with 289 additions and 423 deletions
+18 -17
View File
@@ -2,7 +2,7 @@ unit uSoundManager;
interface
uses System.classes, winapi.ShellAPI, bass_simple, winapi.windows, System.SysUtils;
uses System.classes, winapi.ShellAPI, {bass_simple,} winapi.windows, System.SysUtils;
type
TSongMachine = class(TObject)
@@ -21,20 +21,21 @@ implementation
uses uGeneral;
var
mp: TBassSimple;
{ var
mp: TBassSimple;}
{ SongMachine }
constructor TSongMachine.Create;
begin
mp := TBassSimple.Create(0);
inherited;
{ mp := TBassSimple.Create(0);}
end;
destructor TSongMachine.Destroy;
begin
mp.FreeStream;
mp.Free;
{ mp.FreeStream;
mp.Free;}
end;
function TimeToSeconds(const timeStr: string): Integer;
@@ -55,7 +56,7 @@ end;
procedure TSongMachine.PlaySilent(AFileName: string; aVolume: string);
var
sec: string;
mm: TBassSimple;
{ mm: TBassSimple;}
begin
try
if not FileExists(AFileName) then
@@ -63,14 +64,14 @@ begin
TTW_Bot.toLog( 'TSongMachine', 'PlayPublic', 'Íåò ôàéëà ' + AFileName,2);
exit;
end;
mm := TBassSimple.Create(0);
try
mm.OpenFile(AFileName);
sec := inttostr(TimeToSeconds(mm.TimeLength) + 1);
finally
mm.FreeStream;
mm.Free;
end;
{ mm := TBassSimple.Create(0);
try
mm.OpenFile(AFileName);
sec := inttostr(TimeToSeconds(mm.TimeLength) + 1);
finally
mm.FreeStream;
mm.Free;
end;}
ShellExecute(0, 'open', PChar(myConst.SilentPlay),
PChar(Format('%s %s "%s"', [sec, aVolume, AFileName])), nil, SW_HIDE);
except
@@ -87,8 +88,8 @@ begin
TTW_Bot.toLog( 'TSongMachine', 'PlayPublic', 'Íåò ôàéëà ' + AFileName,2);
exit;
end;
mp.Volume := strtoint(aVolume);
mp.Play(AFileName)
{ mp.Volume := strtoint(aVolume);
mp.Play(AFileName)}
except
on e: Exception do
TTW_Bot.toLog( 'TSongMachine', 'PlaySilent', e.message,2)