It is currently March 28th, 2024, 4:36 pm

Hide an image for length of wav

Get help with creating, editing & fixing problems with skins
Post Reply
Notthatbutton
Posts: 1
Joined: September 8th, 2017, 9:23 pm

Hide an image for length of wav

Post 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]
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Hide an image for length of wav

Post 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
User avatar
ZipD
Posts: 37
Joined: September 10th, 2017, 4:31 pm

Re: Hide an image for length of wav

Post 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?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Hide an image for length of wav

Post 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.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hide an image for length of wav

Post 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.
Post Reply