It is currently September 14th, 2024, 9:51 pm

Help

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 8127
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help

Post by Yincognito »

eclectic-tech wrote: June 2nd, 2024, 2:59 pm From his comment, I thought it may help... but I agree that your attempt to teach is the better method :thumbup:

A working example with corrections to his attempt, seem like it may help him, or others who may read this thread.

We'll see if any of this helps :???: .
Sure thing, no worries - it's always great to have choices. I was in a hurry when I posted my brief reply earlier, and I assumed that it was enough for the OP to figure out the implications (in some cases it happens, even if just starting with Rainmeter). Apparently not in this case, so it's probably best to have a code sample as well. :thumbup:

A small note though: the way text slides in your preview doesn't seem to match what he said he eventually wanted, i.e. being more similar to how my code earlier was sliding, and which wasn't what was desired. :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5511
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help

Post by eclectic-tech »

Yincognito wrote: June 2nd, 2024, 6:02 pm {clip!}
A small note though: the way text slides in your preview doesn't seem to match what he said he eventually wanted, i.e. being more similar to how my code earlier was sliding, and which wasn't what was desired. :???:
Well that's what happens when I don't read the original post and arriving late to the party! :)
Maybe I'll go back and do that, but it may all be too late for Japmc7...
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

Hello guys, thank you all for answering :welcome: I've been working hard on the code Yincognito gave me, that's why I've been away, last night I went to bed at 5am trying to understand the Yincognito's explanation, but here I am with the update of the results...

I did as I understood thanks to the more specific explanation of Yincognito, I still don’t understand how it works but at least I’m getting what I wanted, thanks to all of you, but, now an inconvenience arose, the new code does what I want but sometimes gets out of control, sometimes, only sometimes when I change the song, it goes on long and doesn’t appear anymore unless I refresh the skin, I show the problem below in the gif...
Problem.gif
Here's the code I managed to make after many hour:

Code: Select all

[Variables]
Delay=2000
Step=2

[Rainmeter]
Update=35

---Measures Scrolling Rules---

[Title]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=WMP
PlayerType=Title
RegExpSubstitute=1
Substitute="^$":"None"

[Artist]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=WMP
PlayerType=Artist
RegExpSubstitute=1
Substitute="^$":"None"

[Album]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=WMP
PlayerType=Album
RegExpSubstitute=1
Substitute="^$":"None"

[Info]
Measure=String
String=[Title] - [Artist] - [Album]
RegExpSubstitute=1
Substitute="^None - None - None$":"Nothing Playing"
OnChangeAction=[!DisableMeasure Position][!Delay #Delay#][!UpdateMeasure Position][!UpdateMeter Text][!Redraw][!EnableMeasure Position]
DynamicVariables=1

[Position]
Measure=Calc
Formula=([Text:W]-[Container:W]>0?Position+#Step#:Position)
IfCondition=(Position<0)||(Position>[Text:W]-[Container:W])
IfTrueAction=[!PauseMeasure Position][!DisableMeasure Position][!Delay #Delay#][!UnpauseMeasure Position][!UpdateMeasure Position][!Delay #Delay#][!EnableMeasure Position]
DynamicVariables=1

---Meters Fonts and Container Colors&Size Rules---

[Shape]
Meter=Shape
Shape=Rectangle 1,1,327,23 | Fill Color 0,0,0,128 | StrokeWidth 2 | Stroke Color 128,128,128,255

[Container]
Meter=Image
X=2
Y=1
W=322
H=23
SolidColor=0,0,0,255

[Text]
Container=Container
Meter=String
X=(-[Position])
Y=1
FontFace=Arial Rounded MT Bold
FontSize=13
FontColor=255,255,255,255
AntiAlias=1
MeasureName=Info
Text=%1
DynamicVariables=1
I don’t know if I’m doing something wrong, or if it’s a Rainmeter core problem, I don't know, maybe I'm missing something.
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 8127
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help

Post by Yincognito »

Japmc7 wrote: June 2nd, 2024, 9:13 pm Hello guys, thank you all for answering :welcome: I've been working hard on the code Yincognito gave me, that's why I've been away, last night I went to bed at 5am trying to understand the Yincognito's explanation, but here I am with the update of the results...

I did as I understood thanks to the more specific explanation of Yincognito, I still don’t understand how it works but at least I’m getting what I wanted, thanks to all of you, but, now an inconvenience arose, the new code does what I want but sometimes gets out of control, sometimes, only sometimes when I change the song, it goes on long and doesn’t appear anymore unless I refresh the skin, I show the problem below in the gif...
[...]
I don’t know if I’m doing something wrong, or if it’s a Rainmeter core problem, I don't know, maybe I'm missing something.
Yeah, sorry for the previous inconvenience, I was busy with some domestic stuff between posting the brief message earlier and posting the more specific explanation later on, never thought you'd spend that much time figuring out what seemed pretty logical to me. Anyway, I'm glad that you finally got the idea. :thumbup:

Now, on the current inconvenience, I get it too thanks to your details on how to reproduce it. Not sure what it could be and I don't think I'll bother with finding out, since the code is otherwise correct. Instead, I think a better way to approach this here would be to use a Loop measure and not bother with all that disabling and enabling to reset the value based on which the text position is set, or with the redundancy of #Delay# in both the OnChangeAction and IfTrueAction options. So, try this code (I renamed the Position measure to Offset in order to be more self explanatory, and I also added an optional meter to display some details about how various values relate to each other):

Code: Select all

[Variables]
Player=Winamp
Update=35
Delay=2000
Step=2

[Rainmeter]
Update=#Update#
AccurateText=1
DynamicWindowSize=1

---Measures---

[Title]
Measure=NowPlaying
PlayerName=#Player#
PlayerType=Title
RegExpSubstitute=1
Substitute="^$":"None"

[Artist]
Measure=NowPlaying
PlayerName=[Title]
PlayerType=Artist
RegExpSubstitute=1
Substitute="^$":"None"

[Album]
Measure=NowPlaying
PlayerName=[Title]
PlayerType=Album
RegExpSubstitute=1
Substitute="^$":"None"

[Info]
Measure=String
String=[Title] - [Artist] - [Album]
RegExpSubstitute=1
Substitute="^None - None - None$":"Nothing Playing"
OnChangeAction=[!UpdateMeter *][!Redraw]
DynamicVariables=1

[Offset]
Measure=Loop
StartValue=0
EndValue=([Text:W]-[Container:W]>0?[Text:W]-[Container:W]:0)
Increment=#Step#
IfCondition=([Text:W]-[Container:W]>0)&&([Offset]=0)
IfTrueAction=[!PauseMeasure Offset][!Delay #Delay#][!UnpauseMeasure Offset]
IfCondition2=([Text:W]-[Container:W]>0)&&([Offset]=[Text:W]-[Container:W])
IfTrueAction2=[!PauseMeasure Offset][!Delay #Delay#][!UnpauseMeasure Offset]
DynamicVariables=1

---Meters---

[Shape]
Meter=Shape
Shape=Rectangle 1,1,327,23 | Fill Color 0,0,0,128 | StrokeWidth 2 | Stroke Color 128,128,128,255

[Container]
Meter=Image
X=4
Y=1
W=321
H=23
SolidColor=0,0,0,255

[Text]
Container=Container
Meter=String
X=(-[Offset])
Y=1
FontFace=Arial Rounded MT Bold
FontSize=13
FontColor=255,255,255,255
AntiAlias=1
MeasureName=Info
Text=%1
DynamicVariables=1

[Details]
Meter=String
X=0
Y=13R
FontFace=Arial Rounded MT Bold
FontSize=13
FontColor=255,255,255,255
AntiAlias=1
Text=Text Width: [Text:W], Container Width: [Container:W]#CRLF#Offset    :  [Offset] (Min: 0, Max: [Text:W] - [Container:W])#CRLF#Position: -[Offset] (Min: [Container:W] - [Text:W], Max: 0)
DynamicVariables=1
In my tests, this didn't exhibit the problems you mentioned anymore, but make sure to extensively test it yourself anyway.
I still don’t understand how it works
So why don't you...
- take a look in the manual to get familiar with the desired things or syntax from the code
- or, alternatively / additionally:
Yincognito wrote: May 30th, 2024, 8:02 pmask if you don't understand something
...and clarify whatever questions you might have? If the details meter I added in the code above doesn't suffice, that is. ;-)
Note: If anyone wonders, I had to break what it could have been a single IfCondition above into two almost identical IfCondition and IfCondition2, because of the default way they work (the 2nd sentence there) and the fact that what's in IfCondition is met immediately after what's in IfCondition2 is met (so, if both branches would belong to a single IfCondition, there would be no available moment when the said test becomes "false" in order to trigger again the actions that happen when "true"). Didn't want to use IfConditionMode as an aleternative either, since the default behavior had its benefits in this case.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

Hi Yincognito I hope you're ok, the last code you shared worked just perfect, I'm very grateful to you for making this beauty possible, really, thank you for the patience, I'd like to close this skin but I was also thinking of changing the form I control the volume, as you told me there's a better way of doing this, but... studying the code you shared about that topic, I realized that it's more focused on the overall volume of the operating system, and not the volume of the WMP itself, so I was wondering if there's any way to apply the method to the WMP directly, and if there's any way of doing the same with the progress bar, anyways if I can do the same with the progress bar, it would be great, thank you in advance as always, you all helped me a lot, thank you very much for helping a 41 years old man fulfill his dream of bringing back the Darkling Theme, but this time improved :D thanks to all of you :bow:
User avatar
Yincognito
Rainmeter Sage
Posts: 8127
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help

Post by Yincognito »

Japmc7 wrote: June 4th, 2024, 12:06 am [...] but I was also thinking of changing the form I control the volume, as you told me there's a better way of doing this, but... studying the code you shared about that topic, I realized that it's more focused on the overall volume of the operating system, and not the volume of the WMP itself, so I was wondering if there's any way to apply the method to the WMP directly, and if there's any way of doing the same with the progress bar [...]
Yes, there is a way to get and set the player volume instead of the system volume, see the Options > PlayerType > Volume (to get it) and the Bangs > SetVolume N (to set it) here:
https://docs.rainmeter.net/manual/measures/nowplaying/

Yes, there is a way to do it through a progress bar, see here:
Yincognito wrote: May 29th, 2024, 8:12 pm it's just about making a meter as wide as all those [ProgressN] (edit: [VolumeN]) meters, and then setting the player position (edit: volume, see above) to $MouseX:%$ on click (edit: in the meter's LeftMouseUpAction), it's that simple.
https://docs.rainmeter.net/manual/meters/bar/

So, to summarize things, you'll need:
- another NowPlaying measure to get the volume
- a Bar meter referencing the above in its MeasureName, and then in its LeftMouseUpAction commanding the said measure to set the volume to $MouseX:%$, updating the measure and the meter, and redrawing the skin

As for implementing this, it's time to try your luck with this yourself, it's extremely simple, you'll see. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

Hahaha, sometimes you're so fun Yincognito, for me is not simple at all, for me this is Chinese but thank you for answer, be good.
User avatar
Yincognito
Rainmeter Sage
Posts: 8127
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help

Post by Yincognito »

Japmc7 wrote: June 5th, 2024, 4:39 am Hahaha, sometimes you're so fun Yincognito, for me is not simple at all, for me this is Chinese but thank you for answer, be good.
Come on now, I literally spoon fed you both steps, all you need to do is "translate" the instructions into maximum 10 lines of code for both, where only two lines need minor adjustment, the rest you can just copy paste from the (examples in the) manual (by the way, that's what I did too). Nobody's going to serve everything on a plate for you if you don't do anything, and that goes much further in life than just Rainmeter, where:
https://forum.rainmeter.net/viewtopic.php?t=8195

P.S. I like fun and being funny, much better than sad and tragic. :lol:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

Hello guys I hope you're ok, after 3 days of studying the code of how the volume works, I had to turn to another skin that I got out there and modify it, there were really many things missing and that’s why the volume didn’t come out, now, from what I could understand and modify, this is what I got:

Code: Select all

[Rainmeter]
Update=35
BackgroundMode=2
SolidColor=0,0,0,1

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=WMP
PlayerType=Volume
IfCondition=mPlayer = -1
IfTrueAction=[!SetOption MeterSlider X "(([mPlayer:] * (117 - 5) / 100) + 5)"]
IfConditionMode=1

; MeasureMouse is the meat and potatoes of creating a slider. MeasurePercent is used to turn the position into a percentage for use various places.

[MeasureMouse]
Measure=Plugin
Plugin=Mouse
LeftMouseDragAction=[!SetOption MeterSlider X "(Clamp(($MouseX$-15),5,117))"][!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 205,205,205,255 | Stroke Color 255,0,0,255"][!SetOption mPlayer IfCondition ""][!ShowMeter MeterPercent][!UpdateMeter "MeterPercent"][!UpdateMeasure MeasurePercent][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!CommandMeasure MeasureMouse "Stop"][!SetOption mPlayer IfCondition "mPlayer = -1"][!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 247,247,247,255 | StrokeWidth 0"][!UpdateMeter *][!Redraw][!UpdateMeasure MeasurePercent][!HideMeter MeterPercent][!UpdateMeasure mPlayer]
RelativeToSkin=1
RequireDragging=1
DynamicVariables=1

[MeasurePercent]
Measure=Calc
Formula=[MeterSlider:X]
MinValue=5
MaxValue=117
DynamicVariables=1
IfCondition=mPlayer > -1
IfTrueAction=[!CommandMeasure "mPlayer" "SetVolume [MeasurePercent:%,0]"]
IfConditionMode=1

[MeterSlideBack]
Meter=Shape
Shape=Rectangle 0,0,120,10 | Fill Color 0,0,0,1 | StrokeWidth 2 | Stroke Color 255,0,0,255
X=20
Y=20
LeftMouseDownAction=[!ShowMeter "MeterPercent"][!CommandMeasure MeasureMouse "Start"][!SetOption mPlayer IfCondition ""][!UpdateMeter *]
LeftMouseUpAction=[!SetOption mPlayer IfCondition "mPlayer = -1"]

[MeterSlideBar]
Meter=Shape
X=20
Y=20
Shape=Rectangle 1,1,[MeterSlider:X],8,0 | Fill Color 150,0,0,180 | StrokeWidth 0
DynamicVariables=-1

[MeterSlider]
Meter=Shape
Y=20
Shape=Rectangle 16,0,6,10 | Fill Color 247,247,247,255 | Stroke Color 255,0,0,255
LeftMouseDownAction=[!ShowMeter MeterPercent][!CommandMeasure MeasureMouse "Start"][!UpdateMeter "MeterPercent"]
MouseOverAction=[!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 205,205,205,255 | Stroke Color 255,0,0,255"][!ShowMeter MeterPercent][!UpdateMeter "MeterPercent"][!UpdateMeter "MeterSlider"][!Redraw][!SetOption MeasureMouse LeftMouseUpAction """[!CommandMeasure MeasureMouse "Stop"][!SetOption mPlayer IfCondition "mPlayer = -1"][!UpdateMeter *][!Redraw][!UpdateMeasure MeasurePercent][!UpdateMeasure mPlayer]"""]
MouseLeaveAction=[!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 247,247,247,255 | Stroke Color 255,0,0,255"][!HideMeter MeterPercent][!UpdateMeter "MeterPercent"][!UpdateMeter "MeterSlider"][!Redraw][!SetOption MeasureMouse LeftMouseUpAction """[!CommandMeasure MeasureMouse "Stop"][!SetOption mPlayer IfCondition "mPlayer = -1"][!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 247,247,247,255 | Stroke Color 255,0,0,255"][!UpdateMeter *][!Redraw][!UpdateMeasure MeasurePercent][!HideMeter MeterPercent][!UpdateMeasure mPlayer]"""]
DynamicVariables=1

[MeterPercent]
Meter=String
X=([MeterSlider:X]+14)
Y=45
FontFace=BitDust Two
FontSize=12
FontColor=255,255,255,255
Percentual=1
NumOfDecimals=0
StringAlign=CenterCenter
DynamicVariables=1
Text=[MeasurePercent:%,0]
InlineSetting=CharacterSpacing | 0 | -0.25
Hidden=1
Darkling.gif
Although I could partially dispel how the code works, I notice that it has erratic behavior at times, I’ve made several modifications to see if it gets better but I couldn’t, one of the things I’d like to correct is that when I refresh the skin, almost always lowers the volume to zero, also happens when I load the skin the first time, if there is someone who can better understand this behavior, please give me a hand, as always thanks in advance and sorry for the inconvenience.
You do not have the required permissions to view the files attached to this post.
Japmc7
Posts: 33
Joined: May 11th, 2024, 3:57 am

Re: Help

Post by Japmc7 »

I managed to clean the skin of some lines of code that I don’t think they were doing anything, I think I almost made it, now all I need to do is make sure that the volume doesn’t go to zero when I refresh or load the skin, here is the code:

Code: Select all

[Rainmeter]
Update=35
BackgroundMode=2
SolidColor=0,0,0,1

[mPlayer]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=WMP
PlayerType=Volume
IfCondition=mPlayer = -1
IfTrueAction=[!SetOption MeterSlider X "(([mPlayer:] * (117 - 5) / 100) + 5)"]
IfConditionMode=1

; MeasureMouse is the meat and potatoes of creating a slider. MeasurePercent is used to turn the position into a percentage for use various places.

[MeasureMouse]
Measure=Plugin
Plugin=Mouse
LeftMouseDragAction=[!SetOption MeterSlider X "(Clamp(($MouseX$-15),5,117))"][!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 205,205,205,255 | Stroke Color 255,0,0,255"][!SetOption mPlayer IfCondition ""][!ShowMeter MeterPercent][!UpdateMeter "MeterPercent"][!UpdateMeasure MeasurePercent][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!CommandMeasure MeasureMouse "Stop"][!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 247,247,247,255 | Stroke Color 255,0,0,255"][!UpdateMeter *][!Redraw][!UpdateMeasure MeasurePercent][!HideMeter MeterPercent][!UpdateMeasure mPlayer]

RelativeToSkin=1
RequireDragging=1
DynamicVariables=1

[MeasurePercent]
Measure=Calc
Formula=[MeterSlider:X]
MinValue=5
MaxValue=117
DynamicVariables=1
IfCondition=mPlayer > -1
IfTrueAction=[!CommandMeasure "mPlayer" "SetVolume [MeasurePercent:%,0]"]
IfConditionMode=1

[MeterSlideBack]
Meter=Shape
Shape=Rectangle 0,0,120,10 | Fill Color 0,0,0,1 | StrokeWidth 2 | Stroke Color 255,0,0,255
X=20
Y=20
LeftMouseDownAction=[!ShowMeter "MeterPercent"][!CommandMeasure MeasureMouse "Start"]

[MeterSlideBar]
Meter=Shape
X=20
Y=20
Shape=Rectangle 1,1,[MeterSlider:X],8,0 | Fill Color 150,0,0,180 | StrokeWidth 0
DynamicVariables=-1

[MeterSlider]
Meter=Shape
Y=20
Shape=Rectangle 16,0,6,10 | Fill Color 247,247,247,255 | Stroke Color 255,0,0,255
LeftMouseDownAction=[!ShowMeter MeterPercent][!CommandMeasure MeasureMouse "Start"][!UpdateMeter "MeterPercent"]
MouseOverAction=[!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 205,205,205,255 | Stroke Color 255,0,0,255"][!ShowMeter MeterPercent][!UpdateMeter "MeterPercent"][!UpdateMeter "MeterSlider"][!Redraw][!SetOption MeasureMouse LeftMouseUpAction """[!CommandMeasure MeasureMouse "Stop"][!SetOption mPlayer IfCondition "mPlayer = -1"][!UpdateMeter *][!Redraw][!UpdateMeasure MeasurePercent][!UpdateMeasure mPlayer]"""]
MouseLeaveAction=[!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 247,247,247,255 | Stroke Color 255,0,0,255"][!HideMeter MeterPercent][!UpdateMeter "MeterPercent"][!UpdateMeter "MeterSlider"][!Redraw][!SetOption MeasureMouse LeftMouseUpAction """[!CommandMeasure MeasureMouse "Stop"][!SetOption mPlayer IfCondition "mPlayer = -1"][!SetOption MeterSlider Shape "Rectangle 16,0,6,10 | Fill Color 247,247,247,255 | Stroke Color 255,0,0,255"][!UpdateMeter *][!Redraw][!UpdateMeasure MeasurePercent][!HideMeter MeterPercent][!UpdateMeasure mPlayer]"""]
DynamicVariables=1

[MeterPercent]
Meter=String
X=([MeterSlider:X]+14)
Y=45
FontFace=BitDust Two
FontSize=12
FontColor=255,255,255,255
Percentual=1
NumOfDecimals=0
StringAlign=CenterCenter
DynamicVariables=1
Text=[MeasurePercent:%,0]
InlineSetting=CharacterSpacing | 0 | -0.25
Hidden=1
I want to clarify that I changed IfFalseAction= to IfTrueAction= in the [mPlayer] part because IfTrueAction= Made the Slider work erratically, but if there is any way to polish or improve this code, I would greatly appreciate your help, good night. :welcome: