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
| | |-+  user defined variable's in WPS ?
« previous next »
  • Print
Pages: [1]

Author Topic: user defined variable's in WPS ?  (Read 1292 times)

Offline Misspell

  • Member
  • *
  • Posts: 33
user defined variable's in WPS ?
« on: July 02, 2011, 10:51:47 PM »
Id like like to set acouple different viewports widths based on Album art, if present then width will be xxx if not present then width will be yyy, is this possible ?

Right now im using %Vi(a,,,10,) and %Vi(b,,,50,) with an if condition then loading the viewpoint i need. I would like to only do a single check, set %MyWidth and then use %MyWidth through out my code.

_
Logged
NOTE: iPod 5.5G - PC = Ubuntu (Lucid) OS
~ What was once an opinion, became a fact, to be later proven wrong ~

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: user defined variable's in WPS ?
« Reply #1 on: July 03, 2011, 12:05:39 AM »
That seems like re-inventing the wheel to me...what you want is possible, but, is it actually needed?

example:

%?C<%Vd(small_viewport)|%Vd(big_viewport)>

Seems to be the best way to do it to me personally.

You could of course do:

%?C<%vs(MyWidth,set,0)|%vs(MyWidth,set,1)>
(or something similar, I've not long woken up)

But you're still going to have to check that variable elsewhere with something like:

%vg(MyWidth)<%Vd(small_viewport)|%Vd(big_viewport)>

Variables, in my experience, aren't the answer to simplifying things ;)
I've only ever used them in situations where it was literally impossible to achieve <effect X> in any other way.


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

Offline Misspell

  • Member
  • *
  • Posts: 33
Re: user defined variable's in WPS ?
« Reply #2 on: July 03, 2011, 11:16:20 AM »
The wiki page says Skin Variables (Touchscreen only); even if i wanted to, this will not work with an iPod Video skin, correct ?

After looking at your explanation, im gonna stay with what i currently have.

I thought i could do something like (and define the variable once):
%?C<%vs(MyWidth,set,313)|%vs(MyWidth,set,180)>

Then through out my code:
%V(0,18,%vg(MyWidth),7,-)
%V(0,58,%vg(MyWidth),32,-)
etc...

But the uieditor errors out when %V uses %vg(MyWidth) as a value and the sim pukes to default skin.

Thanks for the lesson.
Logged
NOTE: iPod 5.5G - PC = Ubuntu (Lucid) OS
~ What was once an opinion, became a fact, to be later proven wrong ~

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: user defined variable's in WPS ?
« Reply #3 on: July 03, 2011, 08:19:33 PM »
The syntax for skin variables variables is too new for the theme-editor...
It'll barf at anything it doesn't understand, its pretty out of sync with current svn.
Any syntax added in the last ~6 months will break it.


Also...yeah, I did slip up with skin variables, apparently they are touch only but I don't immediately see why.


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

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: user defined variable's in WPS ?
« Reply #4 on: July 03, 2011, 09:45:40 PM »
skin variables cant be used in viewport definitions like you want to do anyway.

edit: damn my typos
« Last Edit: July 04, 2011, 12:16:18 AM by JdGordon »
Logged


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

Offline Misspell

  • Member
  • *
  • Posts: 33
Re: user defined variable's in WPS ?
« Reply #5 on: July 03, 2011, 10:43:44 PM »
Quote from: JdGordon on July 03, 2011, 09:45:40 PM
skin variables can be used in viewport definitions like you want to do anyway.

Tested the following in the sim and also in an iPod Video and both crashed to stock skin.
Code: [Select]
%?C<%vs(MyWidth,set,300)|%vs(MyWidth,set,180)>
%V(5,2,%vg(MyWidth),15,3)

commenting out %V works, but as soon as its active, skin pukes.
Is the wiki up-to-date and this option is Touchscreen only ?
If not, whats the syntax or what an i doing wrong ?

_
Logged
NOTE: iPod 5.5G - PC = Ubuntu (Lucid) OS
~ What was once an opinion, became a fact, to be later proven wrong ~

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: user defined variable's in WPS ?
« Reply #6 on: July 04, 2011, 12:17:15 AM »
sorry, that should have said CANT....
and yeah, I belive the wiki is corre ct that skin vars are only available to touchscreen targets. Mostly because noone has come up with a reason to need them in non touch targets
Logged


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

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  user defined variable's in WPS ?
 

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

Page created in 0.073 seconds with 14 queries.