Support and General Use > Theming and Appearance Customization
WPS coding help: Blinking song title while on pause
(1/1)
verdigris:
Hello,
I am trying to make the title blink when the player is paused, but nothing I've tried has really worked so far. Could someone pinpoint what's wrong with my code? Thanks!
--- Code: ---#Disable Statusbar
%wd
#Load images
# Battery
%xl|B|battery.bmp|1|119|6|
# Repeat
%xl|R|repeat.bmp|15|119|4|
# Shuffle
%xl|S|shuffle.bmp|21|119|
#Track info
%s%ac%?mp<%?it<%it|->|%?it<%it|->|%Vdp|%?it<%it|->|%?it<%it|->?
#Play bar
%ac%?px<•|• •|• • •|• • • •|• • • • •|• • • • • •|• • • • • • •|• • • • • • • •|• • • • • • • • •|• • • • • • • • • •>
#Track info
%s%ac%?ia<%ia|%?ic<%ic|->> • %?id<%id|->
#Player/control status
%?bs<%bs|%?bp<%xdBa|%?bc<%xdBa|%?bl<%xdBb|%xdBc|%xdBd|%xdBe|%xdBf>>>>
%?mm<|%xdRa|%xdRb|%xdRc|%xdRd>
%?ps<%xdS>
#Load conditional viewport for pause
%V|p|0|18|160|12|1|
%s%ac%?it<%t2%it;%t1 |%t2-;%t1 >
--- End code ---
MarcGuay:
What happens now? Does it display at all or fall back to the default? You have an extra question mark at the end of the Track Info line.
verdigris:
Hihi!
Thanks for the prompt reply and for picking out the extra "?". The screen would revert to the default WPS which, I am assuming, means that some part of the code doesn't make sense (sorry, don't know the technical term for a code that doesn't work :P).
I did some testing and think the problem seems to be with conditional viewports. I tried disabled the viewport code and replaced "Vdp" with "Pause":
--- Code: ---#Disable Statusbar
%wd
#Load images
# Battery
%xl|B|battery.bmp|1|119|6|
# Repeat
%xl|R|repeat.bmp|15|119|4|
# Shuffle
%xl|S|shuffle.bmp|21|119|
#Track info (Title)
%s%ac%?mp<%?it<%it|->|%?it<%it|->|pause|%?it<%it|->|%?it<%it|->>
#Play bar
%ac%?px<•|• •|• • •|• • • •|• • • • •|• • • • • •|• • • • • • •|• • • • • • • •|• • • • • • • • •|• • • • • • • • • •>
#Track info (Artist • Album)
%s%ac%?ia<%ia|%?ic<%ic|->> • %?id<%id|->
#Player/control status
%?bs<%bs|%?bp<%xdBa|%?bc<%xdBa|%?bl<%xdBb|%xdBc|%xdBd|%xdBe|%xdBf>>>>
%?mm<|%xdRa|%xdRb|%xdRc|%xdRd>
%?ps<%xdS>
#Load conditional viewport for pause
#%V|p|0|18|160|12|1|
#%s%ac%?it<%t2%it;%t1 |%t2-;%t1 >
#Pause
--- End code ---
Everything works, except that even if I pause the song, "Pause" doesn't show up; the title remains as it is ???
BdN3504:
%V|p|0|18|160|12|1|
this line is wrong. %V creates a viewport (you can't use letters if you choose that option). %Vl loads a viewport. I think you accidentally forgot the "l". But this line won't work, even if you correct %V to %Vl, because you forgot to define the colour (RGB888) parameters;
The line MUST look like this to work:
%Vl|p|0|18|160|50|1|-|-|
even if you don't care about colours, you have to use the brackets and the hyphen, otherwise the wps parser does not understand that it's dealing with a viewport declaration.
if you want to use conditionals with alternating sublines, you have to put the time definitions before the conditionals:
%s%ac%?it<%t2%it;%t1 |%t2-;%t1 >
%s%t2%ac%?it<%it|->;%t1%ac%?it< | >;
i created a viewport for you, this should work, but i don't know if it is what you want...
--- Code: ---%ar%?mp<-|%?it<%it|->|%Vdp|-|->
%Vl|p|0|18|160|50|1|-|-|
%s%t2%ac%?it<%it|->;%t1%ac%?it< | >
Pause
--- End code ---
verdigris:
Hi again,
Thanks so much for the help. The WPS actually works now instead of defaulting to the default WPS theme. ^__^
New problems have cropped out though:
1. When pause is on, the conditional viewport is loaded, but its contents aren't loaded. I.e. it's a blank instead of blinking. I have tried disabling the code for blinking and just put "Pause" there as text, but that didn't work either.
2. Images are no longer loading. The Wiki said that the default viewport can't be used with texts, so I'm assuming that images still work in the main viewport. I don't think the additional viewports overlap with the image locations (my screen is 160x128, mono) so I'm not sure where I've gone wrong.
Current code:
--- Code: ---#Disable Statusbar
%wd
#Load images
# Battery
%xl|B|battery.bmp|1|119|6|
# Repeat
%xl|R|repeat.bmp|15|119|4|
# Shuffle
%xl|S|shuffle.bmp|21|119|
#Load conditional viewport for pause
%Vl|p|0|18|160|30|1|-|-|
#%s%ac%t2%?it<%it|->;%t1
Pause
#Main viewport
%V|0|0|-|100|1|-|-|
#Track info (Title)
%ac%?mp<%?it<%it|->|%?it<%it|->|%Vdp|%?it<%it|->|%?it<%it|->>
#Play bar
%ac%?px<•|• •|• • •|• • • •|• • • • •|• • • • • •|• • • • • • •|• • • • • • • •|• • • • • • • • •|• • • • • • • • • •>
#Track info (Artist • Album)
%s%ac%?ia<%ia|%?ic<%ic|->> • %?id<%id|->
#Player/control status
%?bs<%bs|%?bp<%xdBa|%?bc<%xdBa|%?bl<%xdBb|%xdBc|%xdBd|%xdBe|%xdBf>>>>
%?mm<|%xdRa|%xdRb|%xdRc|%xdRd>
%?ps<%xdS>
--- End code ---
Thanks very much for all the help so far!
Navigation
[0] Message Index
Go to full version