Corners the freezing by adding a lot more debug info

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2078 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-10-18 08:42:40 +00:00
parent ddfc0e9dee
commit 4ba3ac9dae
6 changed files with 146 additions and 105 deletions

View File

@ -18,7 +18,7 @@
<AutoIncrementBuild Value="True"/> <AutoIncrementBuild Value="True"/>
<MinorVersionNr Value="3"/> <MinorVersionNr Value="3"/>
<RevisionNr Value="5"/> <RevisionNr Value="5"/>
<BuildNr Value="740"/> <BuildNr Value="746"/>
<StringTable ProductVersion="0.3.5.737"/> <StringTable ProductVersion="0.3.5.737"/>
</VersionInfo> </VersionInfo>
<BuildModes Count="1"> <BuildModes Count="1">
@ -276,7 +276,8 @@
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>
<Debugging> <Debugging>
<UseLineInfoUnit Value="False"/> <GenerateDebugInfo Value="True"/>
<DebugInfoType Value="dsAuto"/>
</Debugging> </Debugging>
<LinkSmart Value="True"/> <LinkSmart Value="True"/>
</Linking> </Linking>

View File

@ -18,7 +18,7 @@ interface
uses uses
Classes, SysUtils, Classes, SysUtils,
{$ifdef HAS_CDROM}cdrom, discid,{$endif} {$ifdef HAS_CDROM}cdrom, discid,{$endif}
lnet, config; lnet, config, debug;
type type
@ -127,7 +127,7 @@ begin
ErrorCode:=0; ErrorCode:=0;
s:=''; s:='';
asocket.GetMessage(s); asocket.GetMessage(s);
writeln('Socket message length: ', Length(s)); DebugOutLn(Format('Socket message length: %d', [Length(s)]), 1);
if s<>'' then begin if s<>'' then begin
if length(s)>3 then begin if length(s)>3 then begin
posi:=pos(#13, s); posi:=pos(#13, s);

View File

@ -5,7 +5,7 @@ object Main: TMain
Width = 893 Width = 893
ActiveControl = Panel4 ActiveControl = Panel4
Caption = 'titel' Caption = 'titel'
ClientHeight = 597 ClientHeight = 604
ClientWidth = 893 ClientWidth = 893
Icon.Data = { Icon.Data = {
3E42000000000100010040400000010020002842000016000000280000004000 3E42000000000100010040400000010020002842000016000000280000004000
@ -548,7 +548,7 @@ object Main: TMain
object StatusBar1: TStatusBar object StatusBar1: TStatusBar
Left = 0 Left = 0
Height = 23 Height = 23
Top = 574 Top = 581
Width = 893 Width = 893
Panels = < Panels = <
item item
@ -562,7 +562,7 @@ object Main: TMain
end end
object Splitter1: TSplitter object Splitter1: TSplitter
Left = 288 Left = 288
Height = 574 Height = 581
Top = 0 Top = 0
Width = 8 Width = 8
AutoSnap = False AutoSnap = False
@ -572,19 +572,19 @@ object Main: TMain
end end
object Panel1: TPanel object Panel1: TPanel
Left = 296 Left = 296
Height = 574 Height = 581
Top = 0 Top = 0
Width = 597 Width = 597
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 574 ClientHeight = 581
ClientWidth = 597 ClientWidth = 597
TabOrder = 0 TabOrder = 0
OnClick = Panel1Click OnClick = Panel1Click
OnResize = Panel1Resize OnResize = Panel1Resize
object TitleTree: TListView object TitleTree: TListView
Left = 0 Left = 0
Height = 144 Height = 151
Top = 5 Top = 5
Width = 587 Width = 587
Align = alTop Align = alTop
@ -599,27 +599,27 @@ object Main: TMain
item item
AutoSize = True AutoSize = True
Caption = 'Artist' Caption = 'Artist'
Width = 44 Width = 567
end end
item item
AutoSize = True AutoSize = True
Caption = 'Title' Caption = 'Title'
Width = 39 Width = 35
end end
item item
AutoSize = True AutoSize = True
Caption = 'Album' Caption = 'Album'
Width = 52
end
item
AutoSize = True
Caption = 'Track'
Width = 44 Width = 44
end end
item
AutoSize = True
Caption = 'Track'
Width = 41
end
item item
AutoSize = True AutoSize = True
Caption = 'Genre' Caption = 'Genre'
Width = 49 Width = 44
end end
item item
AutoSize = True AutoSize = True
@ -631,7 +631,7 @@ object Main: TMain
AutoSize = True AutoSize = True
Caption = 'Length' Caption = 'Length'
MaxWidth = 60 MaxWidth = 60
Width = 341 Width = 48
end> end>
PopupMenu = titlelistmenu PopupMenu = titlelistmenu
ReadOnly = True ReadOnly = True
@ -654,7 +654,7 @@ object Main: TMain
Cursor = crVSplit Cursor = crVSplit
Left = 0 Left = 0
Height = 10 Height = 10
Top = 149 Top = 156
Width = 597 Width = 597
Align = alTop Align = alTop
ResizeAnchor = akTop ResizeAnchor = akTop
@ -662,7 +662,7 @@ object Main: TMain
object Panel3: TPanel object Panel3: TPanel
Left = 0 Left = 0
Height = 415 Height = 415
Top = 159 Top = 166
Width = 597 Width = 597
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
@ -847,7 +847,7 @@ object Main: TMain
end end
object current_title_edit: TEdit object current_title_edit: TEdit
Left = 12 Left = 12
Height = 27 Height = 21
Top = 109 Top = 109
Width = 200 Width = 200
Color = clBtnFace Color = clBtnFace
@ -856,7 +856,7 @@ object Main: TMain
end end
object current_title_edit1: TEdit object current_title_edit1: TEdit
Left = 12 Left = 12
Height = 27 Height = 21
Top = 141 Top = 141
Width = 200 Width = 200
Color = clBtnFace Color = clBtnFace
@ -865,9 +865,9 @@ object Main: TMain
end end
object randomcheck: TCheckBox object randomcheck: TCheckBox
Left = 135 Left = 135
Height = 23 Height = 17
Top = 257 Top = 257
Width = 76 Width = 57
Caption = 'Random' Caption = 'Random'
OnChange = randomcheckChange OnChange = randomcheckChange
TabOrder = 3 TabOrder = 3
@ -919,7 +919,7 @@ object Main: TMain
item item
AutoSize = True AutoSize = True
Caption = 'Playlist' Caption = 'Playlist'
Width = 346 Width = 344
end> end>
PopupMenu = playlistmenu PopupMenu = playlistmenu
ReadOnly = True ReadOnly = True
@ -950,10 +950,10 @@ object Main: TMain
TabOrder = 2 TabOrder = 2
object filetypebox: TComboBox object filetypebox: TComboBox
Left = 360 Left = 360
Height = 27 Height = 21
Top = 8 Top = 8
Width = 90 Width = 90
ItemHeight = 0 ItemHeight = 13
ItemIndex = 0 ItemIndex = 0
Items.Strings = ( Items.Strings = (
'all types' 'all types'
@ -971,7 +971,7 @@ object Main: TMain
end end
object searchstr: TEdit object searchstr: TEdit
Left = 120 Left = 120
Height = 27 Height = 21
Top = 8 Top = 8
Width = 232 Width = 232
OnKeyUp = searchstrKeyUp OnKeyUp = searchstrKeyUp
@ -1013,11 +1013,11 @@ object Main: TMain
end end
object clear_list: TBitBtn object clear_list: TBitBtn
AnchorSideBottom.Side = asrCenter AnchorSideBottom.Side = asrCenter
Left = 517 Left = 509
Height = 30 Height = 30
Hint = 'Clear Playlist' Hint = 'Clear Playlist'
Top = 7 Top = 7
Width = 66 Width = 74
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
AutoSize = True AutoSize = True
Caption = 'Clear' Caption = 'Clear'
@ -1084,9 +1084,9 @@ object Main: TMain
end end
object lblPath: TLabel object lblPath: TLabel
Left = 8 Left = 8
Height = 20 Height = 14
Top = 56 Top = 56
Width = 46 Width = 33
Caption = 'lblPath' Caption = 'lblPath'
ParentColor = False ParentColor = False
end end
@ -1094,19 +1094,19 @@ object Main: TMain
end end
object Panel4: TPanel object Panel4: TPanel
Left = 0 Left = 0
Height = 574 Height = 581
Top = 0 Top = 0
Width = 288 Width = 288
Align = alLeft Align = alLeft
BorderSpacing.InnerBorder = 30 BorderSpacing.InnerBorder = 30
BevelOuter = bvNone BevelOuter = bvNone
ClientHeight = 574 ClientHeight = 581
ClientWidth = 288 ClientWidth = 288
TabOrder = 1 TabOrder = 1
OnClick = Panel4Click OnClick = Panel4Click
object ArtistTree: TTreeView object ArtistTree: TTreeView
Left = 26 Left = 26
Height = 564 Height = 571
Top = 5 Top = 5
Width = 259 Width = 259
Align = alClient Align = alClient
@ -1116,7 +1116,7 @@ object Main: TMain
BorderSpacing.InnerBorder = 20 BorderSpacing.InnerBorder = 20
BorderSpacing.CellAlignHorizontal = ccaLeftTop BorderSpacing.CellAlignHorizontal = ccaLeftTop
BorderSpacing.CellAlignVertical = ccaLeftTop BorderSpacing.CellAlignVertical = ccaLeftTop
DefaultItemHeight = 22 DefaultItemHeight = 16
DragMode = dmAutomatic DragMode = dmAutomatic
ExpandSignType = tvestArrow ExpandSignType = tvestArrow
Images = ImageList1 Images = ImageList1
@ -1147,9 +1147,9 @@ object Main: TMain
OnClick = ArtistSrchFieldClick OnClick = ArtistSrchFieldClick
object Label2: TLabel object Label2: TLabel
Left = 77 Left = 77
Height = 20 Height = 14
Top = 8 Top = 8
Width = 44 Width = 34
Caption = 'Search' Caption = 'Search'
ParentColor = False ParentColor = False
end end
@ -1200,7 +1200,7 @@ object Main: TMain
end end
object artistsearch: TEdit object artistsearch: TEdit
Left = 8 Left = 8
Height = 27 Height = 21
Top = 32 Top = 32
Width = 110 Width = 110
OnKeyUp = ArtistTreeKeyUp OnKeyUp = ArtistTreeKeyUp
@ -1210,7 +1210,7 @@ object Main: TMain
end end
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 0 Left = 0
Height = 569 Height = 576
Top = 5 Top = 5
Width = 26 Width = 26
Align = alLeft Align = alLeft

View File

@ -903,6 +903,7 @@ procedure TMain.playClick(Sender: TObject);
var var
err: integer; err: integer;
begin begin
DebugOutLn('[TMain.playClick] START', 1);
if (not PlayerObj.paused) then if (not PlayerObj.paused) then
begin begin
playtimer.Enabled := False; playtimer.Enabled := False;
@ -948,6 +949,7 @@ begin
//if player paused //if player paused
pauseClick(nil); pauseClick(nil);
end; end;
DebugOutLn('[TMain.playClick] END', 1);
end; end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@ -975,6 +977,7 @@ var
tmppos: integer; tmppos: integer;
fileobj: TMediaFileClass; fileobj: TMediaFileClass;
begin begin
DebugOutLn('[TMain.playtimerTimer] START', 1);
try try
// if PlayerObj.playing=false then stopClick(nil); // if PlayerObj.playing=false then stopClick(nil);
if PlayerObj.PlaybackMode = STREAMING_MODE then if PlayerObj.PlaybackMode = STREAMING_MODE then
@ -984,11 +987,11 @@ begin
else else
StatusBar1.Panels[0].Text := 'Buffering Stream...'; StatusBar1.Panels[0].Text := 'Buffering Stream...';
end; end;
// writeln('ontimer'); DebugOutLn('[TMain.playtimerTimer] A', 1);
if (PlayerObj.playing) and (PlayerObj.PlaybackMode = FILE_MODE) and if (PlayerObj.playing) and (PlayerObj.PlaybackMode = FILE_MODE) and
(PlayerObj.paused = False) then (PlayerObj.paused = False) then
begin begin
// writeln('player playing'); DebugOutLn('[TMain.playtimerTimer] player playing', 1);
if not bPnlPlaytimeNegated then if not bPnlPlaytimeNegated then
pnlPlaytime.Caption := PlayerObj.get_timestr pnlPlaytime.Caption := PlayerObj.get_timestr
@ -998,14 +1001,18 @@ begin
playwin.TimeImg.Canvas.Font.Color := ClNavy; playwin.TimeImg.Canvas.Font.Color := ClNavy;
playwin.TimeImg.Canvas.TextOut(5, 3, pnlPlaytime.Caption); playwin.TimeImg.Canvas.TextOut(5, 3, pnlPlaytime.Caption);
DebugOutLn('[TMain.playtimerTimer] B', 1);
DebugOutLn(Format('[TMain.playtimerTimer] tmppos=%d', [tmppos]), 1);
tmppos := PlayerObj.Get_FilePosition; tmppos := PlayerObj.Get_FilePosition;
trackbar.position := tmppos; trackbar.position := tmppos;
// writeln(tmppos);
x2 := (trackbar.position * 2) - 3; x2 := (trackbar.position * 2) - 3;
if x2 < 3 then if x2 < 3 then
x2 := 3; x2 := 3;
DebugOutLn('[TMain.playtimerTimer] D', 1);
if (tmppos = 100) then if (tmppos = 100) then
begin begin
DebugOutLn('[TMain.playtimerTimer] E', 1);
// writeln('nexttrack'); // writeln('nexttrack');
// WriteLn(PlayerObj.CurrentTrack); // WriteLn(PlayerObj.CurrentTrack);
if (PlayerObj.CurrentTrack < PlayerObj.Playlist.ItemCount) then if (PlayerObj.CurrentTrack < PlayerObj.Playlist.ItemCount) then
@ -1015,6 +1022,7 @@ begin
end; end;
if CactusConfig.CoverDownload and (CoverFound = False) and (LoopCount < 20) then if CactusConfig.CoverDownload and (CoverFound = False) and (LoopCount < 20) then
begin begin
DebugOutLn('[TMain.playtimerTimer] F', 1);
Inc(LoopCount); Inc(LoopCount);
if (assigned(LastFMAPI)) and (LastFMAPI.data_ready) then if (assigned(LastFMAPI)) and (LastFMAPI.data_ready) then
begin begin
@ -1025,7 +1033,7 @@ begin
CoverImage.Picture.LoadFromFile(fileobj.CoverPath); CoverImage.Picture.LoadFromFile(fileobj.CoverPath);
playwin.AlbumCoverImg.Picture.LoadFromFile(fileobj.CoverPath); playwin.AlbumCoverImg.Picture.LoadFromFile(fileobj.CoverPath);
except except
DebugOutLn('EXCEPTION', 3); DebugOutLn('EXCEPTION', 1);
end; end;
end; end;
CoverFound := True; CoverFound := True;
@ -1034,13 +1042,17 @@ begin
end end
else if (LoopCount >= 20) and (CoverFound = False) then else if (LoopCount >= 20) and (CoverFound = False) then
CoverImage.Picture.Clear; CoverImage.Picture.Clear;
DebugOutLn('[TMain.playtimerTimer] G', 1);
end end
else else
begin
DebugOutLn('[TMain.playtimerTimer] H', 1);
{playtimer.Enabled:=false}; {playtimer.Enabled:=false};
end;
except except
DebugOutLn('CAUGHT EXCEPTION IN PLAYTIMER!!!!', 3); DebugOutLn('CAUGHT EXCEPTION IN PLAYTIMER!!!!', 1);
end; end;
DebugOutLn('[TMain.playtimerTimer] END', 1);
end; end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@ -3292,12 +3304,11 @@ end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
procedure TMain.checkmobileTimer(Sender: TObject); procedure TMain.checkmobileTimer(Sender: TObject);
var var
PlayerScanThread: TScanThread; PlayerScanThread: TScanThread;
tmps: string; tmps: string;
begin begin
DebugOutLn('[TMain.checkmobileTimer] START', 1);
if (player_connected = False) and FileExists(CactusConfig.DAPPath + 'cactuslib') then if (player_connected = False) and FileExists(CactusConfig.DAPPath + 'cactuslib') then
begin begin
DebugOut('DAP detected...', 2); DebugOut('DAP detected...', 2);
@ -3333,6 +3344,7 @@ begin
disconnectDAP; disconnectDAP;
StatusBar1.Panels[1].Text := 'Device disconnected'; StatusBar1.Panels[1].Text := 'Device disconnected';
end; end;
DebugOutLn('[TMain.checkmobileTimer] END', 1);
end; end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

View File

@ -95,14 +95,15 @@ const MPLAYER_BINARY='mplayer.exe';
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
procedure TMPlayerClass.SendCommand(cmd: string); procedure TMPlayerClass.SendCommand(cmd: string);
begin begin
// writeln('sendcommand'); DebugOutLn('[TMPlayerClass.sendcommand] START cmd=' + cmd, 1);
cmd:=cmd+#10; //MPLayer always needs #10 as Lineending, no matter if win32 or linux cmd:=cmd+#13#10; //MPLayer always needs #10 as Lineending, no matter if win32 or linux
try try
// writeln('sendcommand2'); DebugOutLn('[TMPlayerClass.sendcommand] 2', 1);
if GetMPlayerPlaying then MPlayerProcess.Input.write(cmd[1], length(cmd)); if GetMPlayerPlaying then MPlayerProcess.Input.write(cmd[1], length(cmd));
// writeln('sendcommand3'); DebugOutLn('[TMPlayerClass.sendcommand] 3', 1);
except writeln('EXCEPTION sending command to mplayer'); except
end; DebugOutLn('EXCEPTION sending command to mplayer', 1);
end;
end; end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function TMPlayerClass.GetProcessOutput: string; function TMPlayerClass.GetProcessOutput: string;
@ -176,39 +177,55 @@ end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function TMPlayerClass.play(index: integer): byte; function TMPlayerClass.play(index: integer): byte;
var MPOptions: String; var
MPOptions: String;
begin begin
if (index<Playlist.ItemCount) and (index>=0) then begin DebugOutLn('[TMPlayerClass.play]', 1);
if (FileExists(playlist.items[index].path)) then begin if (index<Playlist.ItemCount) and (index>=0) then
if FPlaying then stop; begin
MPlayerProcess:=TProcess.Create(nil); if (FileExists(playlist.items[index].path)) then
begin
if FPlaying then stop;
if not UseExternalConfig then begin MPlayerProcess:=TProcess.Create(nil);
MPOptions:='-slave -quiet -softvol';
if OutputMode=ALSAOUT then MPOptions:=MPOptions+' -ao alsa';
if OutputMode=OSSOUT then MPOptions:=MPOptions+' -ao oss';
end else MPOptions:='-include '+ExternalConfigFile;
MPOptions:=' -af volume=' + IntToStr(IntTodB(FVolume, 100)) +' '+ MPOptions;// -volume xx only supported with patched mplayer; if not UseExternalConfig then
begin
MPOptions:='-slave -quiet -softvol';
if OutputMode=ALSAOUT then MPOptions:=MPOptions+' -ao alsa';
if OutputMode=OSSOUT then MPOptions:=MPOptions+' -ao oss';
end
else
MPOptions:='-include '+ExternalConfigFile;
FPlaybackMode:=FILE_MODE; MPOptions:=' -af volume=' + IntToStr(IntTodB(FVolume, 100)) +' '+ MPOptions;// -volume xx only supported with patched mplayer;
//DebugOutLn('playing -> '+playlist.items[index].path, 1);
// writeln(StringReplace(playlist.items[index].path, '''', '''''', [rfReplaceAll]));
MPlayerProcess.CommandLine:=FMplayerPath+' '+MPOptions+' "'+playlist.items[index].path+'"';
DebugOutLn(MPlayerProcess.CommandLine,5); FPlaybackMode:=FILE_MODE;
FLastGet_Pos:=0;
MPlayerProcess.Options:= MPlayerProcess.Options + [poUsePipes, poDefaultErrorMode, poStderrToOutPut, poNoConsole];
MPlayerProcess.Execute;
if MPlayerProcess.Running then begin DebugOutLn('playing -> '+playlist.items[index].path, 1);
FCurrentTrack:=index; DebugOutLn(StringReplace(playlist.items[index].path, '''', '''''', [rfReplaceAll]), 1);
FPlaying:=true;
Playlist.Items[index].Played:=true; MPlayerProcess.CommandLine:=FMplayerPath+' '+MPOptions+' "'+playlist.items[index].path+'"';
result:=0;
end; DebugOutLn(MPlayerProcess.CommandLine,5);
end else result:=1; FLastGet_Pos:=0;
end else DebugOutLn('File not found ->'+playlist.items[index].path,0); MPlayerProcess.Options:= MPlayerProcess.Options + [poUsePipes, poDefaultErrorMode, poStderrToOutPut, poNoConsole];
MPlayerProcess.Execute;
if MPlayerProcess.Running then
begin
DebugOutLn('MPlayerProcess is Running', 1);
FCurrentTrack:=index;
FPlaying:=true;
Playlist.Items[index].Played:=true;
result:=0;
end;
end
else
result:=1;
end
else
DebugOutLn('File not found ->'+playlist.items[index].path,0);
end; end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function TMPlayerClass.play(url: string): byte; function TMPlayerClass.play(url: string): byte;
@ -364,27 +381,38 @@ end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function TMPlayerClass.Get_FilePosition: longint; function TMPlayerClass.Get_FilePosition: longint;
var tmps: string; var
i:integer; tmps: string;
i:integer;
begin begin
if GetMPlayerPlaying then begin DebugOutLn('[TMPlayerClass.Get_FilePosition] START', 1);
i:=0; if GetMPlayerPlaying then
repeat begin begin
SendCommand('get_property percent_pos'); DebugOutLn('[TMPlayerClass.Get_FilePosition] A', 1);
sleep(8); i:=0;
tmps:=GetProcessOutput; repeat
inc(i); SendCommand('get_property percent_pos');
// writeln('jj'); sleep(8);
end; tmps:=GetProcessOutput;
until (pos('percent_pos', tmps)>0) or (i>=5); inc(i);
// writeln('getpos'); DebugOutLn('[TMPlayerClass.Get_FilePosition] ' + tmps, 1);
i:=LastDelimiter('=', tmps); until (pos('percent_pos', tmps)>0) or (i>=5);
if i > 0 then begin
FLastGet_Pos:=round(StrToFloat(Copy(tmps, i+1, Length(tmps)-i))); // writeln('getpos');
result:=FLastGet_Pos; i:=LastDelimiter('=', tmps);
end else result:=-1; if i > 0 then
end else result:=-1; begin
if (result=-1) and (FLastGet_Pos>0) then Result:=100; FLastGet_Pos:=round(StrToFloat(Copy(tmps, i+1, Length(tmps)-i)));
result:=FLastGet_Pos;
end
else
result:=-1;
end
else
result:=-1;
if (result=-1) and (FLastGet_Pos>0) then Result:=100;
DebugOutLn('[TMPlayerClass.Get_FilePosition] END', 1);
end; end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function TMPlayerClass.get_FileLength: longint; function TMPlayerClass.get_FileLength: longint;

View File

@ -33,7 +33,7 @@ TAudioBackend=(MPLAYERBACK, FMODBACK);
{ TPlayerClass } { TPlayerClass }
type type
TPlayerClass = class TPlayerClass = class
Protected Protected
fTotalLength: int64; fTotalLength: int64;
FPlaying, FPaused: Boolean; FPlaying, FPaused: Boolean;