Hello!
I am using foobar for 3 weeks now and got enthusiastic with it and especially with trackinfo_mod...
This is what i came up with after few hours:
// PerSecond
////PLAYING TIME
$if(
%Playback_time%,
$alignabs(0,$sub(%_height%,39),%_width%,15,,)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) Length:$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255) %Playback_time% / %length% $font(,8,glow-0-0-0 glowexpand-1,183-207-255)minutes
)
////
////PROGRESS BAR(INNER)
$if(
$strcmp(%playback_time_seconds%,0),
,
$drawrect(5,$sub(%_height%,18),$muldiv(%playback_time_seconds%,$sub(%_width%,17),%length_seconds%),5,pencolor-0-0-25 brushcolor-$muldiv(%_time_elapsed_seconds%,221,%_time_total_seconds%)-114-$sub(255,$muldiv(%_time_elapsed_seconds%,255,%_time_total_seconds%)))
$drawrect($add($muldiv(%playback_time_seconds%,$sub(%_width%,17),%length_seconds%),5),$sub(%_height%,18),1,10,pencolor-68-105-171 brushcolor-null)
$if(%Playback_time%,
$puts(progress,$muldiv(%_time_elapsed_seconds%,1000,%_time_total_seconds%))
$alignabs($sub($muldiv(%playback_time_seconds%,$sub(%_width%,17),%length_seconds%),4),$sub(%_height%,11),%_width%,15,,)
$font(,6,glow-0-0-0 glowexpand-1 ,183-207-255)
$if(
%_time_total%,
$ifgreater(10,$get(progress),' 0.'$right($get(progress),1),
$ifgreater(100,$get(progress), $left($get(progress),1)'.'$right($get(progress),1),
$ifgreater(1000,$get(progress),$left($get(progress),2)'.'$right($get(progress),1),
$ifequal(1000,$get(progress),'100',))))'%')
)
)
////
// PerTrack
////PROGRESS BAR(OUTER)
$drawrect(4,$sub(%_height%,19),$sub(%_width%,15),7,brushcolor-null pencolor-68-105-171)
////
$if(
%_trackinfo_notrack%
,$alignset() $alignrel(left,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) No track,
////ARTIST
$alignrel(left,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) Artist:$iflonger(%artist%,40,$font(,8,bold glow-0-0-0 glowexpand-1,183-207-255)[ %artist%],$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255)[ %artist%])
////
//// PLAY COUNTER
$alignrel(right,top)
$if(
$strcmp(%play_counter%,?),
$font(,8,glow-0-0-0 glowexpand-1,183-207-255)Playing song for first time ,
$if(
$strcmp(%play_counter%,1),
$font(,8,glow-0-0-0 glowexpand-1,183-207-255)Song played %play_counter% time ,
$font(,8,glow-0-0-0 glowexpand-1,183-207-255)Song played %play_counter% times
)
)
////
////TRACK
$alignset() $alignrel(left,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) Track:$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255)$iflonger(%title%,40,$font(,8,bold glow-0-0-0 glowexpand-1,183-207-255)[ #%Tracknumber% - ][%title%],$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255)[ #%Tracknumber% - ][%title%])
////
//// LAST PLAYED
$puts(lp_year
,$substr(%last_played%,1,4))
$puts(lp_month
,$substr(%last_played%,6,7))
$puts(lp_day
,$substr(%last_played%,9,10))
$puts(lp_hour
,$substr(%last_played%,12,13))
$puts(lp_min
,$substr(%last_played%,15,16))
$puts(lp_sec
,$substr(%last_played%,18,19))
$alignrel(right,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255)
$if(
$strcmp(%play_counter%,?),
,
$if(
$strcmp(%play_counter%,1),
on,
Last on
)
$if(
%last_played%,
$get(lp_day)-$get(lp_month)-$get(lp_year)' at '$get(lp_hour):$get(lp_min) )
)
////
////ALBUM
$alignset() $alignrel(left,top)$font(,8,glow-0-0-0 glowexpand-1,183-207-255) Album:$iflonger(%album%,40,$font(,8,bold glow-0-0-0 glowexpand-1,183-207-255)[ %album%],$font(,10,bold glow-0-0-0 glowexpand-1,183-207-255)[ %album%])$font(,8,bold glow-0-0-0 glowexpand-1,183-207-255) ['['%date%']']
////
////GAIN INFO
$puts(gain,
$if2($replace(%__replaygain_track_gain%,' ',),'N/A') / $if2($replace(%__replaygain_album_gain%,' ',),'N/A')
)
$alignabs($sub(%_width%,$calcwidth($get(gain))),$sub(%_height%,52),%_width%,15,,)$font(,8,glow-0-0-0 glowexpand-1,183-207-255)$get(gain)
////DECODER INFO
$puts(decoderinfo,
%codec%',' $if3($info(MP3_STEREO_MODE),%channels%) @
$puts(ratio,
$muldiv($info(bitrate),1000,
$div($mul($info(samplerate),$info(bitspersample),$info(channels)),1000)))
$if($info(bitrate),
$if($info(bitspersample),
$if($and(
$strcmp($info(codec),'WavPack'),
$not($strstr($info(codec_profile),'lossless'))),
$info(bitrate)'kb/s',
$ifgreater(100,$get(ratio),$left($get(ratio),1)'.'$right($get(ratio),1),
$ifgreater(1000,$get(ratio),$left($get(ratio),2)'.'$right($get(ratio),1),
$ifequal(1000,$get(ratio),'100.0',)))'% '),
[%codec_profile%',' ]$info(bitrate)'kb/s '))
)
$alignabs($sub(%_width%,$calcwidth($get(decoderinfo))),$sub(%_height%,37),%_width%,15,,)$font(,8,glow-0-0-0 glowexpand-1,183-207-255)$get(decoderinfo)
////
)
//// PAUSED
$alignabs($sub($div(%_width%,2),30),$sub(%_height%,37),%_width%,15,,)$font(,10,bold glow-0-0-0 glowexpand-1,255-179-0)$if(%_ispaused%,'Paused',)
////
- Auto changing font size on long artist/track/album names
- Colorchanging progressbar, depending on...progress ;-)
- progress percentage moving with progressbar
- etc...
What do you think?
Any advice on cleaning up the code?