Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Blank option for conditional with images
« previous next »
  • Print
Pages: [1]

Author Topic: Blank option for conditional with images  (Read 2648 times)

Offline Zivo

  • Member
  • *
  • Posts: 66
Blank option for conditional with images
« on: October 11, 2007, 04:05:25 PM »
hello Helpers

i have a Q

i m writing a WPS very nice by the way
i want to make the volume graphic

i want it to be 8 parts =  11~ DB for each part (image)
but i only want to use 7 images, as the first part is blank,nothing,empty.
i dont want to create a transparent bitmap because i prefer to use it for something else

i should i write it, this can be usefull for battery too

thats what i try
%?pv<|%xdG|%xdH|%xdI|%xdJ|%xdK|%xdL|%xdM>

Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Blank option for conditional with images
« Reply #1 on: October 11, 2007, 04:07:25 PM »
1) "Q" is not a word. Please see the posting guidelines.
2) What is your question? When you try that, what happens, different from what you expect?
Logged

Offline Zivo

  • Member
  • *
  • Posts: 66
Re: Blank option for conditional with images
« Reply #2 on: October 11, 2007, 05:15:32 PM »
im sorry for the "Q"

lets say 6 images 7 parts

i expect to see nothing in the first part between 84 - 73 (no image/unload existing image)
then image1 between 72 - 61
then image2 between 60 - 49
then image3 between 48 - 37
then image4 between 36 - 25
then image5 between 24 - 13
then image6 between 12 - 0

insted i see only the pictures in a bigger gap
Logged

Offline Yotto

  • Artist
  • Member
  • *
  • Posts: 826
  • Every Silver Lining has a Cloud
    • My Blog
Re: Blank option for conditional with images
« Reply #3 on: October 11, 2007, 07:57:53 PM »
I don't understand what you mean by "insted i see only the pictures in a bigger gap" but I can answer this:

"(no image/unload existing image)"

Unless something has changed recently, rockbox will *NOT* unload an existing image if the conditional says "No image".  Think of the conditional not as loading an object to be displayed, but instead as painting an image on the screen.  If the conditional tells it to paint image1, it will.  If, later it tells it to paint no image, it will do that as well, leaving image1 up on the screen.

It's been a while since I have done images, so I may be wrong and/or could be remembering wrong, but the solution, if I am right, is to create a "blank" image and paint it instead of what you are doing now.
Logged
Pulp Audio Weekly - Where we talk about News, Reviews, and pretty much anything else we feel like discussing.

Offline PaulJam

  • Member
  • *
  • Posts: 170
Re: Blank option for conditional with images
« Reply #4 on: October 11, 2007, 08:34:41 PM »
Hi,

from the CustomWPS wiki (http://www.rockbox.org/twiki/bin/view/Main/CustomWPS):
Quote
%pv     Current volume in decibels (dB). Can also be used in a conditional: %?pv[Mute|...|0 dB|Above 0 dB]
The first and the last two conditionals are handeled specially.

So i think to achieve your desired result the line should be:
%?pv<||%xdG|%xdH|%xdI|%xdJ|%xdK|%xdL|%xdM|%xdM|%xdM>
« Last Edit: October 11, 2007, 08:37:59 PM by PaulJam »
Logged

Offline Zivo

  • Member
  • *
  • Posts: 66
Re: Blank option for conditional with images
« Reply #5 on: October 12, 2007, 07:21:21 AM »
Quote from: Yotto on October 11, 2007, 07:57:53 PM
I don't understand what you mean by "insted i see only the pictures in a bigger gap" but I can answer this:

"(no image/unload existing image)"

Unless something has changed recently, rockbox will *NOT* unload an existing image if the conditional says "No image".  Think of the conditional not as loading an object to be displayed, but instead as painting an image on the screen.  If the conditional tells it to paint image1, it will.  If, later it tells it to paint no image, it will do that as well, leaving image1 up on the screen.

It's been a while since I have done images, so I may be wrong and/or could be remembering wrong, but the solution, if I am right, is to create a "blank" image and paint it instead of what you are doing now.


ok i see , but can i use one blank image for all of my needs like in battery
Logged

Offline Multiplex

  • Member
  • *
  • Posts: 440
Re: Blank option for conditional with images
« Reply #6 on: October 12, 2007, 07:59:12 AM »
You may run into trouble with memory if you create lots of images for volume or battery.

A neat trick that I learned from the Rockboxed WPS is this;
Don't create 4 images, one with one bar, one with two bars, one with three, etc.
Create an image of the 1st bar, make the second image be what you add to the first, the third the bit to add to 1 & 2 and so on. Then do something like
%?pv<|%xda|%xda%xdb|%xda%xdb%xdc|%xda%xdb%xdc%xdd>

The one I updated with this can be seen here previously it ran out of memory for all the images.

For what it's worth I don't think you need the blank image but I have to admit that this one does sometimes leave behind little crumbs of the image for the hold switches.
Logged

Offline Zivo

  • Member
  • *
  • Posts: 66
Re: Blank option for conditional with images
« Reply #7 on: October 12, 2007, 08:25:32 AM »
i do like you said but thats not the problem

i just read this http://forums.rockbox.org/index.php?topic=10418.0

and i understand now that someone tought its good to change the volume way

maybe this is the problem
i try to understand what i s the change but i didnt understand

what i know and remember is
0 = highest Volume
-84 = Mute

85 degrees ,like you say, means i can put theoretically between 2 - 85 images in any way i like, and i want to put 8 images divided like this
1 image per 10.5 degrees

now its all change i dont know way and how so please can someone explain me

may be its better when you understand this but i think the old way gives you all the possibilities you want so whats good in this change

thanks



Logged

Offline Multiplex

  • Member
  • *
  • Posts: 440
Re: Blank option for conditional with images
« Reply #8 on: October 12, 2007, 12:24:50 PM »
I think PaulJam has the exact answer for you in his post (and he does some VERY nice WPSs!)
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Blank option for conditional with images
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.09 seconds with 14 queries.