// ----- BACKGROUND ----- //
$drawrect(0,0,%ps_width%,%ps_height%,%do.colour%,%do.colour%)
$drawroundrect(0,$add(%ps_width%,10),$sub(%ps_width%,1),$sub(%ps_height%,$add(%ps_width%,44)),1,0,19-30-38-255,63-100-127-100,)

// ----- BACKGROUND SPECTRUM PANEL ----- //
$if(%ps_isplaying%,$gradientrect(1,$add(%ps_width%,11),$sub(%ps_width%,2),$sub(%ps_height%,$add(%ps_width%,45)),21-33-41-255,21-33-41-255,vertical,50))

// ----- PANEL-MANAGEMENT ----- //
$showpanel_c(Cover Panel,$ifequal(%do.cover.switch%,1,1,0))
$showpanel_c(Cover Panel 2,$ifequal(%do.cover.switch%,1,0,1))
//$showpanel_c(Seekbar,$if($or($not(%ps_isplaying%),$stricmp($left(%path%,7),'http://'),$stricmp(%codec%,cdda)),0,$ifequal(%do.seekbar.switch%,1,1,0)))
//$showpanel_c(WSH Seekbar,$if($and(%length%,$or($stricmp($left(%path%,7),'http://'),$greater(1,%do.seekbar.switch%),$stricmp(%codec%,cdda))),1,$if(%isplaying%,0,1)))
//$showpanel_c(Channel spectrum panel,$if(%length%,0,$ifequal(%do.spectrum.switch%,1,1,0)))
$showpanel_c(Seekbar,$ifequal(%do.spectrum.switch%,1,0,$if($or($not(%ps_isplaying%),$stricmp($left(%path%,7),'http://'),$stricmp(%codec%,cdda)),0,$ifequal(%do.seekbar.switch%,1,1,0))))
$showpanel_c(WSH Seekbar,$ifequal(%do.spectrum.switch%,1,0,$if($and(%length%,$or($stricmp($left(%path%,7),'http://'),$greater(1,%do.seekbar.switch%),$stricmp(%codec%,cdda))),1,$if(%isplaying%,0,1))))
$showpanel_c(Channel spectrum panel,$ifequal(%do.spectrum.switch%,1,1,0))

$movepanel_c(Cover Panel,0,0,%ps_width%,%ps_width%)
$movepanel_c(Cover Panel 2,0,0,%ps_width%,%ps_width%)
$movepanel_c(Seekbar,1,$add(%ps_width%,11),$sub(%ps_width%,2),$sub(%ps_height%,$add(%ps_width%,45)))
$movepanel_c(WSH Seekbar,1,$add(%ps_width%,11),$sub(%ps_width%,2),$sub(%ps_height%,$add(%ps_width%,45)))
$movepanel_c(Channel spectrum panel,1,$add(%ps_width%,11),$sub(%ps_width%,2),$sub(%ps_height%,$add(%ps_width%,45)))

// ----- STREAM FIX FOR WAVEFORM SEEKBAR & RADIO LOGO ----- //
$puts(text,$if(%ps_isplaying%,$upper(%title%)))
$puts(text.w,$gettextwidth($get(text),Impact,68,))
$puts(text.h,$sub(%ps_height%,$add(%ps_width%,57)))
$puts(comp,$div(2000,$muldiv($get(text.w),100,%ps_width%)))
$puts(delta,$ifgreater($sub(%ps_width%,$get(text.w)),0,$mul(3,$get(comp)),$add($mul(3,$get(comp)),1)))
$puts(size,$ifgreater(%ps_width%,$get(text.w),$min($get(delta),$get(text.h)),$min($get(delta),$get(text.h))))
$puts(size.c,$ifgreater(%ps_width%,$get(text.w),-1,0))
$puts(text.c,$ifgreater(%ps_width%,$get(text.w),$ifgreater($get(size),68,2,0),-1))

$font(Impact,$add($get(size),$get(size.c)))

$if($not(%length%),$ifequal(%do.spectrum.switch%,1,
//  ----- STANDART TEXT ----- //
//$drawtextex($get(text),1,$add(%ps_width%,8),%ps_width%,$sub(%ps_height%,$add(%ps_width%,44)),10-16-20,hcenter vcenter end_ellipsis)
$drawtextex($get(text),0,$add(%ps_width%,10),%ps_width%,$sub(%ps_height%,$add(%ps_width%,44)),38-61-76,hcenter vcenter end_ellipsis)
,
//  ----- GLOW TEXT ----- //
$drawstring($get(text),1,$add(%ps_width%,12,$get(text.c)),%ps_width%,$sub(%ps_height%,$add(%ps_width%,44)),10-16-20-255,hcenter vcenter elipchar nowrap aa,glow:5:10-16-20:0)
$drawstring($get(text),0,$add(%ps_width%,13,$get(text.c)),%ps_width%,$sub(%ps_height%,$add(%ps_width%,44)),63-100-127-90,hcenter vcenter elipchar nowrap glow_aa)
$drawstring($get(text),0,$add(%ps_width%,15,$get(text.c)),%ps_width%,$sub(%ps_height%,$add(%ps_width%,44)),63-100-127-255,hcenter vcenter elipchar nowrap glow_aa)
))

// ----- PLAYBACK STOP SCROLL TEXT ----- //
$font(Impact,20,bold)
$puts(text2,$if(%isplaying%,,DarkOne v4.0))
$drawstring($get(text2),0,$sub(%ps_height%,30),%ps_width%,30,10-16-20-230,hcenter vcenter elipword nowrap glow_aa)
$drawstring($get(text2),0,$sub(%ps_height%,28),%ps_width%,30,63-100-127-255,hcenter vcenter elipword nowrap glow_aa)

// ----- BUTTONS ----- //
$font(Arial Black,5,)
$textbutton(0,2,1,1,,,CONTEXT:Main Menu/File/,,)
$textbutton(0,$add(%ps_width%,1),$sub($div(%ps_width%,3),1),8,$ifequal(%do.cover.switch%,1,COVER PANEL I,COVER PANEL II),$ifequal(%do.cover.switch%,1,COVER PANEL I,COVER PANEL II),SETGLOBAL:do.cover.switch:$ifequal(%do.cover.switch%,1,0,1);REFRESH,fontcolor:19-30-38 brushcolor:37-57-73-0 pencolor:37-57-73-0,fontcolor:10-20-30 brushcolor:63-100-127-100 pencolor:37-57-73-0)
$textbutton($div(%ps_width%,3),$add(%ps_width%,1),$div(%ps_width%,3),8,$ifequal(%do.seekbar.switch%,1,WAWE SEEKBAR,WSH SEEKBAR),$ifequal(%do.seekbar.switch%,1,WAWE SEEKBAR,WSH SEEKBAR),SETGLOBAL:do.seekbar.switch:$ifequal(%do.seekbar.switch%,1,0,1);REFRESH,fontcolor:19-30-38 brushcolor:37-57-73-0 pencolor:37-57-73-0,fontcolor:10-20-30 brushcolor:63-100-127-100 pencolor:37-57-73-0)
$textbutton($add($mul($div(%ps_width%,3),2),1),$add(%ps_width%,1),$div(%ps_width%,3),8,$ifequal(%do.spectrum.switch%,1,SPECTRUM PANEL ON,SPECTRUM PANEL OFF),$ifequal(%do.spectrum.switch%,1,SPECTRUM PANEL ON,SPECTRUM PANEL OFF),SETGLOBAL:do.spectrum.switch:$ifequal(%do.spectrum.switch%,1,0,1);REFRESH,fontcolor:19-30-38 brushcolor:37-57-73-0 pencolor:37-57-73-0,fontcolor:10-20-30 brushcolor:63-100-127-100 pencolor:37-57-73-0)