Page 1 of 1

Hide an image for length of wav

Posted: September 8th, 2017, 9:42 pm
by Notthatbutton
Hi Rainmeter community,

I'm still learning rainmeter, only in the early stages and stuck on a simple line of code.
It's a simple push button that plays a wav file, but would like the button to hide for the length of the wave
then show once wav has finished.
Help Anyone?
Thanks

[Rainmeter]
Update=1000

[Text]
Meter=String
Text=2nd Floor
AntiAlias=1
FontColor=255,255,255
FontFace=Segoe UI
FontSize=50
Y=110

[Button2]
Meter=Image
ImageName=#@#Images\ButtonG.png
X=90

[Button]
Meter=Image
ImageName=#@#Images\ButtonR.png
X=90
LeftMouseUpAction=!Execute [!Update] [Play "#@#Sounds\2nd Floor.wav"] [!ShowMeter Button2] [!HideMeter Button] [!Update] [!ShowMeter Button]

Re: Hide an image for length of wav

Posted: September 9th, 2017, 4:00 am
by jsmorley
This is not something that can be done with just native Rainmeter, as there is no way for Rainmeter to "know" when the Play command is done. It's petty much "fire and forget".

However, I was messing with some C# stuff today anyway, so I knocked out a little Rainmeter Plugin that can help.

https://forum.rainmeter.net/viewtopic.php?p=139480#p139480

Re: Hide an image for length of wav

Posted: September 10th, 2017, 4:45 pm
by ZipD
Using the NowPlaying plugin, wouldn't one be able to to check Position is equal to Duration? Or even check if Progress = 100?

Re: Hide an image for length of wav

Posted: September 11th, 2017, 12:41 am
by jsmorley
ZipD wrote:Using the NowPlaying plugin, wouldn't one be able to to check Position is equal to Duration? Or even check if Progress = 100?
But why would I want to have to load up a media player to simply play a .wav file on some click or other action in my skin? I don't think I want Winamp popping up in front of everything any time I click on some button.

Re: Hide an image for length of wav

Posted: September 11th, 2017, 12:04 pm
by balala
jsmorley wrote:But why would I want to have to load up a media player to simply play a .wav file on some click or other action in my skin? I don't think I want Winamp popping up in front of everything any time I click on some button.
I think ZipD makes a mistake, thinking that when Rainmeter plays a wav, it loads the default player. But it doesn't. That's why his method, wouldn't work at all.