Adds a release mode for the CactusJukebox without so much debug info

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2079 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-10-18 08:53:29 +00:00
parent 4ba3ac9dae
commit b39e1cce61
4 changed files with 82 additions and 24 deletions

View File

@ -21,8 +21,59 @@
<BuildNr Value="746"/> <BuildNr Value="746"/>
<StringTable ProductVersion="0.3.5.737"/> <StringTable ProductVersion="0.3.5.737"/>
</VersionInfo> </VersionInfo>
<BuildModes Count="1"> <BuildModes Count="2">
<Item1 Name="default" Default="True"/> <Item1 Name="Debug" Default="True"/>
<Item2 Name="Release">
<CompilerOptions>
<Version Value="10"/>
<Target>
<Filename Value="../cactus_jukebox"/>
</Target>
<SearchPaths>
<OtherUnitFiles Value="fmodintf;tagreader;plugin/sdk;plugin/impl"/>
<UnitOutputDirectory Value="../source/obj"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<CStyleOperator Value="False"/>
<AllowLabel Value="False"/>
<UseAnsiStrings Value="False"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<IOChecks Value="True"/>
<RangeChecks Value="True"/>
<OverflowChecks Value="True"/>
<StackChecks Value="True"/>
</Checks>
<Optimizations>
<OptimizationLevel Value="0"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<DebugInfoType Value="dsAuto"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<Verbosity>
<ShowHintsForUnusedUnitsInMainSrc Value="True"/>
</Verbosity>
<WriteFPCLogo Value="False"/>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</Item2>
</BuildModes> </BuildModes>
<PublishOptions> <PublishOptions>
<Version Value="2"/> <Version Value="2"/>

View File

@ -41,9 +41,13 @@ begin
Application.Title:='cactus'; Application.Title:='cactus';
{$ifdef CactusDebug} {$ifdef CactusDebug}
CVerbosityLevel:=9; CVerbosityLevel:=9;
{$else}
{$ifdef Windows}
CVerbosityLevel:=0;
{$else} {$else}
CVerbosityLevel:=1; CVerbosityLevel:=1;
{$endif} {$endif}
{$endif}
DebugOutLn('', 1); DebugOutLn('', 1);

View File

@ -977,7 +977,7 @@ var
tmppos: integer; tmppos: integer;
fileobj: TMediaFileClass; fileobj: TMediaFileClass;
begin begin
DebugOutLn('[TMain.playtimerTimer] START', 1); DebugOutLn('[TMain.playtimerTimer] START', 3);
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
@ -1001,18 +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('[TMain.playtimerTimer] B', 3);
DebugOutLn(Format('[TMain.playtimerTimer] tmppos=%d', [tmppos]), 1); DebugOutLn(Format('[TMain.playtimerTimer] tmppos=%d', [tmppos]), 3);
tmppos := PlayerObj.Get_FilePosition; tmppos := PlayerObj.Get_FilePosition;
trackbar.position := tmppos; trackbar.position := 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); DebugOutLn('[TMain.playtimerTimer] D', 3);
if (tmppos = 100) then if (tmppos = 100) then
begin begin
DebugOutLn('[TMain.playtimerTimer] E', 1); DebugOutLn('[TMain.playtimerTimer] E', 3);
// writeln('nexttrack'); // writeln('nexttrack');
// WriteLn(PlayerObj.CurrentTrack); // WriteLn(PlayerObj.CurrentTrack);
if (PlayerObj.CurrentTrack < PlayerObj.Playlist.ItemCount) then if (PlayerObj.CurrentTrack < PlayerObj.Playlist.ItemCount) then
@ -1022,7 +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); DebugOutLn('[TMain.playtimerTimer] F', 3);
Inc(LoopCount); Inc(LoopCount);
if (assigned(LastFMAPI)) and (LastFMAPI.data_ready) then if (assigned(LastFMAPI)) and (LastFMAPI.data_ready) then
begin begin
@ -1042,17 +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); DebugOutLn('[TMain.playtimerTimer] G', 3);
end end
else else
begin begin
DebugOutLn('[TMain.playtimerTimer] H', 1); DebugOutLn('[TMain.playtimerTimer] H', 3);
{playtimer.Enabled:=false}; {playtimer.Enabled:=false};
end; end;
except except
DebugOutLn('CAUGHT EXCEPTION IN PLAYTIMER!!!!', 1); DebugOutLn('CAUGHT EXCEPTION IN PLAYTIMER!!!!', 1);
end; end;
DebugOutLn('[TMain.playtimerTimer] END', 1); DebugOutLn('[TMain.playtimerTimer] END', 3);
end; end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

View File

@ -95,14 +95,17 @@ const MPLAYER_BINARY='mplayer.exe';
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
procedure TMPlayerClass.SendCommand(cmd: string); procedure TMPlayerClass.SendCommand(cmd: string);
begin begin
DebugOutLn('[TMPlayerClass.sendcommand] START cmd=' + cmd, 1); DebugOutLn('[TMPlayerClass.sendcommand] START cmd=' + cmd, 3);
cmd:=cmd+#13#10; //MPLayer always needs #10 as Lineending, no matter if win32 or linux cmd:=cmd+#10; //MPLayer always needs #10 as Lineending, no matter if win32 or linux
try try
DebugOutLn('[TMPlayerClass.sendcommand] 2', 1); if GetMPlayerPlaying then
if GetMPlayerPlaying then MPlayerProcess.Input.write(cmd[1], length(cmd)); begin
DebugOutLn('[TMPlayerClass.sendcommand] 3', 1); DebugOutLn('[TMPlayerClass.sendcommand] 2', 3);
MPlayerProcess.Input.write(cmd[1], length(cmd));
end;
DebugOutLn('[TMPlayerClass.sendcommand] 3', 3);
except except
DebugOutLn('EXCEPTION sending command to mplayer', 1); DebugOutLn('EXCEPTION sending command to mplayer', 3);
end; end;
end; end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@ -180,7 +183,7 @@ function TMPlayerClass.play(index: integer): byte;
var var
MPOptions: String; MPOptions: String;
begin begin
DebugOutLn('[TMPlayerClass.play]', 1); DebugOutLn('[TMPlayerClass.play]', 3);
if (index<Playlist.ItemCount) and (index>=0) then if (index<Playlist.ItemCount) and (index>=0) then
begin begin
if (FileExists(playlist.items[index].path)) then if (FileExists(playlist.items[index].path)) then
@ -214,7 +217,7 @@ begin
if MPlayerProcess.Running then if MPlayerProcess.Running then
begin begin
DebugOutLn('MPlayerProcess is Running', 1); DebugOutLn('MPlayerProcess is Running', 3);
FCurrentTrack:=index; FCurrentTrack:=index;
FPlaying:=true; FPlaying:=true;
Playlist.Items[index].Played:=true; Playlist.Items[index].Played:=true;
@ -385,17 +388,17 @@ var
tmps: string; tmps: string;
i:integer; i:integer;
begin begin
DebugOutLn('[TMPlayerClass.Get_FilePosition] START', 1); DebugOutLn('[TMPlayerClass.Get_FilePosition] START', 3);
if GetMPlayerPlaying then if GetMPlayerPlaying then
begin begin
DebugOutLn('[TMPlayerClass.Get_FilePosition] A', 1); DebugOutLn('[TMPlayerClass.Get_FilePosition] A', 3);
i:=0; i:=0;
repeat repeat
SendCommand('get_property percent_pos'); SendCommand('get_property percent_pos');
sleep(8); sleep(8);
tmps:=GetProcessOutput; tmps:=GetProcessOutput;
inc(i); inc(i);
DebugOutLn('[TMPlayerClass.Get_FilePosition] ' + tmps, 1); DebugOutLn('[TMPlayerClass.Get_FilePosition] ' + tmps, 3);
until (pos('percent_pos', tmps)>0) or (i>=5); until (pos('percent_pos', tmps)>0) or (i>=5);
// writeln('getpos'); // writeln('getpos');
@ -412,7 +415,7 @@ begin
result:=-1; result:=-1;
if (result=-1) and (FLastGet_Pos>0) then Result:=100; if (result=-1) and (FLastGet_Pos>0) then Result:=100;
DebugOutLn('[TMPlayerClass.Get_FilePosition] END', 1); DebugOutLn('[TMPlayerClass.Get_FilePosition] END', 3);
end; end;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function TMPlayerClass.get_FileLength: longint; function TMPlayerClass.get_FileLength: longint;