It is currently May 2nd, 2024, 6:02 pm

Update Rate With Large Amount of Buttons

Get help with creating, editing & fixing problems with skins
cleeezzz
Posts: 5
Joined: January 22nd, 2012, 5:15 am

Update Rate With Large Amount of Buttons

Post by cleeezzz »

So i took soita skin for media players and did a little editing, i noticed the progress bar could not be clicked to seek around the song, so i created 50 buttons spaced evenly through the progress bar that allows me to skip, all this works but i have noticed my cpu usage is much higher. Since these buttons are invisible (right over the progress bar), is there a way to make update not refresh the 50 buttons every second?

or is it just a coincidence that its taking more cpu o-o
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Update Rate With Large Amount of Buttons

Post by poiru »

Can you show the code for a single button?
cleeezzz
Posts: 5
Joined: January 22nd, 2012, 5:15 am

Re: Update Rate With Large Amount of Buttons

Post by cleeezzz »

[0]
Meter=BUTTON
ButtonImage=Seek.png
X=25
Y=98
LeftMouseUpAction=!Execute [!RainmeterPluginBang "mPlayer SetProgress 0"]

[2]
Meter=BUTTON
ButtonImage=Seek.png
X=5r
Y=98
LeftMouseUpAction=!Execute [!RainmeterPluginBang "mPlayer SetProgress 2"]

0 to 100, intervals of 2 Seek.png is a transparent image about 10 pixels wide (i originally had it at 5, but somehow it was too small)
bar length is 250, so 250/5 = 50 buttons

also, was there a better way to do this type of seek? (instead of 50 buttons)

it might just be my outdated computer =/
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Update Rate With Large Amount of Buttons

Post by jsmorley »

Poiru may have other thoughts, but I created a test skin with 100 buttons following the example you gave, and it seems to work fine for me without any significant CPU usage.

Do you perhaps have your Update= in [Rainmeter] set really low? I set mine to Update=200 and with the 100 buttons I see no significant increase in CPU usage.
Test.rmskin
You do not have the required permissions to view the files attached to this post.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Update Rate With Large Amount of Buttons

Post by poiru »

cleeezzz wrote:also, was there a better way to do this type of seek? (instead of 50 buttons)

it might just be my outdated computer =/
Could you try with IMAGE? E.g.:

Code: Select all

[0]
Meter=IMAGE
SolidColor=0,0,0,1
X=25
Y=98
W=3
H=10
LeftMouseUpAction=!Execute [!RainmeterPluginBang "mPlayer SetProgress 0"]
cleeezzz
Posts: 5
Joined: January 22nd, 2012, 5:15 am

Re: Update Rate With Large Amount of Buttons

Post by cleeezzz »

i left it at 1000ms, i guess its just my computer then

is there a difference between image and button?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Update Rate With Large Amount of Buttons

Post by jsmorley »

I'd be interested to see what you get if you run that .rmskin I posted and see if my skin creates any CPU issues for you. Since it is "just" the buttons and no other functionality, if it works better for you it might mean we should look elsewhere in your skin to see if something else is having an impact.

As to Image vs. Button in this case, using Meter=Image and SolidColor instead of a "button" is almost certainly going to work at least a tad better as Rainmeter doesn't have to evaluate the button image and divide it in three to show the "over/off/click" states of the button, and in any case doesn't have to load and manage an image file. Since you are just using a "transparent" button, there is no advantage to it over an Image meter as you don't need or want the "states".
cleeezzz
Posts: 5
Joined: January 22nd, 2012, 5:15 am

Re: Update Rate With Large Amount of Buttons

Post by cleeezzz »

i changed it to image, it seems to be a little better, thanks