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




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
| | |-+  %px
« previous next »
  • Print
Pages: [1]

Author Topic: %px  (Read 3479 times)

Offline hakimio

  • Member
  • *
  • Posts: 11
%px
« on: May 18, 2008, 10:38:52 AM »
Here Llorean says %px could be used to create slider progressbar. Can anyone explain how this could be done?
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: %px
« Reply #1 on: May 18, 2008, 10:21:42 PM »
The %px tag displays the percentage of a song played.  You could use it as a conditional (%?px) to display a sequence of images as a sort of custom progress bar.  If you wanted a slider bar, you could just make a sequence of images with the slider moved across the bar.  However, depending how many images you choose to use, your slider may or may not look very smoothly animated.
Logged
Welp, my iriver H10 20GB is out of commission again.

Offline hakimio

  • Member
  • *
  • Posts: 11
Re: %px
« Reply #2 on: May 18, 2008, 11:16:19 PM »
Could you post an example?
Logged

Offline MarcGuay

  • Rockbox Expert
  • Member
  • *
  • Posts: 1065
Re: %px
« Reply #3 on: May 19, 2008, 12:03:51 AM »
I believe that something like this:

Code: [Select]
%?px<1|2|3|4>
Would display a "1" for the first quater of the track, a "2" for the second quarter, and so on... If you replaced the numbers with image-display tags (%xd), then those images would be displayed in the same fashion.  I presume you've perused the CustomWPS wiki page already?
Logged

Offline hakimio

  • Member
  • *
  • Posts: 11
Re: %px
« Reply #4 on: May 19, 2008, 12:10:06 AM »
Quote from: MarcGuay on May 19, 2008, 12:03:51 AM
I believe that something like this:

Code: [Select]
%?px<1|2|3|4>
Would display a "1" for the first quater of the track, a "2" for the second quarter, and so on... If you replaced the numbers with image-display tags (%xd), then those images would be displayed in the same fashion.
So if I need smooth progressbar, I need 100x%xd?  :D
Edit: and I need to specify 100 different coordinates? :D
Quote
I presume you've perused the CustomWPS wiki page already?
Yup, I have.
« Last Edit: May 19, 2008, 12:12:50 AM by hakimio »
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: %px
« Reply #5 on: May 19, 2008, 12:30:59 AM »
I believe it should also work as a combined single strip image as well. If you need 100 steps, then yes, you need 100 subimages. But not every progress bar will be 100 pixels wide. For example, you can now also do a filling hourglass, or a circle that fills like a pie chart, or really anything you can come up with.
Logged

Offline hakimio

  • Member
  • *
  • Posts: 11
Re: %px
« Reply #6 on: May 19, 2008, 01:02:15 AM »
Quote from: Llorean on May 19, 2008, 12:30:59 AM
I believe it should also work as a combined single strip image as well. If you need 100 steps, then yes, you need 100 subimages. But not every progress bar will be 100 pixels wide.
And what if I have 154 px progressbar? What if I have ipod video with huge screen?
Quote
For example, you can now also do a filling hourglass, or a circle that fills like a pie chart, or really anything you can come up with.
Yes, I can, but if I need SLIDER progressbar, I don't need pie chart, hourglass or anything else.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: %px
« Reply #7 on: May 19, 2008, 01:06:17 AM »
You can still do it with strips and subimages, just fine. What's the problem? A solution was chosen that is VASTLY more flexible since it allows both what you want to display and several other things as well. I was merely illustrating the things that this method can do that a slider can't. This method can still also do a slider.
Logged

Offline hakimio

  • Member
  • *
  • Posts: 11
Re: %px
« Reply #8 on: May 19, 2008, 01:12:46 AM »
Progressbar won't be smooth and move pretty ugly (max percentage value, I guess, is 100, so you can't specify more than 100 arguments for %?px).
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: %px
« Reply #9 on: May 19, 2008, 01:17:24 AM »
Have you actually tried it? A two pixel step will actually look fairly smooth. Pixels are quite small on the larger screens. It seems to me you're jumping to conclusions without doing any experimentation first. As it stands, this solution offers a lot more flexibility. Meanwhile the slider was previously in Rockbox some time ago, and removed.

Can you offer a justification good enough that it covers redundant code and binary waste, something much better than "it will look very slightly smoother" to convince whichever developers decided it should be removed to put it back?
« Last Edit: May 19, 2008, 01:19:03 AM by Llorean »
Logged

Offline Job Van Dam

  • Member
  • *
  • Posts: 167
Re: %px
« Reply #10 on: May 20, 2008, 09:26:21 AM »
Another good but small reason the original slider progress bar was good was the fact it was alot easier to implement and the code was more manageable too

For the current one you have to do the math to make the steps look smooth between the start and end point.
The code is also kinda ugly because not only will you have a gigantic conditional but you may also (in my case anyway) have the same image repeated many times over expect with different coordinates. I thought it would be better than using sub images with alot of transperency.

With the old one you just specify the image, the start and stop points and you're done and it's smoother than a baby's bottom.
Logged

Offline hakimio

  • Member
  • *
  • Posts: 11
Re: %px
« Reply #11 on: May 20, 2008, 10:01:01 AM »
And one more: you might just run out of letters (we have only 24, right?).
Logged

Offline wintermute23

  • Member
  • *
  • Posts: 112
  • What Would Batman Do?
Re: %px
« Reply #12 on: May 20, 2008, 10:18:33 AM »
26, each of which can be used in upper or lower case, for a total of 52 sub-images per strip.

And if you need more than that, there's no reason why you can't spread it across two or more image strips. If you really wanted to, you could use 2,704 images, if you could get them all to fit in the buffer...
Logged
Past: iRiver H320 w/ 32GB CF card mod; iPod 4th Gen 30GB; iPod 5th Gen 30GB

Present: iPod Classic 80GB

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  %px
 

  • SMF 2.0.6 | SMF © 2013, Simple Machines
  • XHTML
  • RSS
  • WAP2

Page created in 0.105 seconds with 64 queries.