From 8af01c60d263cd0997982e392b8f26d3c8088a0b Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Thu, 10 Nov 2011 14:35:21 +0000 Subject: [PATCH] Hopefully this is the end of spurious writeln's git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2121 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../cactusjukebox/source/addradio.pas | 6 +-- .../cactusjukebox/source/cactusjukebox.lpi | 2 +- applications/cactusjukebox/source/cddb.pas | 6 +-- applications/cactusjukebox/source/cdrip.pas | 32 ++++++------- applications/cactusjukebox/source/editid3.pas | 8 ++-- .../cactusjukebox/source/fmodplayer.pas | 29 ++++++----- .../cactusjukebox/source/functions.pas | 9 ++-- applications/cactusjukebox/source/last_fm.pas | 4 +- .../cactusjukebox/source/mainform.pas | 48 +++++++------------ .../cactusjukebox/source/mediacol.pas | 19 +++----- applications/cactusjukebox/source/mplayer.pas | 7 +-- applications/cactusjukebox/source/player.pas | 1 - .../cactusjukebox/source/playlist.pas | 9 +--- .../cactusjukebox/source/settings.pas | 17 ++----- applications/cactusjukebox/source/skin.pas | 2 - .../cactusjukebox/source/streamcol.pas | 9 ++-- .../source/tagreader/mp3file.pas | 29 ++++++----- 17 files changed, 104 insertions(+), 133 deletions(-) diff --git a/applications/cactusjukebox/source/addradio.pas b/applications/cactusjukebox/source/addradio.pas index 566324ab0..6b0d00cfe 100644 --- a/applications/cactusjukebox/source/addradio.pas +++ b/applications/cactusjukebox/source/addradio.pas @@ -6,8 +6,8 @@ Unit addradio; Interface Uses -Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, -Buttons, EditBtn, streamcol, mainform; + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, + Buttons, EditBtn, streamcol, mainform, debug; Type @@ -87,7 +87,7 @@ Begin If FAdvanced Then Begin i := StreamCollection.add(StreamUrlEdit.Text, StationNameEdit.Text); - writeln(StreamUrlEdit.Text); + DebugOutLn(StreamUrlEdit.Text, 0); End Else Begin diff --git a/applications/cactusjukebox/source/cactusjukebox.lpi b/applications/cactusjukebox/source/cactusjukebox.lpi index a3c22a0c3..688c2eeb1 100644 --- a/applications/cactusjukebox/source/cactusjukebox.lpi +++ b/applications/cactusjukebox/source/cactusjukebox.lpi @@ -18,7 +18,7 @@ - + diff --git a/applications/cactusjukebox/source/cddb.pas b/applications/cactusjukebox/source/cddb.pas index a53209df3..66b78ef46 100755 --- a/applications/cactusjukebox/source/cddb.pas +++ b/applications/cactusjukebox/source/cddb.pas @@ -302,7 +302,7 @@ procedure TCddbObject.Parsedata; title[i]:=Latin1toUTF8(title[i]); delete(s, 1, pos(#10, s)); if i>8 then - writeln('title ---> ',title[i]); + DebugOutLn('title ---> '+title[i], 0); // deleted:=true; end; @@ -371,10 +371,10 @@ begin {$endif} DebugOutLn(Format('%d CD-ROM drives autodetected', [DriveCount]), 0); For b:=1 to DriveCount do - Writeln('Drive ',b,' on device: ',CDRomDrives[b]); + DebugOutLn(Format('Drive %d on device: %s',[b, CDRomDrives[b]]), 0); Except On E : exception do - Writeln(E.ClassName,' exception caught with message: ',E.Message); + DebugOutLn('[TCddbObject.create] exception caught with message: '+E.Message, 0); end; if DriveCount=0 then diff --git a/applications/cactusjukebox/source/cdrip.pas b/applications/cactusjukebox/source/cdrip.pas index 91490b259..a2843c33a 100755 --- a/applications/cactusjukebox/source/cdrip.pas +++ b/applications/cactusjukebox/source/cdrip.pas @@ -5,9 +5,10 @@ Unit cdrip; Interface -Uses -Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls, -StdCtrls, Buttons, ExtCtrls, cddb, dos, Grids, DBCtrls, process; +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ComCtrls, + StdCtrls, Buttons, ExtCtrls, cddb, dos, Grids, DBCtrls, process, + debug; resourcestring @@ -132,7 +133,7 @@ Begin {$ifdef win32} Exec('eject.exe',CDDBcon.CDromDrives[drivebox.ItemIndex+1]); {$endif win32} - writeln('ATTENTION!! DIRTY! ejecting cdrom drive... '); + DebugOutLn('ATTENTION!! DIRTY! ejecting cdrom drive... ',0); Trackgrid.Clean([gzNormal, gzFixedCols]); End; @@ -312,12 +313,7 @@ Begin Trackgrid.Clean([gzNormal, gzFixedCols]); Trackgrid.RowCount := 1; Trackgrid.ColWidths[0] := 20; - For i:= 1 To length(CDDBcon.album) Do - Begin - write(byte(CDDBcon.album[i])); - write('-'); - End; - writeln; + For b:= 1 To CDDBcon.NrTracks Do Begin str(b, tmps); @@ -380,13 +376,13 @@ Begin OutFileNames[EncodeTrack] := IncludeTrailingPathDelimiter(outfolder)+OutFileNames[EncodeTrack]; OutFileNames[EncodeTrack] := StringReplace(OutFileNames[EncodeTrack], #39, '', [ rfReplaceAll]); - writeln(OutFileNames[EncodeTrack]); + DebugOutLn(OutFileNames[EncodeTrack],0); EncodeProcess.CommandLine := '/usr/bin/lame -h -b'+bitratebox.Items[bitratebox.ItemIndex]+ ' --tt "'+UTF8toLatin1(Trackgrid.Cells[1, EncodeTrack])+ '" --ta "'+UTF8toLatin1(artistedit.Text)+'" --tl "'+ UTF8toLatin1(albumedit.Text)+'" --tn '+tmps+' "'+outfolder+ '/Track'+tmps+'.wav"'+' "'+OutFileNames[EncodeTrack]+'"'; - writeln(EncodeProcess.CommandLine); + DebugOutLn(EncodeProcess.CommandLine,0); Caption := 'Encoding Track '+inttostr(EncodeTrack)+' ...'; EncodeProcess.Options := [poUsePipes, poStderrToOutPut]; EncodeProcess.Execute; @@ -404,7 +400,7 @@ Begin Begin DeleteFile(outfolder+'/Track'+tmps+'.wav'); DeleteFile(outfolder+'/Track'+tmps+'.inf'); - writeln('delete '+outfolder+'/Track'+tmps+'.wav'); + DebugOutLn('delete '+outfolder+'/Track'+tmps+'.wav',0); End; Repeat inc(i) @@ -428,13 +424,13 @@ Begin outfolder+'/Track'+tmps+'.wav'''; RipProcess.Options := [poUsePipes,poStderrToOutPut, poDefaultErrorMode]; Caption := 'Ripping Track '+tmps+' ...'; - writeln('Ripping Track '+tmps); + DebugOutLn('Ripping Track '+tmps,0); RipProcess.Execute; Timer1.Enabled := true; End Else Begin - writeln('Finished all tracks'); + DebugOutLn('Finished all tracks', 0); Trackgrid.Cells[2,RipTrack] := '100%'; Caption := 'CD Rip... < Finished >'; Trackgrid.Options:= Trackgrid.Options + [goEditing]; @@ -462,7 +458,7 @@ Begin tmps := copy(Outputstring.Strings[i], pos('%', Outputstring.Strings[i])-2, 2); if tmps<>'' then EncPercent:=tmps; end; - writeln(EncPercent); + DebugOutLn(EncPercent,0); Trackgrid.Cells[2,EncodeTrack] := EncPercent+'%'; Application.ProcessMessages; End; @@ -473,7 +469,7 @@ Begin ripping := true; encoding := false; ToEncode[RipTrack] := false; - writeln('adding file'); + DebugOutLn('adding file',0); MediaCollection.add(OutFileNames[EncodeTrack]); End; End; @@ -568,7 +564,7 @@ Begin RipProcess.CommandLine := '/usr/bin/cdda2wav -D'+CDDBcon.Device+' -t '+tmps+' "'+ outfolder+'/Track'+tmps+'.wav"'; RipProcess.Options := [poUsePipes, poStderrToOutPut, poDefaultErrorMode]; - writeln('Ripping Track '+tmps); + DebugOutLn('Ripping Track '+tmps, 0); Caption := 'Ripping Track '+tmps+' ...'; RipProcess.Execute; Timer1.Enabled := true; diff --git a/applications/cactusjukebox/source/editid3.pas b/applications/cactusjukebox/source/editid3.pas index 0d0404a33..9d313fc5a 100755 --- a/applications/cactusjukebox/source/editid3.pas +++ b/applications/cactusjukebox/source/editid3.pas @@ -419,7 +419,7 @@ Begin If (picrequest_send) And LastFMAPI.data_ready Then Begin - writeln(MedFileObj.CoverPath); + DebugOutLn(MedFileObj.CoverPath,0); AlbumCoverImg.Canvas.Clear; Try AlbumCoverImg.Picture.LoadFromFile(MedFileObj.CoverPath); @@ -709,7 +709,7 @@ Begin Try AlbumCoverImg.Picture.LoadFromFile(MedFileObj.CoverPath); Except - writeln('EXCEPTION loading cover file from '+MedFileObj.CoverPath); + DebugOutLn('EXCEPTION loading cover file from '+MedFileObj.CoverPath,0); End; End Else @@ -761,7 +761,7 @@ Begin idlabel.Caption := 'File-Id: ' + IntToStr(MedFileObj.id); indexlabel.Caption := 'File-Index: ' + IntToStr(MedFileObj.index); - writeln('########AlbumCover'); + DebugOutLn('########AlbumCover',0); // DEBUG-INFO If (MedFileObj.album<>'') and CactusConfig.CheckCoverPath Then @@ -772,7 +772,7 @@ Begin Try AlbumCoverImg.Picture.LoadFromFile(MedFileObj.CoverPath); Except - writeln('EXCEPTION loading cover'); + DebugOutLn('EXCEPTION loading cover',0); End; End Else diff --git a/applications/cactusjukebox/source/fmodplayer.pas b/applications/cactusjukebox/source/fmodplayer.pas index 06e8a14ec..2affe8987 100755 --- a/applications/cactusjukebox/source/fmodplayer.pas +++ b/applications/cactusjukebox/source/fmodplayer.pas @@ -21,7 +21,7 @@ uses Classes, SysUtils, {$ifdef win32} fmoddyn, {$endif} {$ifdef unix} fmoddyn, {$endif} - fmodtypes, mediacol, playlist, playerclass; + fmodtypes, mediacol, playlist, playerclass, debug; type //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -121,8 +121,9 @@ begin if FSOUND_Init(44100, 32, 0)=true then begin FPlaybackMode:=FILE_MODE; - writeln('playing -> '+playlist.items[index].path); - if (FileExists(playlist.items[index].path)) then begin + DebugOutLn('playing -> '+playlist.items[index].path,0); + if (FileExists(playlist.items[index].path)) then + begin tmpp:=StrAlloc(length(playlist.items[index].path)+1); StrPCopy(tmpp,playlist.items[index].path); @@ -138,18 +139,20 @@ begin if z = 0 then begin //If loading was succesful write(' start playing... '); FSOUND_Stream_Play (FSOUND_FREE,Soundhandle); // Start playing - writeln(' ready... '); + DebugOutLn(' ready... ',0); FSOUND_SetVolume(0, FVolume); playlist.items[index].played:=true; fplaying:=true; result:=0; FCurrentTrack:=index; - end else begin - write('error: can''t play file');writeln(z); - end; - end else result:=1; - end else result:=2; - end; + end + else + DebugOutLn(Format('error: can''t play file %d',[z]), 0); + end + else result:=1; + end + else result:=2; + end; end else begin writeln('INTERNAL error: playlistindex out of bound'); @@ -175,15 +178,15 @@ begin //FSOUND_Close; {$ifdef linux} if OutputMode = OSSOUT then begin - if FSOUND_SetOutput(FSOUND_OUTPUT_OSS) then writeln('Oss output openend') else writeln('failed opening oss output') + if FSOUND_SetOutput(FSOUND_OUTPUT_OSS) then DebugOutLn('Oss output openend',0) else writeln('failed opening oss output') end else begin - if FSOUND_SetOutput(FSOUND_OUTPUT_ALSA) then writeln('alsa output openend') else writeln('failed opening alsa output') + if FSOUND_SetOutput(FSOUND_OUTPUT_ALSA) then DebugOutLn('alsa output openend',0) else writeln('failed opening alsa output') end; {$endif} if FSOUND_Init(44100, 32, 0)=true then begin FPlaybackMode:=STREAMING_MODE; - writeln('playing -> '+url); + DebugOutLn('playing -> '+url,0); tmpp:=StrAlloc(length(url)+1); StrPCopy(tmpp,url); diff --git a/applications/cactusjukebox/source/functions.pas b/applications/cactusjukebox/source/functions.pas index 4b6f7a49f..1c38c7679 100644 --- a/applications/cactusjukebox/source/functions.pas +++ b/applications/cactusjukebox/source/functions.pas @@ -18,7 +18,8 @@ Unit functions; Interface Uses -Classes, SysUtils, math, config; + Classes, SysUtils, math, + debug, config; @@ -181,7 +182,7 @@ Begin If utf16 Then Begin i := i+2; - writeln('utf16'); + DebugOutLn('utf16',0); Repeat Begin inc(i); @@ -321,8 +322,8 @@ Begin // get free memory on player, format string SetCurrentDir(CactusConfig.DAPPath); result := DiskFree(0); - writeln('------>'); - writeln(DiskFree(0)); + DebugOutLn('------>',0); + DebugOutLn(Format('DiskFree=%d',[DiskFree(0)]),0); SetCurrentDir(tmps); End; diff --git a/applications/cactusjukebox/source/last_fm.pas b/applications/cactusjukebox/source/last_fm.pas index 0cc232814..80091ab21 100644 --- a/applications/cactusjukebox/source/last_fm.pas +++ b/applications/cactusjukebox/source/last_fm.pas @@ -180,7 +180,7 @@ begin try HTTPConnection.Document.SaveToFile(FAlbumInfo.CoverSavePath); except - writeln('EXCEPTION writing cover art to disk'); + DebugOutLn('EXCEPTION writing cover art to disk',0); end; HTTPConnection.Free; End else DebugOutLn('No cover found :(', 5); @@ -195,7 +195,7 @@ begin FArtist:=artist; furl := Furlprefix + Format('?method=album.getinfo&api_key=%s&artist=%s&album=%s', [FAPIKey, FArtist, FAlbum]); furl := AnsiReplaceStr(furl, ' ', '%20'); - writeln(furl); + DebugOutLn(furl,0); SendRequest(@album_getInfosRCV); end; diff --git a/applications/cactusjukebox/source/mainform.pas b/applications/cactusjukebox/source/mainform.pas index 146c6c949..edb60d6cd 100644 --- a/applications/cactusjukebox/source/mainform.pas +++ b/applications/cactusjukebox/source/mainform.pas @@ -269,7 +269,6 @@ type procedure LibraryModeBtnClick(Sender: TObject); procedure MenuItem15Click(Sender: TObject); procedure MenuItem25Click(Sender: TObject); - procedure menuShowCactusClick(Sender: TObject); procedure MIrandom_playlistClick(Sender: TObject); procedure MIViewAlbumClick(Sender: TObject); procedure MIViewArtistClick(Sender: TObject); @@ -577,7 +576,7 @@ begin end else begin - writeln('finished'); + DebugOutLn('finished', 0); TargetCollection.SaveToFile; TargetCollection.Free; main.connectDAP; @@ -680,16 +679,15 @@ begin if MessageDlg('Some files on your harddisk seem to have changed.' + LineEnding + 'Adopt changes in Cactus library?', mtWarning, mbOKCancel, 0) = mrOk then begin - writeln(1); fstatus := 255; - writeln('assigning'); + DebugOutLn('[TScanThread.ShowStatus] assigning', 0); // PTargetCollection^.Assign(tmpcollection); - writeln('saving'); + DebugOutLn('saving', 0); // PTargetCollection^.save_lib(PTargetCollection^.savepath); Main.clear_listClick(nil); - writeln('WARNING: if excption occurs, playlist has to be cleared here!'); + DebugOutLn('WARNING: if excEption occurs, playlist has to be cleared here!', 0); // Main.update_player_hdd_relations; main.update_artist_view; update_title_view; @@ -702,11 +700,11 @@ begin if (fstatus = 0) or (fstatus = 128) then begin Main.StatusBar1.Panels[0].Text := 'Ready'; - writeln('fstatus 0, 126'); + DebugOutLn('fstatus 0, 126', 0); Main.StatusBar1.Panels[1].Alignment := taRightJustify; tmpcollection.Free; end; - writeln('showStatus'); + DebugOutLn('showStatus', 0); end; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -790,7 +788,7 @@ begin y := Volumebar.Height; if y < 0 then y := 0; - writeln(y); + DebugOutLn(IntToStr(y), 0); newVolume := 100 - ((y * 100) div (Volumebar.Height)); PlayerObj.set_volume(newVolume); @@ -861,7 +859,7 @@ begin begin if oldindex >= 0 then playlist.Items[oldindex].ImageIndex := -1; - writeln(oldindex); + DebugOutLn(IntToStr(oldindex), 0); playlist.Items[i].ImageIndex := 0; playlist.Items[i].MakeVisible(False); playtimer.Enabled := True; @@ -1163,16 +1161,12 @@ begin if FileExists(CactusConfig.DAPPath) then begin checkmobile.Enabled := False; - writeln('ooo'); disconnectDAP; - writeln('aa'); ScanCol := TMediaCollectionClass.Create; ScanCol.syncronize := @ScanSyncronize; Enabled := False; - writeln('ll'); ScanCol.PathFmt := FRelative; ScanCol.savepath := CactusConfig.DAPPath + 'cactuslib'; - writeln('dd'); ScanCol.add_directory(CactusConfig.DAPPath); ScanCol.SaveToFile; ScanCol.Free; @@ -1455,11 +1449,6 @@ begin addRadioForm.ShowModal; end; -procedure TMain.menuShowCactusClick(Sender: TObject); -begin - -end; - //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ procedure TMain.MIViewAlbumClick(Sender: TObject); @@ -2162,7 +2151,7 @@ begin begin if StreamCollection.LoadFromFile(CactusConfig.StreamColPath) = False then begin - writeln('Error loading stream collection'); + DebugOutLn('Error loading stream collection', 0); end; end; @@ -2538,8 +2527,8 @@ begin end; until ((lowercase(ArtistTree.items[i].Text) = curartist) and (ArtistTree.Items[i].Level = 1)) or (i >= ArtistTree.items.Count - 1); - writeln(curartist); - writeln(ArtistTree.items[i].Text); + DebugOutLn(curartist, 0); + DebugOutLn(ArtistTree.items[i].Text, 0); if lowercase(ArtistTree.items[i].Text) = curartist then begin ArtistTree.selected := main.artisttree.items[i]; @@ -3034,7 +3023,7 @@ begin else DebugOutLn(' --> Invalid message/filename received via IPC', 2); end; - Writeln('IPC end'); + DebugOutLn('IPC end', 0); end; procedure TMain.skinmenuClick(Sender: TObject); @@ -3151,7 +3140,7 @@ begin sl := TStringList.Create; try IndexOfCurrentColumn := column.index; - writeln(IndexOfCurrentColumn); + DebugOutLn(Format('IndexOfCurrentColumn=%d', [IndexOfCurrentColumn]), 0); if IndexOfCurrentColumn <> 0 then begin @@ -3344,7 +3333,7 @@ begin // get free memory on player, format string DebugOut('loaded', 2); tmps := ByteToFmtString(FreeSpaceOnDAP, 3, 2); - writeln(FreeSpaceOnDAP); + DebugOutLn(FreeSpaceOnDAP, 0); StatusBar1.Panels[1].Text := 'Device connected ' + tmps + ' free'; if CactusConfig.background_scan then begin @@ -3425,9 +3414,8 @@ begin if CactusConfig.StopOnClear then StopButtonImgClick(Sender); Playlist.BeginUpdate; - writeln(Playlist.Items.Count); + DebugOutLn('clear', 0); Playlist.Items.Clear; - writeln('clear'); playlist.Column[0].Caption := rsPlaylist; PlayerObj.playlist.Clear; Playlist.EndUpdate; @@ -3738,7 +3726,6 @@ begin playlist.items[i - 1].Selected := True; //tempitem.MakeVisible(true); end; - writeln(playlist.Selected.Index); end; // Key DOWN @@ -3901,7 +3888,7 @@ begin begin StatusBar1.Panels[0].Text := 'Buffering stream...'; StreamInfoObj := TStreamInfoItemClass(ArtistTree.Selected.Data); - writeln(PlayerObj.play(StreamInfoObj.URL)); + DebugOutLn(PlayerObj.play(StreamInfoObj.URL), 0); current_title_edit.Text := 'Playing radio stream...'; current_title_edit1.Text := StreamInfoObj.Name; playtimer.Enabled := True; @@ -3940,7 +3927,6 @@ var c: char; i: integer; begin - writeln(key); b := key; c := char(b); case key of @@ -4337,7 +4323,7 @@ procedure TMain.titlelistmenuPopup(Sender: TObject); var MedFileObj: TMediaFileClass; begin - writeln('titletree popupmenu'); + DebugOutLn('[TMain.titlelistmenuPopup]', 0); if TitleTree.Selected <> nil then begin MedFileObj := TMediaFileClass(TitleTree.Selected.Data); diff --git a/applications/cactusjukebox/source/mediacol.pas b/applications/cactusjukebox/source/mediacol.pas index 4b251a205..e990a3f72 100644 --- a/applications/cactusjukebox/source/mediacol.pas +++ b/applications/cactusjukebox/source/mediacol.pas @@ -180,7 +180,7 @@ Var mp3search,dirsearch: TSearchrec; fHandle: file Of byte; Begin dir := IncludeTrailingPathDelimiter(dir); - writeln('scanning through: '+dir); + DebugOutLn('scanning through: '+dir, 0); syncronize(dir); If FindFirst(dir+'*.*',faAnyFile,mp3search)=0 Then Begin @@ -283,7 +283,7 @@ Begin {$i+} if IoResult<>0 then begin result := false; - writeln('unable to open file ', path); + DebugOutLn('unable to open file '+path, 0); exit; end; @@ -357,10 +357,8 @@ Begin Except close(lfile); fsorted := sortState; - writeln('lib seems corupted'); - write('exception at entry '); - writeln(i); - write('line: ');writeln(linecount); + DebugOutLn('lib seems corupted', 0); + DebugOutLn(Format('exception at entry %d line: %d', [i, linecount]), 0); result := false; End; End; @@ -522,8 +520,8 @@ Begin Else FEnumerated := false; except - writeln('exception sorting object in library'); - writeln(MedFileObj.Path); + DebugOutLn('exception sorting object in library',0); + DebugOutLn(MedFileObj.Path,0); end; End Else @@ -851,7 +849,6 @@ Begin try if FileExists(Path) then begin - writeln(path); OGGFile.ReadFromFile(Path); artist := UTF8Encode(OGGFile.Artist); title := UTF8Encode(OGGFile.Title); @@ -955,7 +952,7 @@ Begin playtime := SecondsToFmtStr(Playlength); Except - writeln('**EXCEPTION reading wave file '+path+'**'); + DebugOutLn('**EXCEPTION reading wave file '+path+'**',0); End; End; @@ -968,7 +965,6 @@ Begin try if FileExists(Path) then begin - // writeln(path); MP3File.ReadTag(Path); artist := StrToUTF8(MP3File.Artist); title := StrToUTF8(MP3File.Title); @@ -1094,7 +1090,6 @@ Begin start := index; If (Collection<>nil) and Collection.sorted Then Begin - writeln(i); If (i0) And (CompareText(FArtist, Collection.Items[i+1].Artist)=0) Then Begin diff --git a/applications/cactusjukebox/source/mplayer.pas b/applications/cactusjukebox/source/mplayer.pas index c22301cf5..5b72eb63e 100644 --- a/applications/cactusjukebox/source/mplayer.pas +++ b/applications/cactusjukebox/source/mplayer.pas @@ -131,7 +131,8 @@ begin Result := ''; // writeln(Result); except - writeln('EXCEPTION reading mplayer output');result:=''; + DebugOutLn('EXCEPTION reading mplayer output', 0); + result:=''; end; //writeln('endget'); AStringList.Free; @@ -278,7 +279,7 @@ begin if FPlaying and Assigned(MPlayerProcess) then begin SendCommand('pause'); sleep(10); - writeln('pauseee'); + DebugOutLn('pauseee', 0); FPaused:=not FPaused; end; end; @@ -305,7 +306,7 @@ var r:byte; begin r:=127; if fplaying then begin - writeln('mnexttrack'); + DebugOutLn('mnexttrack', 0); if FCurrentTrack 2006-2008 Contact the author at: sebastian_kraft@gmx.de This Software is published under the GPL - - - - - - } - - Unit settings; {$mode objfpc}{$H+} @@ -23,8 +15,9 @@ Unit settings; Interface Uses -Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, -ExtCtrls, Buttons, ComCtrls, CheckLst, config, playerclass, mplayer; + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, + ExtCtrls, Buttons, ComCtrls, CheckLst, config, playerclass, mplayer, + debug; resourcestring rsAutoloadLast = 'Load last library at startup'; @@ -309,8 +302,8 @@ Begin If DirectoryExists(CactusConfig.ConfigPrefix+DirectorySeparator+'covercache') Then Begin If EraseDirectory(CactusConfig.ConfigPrefix+DirectorySeparator+'covercache') Then - writeln('Covercache has been cleared...') - Else writeln('ERROR while clearing covercache...'); + DebugOutLn('Covercache has been cleared...',0) + Else DebugOutLn('ERROR while clearing covercache...',0); End; End; diff --git a/applications/cactusjukebox/source/skin.pas b/applications/cactusjukebox/source/skin.pas index 42fbb1495..6bcad0755 100755 --- a/applications/cactusjukebox/source/skin.pas +++ b/applications/cactusjukebox/source/skin.pas @@ -352,8 +352,6 @@ Begin {Main.ImageList1.Insert(0, tmpbmp, nil); Main.ImageList1.Insert(1, tmpbmp, nil);} - // writeln(skinxml.GetValue('Database/Play/Icon','ss')); - main.PlayButtonImg.Picture.LoadFromFile(Self.play.Img); main.StopButtonImg.Picture.LoadFromFile(Self.stop.Img); main.PauseButtonImg.Picture.LoadFromFile(Self.pause.Img); diff --git a/applications/cactusjukebox/source/streamcol.pas b/applications/cactusjukebox/source/streamcol.pas index 76e89c87a..c985bb4fa 100644 --- a/applications/cactusjukebox/source/streamcol.pas +++ b/applications/cactusjukebox/source/streamcol.pas @@ -5,10 +5,11 @@ Unit streamcol; Interface -Uses -Classes, SysUtils; +uses + Classes, SysUtils, + debug; -Type +type { TStreamInfoItemClass } @@ -120,7 +121,7 @@ Begin End; result:=true; Except - writeln('ERROR reading stream collection'); + DebugOutLn('ERROR reading stream collection',0); result:=false; End; End; diff --git a/applications/cactusjukebox/source/tagreader/mp3file.pas b/applications/cactusjukebox/source/tagreader/mp3file.pas index 02101cd4f..73d9ac38d 100644 --- a/applications/cactusjukebox/source/tagreader/mp3file.pas +++ b/applications/cactusjukebox/source/tagreader/mp3file.pas @@ -136,7 +136,7 @@ begin // doesn't work with VBR files ! End; End - Else writeln(FFileName+' -> no valid mpeg header found'); + Else DebugOutLn('[TMP3File.ReadHeader] '+FFileName+' -> no valid mpeg header found', 0); end; function TMP3File.GetId3V1Track: Integer; @@ -248,7 +248,9 @@ Begin yearv2 := ''; end; End; - except WriteLn(Filename+' -> exception while reading id3v2 tag... skipped!!'); end; + except + DebugOutLn('[TMP3File.ReadTag] '+Filename+' -> exception while reading id3v2 tag... skipped!!', 0); + end; {id3v1} try fileseek(mp3filehandle,-128, fsfromend); @@ -284,7 +286,10 @@ Begin else ftrack := ''; End; // else writeln('no id3v1 tag'); - except WriteLn(Filename+' -> exception while reading id3v1 tag... skipped!!'); end; + except + DebugOutLn('TMP3File.ReadTag] '+Filename+ + ' -> exception while reading id3v1 tag... skipped!!', 0); + end; (* {$IFNDEF WINDOWS} If ((artistv2<>'')) And (CactusConfig.id3v2_prio Or (artist='')) Then Fartist := artistv2; If ((titlev2<>'')) And (CactusConfig.id3v2_prio Or (title='')) Then Ftitle := titlev2; @@ -518,15 +523,15 @@ Begin mp3filehandle := fileopen(Filename,fmOpenWrite); If mp3filehandle<>-1 Then - Begin - If FileGetAttr(Filename)=faReadOnly Then DebugOutLn('file is read only', 0); - fileseek(mp3filehandle,-128,fsfromend); - writeln(ftitle); - writeln(fartist); - filewrite(mp3filehandle,buf,128); - fileclose(mp3filehandle); - End - Else writeln('ERROR: cant write tag. file not found'); + Begin + If FileGetAttr(Filename)=faReadOnly Then DebugOutLn('file is read only', 0); + fileseek(mp3filehandle,-128,fsfromend); + DebugOutLn(ftitle,0); + DebugOutLn(fartist,0); + filewrite(mp3filehandle,buf,128); + fileclose(mp3filehandle); + End + Else DebugOutLn('ERROR: cant write tag. file not found',0); end;