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
| | |-+  (SOLVED)Having no luck with %xl and %xd
« previous next »
  • Print
Pages: [1]

Author Topic: (SOLVED)Having no luck with %xl and %xd  (Read 2498 times)

Offline KiyoshiKatu

  • Member
  • *
  • Posts: 10
(SOLVED)Having no luck with %xl and %xd
« on: January 09, 2013, 05:19:50 AM »
Alrighty, at this point it is becoming very apparent just how much of a newb I really am. I have successfully made several layout changes with my theme, and have several of the major items in place on the wps (the sbs is going much slower, as I'm just trying to get things working on the wps for now).

I am having some serious issues getting images to load and display while using the %xl and %xd tags in my theme. As far as I can tell, I am getting the syntax correct, and placement isn't an issue (I successfully replaced one set of tags with just plain %x, but using the exact same image, and it displayed fine). However, every time I try to make use of these tags, my wps crashes completely, and Rockbox just loads the default wps in its place.

Here's an example of the code that I am using in attempting to make a volume bar:

Code: [Select]
%xl(V,abstract_vol.bmp,0,0,13)
#
<SNIP>
#
%V(1,-10,-,-,1)
%?pv<%xd(Va)|%xd(Vb)|%xd(Vc)|%xd(Vd)|%xd(Ve)|%xd(Vf)|%xd(Vg)|%xd(Vh)|%xd(Vi)|%xd(Vj)|%xd(Vk)|%xd(Vl)|%Xd(Vm)> %pv

I have tested the viewport location to be at the bottom left corner of the screen, by placing text there with no images, then attempted to add the actual volume bar once location was verified.

It should be noted that I am using the simulator for iPod color/photo off of rasher.dk, and all other tested themes display without issue. I have tried closing and re-opening the simulator, just in case that was causing an issue, to no avail. I doubt it is the simulator; it is far more likely to be my code.

Let me know that you think, thanks!
« Last Edit: January 09, 2013, 09:11:35 PM by KiyoshiKatu »
Logged

Offline RockBoxFan

  • Member
  • *
  • Posts: 55
Re: Having no luck with %xl and %xd
« Reply #1 on: January 09, 2013, 02:03:37 PM »
I am a bit rusty (and was no expert when I wasn't), but a crash to the default wps usually means you have a syntax error. 

Why do you have the %pv at the END of the line?
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Having no luck with %xl and %xd
« Reply #2 on: January 09, 2013, 02:25:17 PM »
Quote from: RockBoxFan on January 09, 2013, 02:03:37 PM
Why do you have the %pv at the END of the line?

To display the volume in decibels, after the volume bar, which should be absolutely fine.


[Saint]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline RockBoxFan

  • Member
  • *
  • Posts: 55
Re: Having no luck with %xl and %xd
« Reply #3 on: January 09, 2013, 02:35:05 PM »
OK.  (My rust is showing...)  Then I don't see a problem with the code snippet.  Of course, abstract_vol.bmp must exist, have 13 images, fit in the viewport, etc....
Logged

Offline KiyoshiKatu

  • Member
  • *
  • Posts: 10
Re: Having no luck with %xl and %xd
« Reply #4 on: January 09, 2013, 02:38:09 PM »
Interesting. What's really throwing me off is that this isn't the only instance where I'm having issues with loading, and subsequently displaying, images using those tags. Perhaps a bug? Or maybe I should just be patient, and wait to get my hands on a Rockboxed iPod for real life testing.
Logged

Offline KiyoshiKatu

  • Member
  • *
  • Posts: 10
Re: Having no luck with %xl and %xd
« Reply #5 on: January 09, 2013, 02:40:39 PM »
Also, just in case the image is the issue, here's what I have been trying to use. I have it resting in /.rockbox/wps/abstract/abstract_vol.bmp

* abstract_vol.jpg (2.27 kB, 22x195 - viewed 195 times.)
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: Having no luck with %xl and %xd
« Reply #6 on: January 09, 2013, 02:55:44 PM »
Quote from: RockBoxFan on January 09, 2013, 02:35:05 PM
Of course, abstract_vol.bmp must exist, have 13 images, fit in the viewport, etc....

Actually, only the first criteria there is true.

The image is just a bitmap, you tell the skin engine how many portions to divide it into, which is completely arbitrary as long as you don't attempt to make a call to display a sub-image that doesn't exist. For example, trying to do:

Code: [Select]
#New style
%xl(foo, foo.bmp, 0, 0, 10)
%xd(foo, 11)

Code: [Select]
#Old style
%xl(A, foo.bmp, 0, 0, 10)
%xd(Ak)

...that will fail.

Images don't care if they fit in the viewport, either. With the exception of backdrops and the default (full-screen) viewport (a backdrop must be no smaller than, and no larger than, full-screen).

I'm not playing Internet King here, just clearing up some things for the greater good.


[Saint]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline RockBoxFan

  • Member
  • *
  • Posts: 55
Re: Having no luck with %xl and %xd
« Reply #7 on: January 09, 2013, 03:02:36 PM »
Thanks for the clarification.  You're way more familiar with this than I am!

Sorry, I don't think I can help.  I'm not familiar with the -10 y value.  Does that count up from the bottom, instead of down from the top?

When in doubt, I throw EVERYTHING out ("<SNIP>" section), keeping only the code in question.  Pare it down to something that works, then slowly build it back up again...
Logged

Offline KiyoshiKatu

  • Member
  • *
  • Posts: 10
Re: Having no luck with %xl and %xd
« Reply #8 on: January 09, 2013, 03:07:11 PM »
Yes, -10 is for the Y coordinate, which tells it to start 10 pixels from the lower border.

While I haven't excluded the rest of the code or anything, I have commented out just the line for the volume bar, which immediately makes the whole rest of the skin work, which is why I'm assuming that I have done something wrong in that tag. That being said, I'll definitely go give it a shot and see what happens if I leave out the rest of the tags in the wps file.

Edit: Just gave it a try, same result. Commented out every single line in the wps except for the %wd tag and the %xl and %xd tags that are in question. WPS still crashes to default wps skin.
« Last Edit: January 09, 2013, 03:10:03 PM by KiyoshiKatu »
Logged

Offline RockBoxFan

  • Member
  • *
  • Posts: 55
Re: Having no luck with %xl and %xd
« Reply #9 on: January 09, 2013, 03:45:29 PM »
I've reached the level of my incompetence.  Sorry, I don't have any more suggestions other than to try it on an actual device, or to upgrade the simulator.
Logged

Offline KiyoshiKatu

  • Member
  • *
  • Posts: 10
Re: Having no luck with %xl and %xd
« Reply #10 on: January 09, 2013, 04:25:12 PM »
No problem, thanks for attempting to help :)
Logged

Offline KiyoshiKatu

  • Member
  • *
  • Posts: 10
Re: Having no luck with %xl and %xd
« Reply #11 on: January 09, 2013, 09:02:00 PM »
Quote from: [Saint] on January 09, 2013, 02:55:44 PM

Code: [Select]
#New style
%xl(foo, foo.bmp, 0, 0, 10)
%xd(foo, 11)


That was the key! Turns out my tag syntax was the old style. Replaced that big mess of tag with the following two tags:

Code: [Select]
%xl(vol,abstract_vol.bmp,0,0,13)

<SNIP>

%xd(vol,%pv)
Logged

Offline RockBoxFan

  • Member
  • *
  • Posts: 55
Re: (SOLVED)Having no luck with %xl and %xd
« Reply #12 on: January 10, 2013, 08:19:19 AM »
I guess I am out of touch.  I was unaware that the "old style" was no longer valid.

Glad you got it worked out; sorry I was not more help.

...does this mean my themes will "break" the next time I upgrade?  (I am running 3.9)
« Last Edit: January 10, 2013, 12:39:29 PM by RockBoxFan »
Logged

Offline KiyoshiKatu

  • Member
  • *
  • Posts: 10
Re: (SOLVED)Having no luck with %xl and %xd
« Reply #13 on: January 10, 2013, 01:50:28 PM »
Not likely. In talking with Saint, the behavior that I am experiencing is out of the norm. For whatever reason, the tags don't work with my theme using old style, but other themes which do, work just fine, even for me. This is also all done in the simulator, and that could be part of the reason why it was failing. No matter the reason, it didn't work for me, but it works for everything else, so I don't necessarily think that an update will break anything, just good to know for future reference.
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  (SOLVED)Having no luck with %xl and %xd
 

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

Page created in 0.076 seconds with 15 queries.