It is currently May 19th, 2024, 8:48 pm

How to constantly refresh a skin?

Get help with creating, editing & fixing problems with skins
martinotecco
Posts: 1
Joined: May 4th, 2024, 11:44 am

How to constantly refresh a skin?

Post by martinotecco »

How to constantly refresh a skin?
I got the VolumeMixer skin by JaxCore and I've set it on the static mode, where there's the volume icon in the system tray and if I click it it shows up the mixer. There's a problem, when hovering over the icon, it shows info
Volume: <volumeLevel>
but this isn't so accurate, sometimes it stucks up and doesn't adjust the text, for example if I connect/disconnect my bluetooth headphones (so the output device changes) it doesn't adjust the volume, or if I change volume frequently it doesn't adjust it. This thing is solved only by refreshing the skin! The Update and UpdateDivider variables in there seems to be useless at this point...
Now, I don't know how to code a skin and I don't know how to solve this bug, the only thing I can assume is that would be useful constantly refreshing the skin, not updating, refreshing!
How can I do it?

Here is the skin

Code: Select all

[Rainmeter]
Update=1000
DefaultSavePosition=0
DefaultAlwaysOnTop=0
DefaultDraggable=0
DefaultSnapEdges=0
DefaultStartHidden=1
DefaultAlphaValue=255
DefaultHideOnMouseOver=0
DefaultFadeDuration=100
DefaultClickThrough=0
DefaultKeepOnScreen=0
DefaultAutoSelectScreen=0
DefaultUpdateDivider=-1
DynamicWindowSize=1
AccurateText=1
RightMouseDownAction=[]
RightMouseUpAction=[]

AccurateIconName=1
SkinWidth=#W#
SkinHeight=#H#
OnCloseAction=[!DeactivateConfig "YourMixer\Main\Elements\ControlScreen"]["#@#Actions\AHKv1.exe" "#@#Actions\Source Code\Close.ahk"]

[Variables]
u/include=#@#Vars.inc
u/includegVar1=#SKINSPATH##JaxCore\@Resources\gVars\Time.inc
u/includeCoreDataVars=#SKINSPATH#..\CoreData\Vars.inc

H=#MinH#

; ---------------------------------------------------------------------------- ;
;                                   Functions                                  ;
; ---------------------------------------------------------------------------- ;

[Esc]
Measure=Plugin
Plugin=Hotkey
HotKey=ESCAPE
KeyDownAction=[!UpdateMeasure mToggleSet]
UpdateDivider=-1

[Func]
Measure=Script
ScriptFile=#@#Lua\Func.lua
UpdateDivider=1

[generateMixer]
Measure=Plugin
Plugin=PowershellRM
Scriptfile=#@#Powershell\generateMixer.ps1

u/includeTweenNode1Style=#@#Includes\Animation#Animated#.inc

[mToggle]
Measure=Calc
Formula=1 - mToggle 
IfCondition=mToggle = 0
IfTrueAction=[!UpdateMeasure ACTIONLOAD][!CommandMeasure Esc Start]
IfCondition2=mToggle = 1
IfTrueAction2=[!UpdateMeasure ACTIONUNLOAD][!CommandMeasure Esc Stop]
IfConditionMode=1
DynamicVariables=1
[mToggleSet]
Measure=Calc
Formula=mToggle
IfCondition=mToggle = 0
iftrueaction=[!UpdateMeasure mToggle]
ifconditionmode=1
Group=NUOL
Disabled=1

[ACTIONLOAD]
Measure=String
OnUpdateAction=[!CommandMeasure generateMixer "generateMixer"]
Disabled=1
Group=NUOL
; ["#@#Icons\GetIcons#Layout.fetch_icons#\GetIcons.exe"]

[ACTIONUNLOAD]
Measure=String
OnUpdateAction=[!UpdateMeasure ACTIONUNLOAD "YourMixer\Main\Elements\ControlScreen"]
Disabled=1
Group=NUOL

[ACTIONREFRESH]
Measure=String
OnUpdateAction=[!UpdateMeasure mToggleSet][!Delay 500][!UpdateMeasure mToggle]
Disabled=1
Group=NUOL

[AppVolumeParent]
Measure=Plugin
Plugin=AppVolume
IgnoreSystemSound=1
ExcludeApp=#ExcludeApp#
UpdateDivider=1

[AppVolTester]
Measure=Plugin
Plugin=AppVolume
Parent=AppVolumeParent
Index=1
Substitute=".exe":""

u/includeTray=#@#Includes\Tray#StayOnDesktop##Tray##TrayScroll#.inc
; Thanks DEATHCRAFTER

; ---------------------------------------------------------------------------- ;
;                                    Content                                   ;
; ---------------------------------------------------------------------------- ;

[Dum]
Meter=String
User avatar
Yincognito
Rainmeter Sage
Posts: 7290
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to constantly refresh a skin?

Post by Yincognito »

martinotecco wrote: May 4th, 2024, 11:49 am How to constantly refresh a skin?
I got the VolumeMixer skin by JaxCore and I've set it on the static mode, where there's the volume icon in the system tray and if I click it it shows up the mixer. There's a problem, when hovering over the icon, it shows info
Volume: <volumeLevel>
but this isn't so accurate, sometimes it stucks up and doesn't adjust the text, for example if I connect/disconnect my bluetooth headphones (so the output device changes) it doesn't adjust the volume, or if I change volume frequently it doesn't adjust it. This thing is solved only by refreshing the skin! The Update and UpdateDivider variables in there seems to be useless at this point...
Now, I don't know how to code a skin and I don't know how to solve this bug, the only thing I can assume is that would be useful constantly refreshing the skin, not updating, refreshing!
How can I do it?

Here is the skin

Code: Select all

[Rainmeter]
Update=1000
DefaultSavePosition=0
DefaultAlwaysOnTop=0
DefaultDraggable=0
DefaultSnapEdges=0
DefaultStartHidden=1
DefaultAlphaValue=255
DefaultHideOnMouseOver=0
DefaultFadeDuration=100
DefaultClickThrough=0
DefaultKeepOnScreen=0
DefaultAutoSelectScreen=0
DefaultUpdateDivider=-1
DynamicWindowSize=1
AccurateText=1
RightMouseDownAction=[]
RightMouseUpAction=[]

AccurateIconName=1
SkinWidth=#W#
SkinHeight=#H#
OnCloseAction=[!DeactivateConfig "YourMixer\Main\Elements\ControlScreen"]["#@#Actions\AHKv1.exe" "#@#Actions\Source Code\Close.ahk"]

[Variables]
u/include=#@#Vars.inc
u/includegVar1=#SKINSPATH##JaxCore\@Resources\gVars\Time.inc
u/includeCoreDataVars=#SKINSPATH#..\CoreData\Vars.inc

H=#MinH#

; ---------------------------------------------------------------------------- ;
;                                   Functions                                  ;
; ---------------------------------------------------------------------------- ;

[Esc]
Measure=Plugin
Plugin=Hotkey
HotKey=ESCAPE
KeyDownAction=[!UpdateMeasure mToggleSet]
UpdateDivider=-1

[Func]
Measure=Script
ScriptFile=#@#Lua\Func.lua
UpdateDivider=1

[generateMixer]
Measure=Plugin
Plugin=PowershellRM
Scriptfile=#@#Powershell\generateMixer.ps1

u/includeTweenNode1Style=#@#Includes\Animation#Animated#.inc

[mToggle]
Measure=Calc
Formula=1 - mToggle 
IfCondition=mToggle = 0
IfTrueAction=[!UpdateMeasure ACTIONLOAD][!CommandMeasure Esc Start]
IfCondition2=mToggle = 1
IfTrueAction2=[!UpdateMeasure ACTIONUNLOAD][!CommandMeasure Esc Stop]
IfConditionMode=1
DynamicVariables=1
[mToggleSet]
Measure=Calc
Formula=mToggle
IfCondition=mToggle = 0
iftrueaction=[!UpdateMeasure mToggle]
ifconditionmode=1
Group=NUOL
Disabled=1

[ACTIONLOAD]
Measure=String
OnUpdateAction=[!CommandMeasure generateMixer "generateMixer"]
Disabled=1
Group=NUOL
; ["#@#Icons\GetIcons#Layout.fetch_icons#\GetIcons.exe"]

[ACTIONUNLOAD]
Measure=String
OnUpdateAction=[!UpdateMeasure ACTIONUNLOAD "YourMixer\Main\Elements\ControlScreen"]
Disabled=1
Group=NUOL

[ACTIONREFRESH]
Measure=String
OnUpdateAction=[!UpdateMeasure mToggleSet][!Delay 500][!UpdateMeasure mToggle]
Disabled=1
Group=NUOL

[AppVolumeParent]
Measure=Plugin
Plugin=AppVolume
IgnoreSystemSound=1
ExcludeApp=#ExcludeApp#
UpdateDivider=1

[AppVolTester]
Measure=Plugin
Plugin=AppVolume
Parent=AppVolumeParent
Index=1
Substitute=".exe":""

u/includeTray=#@#Includes\Tray#StayOnDesktop##Tray##TrayScroll#.inc
; Thanks DEATHCRAFTER

; ---------------------------------------------------------------------------- ;
;                                    Content                                   ;
; ---------------------------------------------------------------------------- ;

[Dum]
Meter=String
First, you should make sure that the "bug" is a real bug (this is how a somewhat similar actual bug looks like) and see if a correcly written skin exhibits it or not (if it doesn't, then the culprit would most likely be some part of the skin you're using). Here are 2 correctly written skins:
1) https://github.com/khanhas/AppVolumePlugin/releases (as per the AppVolume plugin page at https://forum.rainmeter.net/viewtopic.php?t=26942)
2) a simpler one, measuring the volume of Winamp.exe (this assumes the AppVolume plugin is already installed; the application can obviously be changed):

Code: Select all

[Variables]
ExcludeApp=

[Rainmeter]
Update=25
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,128

---Measures---

[AppVolumeParent]
Measure=Plugin
Plugin=AppVolume
IgnoreSystemSound=1

[AppVolTester]
Measure=Plugin
Plugin=AppVolume
Parent=AppVolumeParent
AppName=Winamp.exe
NumType=Volume
Substitute=".exe":""

---Meters---

[MeterVolume]
Meter=String
FontFace=Consolas
FontSize=16
FontColor=255,255,255,255
AntiAlias=1
Text=AppVolume: [AppVolTester:%,2]
DynamicVariables=1
For the record, both the above skins have the [Rainmeter] section's Update option set to less than 1000 ms, so they'll report values close to real-time. I somehow doubt that they'll not adjust the volume properly for you, although they might have problems with connecting/disconnecting bluetooth headphones (that's one of the reasons why I didn't buy one when I got the chance, by the way). In any case, a feedback on that from you would be nice to have.

Now on your question, I would strongly advise against continuously refreshing a skin, especially one from JaxCore. Besides the generalities of it being overkill, in the case of a many script featured complex system like in JaxCore, you might have adverse effects (not sure how serious, if any). So, take into account that I personally decline any responsability if something goes wrong in that regard. Anyway, if you're willing to take your chances and bet on no problems, the way to do it is quite simple - just add a OnUpdateAction=[!Refresh] to your [Rainmeter] section from your skin (i.e. right below the OnCloseAction=... part).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16244
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to constantly refresh a skin?

Post by balala »

martinotecco wrote: May 4th, 2024, 11:49 am How to constantly refresh a skin?
Don't repeatedly refresh a skin, this is definitely not a good idea. See Yincognito's above reply as well, his recommendation might be good, however the refresh is not a too desirable operation and you definitely shouldn't do it on a regular basis.
User avatar
CodeCode
Posts: 1367
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: How to constantly refresh a skin?

Post by CodeCode »

balala wrote: May 4th, 2024, 8:13 pm Don't repeatedly refresh a skin, this is definitely not a good idea. See Yincognito's above reply as well, his recommendation might be good, however the refresh is not a too desirable operation and you definitely shouldn't do it on a regular basis.
Another note - if a skin is refreshed at or less than every second, it will crash rainmeter.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.