Support and General Use > Theming and Appearance Customization

Need Help Re: Displaying the Volume in 10% increments using Bitmap Strips

(1/5) > >>

[Saint]:
Sounds easy doesn't it?

And in theory, it is. Well the code seems simple enough:

[Example 1]

%?pv<%xd*n*a|%xd*n*b|%xd*n*c|%xd*n*d|%xd*n*e|%xd*n*f|%xd*n*g|%xd*n*h|%xd*n*i|%xd*n*j>

where *n* = the %xl ID assigned to the Bitmap Strip and a, b, c etc. the sub-image

And this code does indeed work, many WPS's use that exact same piece of code, but the problem I am having is that the first 60/70% or so (ie the first 6 or 7 sub-images in the Bitmap Strip) seems to display in equally sized increments, but then the remaining 40/30% (or the last 4 or 3 Bitmap Strip sub-images) seem to display far too quickly.
What I mean by that is that the spacing between the display of the Bitmap Strip sub-images representing approximately 70 to 100% of the total volume aren't actually *spaced out* at 10% increments, with what I'm experiencing personally it seems there is only a spacing of approximately 1-2Db between the sub-images that *SHOULD* (in theory at least) represent 30/40% of the total volume.

It just doesn't display *smoothly* between the transitions.

The only way I have found to *ACTUALLY* display the volume in 10% increments is this:

[Example 2]

%?pv<%xd*n*a|%xd*n*a|%xd*n*a|%xd*n*a|%xd*n*a|%xd*n*a|%xd*n*a|%xd*n*a|%xd*n*a|%xd*n*a|%xd*n*a|
%xd*n*b|%xd*n*b|%xd*n*b|%xd*n*b|%xd*n*b|%xd*n*b|%xd*n*b|%xd*n*b|%xd*n*b|%xd*n*b|%xd*n*c|
%xd*n*c|%xd*n*c|%xd*n*c|%xd*n*c|%xd*n*c|%xd*n*c|%xd*n*c|%xd*n*c|%xd*n*c|%xd*n*d|%xd*n*d|%xd*n*d|
%xd*n*d|%xd*n*d|%xd*n*d|%xd*n*d|%xd*n*d|%xd*n*d|%xd*n*d|%xd*n*e|%xd*n*e|%xd*n*e|%xd*n*e|
%xd*n*e|%xd*n*e|%xd*n*e|%xd*n*e|%xd*n*e|%xd*n*e|%xd*n*f|%xd*n*f|%xd*n*f|%xd*n*f|%xd*n*f|%xd*n*f|
%xd*n*f|%xd*n*f|%xd*n*f|%xd*n*f|%xd*n*g|%xd*n*g|%xd*n*g|%xd*n*g|%xd*n*g|%xd*n*g|%xd*n*g|%xd*n*g|
%xd*n*g|%xd*n*g|%xd*n*h|%xd*n*h|%xd*n*h|%xd*n*h|%xd*n*h|%xd*n*h|%xd*n*h|%xd*n*h|%xd*n*h|
%xd*n*h|%xd*n*i|%xd*n*i|%xd*n*i|%xd*n*i|%xd*n*i|%xd*n*i|%xd*n*i|%xd*n*i|%xd*n*i|%xd*n*i|%xd*n*j|
%xd*n*j|%xd*n*j|%xd*n*j|%xd*n*j|%xd*n*j|%xd*n*j|%xd*n*j|%xd*n*j|%xd*n*j>

where *n* = the %xl ID assigned to the Bitmap Strip and a, b, c etc. the sub-image
*note that there are 11 "a's" instead of 10 to accommodate for mute.

This is the only way I've found personally (so far) to *smoothly* perresent the volume in 10% increments, and in the WPS I'm building at the moment an accurate disply of the volume using a 10 position "Slide Bar" is kind of an integral feature of it.

And, unfortunately, so is an animation for the Playmode and the bloated code I have to use to display the volume in nice, smooth, equal increments uses up valuable tags that would be better suited to allow me to pack in a few more on screen animations.

I seem to of hit the limit at 1023 Tags+, so the obvious thing to reduce the amount of tags used would be to use [Example 1], but that leads to the weird behaviour I've tried to explain Re: the last 3/4 images not being spaced correctly. And the code in [Example 2] is bloated and takes up tags I'd rather use for animation.

Can anyone tell me why it is that [Example 1] isn't working like I believe it *should* be? ie. each sub image representing an equal 10% portion? I've taught myself WPS code via a lot of reverse engineering of other peoples code, so I'm very much open to being corrected, or to have a better method of doing things explained to me.

Any help with this greatly appreciated, I've been working on this WPS for a while now and I'm almost at 100% and ready to post it, but just a few things like this keep me from doing so.
Also, my apologies for the lengthy post, I'm just a *little* bit anal about attention to detail  ;D



Sincerely,
[St.]

[EDITED BY MODERATOR TO SPLIT VERY LONG LINE]

Llorean:
How many "last sub images" exactly? There's usually a single image for "full volume" (0db) and a single image for "greater than full volume" so these two will always be outside the percentages you expect. Also, I'm not sure what player you're doing it for (may have missed it in there). Each player has a different volume range depending on hardware and it might make some differences.

JdGordon:
What error are you getting that makes you think you are hitting a token limit? There shouldn't be any more limits (we did a fair bit of rework here to remove these annoyances)...

JdGordon:
does %pv do the same as "percentage" if you use 13 images (if you want 10% increments) in the order mute|10%|20%|30%|40%|50%|60%|70%|80%|90%|100%|100%|>100%   the code seems to suggest that would work

[Saint]:
Firstly, thank You all for the prompt replies.


Re:


--- Quote from: Llorean on December 02, 2009, 12:58:43 PM ---How many "last sub images" exactly? There's usually a single image for "full volume" (0db) and a single image for "greater than full volume" so these two will always be outside the percentages you expect. Also, I'm not sure what player you're doing it for (may have missed it in there). Each player has a different volume range depending on hardware and it might make some differences.

--- End quote ---

Not sure what You mean exactly by "last sub images".
The code I'm currently using ([Example 2] from My first post) calls the first sub-image (being a) 11 times in an attempt to accommodate for "mute to 10% of the total volume", each subsequent sub-image (being images b to j) are called 10 times each in an attempt to represent the remaining 90% total volume in 9 equal increments following the first.
I'll post a .png version of the image I intend to use so You can see what I'm aiming for.

The code *seems* to work, visually at least.

But I know for sure that if it's not just outright wrong, that there's a better way of doing it.


Re:


--- Quote from: JdGordon on December 02, 2009, 03:26:33 PM ---What error are you getting that makes you think you are hitting a token limit? There shouldn't be any more limits (we did a fair bit of rework here to remove these annoyances)...


--- End quote ---

The error the RockBox iPod Nano Simulator is giving out is:

WARNING: Maximm Tokens exceeded (1023)

When I was building this WPS I'm currently working on, I coded all the animations I planned to use first (and it was a beautiful thing I might add ;D), and then when it came to doing the Viewports and the rest of the information I wanted to display onscreen I found I was hitting this limit and that in order to display the elements I wanted to, I had to make some pretty drastic sacrifices in the animation department...which really sucked, but I've found a compromise between the two that doesn't seem to exceed any limits at the moment, but I'm at a point where I just CAN"T add anything more to My code, or things on the WPS just stop working when this limit is exceeded.

I had some REALLY big plans RE: animation for this WPS....it'd be nice not to have to worry about limitations in the code like that, I'd rather face running out of room on the Nano's microscopic screen lol


Re:


--- Quote from: JdGordon on December 02, 2009, 09:48:22 PM ---does %pv do the same as "percentage" if you use 13 images (if you want 10% increments) in the order mute|10%|20%|30%|40%|50%|60%|70%|80%|90%|100%|100%|>100%   the code seems to suggest that would work

--- End quote ---

No, I'm sure that %pv *ISN'T* a percentage, as the volume is displayed according to db. and in My opinion db isn't really a scale of anything in particular but rather an arbitrary number on a "pretend" scale.....correct Me if I'm wrong.

What I'm aiming for is to find a *CLEAN* code that will display 10 Bitmap Strip sub-images that will represent:

mute to 10% of the "Total Volume", and each of the 9 subsequent images to represent the following 10% increments up to 100% of the "Total Volume"


I appologise if My understanding/missunderstanding of the WPS code makes it difficult to get My point accross.
All My knowledge of the WPS code is self taught, so My understanding of things may differ greatly to someone who is fluent in the code.



Sincerely,
[St.]

Navigation

[0] Message Index

[#] Next page

Go to full version