It is currently April 19th, 2024, 3:06 am
Help with a bluetooth related skin
-
- Posts: 6
- Joined: March 9th, 2018, 1:02 am
Help with a bluetooth related skin
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.
-
- Rainmeter Sage
- Posts: 5391
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Help with a bluetooth related skin
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.
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.
Code: Select all
[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin
[MeasureAudioString]
Measure=String
String=[MeasureWin7Audio]
OnChangeAction=[!Refresh "ConfigName"]
DynamicVariables=1
[MeterDummy]
Meter=String
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.
Last edited by eclectic-tech on March 12th, 2018, 3:26 pm, edited 2 times in total.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help with a bluetooth related skin
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.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.
-
- Posts: 6
- Joined: March 9th, 2018, 1:02 am
Re: Help with a bluetooth related skin
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.
-
- Rainmeter Sage
- Posts: 5391
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Help with a bluetooth related skin
If it does it once, it will do it twice...rohaanpk03 wrote:Ok so it refreshes when i swap from the headphones to the built in speakers but not the other way around.
What is 'refresh=0'? What does that means? By itself, it means nothing.rohaanpk03 wrote:Also the skins are set to refresh=0 and just using the refresh in the code doesn't work.
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.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 6
- Joined: March 9th, 2018, 1:02 am
Re: Help with a bluetooth related skin
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
[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
-
- Posts: 6
- Joined: March 9th, 2018, 1:02 am
Re: Help with a bluetooth related skin
The skins are
Desktop VU meter and
Visbubble
Desktop VU meter and
Visbubble
-
- Rainmeter Sage
- Posts: 5391
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Help with a bluetooth related skin
My bad... ( I hadn't tested it...)
Add DynamicVariables=1 to the String Measure. Without that, it was not seeing the change.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...)
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
With this code, VisBubble refreshes on every change of the sound device. (Updated first reply with corrected code...)
Last edited by eclectic-tech on March 12th, 2018, 3:27 pm, edited 1 time in total.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 6
- Joined: March 9th, 2018, 1:02 am
Re: Help with a bluetooth related skin
Thanks it worked