Page 1 of 1
Help with a bluetooth related skin
Posted: March 9th, 2018, 1:10 am
by rohaanpk03
Hey guys, I am fairly new to rainmeter and am wanting to start coding some basic skins for my benefit and was wondering if anyone could help me with coding a skin? I want a skin that can detect when i switch between my laptop speakers and bluetooth headphones (or just detect when a bluetooth device device connect to my pc) and auto refresh rainmeter. Whenever I switch between my laptop speakers and headphones I have to refresh rainmeter to get my VU meters to start working again. I do have a skinthe refreshed rainmeter when I click on it but it would be nice to have a skin to do that for me automatically.
Re: Help with a bluetooth related skin
Posted: March 9th, 2018, 3:12 pm
by eclectic-tech
The
Windows7Audio Plugin returns name of the current sound device. You could use an invisible background skin that monitors the audio in a String Measure and uses an
OnChangeAction to refresh Rainmeter.
Code: Select all
[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin
[MeasureAudioString]
Measure=String
String=[MeasureWin7Audio]
OnChangeAction=[!Refresh "ConfigName"]
DynamicVariables=1
[MeterDummy]
Meter=String
I haven't tested, but this should refresh the specified skins when the sound device changes. To refresh more visuzlizers, simply add another refresh (one after another) to the OnChangeAction bang; [!Refresh "VisBubble"][!Refresh "VU-Meter 3"] etc.
Alternately, you could specify which skins are refreshed, rather than a general !Refresh App, which may be undesirable for webparser skins, timing skins, etc.
Edit: Added
DynamicVariables=1 to the string measure. An issue you might encounter is auto switching stops working when a
variant of a skin is chosen; the auto refresh will not be properly initialized when switching to a variant, because you are not loading a new skin. Simply refresh the variant to have it start auto switching.
Re: Help with a bluetooth related skin
Posted: March 9th, 2018, 5:24 pm
by balala
eclectic-tech wrote:Alternately, you could specify which skins are refreshed, rather than a general !Refresh App, which may be undesirable for webparser skins, timing skins, etc.
Definitely a complete refresh isn't desirable. Instead just the appropriate config (skin) should have to be refreshed, adding a Config parameter to a
!Refresh bang. Or eventually a
!RefreshGroup bang should have to be used, creating an appropriate group of skins, if more then one single skin should have to be refreshed.
Re: Help with a bluetooth related skin
Posted: March 11th, 2018, 10:13 pm
by rohaanpk03
Ok so it refreshes when i swap from the headphones to the built in speakers but not the other way around. Also the skins are set to refresh=0 and just using the refresh in the code doesn't work.
Re: Help with a bluetooth related skin
Posted: March 11th, 2018, 10:54 pm
by eclectic-tech
rohaanpk03 wrote:Ok so it refreshes when i swap from the headphones to the built in speakers but not the other way around.
If it does it once, it will do it twice...
rohaanpk03 wrote:Also the skins are set to refresh=0 and just using the refresh in the code doesn't work.
What is 'refresh=0'? What does that means? By itself, it means nothing.
I think you are using skins that regenerate themselves after any changes and when first loaded. You may need to ask the authors of those visualizers for guidance on refreshing techniques.
Re: Help with a bluetooth related skin
Posted: March 12th, 2018, 12:05 am
by rohaanpk03
here one of the codes
[Metadata]
Skin name=DESKTOP VU-METER (Bottom Stereo White + Delay)
Version number=1.2
Information=SOUND LEVEL
Author=HiTBiT-PA
Website=
http://hitbit-pa.deviantart.com/
License=Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[Rainmeter]
Update=0
ContextTitle=Setup Window
ContextAction=!ActivateConfig "Desktop VU-Meter" "Setup.ini"
ContextTitle2=-
ContextTitle3=Refresh
ContextAction3=!Refresh
[Variables]
@include=#@#Variables.inc
@include2=#@#Data\Stereo Delay.inc
[StyleDelay]
X=26r
W=25
H=2
DynamicVariables=1
SolidColor=0,0,0
[StyleFFT]
X=26r
Y=r
W=25
H=240
BarOrientation=Vertical
BarImage=#@#Images\leds8.png
Re: Help with a bluetooth related skin
Posted: March 12th, 2018, 12:07 am
by rohaanpk03
The skins are
Desktop VU meter and
Visbubble
Re: Help with a bluetooth related skin
Posted: March 12th, 2018, 1:41 am
by eclectic-tech
My bad... ( I hadn't tested it...)
Add
DynamicVariables=1 to the String Measure. Without that, it was not seeing the change.
Code: Select all
[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin
[MeasureString]
Measure=String
String=[MeasureWin7Audio]
; To refresh other visualizers, add a [!Refresh CONFIGNAME] to the OnChangeAction below
OnChangeAction=[!Refresh VisBubble]
DynamicVariables=1
[MeterDummy]
Meter=String
To refresh other visualizers, add a [!Refresh
CONFIGNAME] to the OnChangeAction; e.g. [!Refresh "Desktop VU-Meter 3"].
With this code, VisBubble refreshes on every change of the sound device. (Updated first reply with corrected code...)
Re: Help with a bluetooth related skin
Posted: March 12th, 2018, 4:29 am
by rohaanpk03
Thanks it worked