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
translations translations
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
| | |-+  Any possibility for conditional %Cl?
« previous next »
  • Print
Pages: 1 [2]

Author Topic: Any possibility for conditional %Cl?  (Read 964 times)

Offline Dook

  • Member
  • *
  • Posts: 65
    • D00k.net
Re: Any possibility for conditional %Cl?
« Reply #15 on: February 04, 2025, 03:25:24 PM »
Looking incredibly promising so far. Will test the album art patch after exams next week, try see if I can poke and find breaking points. The screenshot tag idea is genius, I can see themes like refresh displaying a blurred version of it's WPS in the background of the home screen. You could make so many interesting themes.
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 1191
Re: Any possibility for conditional %Cl?
« Reply #16 on: February 04, 2025, 06:07:14 PM »
Quote
#<Stop|Play|Pause|Ffwd|Rew|Rec|Rec pause|FM|FM pause>
%?mp<|%Cl(0,0,160,160,b,r)%Cd|%Cl(0,0,140,140,c,c)%Cd||>
^
this works for me could you post something I can test with?
maybe your %VB is causing issue? I couldn't get what you posted above with th %VB and trailing % to work it did weird stuff like not updating till I popped a context menu or something else to force redraw


Yeah I just verified with %VB I have to do a context menu pop to get it to show
figure when you did that before this patch that VB is getting draw at load now you are doing it midstream
which is getting overwritten I'd guess
« Last Edit: February 04, 2025, 08:26:23 PM by Bilgus »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 1191
Re: Any possibility for conditional %Cl?
« Reply #17 on: February 04, 2025, 07:28:25 PM »
Took me a while to find this
https://www.rockbox.org/wiki/CustomWPS.html#Viewport_Draw_Layer
Quote
Viewport Draw Layer
Tag    Description
%VB    Draw on the backdrop layer

Rockbox uses two framebuffers when it does a screen redraw. The bottom layer is used for the backdrop image (the static parts of the display behind text for example), and the upper layer (the text/images). Using this tag you can tell the skin engine to instead draw everything in this viewport onto the backdrop layer instead of the foreground layer. Don't draw text here as it may not work too well. If the skin has this any %X() tag will be ignored and the whole screen will have a solid background (with the colour specified in the settings), so to get the most out of this feature:

    Add a full screen viewport at the start of the skin .. i.e %V(0,0,-,-,-) %VB
    Use %x(filename, 0, 0) to draw a backdrop image (If you want one!)
    Then add %V(0,0,-,-,-) and continue with your skin as normal. Any viewports you want drawn on the backdrop need the %VB tag but otherwise code as normal.

When I do this it doesn't display the album art with VB till I shutdown lol..
I think VB is probably not going to work with this..
« Last Edit: February 04, 2025, 07:31:54 PM by Bilgus »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 1191
Re: Any possibility for conditional %Cl?
« Reply #18 on: February 05, 2025, 12:04:42 AM »
After investigating this for a bit what I believe %VB is doing is drawing to the backdrop and that is working properly
but the skin engine never copies the new data in the backdrop buffer back to the screen
because it only does it on display->clear_viewport();

and the only time it gets done is when the viewport first appears due to this flag:
Code: [Select]
        else if ((skin_viewport->hidden_flags & vp_is_appearing) == vp_is_appearing)
        {
            vp_refresh_mode = SKIN_REFRESH_ALL;
            skin_viewport->hidden_flags = [b]VP_DRAW_HIDEABLE;[/b]
        }

One way I was toying with is when the Backdrop is drawn to with images force a full refresh
we'll see how this goes...



Logged

Offline RetiredTeacherGuy

  • Member
  • *
  • Posts: 43
  • Still trying to learn
    • Chroma theme for Rockbox
Re: Any possibility for conditional %Cl?
« Reply #19 on: February 05, 2025, 05:49:47 AM »
Quote from: Bilgus on February 05, 2025, 12:04:42 AM
After investigating this for a bit what I believe %VB is doing is drawing to the backdrop and that is working properly
but the skin engine never copies the new data in the backdrop buffer back to the screen
because it only does it on display->clear_viewport();

and the only time it gets done is when the viewport first appears due to this flag:
Code: [Select]
        else if ((skin_viewport->hidden_flags & vp_is_appearing) == vp_is_appearing)
        {
            vp_refresh_mode = SKIN_REFRESH_ALL;
            skin_viewport->hidden_flags = [b]VP_DRAW_HIDEABLE;[/b]
        }

One way I was toying with is when the Backdrop is drawn to with images force a full refresh
we'll see how this goes...


Even without using %VB, I find that it will always use the last %Cl regardless. Try this:


Code: [Select]
%?mp<|%Vd(c)%Cl(75,30,170,170)%Cd|%Cl(75,30,140,140)||>
%Vl(c,0,0,-,-,-)[code]


For me, I get 140 x 140 in both play and pause
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 1191
Re: Any possibility for conditional %Cl?
« Reply #20 on: February 05, 2025, 11:25:24 AM »
You missed the final %Cd adding that mkes the second one work
but its not wanting to draw into Viewport 'c'

I'll keep working with it till I get it or give up..

I really want the %VB thing to work might have to do some extra processing to get there

this works but IDK if is actually going into 'c'

Code: [Select]
#%?mp<|%Cl(0,0,160,160,b,r)%VB%Cd|%Cl(0,0,140,140,c,c)%VB%Cd||>
%?mp<|%Vl(c,0,0,-,-,-)%Cl(0,0,170,170)%Cd|%Cl(0,0,140,140)%Cd||>

%?C<%Vd(c)|>

« Last Edit: February 05, 2025, 11:42:31 AM by Bilgus »
Logged

Offline RetiredTeacherGuy

  • Member
  • *
  • Posts: 43
  • Still trying to learn
    • Chroma theme for Rockbox
Re: Any possibility for conditional %Cl?
« Reply #21 on: February 05, 2025, 12:26:05 PM »
Quote from: Bilgus on February 05, 2025, 11:25:24 AM
You missed the final %Cd adding that mkes the second one work
but its not wanting to draw into Viewport 'c'

I'll keep working with it till I get it or give up..

I really want the %VB thing to work might have to do some extra processing to get there

this works but IDK if is actually going into 'c'

Code: [Select]
#%?mp<|%Cl(0,0,160,160,b,r)%VB%Cd|%Cl(0,0,140,140,c,c)%VB%Cd||>
%?mp<|%Vl(c,0,0,-,-,-)%Cl(0,0,170,170)%Cd|%Cl(0,0,140,140)%Cd||>

%?C<%Vd(c)|>


Even with the second %Cd that I had forgotten, I still do not get two different sized (not cropped, but actually proportionally sized) images. Do you?
Logged

Offline RetiredTeacherGuy

  • Member
  • *
  • Posts: 43
  • Still trying to learn
    • Chroma theme for Rockbox
Re: Any possibility for conditional %Cl?
« Reply #22 on: February 05, 2025, 04:28:38 PM »
I wanted to be absolutely sure, so I stripped down the wps file. This is all that it contains:


Code: [Select]
#------------ Background Layer ------------#
%wd
%V(0,0,-,-,-)%VB
%?mp<|%Vl(c,0,0,-,-,-)%Cl(0,0,170,170)%Cd|%Cl(100,100,80,80)%Cd||>
%?C<%Vd(c)|>


#------------ Foreground Layer ------------#
%V(0,0,-,-,-)


What I get when I press play is the 80 x 80 but it is a cropped version of the 170 x 170, placed at location 100,100. Pressing pause has no effect.
« Last Edit: February 05, 2025, 04:55:51 PM by RetiredTeacherGuy »
Logged

Offline Bilgus

  • Developer
  • Member
  • *
  • Posts: 1191
Re: Any possibility for conditional %Cl?
« Reply #23 on: February 06, 2025, 12:33:00 AM »
Yeah thats pretty much what I've got in the file to test with too

I'll probably mull on this a while there are a few things playing against us here

one is the way album art is displayed and its due to the all or nothing nature
of the skin engine, it doesn't have garbage collection it has free it all and start over.
So you can't really allocate anything ahead of time (and why would you every track skip could be different)
thats why it gets farmed out and works different I think.

Next part is the background drawing, I really want that because of themes that draw text over the bg would get wiped out
but that is another can of worms because it doesn't take into account viewports and therefore its drawn all or nothing
and you need to do a full refresh (well a fuller refresh I guess I had to force it by changing flags)
because it really tires TRIES to never redraw the background layer

So IDK give me a while I'll post something if and when I get something that seems promising
otherwise I may just give it up and come back to it later (like after next release)
 
« Last Edit: February 06, 2025, 10:06:11 AM by Bilgus »
Logged

Offline RetiredTeacherGuy

  • Member
  • *
  • Posts: 43
  • Still trying to learn
    • Chroma theme for Rockbox
Re: Any possibility for conditional %Cl?
« Reply #24 on: February 06, 2025, 04:07:41 AM »
Understood, thanks for your efforts Bilgus I really appreciate it
Logged

  • Print
Pages: 1 [2]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  Any possibility for conditional %Cl?
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.065 seconds with 21 queries.