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
| | |-+  need help with brief large volume text on wps please
« previous next »
  • Print
Pages: [1]

Author Topic: need help with brief large volume text on wps please  (Read 1551 times)

Offline rbhawaii

  • Member
  • *
  • Posts: 125
need help with brief large volume text on wps please
« on: September 12, 2013, 12:04:04 AM »
Hello
I have an ipod video 5.5
I made a simple wps that is all text with no graphics. I like it a lot.  Can anyone help me with this:

When I turn the volume up or down I want the entire screen to show the volume number then as soon as I am done adjusting the volume it goes back to my wps screen right away.


Here is my line of code that I use for the volume to be represented by a 0 to 100% scale instead of the default rockbox -db scale.  I know some of you will want to tell me how its not a true 100% scale but im fine with how I made it unless you have a better example of how you did it.

Here is my volume line of code (all the following is one line)

%?pv<MUTE|01|01|02|02|03|03|04|04|05|05|06|06|07|07|08|08|09|09|10|10|11|11|12|12|13|13|14|14|15|15|16|16|17|17|18|18|19|19|20|20|21|21|22|22|23|23|24|24|25|25|26|27|28|29|30|32|34|36|38|40|42|44|46|48|50|52|54|56|58|60|62|64|66|68|70|72|74|76|78|80|82|84|86|88|90|92|94|96|98|100|max>

My wps is size 24 font so for the volume screen I will need the largest font rb has, I don’t want any graphics because I am trying to keep it as simple as possible.

When you reply could you please reply with a full example instead of use “this” or use “that” since I am not an expert and am very willing to learn and help others in the future too.

I already looked at this

http://www.rockbox.org/wiki/CustomWPS

and did not find what I need or how to do it.
 
Thanks
« Last Edit: September 12, 2013, 12:06:12 AM by rbhawaii »
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: need help with brief large volume text on wps please
« Reply #1 on: September 12, 2013, 09:12:18 AM »
The simplest way to do that is by doing something like:

Code: [Select]
# Start of theme
#
# Load our extra (really big) font
%fl(2, really_big_font.fnt)
#
# viewport conditional switching declaration
%?mv(2)<%Vd(volume_changing)|%Vd(wps_metadata)>
#
# declare our viewports
%Vl(volume_changing,0,0,-,-,2)
%ac%?pv<MUTE|01|01|02|02|03|03|04|04|05|05|06|06|07|07|08|08|09|09|10|10|11|11|12|12|13|13|14|14|15|15|16|16|17|17|18|18|19|19|20|20|21|21|22|22|23|23|24|24|25|25|26|27|28|29|30|32|34|36|38|40|42|44|46|48|50|52|54|56|58|60|62|64|66|68|70|72|74|76|78|80|82|84|86|88|90|92|94|96|98|100|max>%%
#
%Vl(wps_metadata,0,0,-,-,1)
foo
bar
baz
pretend metadata code stuffs here
#
# End of theme

All that is doing is selecting between two fullscreen viewports, one with a large font loaded, the other using the currently loaded userfont.
The one with the larger font is displayed for the duration of volume changing and for a period of two seconds thereafter during which time it will display "N%" in centred text before returning to the wps metadata viewport.
I feel I should note that the volume tag %pv doesn't /quite/ work like that...but I rather suspect you know this and you're going for something that "looks right" rather than have it be accurate.


[Saint]
« Last Edit: September 12, 2013, 09:19:19 AM by [Saint] »
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline rbhawaii

  • Member
  • *
  • Posts: 125
Re: need help with brief large volume text on wps please
« Reply #2 on: September 12, 2013, 08:10:58 PM »
Hi Saint
Thanks for your help. At what line should I insert my old code in to your new code?
I copied a font file called  50-Ubuntu-Bold.fnt in to the fonts folder and renamed your line
%fl(2, really_big_font.fnt)
to
%fl(2, 50-Ubuntu-Bold.fnt)

what else should i rename?

so far when i run it its broken , what am i missing?
Thanks
Logged

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: need help with brief large volume text on wps please
« Reply #3 on: September 12, 2013, 10:35:56 PM »
I'm terribly sorry, I wrote that on a tablet's virtual keyboard whilst half asleep.

My mistake, I made a slight typo:

Code: [Select]
# Start of theme
#
# Load our extra (really big) font
%Fl(2, really_big_font.fnt)
#
# viewport conditional switching declaration
%?mv(2)<%Vd(volume_changing)|%Vd(wps_metadata)>
#
# declare our viewports
%Vl(volume_changing,0,0,-,-,2)
%ac%?pv<MUTE|01|01|02|02|03|03|04|04|05|05|06|06|07|07|08|08|09|09|10|10|11|11|12|12|13|13|14|14|15|15|16|16|17|17|18|18|19|19|20|20|21|21|22|22|23|23|24|24|25|25|26|27|28|29|30|32|34|36|38|40|42|44|46|48|50|52|54|56|58|60|62|64|66|68|70|72|74|76|78|80|82|84|86|88|90|92|94|96|98|100|max>
#
%Vl(wps_metadata,0,0,-,-,1)
foo
bar
baz
pretend metadata code stuffs here
#
# End of theme

Is what you want.

Now that I'm more awake, I feel like I should make an effort to explain to you what is going on here in greater detail.
So, lets have a look:

Code: [Select]
# Start of theme
#

Nothing to see here, this is pretty boring. Just a comment, # tells the skin parser to ignore anything that comes after this character on the same line.
Lets move on.

Code: [Select]
# Load our extra (really big) font
%Fl(2, really_big_font.fnt)
#

Here's where we load the additional font we want to use. Notice the identifier it has, 2, we give it an identifier so we can refer to it later.
We're not using 0 or 1, as they are reserved for sysfont and the currently loaded user font respectively.

Code: [Select]
# viewport conditional switching declaration
%?mv(2)<%Vd(volume_changing)|%Vd(wps_metadata)>
#

This is our conditional statement that tells the skin parser  when to display what, and under what circumstances. Your requirement was to display nothing but (a very large) volume percentile display when volume was changed. So we use the %mv tag in a conditional statement to check whether or not volume is being changed. The first tuple is the "true" condition, and the second tuple is the "false" condition.

Notice the value after the %mv tag, "(2)". This value is measured in seconds and/or tenths of seconds, or may be non-existent. It specifies the length of time the true condition should be displayed for after going true.
In this case I used a value of two seconds as I think it is long enough to be able to see the volume clearly after changing it, and not too long that you feel like you're waiting too long for it to return to the false state.

Code: [Select]
# declare our viewports
%Vl(volume_changing,0,0,-,-,2)
%ac%?pv<MUTE|01|01|02|02|03|03|04|04|05|05|06|06|07|07|08|08|09|09|10|10|11|11|12|12|13|13|14|14|15|15|16|16|17|17|18|18|19|19|20|20|21|21|22|22|23|23|24|24|25|25|26|27|28|29|30|32|34|36|38|40|42|44|46|48|50|52|54|56|58|60|62|64|66|68|70|72|74|76|78|80|82|84|86|88|90|92|94|96|98|100|max>
#

Here we set up our first viewport, the one we want used for the "volume changing" true state.
The identifier used, "volume_changing", is simply used so we can both refer to this viewport later to display it and also because it describes the function of the viewport making it easier to read for yourself and others further down the track. The values after that identifier are x, y coordinates that tell the skin parser where we want this viewport to be displayed. I have used "0,0" to specify the top left corner.

The next two values, "-,-" are an easy way to tell the skin parser that we want this viewport to use the full width and height of the screen available to it. You can also specify this value in digits to create a viewport with specific dimensions, these values can be both positive and negative, but for simplicity we'll just use a full-screen viewport. The final value in this declaration, "2", tells the skin parser what font we want this viewport to use. In this case, we're using 2 because it is the identifier for the additional font really_big_font.fnt we loaded earlier.

Then we have your volume code, which I slightly adjusted by adding an alignment tag "%ac" to center the text in the viewport.

Code: [Select]
%Vl(wps_metadata,0,0,-,-,1)
foo
bar
baz
pretend metadata code stuffs here
#
# End of theme

Another full-screen viewport, this time to be displayed when the volume is not currently being changed, and with a font identifier of "1" to tell the skin parser to use whatever the currently loaded user font is (whichever font you specify in the theme's .cfg file). This is the viewport in which we will display everything else we want displayed about the currently playing track when volume isn't being changed.

I used foo, bar, baz, pretend metadata code stuffs here, etc. simply as placeholders. This is where you would insert the rest of your .wps code so that it will be displayed when volume isn't being changed.
The comment signifying the end of the theme code, and all the rest of the comments, are not necessary. They can be kept for future readability or removed if desired.

If you have any more questions, I will try my best to answer them for you.


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

Offline rbhawaii

  • Member
  • *
  • Posts: 125
Re: need help with brief large volume text on wps please
« Reply #4 on: September 13, 2013, 02:48:42 AM »
This is great! everything worked! THANKS

Do you know where I can get fonts that are bigger then 50?
I tried a long time ago and was not able to make(convert) my own fonts.

thanks again
al
Logged

Offline rbhawaii

  • Member
  • *
  • Posts: 125
Re: need help with brief large volume text on wps please
« Reply #5 on: September 22, 2013, 12:18:04 AM »
i trying to have the screen change to the new big font screen when i fast forward or rewind
shouldent this work? it seems to over lap the current screen and is broken... any advice?

%?mp<%Vd(wps_metadata)|%Vd(wps_metadata)|%Vd(wps_metadata)|%Vd(volume_changing)|%Vd(volume_changing)>

thanks
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Theming and Appearance Customization
| | |-+  need help with brief large volume text on wps please
 

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

Page created in 0.065 seconds with 14 queries.