It is currently May 10th, 2024, 5:49 am

System volume control?

Get help with creating, editing & fixing problems with skins
Minihobbs
Posts: 6
Joined: August 26th, 2012, 4:53 pm

System volume control?

Post by Minihobbs »

Heya there,

I have recently installed Rainmeter and found it quite nice to use to clean up my desktop etc. However there is one thing I am wondering about...

How would I be able to create controls for the system volume control?
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: System volume control?

Post by Kaelri »

Rainmeter's Win7Audio plugin lets you control the system volume on Windows 7 or above. There are instructions on that page for using the plugin and changing the volume using bangs.

If you're not familiar with editing Rainmeter skins, I recommend the tutorials in Rainmeter 101 to get you started. :)
Minihobbs
Posts: 6
Joined: August 26th, 2012, 4:53 pm

Re: System volume control?

Post by Minihobbs »

Kaelri wrote:Rainmeter's Win7Audio plugin lets you control the system volume on Windows 7 or above. There are instructions on that page for using the plugin and changing the volume using bangs.

If you're not familiar with editing Rainmeter skins, I recommend the tutorials in Rainmeter 101 to get you started. :)
I thank you for your quick response and guidance to that particular page.
Minihobbs
Posts: 6
Joined: August 26th, 2012, 4:53 pm

Re: System volume control?

Post by Minihobbs »

One thing I forgot to ask about...

How would I get the value of the volume from the plugin?
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: System volume control?

Post by Kaelri »

From the manual page that I linked you to:
Win7Audio wrote:Usage

Code: Select all

[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin
Returns the name of the current sound device (when used in a STRING meter) and the percentage (0-100) of current volume level (when used in a measure which requires a number).
Minihobbs
Posts: 6
Joined: August 26th, 2012, 4:53 pm

Re: System volume control?

Post by Minihobbs »

Kaelri wrote:From the manual page that I linked you to:
This has just confused me.

As I am trying to grab the value and display it in string in which I can add/subtract to that number using the controls.
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: System volume control?

Post by Seahorse »

Stripped straight out of my own Volume meter, you should be able to figure it out from that...

Code: Select all

;===============================================================================================
;Measures
;===============================================================================================

[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin

;Add & subtract 1 to force a numeric output.
[PercentageCalc]
Measure=Calc
Formula=(MeasureWin7Audio+1-1)

;===============================================================================================
;Meters
;===============================================================================================

[MeterPreviousAudioDevice]
Meter=BUTTON
ButtonImage=#@#Images\Previous.png
X=10
Y=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "TogglePrevious"

[MeterNextAudioDevice]
Meter=BUTTON
ButtonImage=#@#Images\Next.png
X=180
Y=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "ToggleNext"

[MeterAudioDeviceName]
Meter=STRING
MeterStyle=StringStyleCenter
MeasureName=MeasureWin7Audio
X=105
Y=12

[MeterBarBackground]
Meter=Image
X=10
Y=22r
W=191
H=14
ImageName=#@#Images\BarBG.png

[MeterBar]
Meter=Bar
MeasureName=MeasureWin7Audio
BarOrientation=Horizontal
X=r
Y=r
W=191
H=14
Flip=0
AutoScale=1
ImageAlpha=200
BarImage=#@#Images\Bar.png

[BarText]
Meter=String
MeasureName=PercentageCalc
X=105
Y=2r
MeterStyle=StringStyleCenter
Text="%1%"

;-----------------------------------------------------------------------------------------------
;Volume !Bangs - invisible boxes matching the grid (A digital frontier)
;-----------------------------------------------------------------------------------------------

[MeterVolume10]
Meter=Image
X=10
Y=35
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 10"

[MeterVolume15]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 15"

[MeterVolume20]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 20"

[MeterVolume25]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 25"

[MeterVolume30]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 30"

[MeterVolume35]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 35"

[MeterVolume40]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 40"

[MeterVolume45]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 45"

[MeterVolume50]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 50"

[MeterVolume55]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 55"

[MeterVolume60]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 60"

[MeterVolume65]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 65"

[MeterVolume70]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 70"

[MeterVolume75]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 75"

[MeterVolume80]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 80"

[MeterVolume85]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 85"

[MeterVolume90]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 90"

[MeterVolume95]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 95"

[MeterVolume100]
Meter=Image
X=10r
Y=r
H=20
W=10
LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "SetVolume 100"
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt

Minihobbs
Posts: 6
Joined: August 26th, 2012, 4:53 pm

Re: System volume control?

Post by Minihobbs »

Okay so I have got the value from the plugin (I think) but what Measure do I need to place it in for it to be displayed as a number? As I know text uses the String Measure.

This is what I have so far...

Code: Select all

[Variables]
CurrentVolume=0

[Style]
FontFace=Arial
FontSize=10
FontColor=150,150,150
AntiAlias=1
;StringAlign=CENTER

[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin.dll

[MeterBackground]
Meter=IMAGE
X=0
y=0
W=40
H=40
ImageName=images\backgroundvol.png

[CurrentVolume]
Meter=STRING
MeterStyle=Style
X=8
Y=12
Text="#CurrentVolume#"
DynamicVariables=1
Hidden=0
Postfix="%"

[Meterminus_BUTTON]
Meter=BUTTON
X=0
Y=45
ButtonImage=images\volbutton.png

[PercentageCalc]
Measure=Calc
Formula=(MeasureWin7Audio+1-1)

[MeterString]
Meter=String
MeasureName=PercentageCalc
X=0
Y=0
W=300
H=16
FontSize=10
FontColor=0,0,0,255
AntiAlias=1
NumOfDecimals=1
Text=[PercentageCalc]

[MeterPlus_BUTTON]
Meter=BUTTON
X=25
Y=45
ButtonImage=images\volbutton.png
User avatar
Seahorse
Posts: 1175
Joined: June 9th, 2010, 5:56 pm
Location: Locks heath, UK

Re: System volume control?

Post by Seahorse »

Have a look at String meters...

Code: Select all

[MeterString]
Meter=String
MeasureName=PercentageCalc
X=0
Y=0
W=300
H=16
FontSize=10
FontColor=0,0,0,255
AntiAlias=1
NumOfDecimals=1
Text=%1
Also you buttons will do nothing at the moment, you probably want something like
for raising 10% (use a negative number for volume down):

LeftMouseUpAction=!CommandMeasure "MeasureWin7Audio" "ChangeVolume 10"

You have two essentially identical string meters one of which will display the variable which doesn't change so you need to lose [CurrentVolume] unless you intend to use !WriteKeyValue Variables.

Your [Style] is not being used either?

You might want to keep this page open while editing...
"Regrettably your planet is one of those scheduled for demolition"
Mike

My Skins at DeviantArt