It is currently June 27th, 2024, 8:34 pm

[!Refreshapp] when skin loaded?

Get help with creating, editing & fixing problems with skins
User avatar
sl23
Posts: 1225
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

you can't have percentual values on a variable, duh
Well that's not very nice! :phhht :lol:

I didn't actually know about that. But now I do, the more I think about it, it just doesn't make sense to me logically.
If a variable displays a number between 1 and 100, isn't that a percentage value that a bar meter can use? I know you're gonna say no, so why not?
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7547
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

The reason why I skipped detailed explanations is that, based on the contents and amount of questions, I would need to write pages and pages of replies and still not be certain you got it all. Might not be nice how I put it (sorry about that), but it's how it is - I don't lie to people just to sound good. :confused:

Yes, your variable + font color idea is good and it can work without conflicts, but you'd need to use escaping (and possibly nesting) to do it. When you set an option to a variable like you did, you're actually setting it to that variable's value, and not to the literal variable. Hence the additional detail that should have been done.

Instead of spending time explaining how that works, I proposed a simpler solution where you'd test 2 numerical values instead in an IfCondition. The result: you did get the IfMatch in the first line and what to test in the second line correctly, but got the || vs && wrong as per your goal:
So, the way it's supposed to work is:
1. Mic Disconnected = #White60#
2. Mic Connected and Active = #Green#
3. Mic Connected and Muted = #Red#
and you used an IfMatch instead of an IfCondition for the second line (despite advising otherwise, since IfMatch works with strings only, while IfCondition works with numbers only):

Code: Select all

IfMatch=[MicMute] || "#MicIconColor#"
See where I'm going with this, and why I'd need to write pages repeating myself at every step? Above, #MicIconColor# (which you should have named #MicConnected# to be more precise and logical) should be tested alongside MicMute (without square brackets, if you want to avoid adding DynamicVariables=1 to that section) exactly as your "supposed to work" breakdown, and then set FontColor accordingly in the meter. By the way, this IfCondition (not IfMatch) should be in the MicMute measure (replacing whatever other tests you have there, if any), because the said measure is the last compared to mDeviceName, meaning that by then both values being tested will be up to date.

Again, I don't have your setup and Line In to test, but like you said, if you get the Mic stuff right, you only need to replicate that for Line In, that's why I didn't cover the latter. Hopefully you'll be able to do that on your own, cause as much as I'd like to, can't help you there since I don't have a Line In to begin with, and there's just too much content in the thread to clearly and entirely understand how you want the skin to behave. It's tiring for me too to follow longer replies going from one thing to another repeatedly, you know... I already did that for the PS variants, it wasn't good cause the .dll is buggy, now I'll stick to essentials.

Regarding the need to refresh, I already mentioned the bug in AudioLevel in the PS thread, maybe it's related:
https://forum.rainmeter.net/viewtopic.php?t=40011

Hopefully I answered some of your questions above. :)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1225
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Apologies for the long thread and posts, I just wanted to get everything down at once. Least you'd know the final goal then. :)

Thing is, I find it hard to even understand the syntax correctly. When to use brackets or quote marks. If Measure names can be used in IfActions, etc, etc.... I try to learn it, but I haven't found anywhere that explains the fundamentals of programming in a way complete beginners can learn. You're told things randomly like that RegEx thing you pointed out, which didn't even work! You're solution to that was incredibly complex for such a simple task! It's hard trying to remember it all when you rarely use it. After looking at the Escaping Variables section of the Manual, it shows how little I understand! The explanation is for people who know the basics of how programming works. I found the same with XYplorer's scripting. It's always written from that perspective. So much to learn for even simple tasks! But I suppose you can't be expected to teach people from zero to hero! :D

I know you have helped a great deal on this and the previous version, thank you, I mean that. I'm impatient, forgetful, get frustrated easily, perfectionist, struggle to let go, all traits of ADHD/Autism. I don't mean to overwhelm you with my posts. I'm eagerly trying to make things clear, but obviously doing just the opposite, sorry for that!

I'll try again with the colouring, thanks for the advice! :thumbup:
- MuLab -
User avatar
sl23
Posts: 1225
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

This is an example of my issues:
IfCondition2=([mDeviceName]=Mic)

I don't even know if the syntax is right or not. I spend hours trying to get it working, trying all different things cos I have no way of finding out what's wrong except this forum. Many things are covered in the fantastic Manual, but not everything is or can be.

I'll keep at it, until I exhaust all possibilities I can come up with. Thank you so much for your help, I meant no offence btw! :great:
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7547
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 21st, 2024, 1:52 pm Apologies for the long thread and posts, I just wanted to get everything down at once. Least you'd know the final goal then. :)

Thing is, I find it hard to even understand the syntax correctly. When to use brackets or quote marks. If Measure names can be used in IfActions, etc, etc.... I try to learn it, but I haven't found anywhere that explains the fundamentals of programming in a way complete beginners can learn. You're told things randomly like that RegEx thing you pointed out, which didn't even work! You're solution to that was incredibly complex for such a simple task! It's hard trying to remember it all when you rarely use it. After looking at the Escaping Variables section of the Manual, it shows how little I understand! The explanation is for people who know the basics of how programming works. I found the same with XYplorer's scripting. It's always written from that perspective. So much to learn for even simple tasks! But I suppose you can't be expected to teach people from zero to hero! :D

I know you have helped a great deal on this and the previous version, thank you, I mean that. I'm impatient, forgetful, get frustrated easily, perfectionist, struggle to let go, all traits of ADHD/Autism. I don't mean to overwhelm you with my posts. I'm eagerly trying to make things clear, but obviously doing just the opposite, sorry for that!

I'll try again with the colouring, thanks for the advice! :thumbup:
Yeah, no worries, I just shared my side of it too. We'll sort things out eventually, just a few bumps on the road, that's all. I understand your point of view as well, would probably be easier if you used these things more often. But yeah, these softwares are programming tools in the end (some lighter, some otherwise), so some of the basics of it should be known. For the rest, it helps a lot if you can make logical connections easily between something you already know and something you don't yet. ;-)

I'll post a code showcasing the coloring later on, maybe it helps.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1225
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Thanks yoo! :rosegift:
I do see your pov too, so you know. :)

Omg, didn't even realise I need to take the order of the Measures into account, so that's why the last one takes precedence? :rolmfao:
I just aint cut out for programming! :-(
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7547
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 21st, 2024, 2:25 pmOmg, didn't even realise I need to take the order of the Measures into account, so that's why the last one takes precedence? :rolmfao:
It's not about precedence (notice how the order matters, and that's from the "getting started" stuff from the manual, aka the basics):
https://docs.rainmeter.net/manual/getting-started/skin-anatomy/#HowASkinBehaves
It's about a very simple logic: if you first do A=5 and then B=3, in the moment when A is assigned its value you won't know the value of B yet, while when B is assigned its value you will know the values of both A and B. This has absolutely nothing to do with programming, it's plain logic, really. :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1225
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Got it working! :yahoo:
I went back to a previous saved version where I used this:

Code: Select all

[mDeviceName]
Measure=Plugin
Plugin=AudioLevel
Parent=mMicdbLevel
Type=DeviceName
Substitute="(Realtek(R) Audio)":"(R)","(USB Audio)":"(USB)","Microphone":"Mic"
IfMatch="Mic"
IfMatchAction=[!EnableMeasure MicMute][!ShowMeter MicPercent][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!DisableMeasure MicMute][!HideMeter MicPercent][!UpdateMeter *][!Redraw]
But the meter kept disappearing when the Mic was unplugged. So decided to figure out why...
It was because I hadn't set Text=[\xE720]!

Sometimes it's just so simple! Like I said, can't see the wood for the trees! :oops: :rolmfao:

Yeah, I did know about order, just never had to take it into account before so sort of forgot! Use it or lose it! :sly:
- MuLab -
User avatar
sl23
Posts: 1225
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: [!Refreshapp] when skin loaded?

Post by sl23 »

Can I push my luck and ask one more question? :oops: O.O

I'm just curious why my RegEx didn't work and why it needs to be so complex?
When I tested it on that site, it highlighted the '.' and the following digit. which is what I needed to replace with "" using "\.\d":"", so I am left wondering why this didn't work at all? I did set RegExSubstitute=1.

If it's too much to explain, don't worry. Thanks so much for your help, you're the best! :D
- MuLab -
User avatar
Yincognito
Rainmeter Sage
Posts: 7547
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [!Refreshapp] when skin loaded?

Post by Yincognito »

sl23 wrote: June 21st, 2024, 2:51 pm Got it working! :yahoo:
I went back to a previous saved version
Well, good for you, but for me the [mRunMicVol] in your code keeps failing (with or without the Substitute or the UpdateDivider, always failing on refresh and most of the times when triggered manually), while it works perfectly in the code I originally posted here. I'm pretty sure the code you ended up with is flawed one way or another, but you got it working so it's your responsibility, don't ask me about it. We (well, you) got a success, so the matter is settled, lol. :D
sl23 wrote: June 21st, 2024, 2:58 pm Can I push my luck and ask one more question? :oops: O.O
I'm just curious why my RegEx didn't work and why it needs to be so complex?
Sure, no problem, but which regex? There are a few, and I can't always read minds from afar... :lol:
The "\.\d":"" would work, if there wasn't a newline after it. So, the output from svcl.exe is actually (notice another blank line after the number):

Code: Select all

83.0

You can see this if you temporarily comment out the Substitute if any, do a String: Copy To Clipboard on the measure in the About > Skins window, and then paste it into an empty Notepad++ text file.

Doing "\.\d\R":"" would probably work, although I'd add the end of the string aka $ as well, e.g. "\.\d\R$":"". By the way, this is what my "(?:\s+|[.]\d+)":"" also does, the only difference is that it deletes blank spaces wherever they are in the string, and cover the possibility of having multiple decimals not just one.

EDIT: I'll just delete the code I had, now that you finally got it working. :great:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth