Support and General Use > Theming and Appearance Customization

WPS code - If/else for button presses

(1/1)

arrow224:
First time WPS coder, so if this has been covered, please tell me where.

I have a H320, Rockbox Experimental Kosh's version 2.9.25.
I am modifying my WPS's to show the real time clock. My issue is with the ipod H500 WPS. Well, not the WPS, but the code behind it.

I want to have an if/else going, where if I push a button to increase or decrease the volume, I want the WPS to show the volume for a few seconds, then go back to the clock. Otherwise, I want it to always show the time.

My code is below. I am currently playing around with some tags, so the comments down the bottom are mine, there for reference for what works, or what was there originally. As you can see, I have tried the alternating sublines, and while they work, they are not what I am looking for.


--- Code: ---# preloading images
%P|pb.bmp|
# battary images
%xl|A|bat0.bmp|185|2|
%xl|B|bat1.bmp|185|2|
%xl|C|bat2.bmp|185|2|
%xl|D|bat3.bmp|185|2|
%xl|E|bat4.bmp|185|2|
# playback images
%xl|a|song_stop.bmp|5|121|
%xl|b|song_play.bmp|5|121|
%xl|c|song_pause.bmp|5|121|
# disable the status bar
%wd



%m|0|220|  %pp/%pe


%m|80|215|%?ia
%m|80|215|%?id
%s%m|80|215|%?it

%?mp

# progress bar
%pb|17|18|



# current time, volume, time remaining
#%t10%m|0|220|%al%pc %ac%pvdb %ar-%pr; %t10%m|0|220|%al%pc %ac%c l:MPc %ar-%pr
#%m|0|220|%al%pc %ac%pvdb %ar-%pr
%?bl
%X|bg.bmp|
# cover art
%C|6|37|[75|75|]
--- End code ---

Genre9mp3:

--- Quote from: arrow224 on October 29, 2006, 04:27:11 AM ---I want to have an if/else going, where if I push a button to increase or decrease the volume, I want the WPS to show the volume for a few seconds, then go back to the clock. Otherwise, I want it to always show the time.
--- End quote ---

This is not possible. You cannot detect button presses with the wps code.

Job Van Dam:
Acually it is possible after you apply this patch.

I was wondering something though I am currently awaiting for my DAP to be Rockbox compatible so I wanted to know when you have Rockbox on your DAP can you see the various .c files in folders?

Thank you.

Navigation

[0] Message Index

Go to full version