diff --git a/applications/cactusjukebox/source/cactusjukebox.lpi b/applications/cactusjukebox/source/cactusjukebox.lpi
index 4cb2b339c..c3dc1bb3e 100644
--- a/applications/cactusjukebox/source/cactusjukebox.lpi
+++ b/applications/cactusjukebox/source/cactusjukebox.lpi
@@ -18,7 +18,7 @@
-
+
diff --git a/applications/cactusjukebox/source/cactusjukebox.pas b/applications/cactusjukebox/source/cactusjukebox.pas
index 569279528..710c55362 100644
--- a/applications/cactusjukebox/source/cactusjukebox.pas
+++ b/applications/cactusjukebox/source/cactusjukebox.pas
@@ -40,7 +40,7 @@ var
begin
Application.Title:='cactus';
{$ifdef CactusDebug}
- CVerbosityLevel:=9;
+ CVerbosityLevel:=8;
{$else}
{$ifdef Windows}
CVerbosityLevel:=0;
diff --git a/applications/cactusjukebox/source/mainform.pas b/applications/cactusjukebox/source/mainform.pas
index fb48c8f97..bdc349489 100644
--- a/applications/cactusjukebox/source/mainform.pas
+++ b/applications/cactusjukebox/source/mainform.pas
@@ -987,11 +987,11 @@ begin
else
StatusBar1.Panels[0].Text := 'Buffering Stream...';
end;
- DebugOutLn('[TMain.playtimerTimer] A', 1);
+ DebugOutLn('[TMain.playtimerTimer] A', 9);
if (PlayerObj.playing) and (PlayerObj.PlaybackMode = FILE_MODE) and
(PlayerObj.paused = False) then
begin
- DebugOutLn('[TMain.playtimerTimer] player playing', 1);
+ DebugOutLn('[TMain.playtimerTimer] player playing', 9);
if not bPnlPlaytimeNegated then
pnlPlaytime.Caption := PlayerObj.get_timestr
@@ -1001,18 +1001,18 @@ begin
playwin.TimeImg.Canvas.Font.Color := ClNavy;
playwin.TimeImg.Canvas.TextOut(5, 3, pnlPlaytime.Caption);
- DebugOutLn('[TMain.playtimerTimer] B', 3);
+ DebugOutLn('[TMain.playtimerTimer] B', 9);
- DebugOutLn(Format('[TMain.playtimerTimer] tmppos=%d', [tmppos]), 3);
+ DebugOutLn(Format('[TMain.playtimerTimer] tmppos=%d', [tmppos]), 9);
tmppos := PlayerObj.Get_FilePosition;
trackbar.position := tmppos;
x2 := (trackbar.position * 2) - 3;
if x2 < 3 then
x2 := 3;
- DebugOutLn('[TMain.playtimerTimer] D', 3);
+ DebugOutLn('[TMain.playtimerTimer] D', 9);
if (tmppos = 100) then
begin
- DebugOutLn('[TMain.playtimerTimer] E', 3);
+ DebugOutLn('[TMain.playtimerTimer] E', 9);
// writeln('nexttrack');
// WriteLn(PlayerObj.CurrentTrack);
if (PlayerObj.CurrentTrack < PlayerObj.Playlist.ItemCount) then
@@ -1022,7 +1022,7 @@ begin
end;
if CactusConfig.CoverDownload and (CoverFound = False) and (LoopCount < 20) then
begin
- DebugOutLn('[TMain.playtimerTimer] F', 3);
+ DebugOutLn('[TMain.playtimerTimer] F', 9);
Inc(LoopCount);
if (assigned(LastFMAPI)) and (LastFMAPI.data_ready) then
begin
@@ -1033,7 +1033,7 @@ begin
CoverImage.Picture.LoadFromFile(fileobj.CoverPath);
playwin.AlbumCoverImg.Picture.LoadFromFile(fileobj.CoverPath);
except
- DebugOutLn('EXCEPTION', 1);
+ DebugOutLn('[TMain.playtimerTimer] EXCEPTION', 1);
end;
end;
CoverFound := True;
@@ -1042,15 +1042,15 @@ begin
end
else if (LoopCount >= 20) and (CoverFound = False) then
CoverImage.Picture.Clear;
- DebugOutLn('[TMain.playtimerTimer] G', 3);
+ DebugOutLn('[TMain.playtimerTimer] G', 9);
end
else
begin
- DebugOutLn('[TMain.playtimerTimer] H', 3);
+ DebugOutLn('[TMain.playtimerTimer] H', 9);
{playtimer.Enabled:=false};
end;
except
- DebugOutLn('CAUGHT EXCEPTION IN PLAYTIMER!!!!', 1);
+ DebugOutLn('[TMain.playtimerTimer] CAUGHT EXCEPTION IN PLAYTIMER!!!!', 1);
end;
DebugOutLn('[TMain.playtimerTimer] END', 3);
end;
diff --git a/applications/cactusjukebox/source/mplayer.pas b/applications/cactusjukebox/source/mplayer.pas
index aaa373a0e..f6a39fdd9 100644
--- a/applications/cactusjukebox/source/mplayer.pas
+++ b/applications/cactusjukebox/source/mplayer.pas
@@ -101,16 +101,17 @@ procedure TMPlayerClass.SendCommand(cmd: string);
var
res: DWORD;
begin
- DebugOutLn('[TMPlayerClass.sendcommand] START cmd=' + cmd, 3);
+ DebugOutLn('[TMPlayerClass.sendcommand] START cmd=' + cmd, 9);
cmd:=cmd+#10; //MPLayer always needs #10 as Lineending, no matter if win32 or linux
try
if GetMPlayerPlaying then
begin
- //DebugOutLn('[TMPlayerClass.sendcommand] 2', 3);
MPlayerProcess.Input.write(cmd[1], length(cmd));
+
+ // Equivalent using the Windows API, which freezes if the buffer is full (aka, not read by mplayer)
//Windows.WriteFile(MPlayerProcess.Input.Handle,cmd[1],length(cmd), res, nil);
end;
- DebugOutLn('[TMPlayerClass.sendcommand] END', 3);
+ DebugOutLn('[TMPlayerClass.sendcommand] END', 9);
except
DebugOutLn('EXCEPTION sending command to mplayer', 3);
end;
@@ -134,7 +135,7 @@ begin
end;
//writeln('endget');
AStringList.Free;
- DebugOutLn('[TMPlayerClass.GetProcessOutput] Result=' + Result, 3);
+ DebugOutLn('[TMPlayerClass.GetProcessOutput] Result=' + Result, 9);
end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -195,7 +196,7 @@ var
MPOptions: String;
i: Integer;
begin
- DebugOutLn('[TMPlayerClass.play]', 3);
+ DebugOutLn('[TMPlayerClass.play]', 5);
if (index=0) then
begin
if (FileExists(playlist.items[index].path)) then
@@ -222,14 +223,14 @@ begin
MPlayerProcess.CommandLine:=FMplayerPath+' '+MPOptions+' "'+playlist.items[index].path+'"';
- DebugOutLn(MPlayerProcess.CommandLine,5);
+ DebugOutLn(MPlayerProcess.CommandLine, 5);
FLastGet_Pos:=0;
- MPlayerProcess.Options:= MPlayerProcess.Options + [poUsePipes, poDefaultErrorMode{, poStderrToOutPut}, poNoConsole];
+ MPlayerProcess.Options:= MPlayerProcess.Options + [poUsePipes, poDefaultErrorMode, poNoConsole]; {, poStderrToOutPut <= This caused freezes in Windows}
MPlayerProcess.Execute;
if MPlayerProcess.Running then
begin
- DebugOutLn('MPlayerProcess is Running', 3);
+ DebugOutLn('MPlayerProcess is Running', 9);
FCurrentTrack:=index;
FPlaying:=true;
Playlist.Items[index].Played:=true;
@@ -240,7 +241,7 @@ begin
result:=1;
end
else
- DebugOutLn('File not found ->'+playlist.items[index].path,0);
+ DebugOutLn('File not found ->'+playlist.items[index].path, 1);
end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function TMPlayerClass.play(url: string): byte;
@@ -400,17 +401,17 @@ var
tmps: string;
i:integer;
begin
- DebugOutLn('[TMPlayerClass.Get_FilePosition] START', 3);
+ DebugOutLn('[TMPlayerClass.Get_FilePosition] START', 9);
if GetMPlayerPlaying then
begin
- DebugOutLn('[TMPlayerClass.Get_FilePosition] A', 3);
+ DebugOutLn('[TMPlayerClass.Get_FilePosition] A', 9);
i:=0;
repeat
SendCommand('get_property percent_pos');
sleep(8);
tmps:=GetProcessOutput;
inc(i);
- DebugOutLn('[TMPlayerClass.Get_FilePosition] GetProcessOutput=' + tmps, 3);
+ DebugOutLn('[TMPlayerClass.Get_FilePosition] GetProcessOutput=' + tmps, 9);
until (pos('percent_pos', tmps)>0) or (i>=5);
// writeln('getpos');
@@ -427,7 +428,7 @@ begin
result:=-1;
if (result=-1) and (FLastGet_Pos>0) then Result:=100;
- DebugOutLn('[TMPlayerClass.Get_FilePosition] END', 3);
+ DebugOutLn('[TMPlayerClass.Get_FilePosition] END', 9);
end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function TMPlayerClass.get_FileLength: longint;