me again : I want to show a play/pause button dependant on the status of playback : stopped, paused or playing.
Here is the code :
<layer name="Stopped" type="button">
<geometry type="absolute">
<size x="27" y="19" />
<position x="$if($stricmp(%cwb_playback_state%,stop),56,505)" y="1" align="left" />
</geometry>
<contents>
<action>
Play or Pause
</action>
<normalImg src="Play.png" />
<overImg src="Play-Hover.png" />
<downImg src="Play-Hover.png" />
</contents>
</layer>
<layer name="Playing" type="button">
<geometry type="absolute">
<size x="27" y="19" />
<position x="$if($stricmp(%cwb_playback_state%,play),56,505)" y="1" align="left" />
</geometry>
<contents>
<action>
Play or Pause
</action>
<normalImg src="Play-Hover.png" />
<overImg src="Pause-Hover.png" />
<downImg src="Pause-Hover.png" />
</contents>
</layer>
<layer name="Paused" type="button">
<geometry type="absolute">
<size x="27" y="19" />
<position x="$if($stricmp(%cwb_playback_state%,pause),56,505)" y="1" align="left" />
</geometry>
<contents>
<action>
Play or Pause
</action>
<normalImg src="Pause-Hover.png" />
<overImg src="Play-Hover.png" />
<downImg src="Play-Hover.png" />
</contents>
</layer>
2 issues :
- at startup, the titleformat code for "position" seems not to be evaluated. position x remains 0, and button displayed at wrong place If i click on it, titleformat gets evaluated and button takes the correct position.
- when player is "stopped", titleformat for buttons position again is not evaluated.
I have tried using %isplaying% and %ispaused% instead of %cwb_playback_state%, makes no difference.