It is currently April 26th, 2024, 11:15 pm

Displaying Maximum value as a numerical value?

Share and get help with Plugins and Addons
Virogenesis
Posts: 2
Joined: April 29th, 2011, 12:07 am

Displaying Maximum value as a numerical value?

Post by Virogenesis »

Hello, I wrote a C++ plugin for the rainmeter and I am returning a maximum value with the initialize function which is useful for the bar display, but I was wondering is there any way to display in a numerical form the INT I get back from that function as well as using it in a bar ?

Thank you very much for the reply.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Displaying Maximum value as a numerical value?

Post by poiru »

If I understood correct, you want to display the value returned in Initialize()?
Virogenesis
Posts: 2
Joined: April 29th, 2011, 12:07 am

Re: Displaying Maximum value as a numerical value?

Post by Virogenesis »

Yes, is it possible ?
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Displaying Maximum value as a numerical value?

Post by poiru »

Virogenesis wrote:Yes, is it possible ?
Yes, although you'd have to handle it on the C++ side. For example, you could have:

Code: Select all

[mPlayer]
Measure=Plugin
Plugin=MyPlugin.dll
MyType=MaxValue
Then:
- Initialize(): Get MyType= and store it somewhere (lets say A). If A is MaxValue, then also store the max value in B.
- Update()/GetStringValue(): If A is MaxValue, then return B. Otherwise return something else.

For an example, you could check PowerPlugin.cpp.