Hello
I'll like to know how to make a panel opens up and close when the music is playing.
My newest skin needs a "bang" or something that triggers a small animated panel or close every time the audio player is in "Playing mode", I'll like that when I press the pause button of the skin that panel (which would be showing the cover of the album inside of an image) closes itself.
I already created a folder name named Lines with two sub folders named anim11 and anim21
I need that the "playing" state triggers a Group.
Then I guess I will have to put those meters in Hidden. (the meter with the ignition of the panel)
The trigger should say ShowMeterblabla, or something like that, but I don't know how to do that!
Another behavior I'll like to add is when the skin is already executed but the AIMP player is closed none of the skin be visible, in other words, the skin in an invisible state until I select some files to be played and automatically the skin be visible while the software AIMP is being executed.
It is currently October 14th, 2024, 10:06 pm
Play / Pause action trigger in a skin
-
- Posts: 24
- Joined: July 17th, 2012, 4:50 am
-
- Rainmeter Sage
- Posts: 16658
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Play / Pause action trigger in a skin
Here is an example:
If you set correctly the Player variable in the [Variables] section, the [MeasureState] measure is returning:
Note the followings:
Code: Select all
[MeasurePlayer]
Measure=Plugin
Plugin=NowPlaying
PlayerName=#Player#
PlayerType=Title
[MeasureState]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=State
- 0 when the player is stopped
- 1 when it's playing
- 2 when it's paused.
Code: Select all
[MeasureState]
...
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!ShowMeter "Meter-To-Be-Shown-When-Playing"][!HideMeter "Meter-To-Be-Hidden-When-Playing"][!Redraw]
IfFalseAction=[!HideMeter "Meter-To-Be-Shown-When-Playing"][!ShowMeter "Meter-To-Be-Hidden-When-Playing"][!Redraw]
- The above IfCondition is true when the player is playing. In this case IfTrueAction is executed, showing the [Meter-To-Be-Shown-When-Playing] meter and hiding the [Meter-To-Be-Hidden-When-Playing] meter. Obviously here you have to add the meters you want to show and hide.
- When the IfCondition is false (take care this happens both, when the player is stopped, and when it's paused as well), [Meter-To-Be-Shown-When-Playing] is hidden, while [Meter-To-Be-Hidden-When-Playing] is shown.
- Doesn't really matter how you hide or show the [Meter-To-Be-Shown-When-Playing] and the [Meter-To-Be-Hidden-When-Playing] meters, by adding Hidden=1 options to them. Doesn't matter, because their state is specified by the bangs of the above IfTrueAction and IfFalseAction options.
-
- Rainmeter Sage
- Posts: 8466
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Play / Pause action trigger in a skin
To add the answer to your last paragraph to what balala mentioned above, you also have the PlayerType=Status to measure whether the player is open (1) or closed (0):
which you can then use along the above [MeasureState] in similar IfConditions to do what you want. Obviously, you can also combine in any way you prefer the comparisons on the values of [MeasureState] and [MeasureStatus] in such an IfCondition, by using the && (logical AND) and || (logical OR) operators (this will also need DynamicVariables=1 added to the measure where you attached the IfCondition, if by any chance you use the square bracket notation for the compared measures).
Code: Select all
[MeasureStatus]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=Status
-
- Posts: 24
- Joined: July 17th, 2012, 4:50 am
Re: Play / Pause action trigger in a skin
Now I made a small progress, appearently the behavior changes in different Windows versions, I'm talking about the same skin folder using the same player (AIMP). I could make the cloud and cover dissapears when is in PAUSE or STOP behavior, but not in the way I like, animation of the cloud and then the cloud still with the cover in it. (In W10 dissapears, in W7 not)
I'll keep trying during a few more days,
Here I show you a screenshot, obviously the rain, eyes, mouth and sketchy shadows at the left of his head and belly are animated. The mouse cursor is over his left hand (our right) showing you the "NEXT" track option.
I post this here so everyone can understand what I'm doing.
Already made the PLAY/PAUSE heart button starts an animation of BEAT while you rest the cursor on it!
I want to make a diffent animation for the face, hidden when music playing but when the PAUSE or STOP states is on the cloud dissapears and the sad face of the dude change to a happy one!
I'll stay in touch!
I'll keep trying during a few more days,
Here I show you a screenshot, obviously the rain, eyes, mouth and sketchy shadows at the left of his head and belly are animated. The mouse cursor is over his left hand (our right) showing you the "NEXT" track option.
I post this here so everyone can understand what I'm doing.
Already made the PLAY/PAUSE heart button starts an animation of BEAT while you rest the cursor on it!
I want to make a diffent animation for the face, hidden when music playing but when the PAUSE or STOP states is on the cloud dissapears and the sad face of the dude change to a happy one!
I'll stay in touch!
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 8466
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Play / Pause action trigger in a skin
The animation behavior should not be dependent on the Windows version, but whether the AIMP data retrieval and commands work might be, given that it's about the how AIMP and the NowPlaying plugin behave on such versions. I'm not entirely sure Rainmeter itself still fully supports Win 7 to be honest.Bayushi Tai wrote: ↑August 2nd, 2024, 8:46 pm Now I made a small progress, appearently the behavior changes in different Windows versions, I'm talking about the same skin folder using the same player (AIMP). I could make the cloud and cover dissapears when is in PAUSE or STOP behavior, but not in the way I like, animation of the cloud and then the cloud still with the cover in it. (In W10 dissapears, in W7 not)
-
- Rainmeter Sage
- Posts: 16658
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Play / Pause action trigger in a skin
Not sure I entirely can follow. Post please:
- An exact description of what you want. What that animation is meant for? When you want to play it and when you want to hide it?
- The skin you have so far. Most probably the code is not enough, because for specific help, we need the images you want to use for the animation, so the best would be to pack the config you have and upload the package.
-
- Posts: 24
- Joined: July 17th, 2012, 4:50 am
Re: Play / Pause action trigger in a skin
I want the cloud panel; the rain and the animation face to be visible with the album cover only when the payer is in PLAYING state.
In pause or stop states the cloud should close using the ignition meter. (I made a simple animation, it's in the Lines folder) and the rain animation needs to disappear with the face animation as well.
You may notice I made the face animation disappear when the player is in STOP or PAUSE state, this is because I need to do another simple animation with a HAPPY FACE and put the in a folder named "happy". I don't need help creating the images, just the code, I'll figure it out later with the other easy face animation.
When the player changes the track (or the user press NEXT or PREVIOUS buttons, the dude hands) a lightning animation needs to appear inside the cloud, in the cover area. The folder for this images is under the name "thunder", this isn't working.
I used to make skin for the old CD Art Display, then I switched to some Rainmeter skins but never like this, I'm really rusty in my code skills, for that I need to apologize.
Here is the skin package.
In pause or stop states the cloud should close using the ignition meter. (I made a simple animation, it's in the Lines folder) and the rain animation needs to disappear with the face animation as well.
You may notice I made the face animation disappear when the player is in STOP or PAUSE state, this is because I need to do another simple animation with a HAPPY FACE and put the in a folder named "happy". I don't need help creating the images, just the code, I'll figure it out later with the other easy face animation.
When the player changes the track (or the user press NEXT or PREVIOUS buttons, the dude hands) a lightning animation needs to appear inside the cloud, in the cover area. The folder for this images is under the name "thunder", this isn't working.
I used to make skin for the old CD Art Display, then I switched to some Rainmeter skins but never like this, I'm really rusty in my code skills, for that I need to apologize.
Here is the skin package.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1391
- Joined: September 7th, 2020, 2:24 pm
- Location: QLD, Australia
Re: Play / Pause action trigger in a skin
I haven't tried and actually just thought of it.
Can a ToggleMeasure bang be used on the play measure?
It would then be:
Can a ToggleMeasure bang be used on the play measure?
It would then be:
Code: Select all
Your code..
Leftmouseupaction=[!Togglemeasure Play][!Update]
Dynamicvariables=1
The rest of relevant code for the click point or button etc.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
-
- Rainmeter Sage
- Posts: 16658
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Play / Pause action trigger in a skin
Bayushi Tai wrote: ↑August 3rd, 2024, 11:33 pm I want the cloud panel; the rain and the animation face to be visible with the album cover only when the payer is in PLAYING state.
In pause or stop states the cloud should close using the ignition meter. (I made a simple animation, it's in the Lines folder) and the rain animation needs to disappear with the face animation as well.
These have been done in the attached code. Please try this code out and let me know how do you find it:Bayushi Tai wrote: ↑August 3rd, 2024, 11:33 pm When the player changes the track (or the user press NEXT or PREVIOUS buttons, the dude hands) a lightning animation needs to appear inside the cloud, in the cover area. The folder for this images is under the name "thunder", this isn't working.
Code: Select all
[Rainmeter]
Update=20
[Metadata]
Name=Bad Day
Author=Teijeiro Art Studio
Version=2.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
[Variables]
@Include=#ROOTCONFIGPATH#\Settings.inc
Step=1
;======================================
; TOOLBAR
;======================================
[mPlayer]
Measure=NowPlaying
PlayerName=#Player#
PlayerType=TITLE
OnChangeAction=[!EnableMeasure "Ignition10"][!ShowMeter "Anim1"][!Redraw]
;TrackChangeAction=[!EnableMeasure Ignition10][!Redraw]
DisableLeadingZero=0
Substitute="":"Unknown""
[mStateButton]
Measure=NowPlaying
PlayerName=#Player#
PlayerType=STATE
Substitute="0":"Play.png","1":"pause.png","2":"Play.png"
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!SetVariable Step "1"][!UpdateMeasure "Ignition"]
IfFalseAction=[!SetVariable Step "-1"][!UpdateMeasure "Ignition"]
[mCover]
Measure=NowPlaying
PlayerName=[mPlayer]
PlayerType=COVER
RegExpSubstitute=1
Substitute="^$":"#ROOTCONFIGPATH#\Images\nocover.png"
[Previous]
Meter=button
ButtonImage=#ROOTCONFIGPATH#\Images\prev.png
X=17
Y=583
LeftMouseUpAction=[!PluginBang "mPlayer Previous"]
Antialias=1
[Next]
Meter=button
ButtonImage=#ROOTCONFIGPATH#\Images\next.png
X=345
Y=583
LeftMouseUpAction=[!PluginBang "mPlayer Next"]
Antialias=1
[ImageMeter]
Meter=Image
ImageName=#ROOTCONFIGPATH#\dude.png
X=56
Y=0
[Play]
Meter=button
ButtonImage=#ROOTCONFIGPATH#\Images\[mStateButton]
X=302
Y=674
LeftMouseUpAction=[!PluginBang "mPlayer PlayPause"]
MouseOverAction=[!ShowMetergroup Heart]
MouseLeaveAction=[!HideMetergroup Heart]
DynamicVariables=1
Antialias=1
;============================================================
;Animations
;============================================================
[ImageMeter6]
Meter=Image
ImageName=rain\[ImageNumberCalc6].png
DynamicVariables=6
UpdateDivider=5
ImageAlpha=250
X=64
Y=150
[ImageNumberCalc6]
Measure=Calc
Formula=Counter %3
[ImageMeter7]
Meter=Image
ImageName=aniheart\[ImageNumberCalc7].png
DynamicVariables=2
UpdateDivider=9
ImageAlpha=250
LeftMouseUpAction=[!PluginBang "mPlayer PlayPause"]
;[!EnableMeasure Ignition2]
;IfEqualAction=[!DisableMeasure Ignition]
X=297
Y=670
Hidden=1
Group=Heart
[ImageNumberCalc7]
Measure=Calc
Formula=Counter %2
[ImageMeter8]
Meter=Image
ImageName=Sketch\[ImageNumberCalc8].png
DynamicVariables=1
UpdateDivider=9
ImageAlpha=90
X=144
Y=435
[ImageNumberCalc8]
Measure=Calc
Formula=Counter %6
[ImageMeter9]
Meter=Image
ImageName=face\[ImageNumberCalc9].png
DynamicVariables=1
UpdateDivider=3
ImageAlpha=250
X=147
Y=433
[ImageNumberCalc9]
Measure=Calc
Formula=Counter %45
; ----------------------------------
; METERS NowPlaying
; ----------------------------------
;[mPlayer]
; Measure=Plugin
; Plugin=NowPlaying.dll
; PlayerName=#Player#
; PlayerType=TITLE
; PlayerPath=
;TrackChangeAction=[!EnableMeasure Ignition10][!Redraw]
; DisableLeadingZero=0
; Substitute="":"Unknown""
[AlbumArt]
Meter=Image
MeasureName=mCover
X=198
Y=72
W=199
H=199
ImageName="%1"
Hidden=1
;Group=Cloud
;============================
;CLOUD PANEL
;============================
;[MeasurePlayer]
;Measure=Plugin
;Plugin=NowPlaying
;PlayerName=#Player#
;PlayerType=Title
;[MeasureState]
;Measure=NowPlaying
;PlayerName=[MeasurePlayer]
;PlayerType=State
;DynamicVariables=1
;IfCondition=(#CURRENTSECTION#=1)
;IfTrueAction=[!RainmeterShowMetergroup Cloud][!ShowMeter ImageMeter6][!ShowMeter ImageMeter9]
;IfFalseAction=[!RainmeterHideMetergroup Cloud][!HideMeter ImageMeter6][!HideMeter ImageMeter9]
;[MeasureStatus]
;Measure=NowPlaying
;PlayerName=[MeasurePlayer]
;PlayerType=Status
;DynamicVariables=1
[Ignition]
Measure=CALC
Formula=( Clamp (( Ignition + #Step# ), 0, 11 ))
;Disabled=1
DynamicVariables=1
;IfEqualValue=12
IfCondition=(#CURRENTSECTION#=11)
IfTrueAction=[!ShowMeter "AlbumArt"]
IfFalseAction=[!HideMeter "AlbumArt"]
;[Ignition2]
;Measure=CALC
;Formula=Ignition2+1
;Disabled=1
;IfEqualValue=12
[meterBackground11]
Meter=IMAGE
MeasureName=Ignition
Path=#ROOTCONFIGPATH#\Lines\anim12\
X=75
Y=0
AntiAlias=1
;Hidden=1
;Group=Cloud
;[meterBackground12]
;Meter=IMAGE
;MeasureName=Ignition2
;Path=#ROOTCONFIGPATH#\Lines\anim11\
;X=75
;Y=0
;AntiAlias=1
;Hidden=1
;Group=Cloud
[anicover]
Meter=IMAGE
X=244
Y=399
TrackChangeAction=[!EnableMeasure Ignition10]
Hidden=1
[Anim1]
Meter=IMAGE
MeasureName=Ignition10
Path=#ROOTCONFIGPATH#\thunder
X=243
Y=401
W=199
H=199
Hidden=1
[Ignition10]
Measure=CALC
Formula=(Ignition10+1)
Disabled=1
IfEqualValue=3
IfEqualAction=[!DisableMeasure Ignition10][!HideMeter "Anim1"][!Redraw]
- In my opinion there is no need for two different animation, one when the cloud is opening (start playing) and another when it closes (pause or stop the playback). Accordingly the [Ignition2] measure and the corresponding [meterBackground12] meter have been removed (in fact I just commented them out, but they can and have to be removed). The remaining [meterBackground11] has to be always visible. No need to hide it, because when the player is stopped or paused, the first frame is shown, but this frame is invisible (transparent). So why hide it?
- Since we're executing the same measure ([Ignition]) in both cases, when the cloud has to open and when it closes, we have to be able to do both: increase and decrease the value of the measure. To can do this, we need a new variable (I named it Step), which has to be set to 1 when the cloud expands and to -1 when it closes. The new variable has been added to the [Variables] section, but obviously if you want, you can move it to the included Settings.inc file.
- You had more NowPlaying measures, in more places over the code. I removed them, keeping / moving them to only one place. There were more parent measures, this is definitely something undesirable. Just saying additionally: even if a while ago NowPlaying was a plugin, it has been converted into an internal measure and should be used accordingly. I update the code in this sense as well.
- Both the !Execute bang and the !Rainmeter... bang prefix have been deprecated long time ago and should never be used. I removed them. The !PluginBang has also been replaced by !CommandMeasure, but for now I kept the !PluginBang bangs. But they definitely have to be replaced (will be a next step).
- I updated a lot of other minor things, which I don't describe in detail. Comparing the old and the new code can reveal these updates.
- Another thing I didn't do, but definitely has to be done, is moving all resources into the @Resources folder. From now using this folder to store the needed resources (such as images, included files and so on) slowly - slowly became mandatory. Recommend to create and use it.
I didn't do this so far, this will be next step in refining the code. Sorry...Bayushi Tai wrote: ↑August 3rd, 2024, 11:33 pm You may notice I made the face animation disappear when the player is in STOP or PAUSE state, this is because I need to do another simple animation with a HAPPY FACE and put the in a folder named "happy". I don't need help creating the images, just the code, I'll figure it out later with the other easy face animation.
So, how the code is working? Does it what you want?
-
- Posts: 24
- Joined: July 17th, 2012, 4:50 am
Re: Play / Pause action trigger in a skin
I'm testing it and it works perfect!
Yes, I'm reading and comparing both codes, the crappy one of mine with the prolific and accurate that you made.
I see that about the NowPlaying that you mentioned, the same thing you told me a few days ago, I need to update the way I code.
About the size of my skin, (I forgot to mention this) this one will be displayed in a 4K TV I use as 3rd monitor, that's why you may notice that my skin is kinda huge for a regular screen, I'll make a smaller version so people can download it and choose which one fits better to their screen/s.
I suppose that people still download them from deviantART, that's right?
(I remember when dA had categories)
Thank you so much for taking your time!
Yes, I'm reading and comparing both codes, the crappy one of mine with the prolific and accurate that you made.
I see that about the NowPlaying that you mentioned, the same thing you told me a few days ago, I need to update the way I code.
About the size of my skin, (I forgot to mention this) this one will be displayed in a 4K TV I use as 3rd monitor, that's why you may notice that my skin is kinda huge for a regular screen, I'll make a smaller version so people can download it and choose which one fits better to their screen/s.
I suppose that people still download them from deviantART, that's right?
(I remember when dA had categories)
Thank you so much for taking your time!