It is currently May 21st, 2024, 11:09 pm

Open first File in Folder?

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16252
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Open first File in Folder?

Post by balala »

CarlotaN wrote: December 7th, 2022, 12:21 pm I think, and I just think that I have found a somewhat better solution than the previous one, not so "pig"... let's see what you think?
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]
Take care about the followings:
  • 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.
These are the most important modifications. But there is one more, which doesn't impact on how the skin is working, however I recommend to taking this as well into account:
  • 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.
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: Open first File in Folder?

Post by CarlotaN »

Wow, it works great! You've got it!!! I no longer knew what to do when all the buttons were disabled.

Many, many, many thanks because one more day and my head would have exploded!
bunnypatea.gif
I am attaching the new file in case someone wants to implement it. It's a bit big because it includes the music

https://drive.google.com/file/d/1-12GRd_08_jdp7GdDvk9VQkFvUlxgAnL/view?usp=share_link
You do not have the required permissions to view the files attached to this post.
Image
User avatar
balala
Rainmeter Sage
Posts: 16252
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Open first File in Folder?

Post by balala »

CarlotaN wrote: December 8th, 2022, 4:59 am Wow, it works great! You've got it!!! I no longer knew what to do when all the buttons were disabled.

Many, many, many thanks because one more day and my head would have exploded!
Don't worry, wouldn't have been. And am glad if helped.
CarlotaN wrote: December 8th, 2022, 4:59 am I am attaching the new file in case someone wants to implement it. It's a bit big because it includes the music
Downloaded and tried it. It is alright, works with no errors. Congratulations.
There is only one single small detail I suggest you. This has been so even in previous versions, including the one posted by me previously, just missed it.
So, since the !Execute bang has been long time ago deprecated, I recommend removing it. It is used in the LeftMouseUpAction option of the [ClosePlayer] meter (specifically into the [!Execute "taskkill wmplayer.exe"] bang of the mentioned option). This is enough to be used as ["taskkill wmplayer.exe"]. Recommend replacing the bang.
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: Open first File in Folder?

Post by CarlotaN »

Thanks again! I'm going to change it right now. I used the 2 options in case the soft formula failed, use brute force :D
Image
User avatar
balala
Rainmeter Sage
Posts: 16252
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Open first File in Folder?

Post by balala »

CarlotaN wrote: December 9th, 2022, 4:22 am I'm going to change it right now. I used the 2 options in case the soft formula failed, use brute force :D
Not sure what do you mean by "soft formula" and "use brute force", but hope you can change it. Please come back if further questions arise.
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: Open first File in Folder?

Post by CarlotaN »

hahahaha soft formula: [!Command Measure "mPlayer" "Close Player"]

Brute force formula: ["taskkill wmplayer.exe"]

But it is that my wmp is very stubborn and when you think it has closed, it is there, spying on the background :oops:

We still have to wait for the player to open the Christmas songs, if possible to minimize it. So girls just have to press play, without further complications.

But only when you have time and are bored. I don't want it to be an obligation or a headache.
Again thank you very much for your interest.
Image
User avatar
balala
Rainmeter Sage
Posts: 16252
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Open first File in Folder?

Post by balala »

CarlotaN wrote: December 11th, 2022, 2:08 am hahahaha soft formula: [!Command Measure "mPlayer" "Close Player"]

Brute force formula: ["taskkill wmplayer.exe"]
The disadvantage of "brute force" is that to get the player closed, you have to close it only from the skin (clicking the appropriate button on the skin). If you close it simply as you close any other program, you get whet you've described:
CarlotaN wrote: December 11th, 2022, 2:08 am But it is that my wmp is very stubborn and when you think it has closed, it is there, spying on the background :oops:
As far as I can tell, this is an issue (bug? - whatever) of Windows Media Player. I think there have been some discussions in the past related to this question, but unfortunately I can't find them right now. However am absolutely positive there is not too much to do. Sorry...
CarlotaN wrote: December 11th, 2022, 2:08 am We still have to wait for the player to open the Christmas songs, if possible to minimize it. So girls just have to press play, without further complications.

But only when you have time and are bored. I don't want it to be an obligation or a headache.
I ONLY work when have enough time. But right now I'm not sure at all what is your question. What is?
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: Open first File in Folder?

Post by CarlotaN »

SOLO trabajo cuando tengo suficiente tiempo. Pero en este momento no estoy seguro en absoluto de cuál es tu pregunta. ¿Qué es?
The intention is that when clicking on play, the WMP will open minimized.
I tried Mark's method and it didn't work for me, I tried another one that you suggested yourself and it worked halfway, but with so many changes now none work

https://forum.rainmeter.net/viewtopic.php?t=23577
Image
User avatar
balala
Rainmeter Sage
Posts: 16252
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Open first File in Folder?

Post by balala »

CarlotaN wrote: December 12th, 2022, 1:59 am The intention is that when clicking on play, the WMP will open minimized.
I tried Mark's method and it didn't work for me, I tried another one that you suggested yourself and it worked halfway, but with so many changes now none work
Not sure what Mark's method are you talking about (or did you mean mak_kawa's method?), but the approach I posted in the linked topic works for me. I assume it should for you as well, but maybe you had a mistake in implementing it. So try this way:
  • Add the [MeasureRun] measure, as I posted in my reply.
  • Replace the [!CommandMeasure "mPlayer" "OpenPlayer"] bang set up in the first !SetVariable bang of the IfTrueAction option of the [MeasureWMP] measure with [!CommandMeasure "MeasureRun" "Run"]. This way the mentioned IfTrueAction option becomes:

    Code: Select all

    [MeasureWMP]
    ...
    IfTrueAction=[!SetVariable PlayAction """[!CommandMeasure "MeasureRun" "Run"][!Delay "200"]["#PlayPlaylist#"]"""][!UpdateMeter "PauseOrPlay"]
    ...
Try please if this works for you. It should...
User avatar
CarlotaN
Posts: 50
Joined: December 5th, 2022, 3:45 am
Location: Madrid, Spain

Re: Open first File in Folder?

Post by CarlotaN »

Yes! It worked!!!
With so much change like this measure, it seemed to me that it was useless, I had erased it. I went back to the Mark_Kawa theme and there was the missing piece!!!
:oops:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=cmd /c "start /B /MIN wmplayer.exe"
State=Hide
----------------------------------

Code: Select all

[MeasureWMP]
Measure=Plugin
Plugin=Process
ProcessName=wmplayer.exe
IfCondition=(#CURRENTSECTION#<=0)
IfTrueAction=[!SetVariable PlayAction """[!CommandMeasure "MeasureRun" "Run"][!Delay "200"]["#PlayPlaylist#"]"""][!UpdateMeter "PauseOrPlay"]
IfFalseAction=[!SetVariable PlayAction ""][!UpdateMeter "PauseOrPlay"]
Thank you, thank you and thousands of thanks!
Image