In meantime I also rewrote a few things. Attaching the code of the rewritten Noël Player.ini:
Code: Select all
[Rainmeter]
Update=1000
MouseScrollDownAction=[!CommandMeasure "mWin7Audio" "ChangeVolume -5"][!Update]
MouseScrollUpAction=[!CommandMeasure "mWin7Audio" "ChangeVolume 5"][!Update]
MiddleMouseUpAction=!Refresh
OnRefreshAction=[!Move "765" "0"][!ZPos -2]
OnCloseAction=[!CommandMeasure mPlayer ClosePlayer]
AccurateText=1
;-------------------------------------------------------------
[Metadata]
Author=Mordasius
Name=MusicPlayer
Version=301013
Information=Music Player | Para Carlota y Miranda
License=Creative Commons Attribution-Non-commercial-Share Alike 3.0
;-------------------------------------------------------------
[Variables]
PlayPlaylist="#@#Musica\Playlist\Noël.wpl"
ButtonX=141
ButtonY=250
AlphaBright=255
AlphaDull=200
[sText]
FontFace=Garamond
FontSize=11
X=200
Y=400
Clipstring=1
StringEffect=SHADOW
StringStyle=BOLD
StringAlign=CENTER
FontColor=CAB178
FontEffectColor=000000
AntiAlias=1
[sController]
X=26r
Y=#ButtonY#
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageAlpha #AlphaDull#][!UpdateMeter #CURRENTSECTION#][!Redraw]
ImageAlpha=#AlphaDull#
Group=Player
;-------------------------------------------------------------
;[MEDICIONES]
;-------------------------------------------------------------
[MeasureWMP]
Measure=Plugin
Plugin=Process
ProcessName=wmplayer.exe
IfCondition=(#CURRENTSECTION#<=0)
IfTrueAction=[!SetVariable PlayAction """[!CommandMeasure "mPlayer" "OpenPlayer"][!Delay "2000"]["#PlayPlaylist#"]"""][!UpdateMeter "PauseOrPlay"]
IfFalseAction=[!SetVariable PlayAction ""][!UpdateMeter "PauseOrPlay"]
[mWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin.dll
Substitute= "-1":"0"
IfAboveValue=0
IfAboveAction=[!HideMeter MtSoundOff][!ShowMeter MtSoundOn]
[mPlayer]
Measure=NowPlaying
PlayerName=WMP
PlayerType=TITLE
PlayerPath=c:\Program Files\Windows Media Player\wmplayer.exe
DisableLeadingZero=0
;[MeaMedia]
;Measure=NowPlaying
;PlayerName=[mPlayer]
;PlayerType=Status
;IfCondition=(#CURRENTSECTION#<=0)
;IfTrueAction=[!SetVariable PlayAction """[!CommandMeasure "mPlayer" "OpenPlayer"][!Delay "2000"]["#PlayPlaylist#"]"""][!UpdateMeter "PauseOrPlay"]
;IfFalseAction=[!SetVariable PlayAction ""][!UpdateMeter "PauseOrPlay"]
;Disabled=1
[mPlayerState]
Measure=NowPlaying
PlayerName=[mPlayer]
PlayerType=STATE
IfEqualValue=0
IfEqualAction=[!HideMeterGroup SoundOff][!HideMeterGroup Xmas2][!ShowMeterGroup Xmas1]
IfAboveValue=0
IfAboveAction=[!EnableMeasureGroup mPlayer][!ShowMeterGroup Player][!HideMeterGroup Xmas1][!ShowMeterGroup Xmas2]
[mStateButton]
Group=mPlayer
Measure=NowPlaying
PlayerName=[mPlayer]
PlayerType=STATE
Substitute="0":"play.png","1":"pausa.png","2":"play.png"
[mPosition]
Group=mPlayer
Measure=NowPlaying
PlayerName=[mPlayer]
PlayerType=POSITION
[mDuration]
Group=mPlayer
Measure=NowPlaying
PlayerName=[mPlayer]
PlayerType=DURATION
[mSmoothProgress]
Group=mPlayer
Measure=SCRIPT
ScriptFile=#@#Scripts\SmoothProgress.lua
UpdatePeriod=1000
ResetInterval=10
SafetyRange=2
Adjustment=1
Disabled=1
;-------------------------------------------------------------
;[MOSTRAR MEDICIONES]
;-------------------------------------------------------------
[MtBackground1]
Meter=IMAGE
ImageName=#@#Imagenes\back.png
X=0
Y=0
W=400
H=400
[MtProgressBar]
Group=Player
Meter=BAR
MeasureName=mSmoothProgress
BarImage=#@#Imagenes\pb2.png
BarOrientation=HORIZONTAL
X=105
Y=223
[sPositionChange]
X=20r
Y=223
H=20
W=20
tooltiptext="Saltar a...."
Group=Player
[MtDurationString]
Group=Player
Meter=STRING
MeasureName=mDuration
MeterStyle=sText
StringAlign=RIGHT
FontFace=Arial
FontSize=7
X=280
Y=210
[MtTrack]
Group=Player
Meter=STRING
MeasureName=mPlayer
MeterStyle=sText
W=200
Y=226
;-------------------------------------------------------------
;[BOTONES]
;-------------------------------------------------------------
[Open]
Meter=IMAGE
ImageName=#@#Imagenes\abrir.png
MeterStyle=sController
X=#ButtonX#
ToolTipText="Abrir el Reproductor"
LeftMouseUpAction=[!CommandMeasure "mPlayer" "OpenPlayer"]
MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#][!UpdateMeter #CURRENTSECTION#][!Redraw]
[Previous]
Meter=IMAGE
ImageName=#@#Imagenes\atras.png
MeterStyle=sController
ToolTipText="Anterior"
MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUpAction=[!CommandMeasure "mPlayer" "Previous"]
[PauseOrPlay]
Meter=IMAGE
ImageName=#@#Imagenes\[mStateButton]
MeterStyle=sController
MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUpAction=#PlayAction#[!CommandMeasure "mPlayer" "PlayPause"]
DynamicVariables=1
[Next]
Meter=IMAGE
ImageName=#@#Imagenes\adelante.png
MeterStyle=sController
ToolTipText="Siguiente"
MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUpAction=[!CommandMeasure "mPlayer" "Next"]
[ClosePlayer]
Meter=IMAGE
ImageName=#@#Imagenes\detener.png
MeterStyle=sController
ToolTipText="Cerrar el Reproductor"
MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUpAction=[!CommandMeasure "mPlayer" "ClosePlayer"]
RightMouseUpAction=[!CommandMeasure "mPlayer" "ClosePlayer"][!Execute "taskkill wmplayer.exe"]
[MtSoundOn]
Group=Player
Meter=Image
ImageName=#@#Imagenes\volumen1.png
MeterStyle=sController
X=192
Y=270
DynamicVariables=1
UpdateDivider=-1
MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUpAction=[!CommandMeasure "mWin7Audio" "ToggleMute"][!HideMeter MtSoundOn][!ShowMeter MtSoundOff][!ReDraw]
Hidden=0
[MtSoundOff]
Group=SoundOff
Meter=Image
ImageName=#@#Imagenes\volumen2.png
MeterStyle=sController
X=0r
Y=0r
DynamicVariables=1
UpdateDivider=-1
MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageAlpha #AlphaBright#][!UpdateMeter #CURRENTSECTION#][!Redraw]
LeftMouseUPAction=[!CommandMeasure "mWin7Audio" "ToggleMute"][!HideMeter MtSoundOff][!ShowMeter MtSoundOn][!ReDraw]
Hidden=1
;-------------------------------------------------------------
;[TIEMPO Y FORMA NAVIDAD]
;-------------------------------------------------------------
[MeasureNow]
Measure=Time
[MtCorona]
Meter=Rotator
MeasureName=MeasureNow
ValueRemainder=1200
W=350
H=350
X=25
Y=25
ImageName=#@#Imagenes\corona.png
RotationAngle=(2*PI)
OffsetX=175
OffsetY=175
[MeterXmas1]
Group=Xmas1
Meter=Image
W=125
H=125
X=138
Y=125
ImageName=#@#Imagenes\xmas1.png
LeftMouseUpAction=[!ActivateConfig "#CURRENTCONFIG#" "Noël.ini"][!Redraw]
[MeterXmas2]
Group=Xmas2
MeasureName=MeasureNow
Meter=Rotator
W=100
H=100
X=150
Y=125
RotationAngle=(-2*PI)
ValueRemainder=300
OffsetX=50
OffsetY=50
ImageName=#@#Imagenes\xmas2.png
LeftMouseUpAction=[!ActivateConfig "#CURRENTCONFIG#" "Noël.ini"][!Redraw]
;-------------------------------------------------------------
;[CAMBIAR EL TRACK]
;-------------------------------------------------------------
[MtStartAgain]
Group=Player
Meter=Image
X=105
Y=223
H=20
W=20
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 0"][!Update]
[MtSetPosition10]
Group=Player
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 10"][!Update]
[MtSetPosition20]
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 20"][!Update]
[MtSetPosition30]
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 30"][!Update]
[MtSetPosition40]
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 40"][!Update]
[MtSetPosition50]
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 50"][!Update]
[MtSetPosition60]
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 60"][!Update]
[MtSetPosition70]
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 70"][!Update]
[MtSetPosition80]
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 80"][!Update]
[MtSetPosition90]
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 90"][!Update]
[MtSetPosition100]
Meter=Image
MeterStyle=sPositionChange
LeftMouseUpAction=[!CommandMeasure "mPlayer" "SetPosition 100"][!Update]
- I added a Process measure (called [MeasureWMP]), which checks if the Windows Media Player process is running. So, this time the state of the player is not checked anymore by a NowPlaying measure, but by a Process measure. The value of the PlayAction variable is set accordingly.
- Accordingly, I removed (well, in fact I commented out) the [MeaMedia] measure. It's not needed anymore, so there is no reason to keep it. If you will use the above code, I recommend to completely remove it.
- I added once again (because in your last code it was not there) the #PlayAction# variable to the LeftMouseUpAction option of the [PauseOrPlay] meter.
- I added the proper path to the PlayerPath option of the [mPlayer] measure. Please take care to check this path and if on your side it's different, replace it with the correct path. Please make sure (at least twice!) you don't use an incorrect path.
- I replaced the Measure=PLUGIN and Plugin=NowPlaying.dll option pairs on each measure which used these, with the single Measure=NowPlaying option. NowPlaying indeed has been a plugin a while ago, but in meantime it has been converted to an internal measure and should be used accordingly.