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
| | |-+  Language aware positioning of WPS elements
« previous next »
  • Print
Pages: [1]

Author Topic: Language aware positioning of WPS elements  (Read 3950 times)

Offline tomers

  • Developer
  • Member
  • *
  • Posts: 76
Language aware positioning of WPS elements
« on: December 05, 2009, 03:09:11 PM »
This is not actually a bug, nor a patch
I would like to have a conditional positioning of an album-art, depending on the #?Sr token. How can I achieve this?

I tried to create a viewport according to two different criteria - whether or not an album-art exist (%?C) and language direction (%?Sr).
Any ideas?

Attached is a work in progress WPS for Cowon-D2, which I try to change into language direction sensitive WPS screen.
* cabbiev2.320x240x16.wps (1.65 kB - downloaded 146 times.)
« Last Edit: December 27, 2009, 04:05:29 PM by tomers »
Logged

Offline tomers

  • Developer
  • Member
  • *
  • Posts: 76
Re: Conditional positioning of album art
« Reply #1 on: December 05, 2009, 03:24:13 PM »
Attaches are screenshots of the expected result (manually made for Cowon D2)

* WPS_LTR.jpg (22.57 kB, 472x368 - viewed 303 times.)

* WPS_RTL.jpg (23.56 kB, 472x368 - viewed 312 times.)
Logged

Offline pixelma

  • Rockbox Expert
  • Member
  • *
  • Posts: 645
Re: Conditional positioning of album art
« Reply #2 on: December 05, 2009, 06:13:04 PM »
You should be able to get this effect with conditional viewports by working with two sets of an album art viewport and a text viewport - both the same size but at different positions.

  • Preload album art (position is relative to the viewport it is displayed in hence the same for the 2 sets)
  • Define two sets of conditional viewports (say "a" for left to right and "b" for right to left) - the album art viewport and the corresponding text one of each set can have the same identifier. And I guess "a" already exists and there will be one for the album art not present case which is probably centre aligned (lets call it "c").
  • Let it display set a, b or c depending on presence of album art and the %?Sr tag.
    I'm not sure how %?Sr is used exactly, assuming it's %?Sr<it's a right to left language|not a right to left language> and with the above example, the most important line should look similar to this:
Code: [Select]
%?C<%?Sr<%Vdb|%Vda>|%Vdc>

    P.S.: Just a wish - if you change it for cabbiev2 in SVN, please try to change all versions for targets that use album art (colour and greyscale displays).


    Edit:
    I just saw your attached .wps file. It looks like there is only one viewport for album art and text (and every case). I would put the album art in an own viewport and the text in a seperate one - the text would be printed across the art and would be displayed in your album art viewport currently if I read things correctly. Then the %Cl can (or should be) before the %Vl tags because it will then be used in the same way, relative to the borders in the two album art viewports which contain the %C. The check for which viewport should be displayed looks correctly I think (with the extra of having left and right aligned versions of the display when there is no album art).
    « Last Edit: December 05, 2009, 06:36:13 PM by pixelma »
    Logged

    Offline tomers

    • Developer
    • Member
    • *
    • Posts: 76
    Re: Conditional positioning of album art
    « Reply #3 on: December 27, 2009, 04:04:50 PM »
    I've just posted a more elegant solution for this problem:
    FS#10882 - RTL aware WPS

    pixelma: I would greatly appreciate if you can review and comment about this patch.
    Logged

    Offline [Saint]

    • Rockbox Expert
    • Member
    • *
    • Posts: 1662
    • Hayden Pearce
      • Google+
    Re: Language aware positioning of WPS elements
    « Reply #4 on: December 27, 2009, 09:21:32 PM »
    tomers,


    Just an opinion, but why not make your own WPS (even if it is just another cabbie variant) as well as the patch?

    The theme site isn't as "dangerously underpopulated" as it used to be (depending on the target)...but it could still (and always) use more content. Fresh content with new or interesting uses of code can inspire new authors to make newer/better content.

    A great many number of people can access this patch, apply it to their liking, compile a build etc.....but a great many more (potentially) could benefit from the same piece of code when presented as a WPS and uploaded to the Theme Site.

    And then, you get to express yourself artistically as well  ;D


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

    Offline tomers

    • Developer
    • Member
    • *
    • Posts: 76
    Re: Language aware positioning of WPS elements
    « Reply #5 on: December 28, 2009, 12:40:06 AM »
    St.,

    Thank you for your feedback.

    Quote from: [St.] on December 27, 2009, 09:21:32 PM
    Just an opinion, but why not make your own WPS (even if it is just another cabbie variant) as well as the patch?
    The main idea of this patch is to make already existent WPS screens look more naturally when Rockbox interface is set to any RTL language (Hebrew, Arabic).
    With my patch applied, the Cabbie theme looks the same (didn't create any regression). But when RTL language is in use, it looks more natural, oriented from right to left. There is no point in creating any new RTL variant of any theme if this patch is used.

    Not all themes can be sensitive to language direction, because their orientation is 'hard-coded' in the graphics, so that horizontally mirroring their viewports or album-art location doesn't look well. One example is the iPodWidgets theme.

    I will try to review all themes in SVN and make them language direction sensitive, if appropriate. I'll add it to the patch, and when we feel it is ready, I'll commit. I'll appreciate if you can test it and report.

    Quote from: [St.] on December 27, 2009, 09:21:32 PM
    A great many number of people can access this patch, apply it to their liking, compile a build etc.....but a great many more (potentially) could benefit from the same piece of code when presented as a WPS and uploaded to the Theme Site.
    The patch will hopefully be committed soon, so that everyone will get its functionality, without the need to patch and recompile...

    Quote from: [St.] on December 27, 2009, 09:21:32 PM
    And then, you get to express yourself artistically as well ;D
    Unfortunately, I am not that of an artist yet  ;)
    Logged

    Offline [Saint]

    • Rockbox Expert
    • Member
    • *
    • Posts: 1662
    • Hayden Pearce
      • Google+
    Re: Language aware positioning of WPS elements
    « Reply #6 on: December 28, 2009, 03:34:07 AM »
    Wow cool, I didn't realise it was headed for a commit.

    Usually I see an idea and think "hey that's cool..." but it never makes it to the official build.

    How did you achieve the effect?

    %?C<%?Sr<RTL viewport|LTR viewport>|no AA so center it and who cares>

    is probably what I'd of tried...
    But I'm interested to know how you've done it.

    [St.]


    PS:
    Quote from: tomers on December 28, 2009, 12:40:06 AM
    Unfortunately, I am not that of an artist yet  ;)

    If you can use Notepad and MSPaint, you can make a WPS  ;D
    « Last Edit: December 28, 2009, 03:41:33 AM by [St.] »
    Logged
    Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

    Offline tomers

    • Developer
    • Member
    • *
    • Posts: 76
    Re: Language aware positioning of WPS elements
    « Reply #7 on: December 28, 2009, 04:12:32 AM »
    Quote from: [St.] on December 28, 2009, 03:34:07 AM
    Wow cool, I didn't realize it was headed for a commit.

    Usually I see an idea and think "hey that's cool..." but it never makes it to the official build.
    All patches are meant to be committed sometime. If they are not appropriate to the official build, they will eventually be closed.

    Quote from: [St.] on December 28, 2009, 03:34:07 AM
    How did you achieve the effect?
    May I suggest you read the code? ::)

    Quote from: [St.] on December 28, 2009, 03:34:07 AM
    %?C<%?Sr<RTL viewport|LTR viewport>|no AA so center it and who cares>
    is probably what I'd of tried...
    I tried using this method, but to code turned out to be awy too complicated. I don't remember exactly what was the exact code (BTW I created the %?Sr directive).
    I think the current suggestion is far better, although the letters used quite suck - but that's the ones left >:(

    Quote from: [St.] on December 28, 2009, 03:34:07 AM
    If you can use Notepad and MSPaint, you can make a WPS  ;D
    I think this is not a good idea - we will get a bunch of ugly themes created by programmers. This task should be given to artists...
    Logged

    Offline [Saint]

    • Rockbox Expert
    • Member
    • *
    • Posts: 1662
    • Hayden Pearce
      • Google+
    Re: Language aware positioning of WPS elements
    « Reply #8 on: December 28, 2009, 04:52:26 AM »
    Quote from: tomers on December 28, 2009, 04:12:32 AM
    I think this is not a good idea - we will get a bunch of ugly themes created by programmers. This task should be given to artists...

    I don't think I've ever really, truly had a moment before now where I could actually type LOL knowing that I actually did "laugh out loud"....my girlfriend came in from the next room to see what was so funny (and was quite dissappointed I might add)

    So..(if I read it correctly) upon this patch being committed the prefix to the x co-ord "s" would then horrizontally mirror the viewport?

    Well, that's a SHITLOAD easier than getting the WPS to do the legwork via conditionals...well done!
    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
    | | |-+  Language aware positioning of WPS elements
     

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

    Page created in 0.079 seconds with 15 queries.