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:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  WPS images issue for volume indicator graphics: unequal distribution of images
« previous next »
  • Print
Pages: [1]

Author Topic: WPS images issue for volume indicator graphics: unequal distribution of images  (Read 6286 times)

Offline Mikerman

  • Artist
  • Member
  • *
  • Posts: 721
WPS images issue for volume indicator graphics: unequal distribution of images
« on: July 03, 2007, 10:49:14 PM »
In creating a graphical volume indicator of the type in the default Rockbox status bar (e.g. one that "grows" as the volume is increased, or in which different images are shown over the volume range), I've found that the individual graphics are not displayed for equal ranges.  

For example, if I have 11 graphics--images of the numbers 0-10--to be displayed to show the current volume level, when I use the conditional volume tag %?pv in the form %?pv<%xda|%xdb|%xdc|%xdd|%xde|%xdf|%xdg|%xdh|%xdi|%xdj|%xdk> where a-k call up images of the numbers 0-10, I've noted that the earlier numbers are displayed for a considerable number of volume increases, whereas the number 8 might be displayed for only a single volume increase.

Originally, I thought that this might have to do with the number of images to be displayed and the inability to equally distribute the total number of volume levels over that range.  For example, for the iRiver H-1xx players, the default volume range is 85 volume levels (0 to -83, in addition to mute); 11 graphical images cannot be equally spaced over that 85 level range.  But that wouldn't seem to explain why one or more of the images would only be displayed for a single volume level while others get 5 or more.

Am I misunderstanding/misusing the volume tag--is there some explanation for what's going on here?  I've been assuming that the number of volume levels would be equally distributed over the number of entries put in the volume conditional, or thereabouts, but that doesn't seem to be the case.  Is the fact that the total number of volume levels can't be equally distributed over the number of entries in the volume conditional throwing the code off or leading to a very different distribution?  Is the solution, then, to express the use of 85 images (for the iRiver H-1xx players) in the conditional?

Thanks for helping me understand what's going on here.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: WPS images issue for volume indicator graphics: unequal distribution of imag
« Reply #1 on: July 03, 2007, 10:51:41 PM »
If you do 12 images the second to last one is "0dB ONLY" and the last one is "values over 0dB"
« Last Edit: July 03, 2007, 10:54:09 PM by Llorean »
Logged

Offline Mikerman

  • Artist
  • Member
  • *
  • Posts: 721
Re: WPS images issue for volume indicator graphics: unequal distribution of images
« Reply #2 on: July 03, 2007, 11:01:28 PM »
Llorean--  Could you BE any faster?

;)

And so, using my number images example above, if I wanted the images for 0-10 to show (0 as low/mute), I would use

%?pv<%xda|%xdb|%xdc|%xdd|%xde|%xdf|%xdg|%xdh|%xdi|%xdj|%xdk|%xdk>

where the a image is the number 0 and the k image the number 10, and then there would be a more or less equal distribution of the volume levels for the images for number 1-9, with the 0 image getting a single volume level and the 10 image getting 2 volume levels (only if the volume level goes above 0dB, otherwise a single level)?
« Last Edit: July 03, 2007, 11:04:42 PM by Mikerman »
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: WPS images issue for volume indicator graphics: unequal distribution of images
« Reply #3 on: July 03, 2007, 11:03:33 PM »
I think so. I don't do WPSes, my tastes are ridiculously simple when it comes to that. I'm not 100% sure the lowest image gets a single volume level, and I don't know if the distribution is perfectly even for the in betweens (it should be, I believe, but I've not tested, and I'm not going to make promises on something I don't know about). I just know the last two are definitely special cases that could've thrown you off.
Logged

Offline Mikerman

  • Artist
  • Member
  • *
  • Posts: 721
Re: WPS images issue for volume indicator graphics: unequal distribution of images
« Reply #4 on: July 03, 2007, 11:07:58 PM »
Thanks--this gives me something to experiment with; the non-equal distribution was entrely throwing me off, without knowing why it might be happening, and I didn't understand the tag explanation as to the last 2 spaces as mandatorily having being "reserved."  

Any others more fluent here than me, please feel free to chime in.
Logged

Offline Mikerman

  • Artist
  • Member
  • *
  • Posts: 721
Re: WPS images issue for volume indicator graphics: unequal distribution of images
« Reply #5 on: July 03, 2007, 11:31:45 PM »
Just experimented, and if I use the first placeholder of the conditional for the 0 image, and the last three (yep, three), for the 10 image, I get a fairly decent distribution without the skipping of any number images.  The 9 image still gets short-changed a bit more than the other images (all the other images get 4 or 5 volume levels; the 9 image only gets 3, while the 10 image gets 6 or 7 volume levels) but this certainly is better than images being skipped entirely.

I'm still not sure I understand the exact mechanics here, though, apart from my empirical testing ....

;)
« Last Edit: July 03, 2007, 11:34:25 PM by Mikerman »
Logged

Offline mschneider

  • Member
  • *
  • Posts: 235
Re: WPS images issue for volume indicator graphics: unequal distribution of images
« Reply #6 on: July 03, 2007, 11:54:25 PM »
Mikerman, quick question. Are you modifying the statusbar that's displayed during file browsing? Or just creating your own for the wps? Just asking.

EDIT: sorry, should have read your first post more thoroughly.
« Last Edit: July 04, 2007, 10:55:40 AM by mschneider »
Logged

Offline Mikerman

  • Artist
  • Member
  • *
  • Posts: 721
Re: WPS images issue for volume indicator graphics: unequal distribution of images
« Reply #7 on: July 04, 2007, 12:49:08 AM »
I'm playing with a WPS I had set out (Marquee Nouveau in the WPS Gallery for the iRiver H1xx players), which has the Rockbox default status bar turned off and incorporates its own graphical control panel, including a battery indicator and volume indicator, etc.  It's the latter that has causing the issue for me--I'm trying to make the volume indicator grow in length (or otherwise change) as volume increases, in a more-or-less continual fashion.  
Logged

Offline Mikerman

  • Artist
  • Member
  • *
  • Posts: 721
Re: WPS images issue for volume indicator graphics: unequal distribution of images
« Reply #8 on: July 05, 2007, 12:00:02 AM »
Just to update what I've been finding, it appears that the volume conditional works as Llorean had noted, with the first and last 2 spaces reserved for the listed volume states (mute, 0 dB, and over 0 dB).  The tag appears to be giving those reserved locations a single volume click, and then splitting all the other clicks between the number of positions used between.

One seeming glitch noted:  the Simulator seems to have slightly different behavior than Rockbox on the player, and so what doesn't appear to work on the Simulator indeed may work on the player itself.  (I found this out upon setting the code on the Simulator and then transferring it to my player, only to find some different results.)

 
Logged

DervishD

  • Guest
Re: WPS images issue for volume indicator graphics: unequal distribution of imag
« Reply #9 on: August 03, 2007, 10:52:50 AM »
Hi all :)

Sorry for being so late in the thread. One of the problems with the volume conditional in WPS is that the distribution in the "lineal" part (that is, excluding 0dB, >0dB and mute) was not being done correctly. I reported the problem and a correct function to map values linearly. Any recent build has the patch applied and the problem is fixed.

The problem caused the last items (the ones before the 0dB and >0dB items) in the conditional to not be used under certain conditions.

Raúl
Logged

Offline Mikerman

  • Artist
  • Member
  • *
  • Posts: 721
Re: WPS images issue for volume indicator graphics: unequal distribution of images
« Reply #10 on: August 03, 2007, 11:36:18 PM »
Thanks and yep, that's exactly what I was finding, especially with the Sim (I don't know if the fix handles the Sim situation).  It drove me batty for days.
Logged

DervishD

  • Guest
Re: WPS images issue for volume indicator graphics: unequal distribution of imag
« Reply #11 on: August 04, 2007, 03:07:09 PM »
I don't know about the sim. In fact, when I was making my own WPS, I didn't notice this problem in the sim! Probably my fault, I don't know. The fact is that when I put the WPS in the iAudio I noticed the problem with the volume values and investigated the issue. It turned out that the function used to map the dB values to the values in the conditional was right if no "special" slots in the conditional were used.

The good part is that, having the source, I know that the only reason I don't fix a bug is my lack of knowledge. I no longer depend on anybody listening to my suggestions to fix propietary firmware. BTW, this firmware is FAR better than the one provided with my Cowon iAudio: the code is readable, it is updated every day, the developers are very active, there are good forums... That's just cool ;)

Raúl
Logged

Offline stavvie34

  • Member
  • *
  • Posts: 1
Re: WPS images issue for volume indicator graphics: unequal distribution of images
« Reply #12 on: March 14, 2009, 06:13:51 PM »
im a bit of a noob at creating wps'. ive only created like 2 or 3.
im working on a grafic volume indicator as well. but when i use the line:

 %?pv<%xdAa|%xdAb|%xdAc|xdAd|%xdAe|%xdAf|%xdAg|%xdAh>

the wps freaks out and none of the code previous and after this code works. not even the volume bar works

i have 8 images for the volume and ive tried useing bitmap strips and single images as well. nothing has worked. can some one please help me with this problem? thanks!

p.s. here is my code for the wps

%wd
#preloading images
%X|aboom2.bmp|
%xl|A|volstrip2.bmp|70|6|

%?pv<%xdAa|%xdAb|%xdAc|xdAd|%xdAe|%xdAf|%xdAg|%xdAh>

%s%ac%it
%s%ac%ia
%s%ac%id

%pc                                             %pt
%pb
%s%acPlaying Next: %It

    %bl            %ca                             


Logged

Offline karashata

  • Rockbox Expert
  • Member
  • *
  • Posts: 603
  • Just a fluffy dragon with too much time on my paws
    • Alex Vanderpol (karashata) on Twitter
Re: WPS images issue for volume indicator graphics: unequal distribution of imag
« Reply #13 on: March 15, 2009, 02:28:02 PM »
You need to add a '8|' to the end of your volume bitmap preload, so the line reads like this:

%xl|A|volstrip2.bmp|70|6|8|

This tells the WPS parser that that image is a bitmap strip with 8 images.
Logged
Welp, my iriver H10 20GB is out of commission again.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  WPS images issue for volume indicator graphics: unequal distribution of images
 

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

Page created in 0.094 seconds with 15 queries.