It is currently May 25th, 2020, 1:23 pm

[Suggestion] Enhancements to Include

Report bugs with the Rainmeter application and suggest features.
User avatar
Yincognito
Posts: 1609
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Suggestion] Enhancements to Include

Post by Yincognito »

DanDaBear wrote:
April 29th, 2020, 3:43 pm
Well . . . :confused:

It didn't quite work with that other widget maker, probably more because of a strange UI and lack of help and tutorials.
(and a lack of updates) O.O
And that other "widget maker" was called...how? Cause I've seen various posts on this topic over the years, and I'm not sure which one you're referring to.
User avatar
DanDaBear
Posts: 39
Joined: February 23rd, 2018, 3:12 am

Re: [Suggestion] Enhancements to Include

Post by DanDaBear »

Xwidget.

It's still out there, even sold on Steam, but hasn't seen an update in a few years, although they have a bunch of different stuff recently created.

That's why I love Rainmeter.
It has a great community and is updated regularly!
User avatar
Yincognito
Posts: 1609
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Suggestion] Enhancements to Include

Post by Yincognito »

DanDaBear wrote:
April 29th, 2020, 6:20 pm
Xwidget.

It's still out there, even sold on Steam, but hasn't seen an update in a few years, although they have a bunch of different stuff recently created.

That's why I love Rainmeter.
It has a great community and is updated regularly!
I see. Well, the application looks great, just like Rainmeter, but of course that visually designing the widgets is helpful. On the other hand, the code being in Javascript, is harder to understand for a non-programmer, compared to the INI format. Also, the fact that Rainmeter is free is a big bonus, along with the others you just mentioned. Despite the limitations of the INI format, my impression is that Rainmeter is more flexible.

But then, I was talking about attempts to "visualize" Rainmeter's skin building process, and not about other apps that visually create skins / widgets. I remember reading about such attempts here on the forum a couple of years ago, and those attempts encountered serious bottlenecks (probably due to a wrong approach, in my view) and became abandoned, or remained at the stage of a "great project" with no practical outcome (at least, not published here).
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3929
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: [Suggestion] Enhancements to Include

Post by eclectic-tech »

Yingonito referenced a post from a few years ago, that used a script measure with an option#/value# scheme to generate measures and meters. It was not very user-friendly because you had to convert each line of an 'ini' formatted measure or meter to an option#/value# format used in the script :uhuh:

I recently came across a script from alatsombath's Ocean visualizer, 'GenerateBands' which can create incremental sections from a template created in standard 'ini' measure/meter format.

I integrated the script into 2 repeating template generator skins:
'GenerateMeasures.ini' creates '#@#My#Template#Measures.inc' using a predefined template file or one you create.
'GenerateMeters.ini' creates '#@#My#Template#Meters.inc' using a predefined template file or one you create.

Those skins are setup and controlled by '@RepeatingVariables.inc' file. It contains the name of your template and the number of repeating measures/meters variables.

I created 2 example packages showing how you might use the repeating template generators in your own skins.

For audio visualizers which basically use 1 incremented measure and 1 related meter, it can create @include files with the number of repeating measures and meters, on the fly, for use in a visualizer. See 'RepeatingTemplateVisualizer' demo package.

For webparser skins, the demo can create title/link (2 indexes... but as many as needed can be added) measures and meters. It uses a few variables and a repeatable formula to automatically calculate the stringindex values. It can dynaically create any number of measures and meters on-the-fly. See 'RepeatingTemplateGoogleNews' package.

Here are the scripts. They are identical, except for the !Log entry. When used in a skin, I comment out opening the created file in an editor.
RepeatMeasureSection.lua

Code: Select all

-- RepeatSection v1.2
-- LICENSE: Creative Commons Attribution-Non-Commercial-Share Alike 3.0
-- Author: alatsombath from 'Ocean', 'Generate Bands' skin

function Initialize()
  local index, section, gsub, readFile = 1, {}, string.gsub, io.input(SKIN:ReplaceVariables(SELF:GetOption("ReadFile"))):read("*all")
  local substitution, lowerLimit, upperLimit = SELF:GetOption("Substitution"), SELF:GetNumberOption("LowerLimit") + 1, SELF:GetNumberOption("UpperLimit") + 1
  
  for i = lowerLimit, upperLimit do
    section[index], index = gsub(readFile, substitution, i-1), index + 1
  end
  
  local file = io.open(SKIN:ReplaceVariables(SELF:GetOption("WriteFile")), "w")
  file:write(table.concat(section, "\n\n"))
  file:close()
 
  SKIN:Bang('!Log', 'Created #@#My#Template#Measures.inc.')

-- Add comment to the line below to prevent opening the file in an editor
  SKIN:Bang('#@#My#Template#Measures.inc.')
    
end
RepeatingMeterSection.lua

Code: Select all

-- RepeatSection v1.2
-- LICENSE: Creative Commons Attribution-Non-Commercial-Share Alike 3.0
-- Author: alatsombath from 'Ocean', 'Generate Bands' skin

function Initialize()
  local index, section, gsub, readFile = 1, {}, string.gsub, io.input(SKIN:ReplaceVariables(SELF:GetOption("ReadFile"))):read("*all")
  local substitution, lowerLimit, upperLimit = SELF:GetOption("Substitution"), SELF:GetNumberOption("LowerLimit") + 1, SELF:GetNumberOption("UpperLimit") + 1
 
  for i = lowerLimit, upperLimit do
    section[index], index = gsub(readFile, substitution, i-1), index + 1
  end
  
  local file = io.open(SKIN:ReplaceVariables(SELF:GetOption("WriteFile")), "w")
  file:write(table.concat(section, "\n\n"))
  file:close()

  SKIN:Bang('!Log', 'Created #@#My#Template#Meters.inc.')

-- Add comment to the line below to prevent opening the file in an editor
  SKIN:Bang('#@#My#Template#Meters.inc.')
  
end
More details, a modular 'TemplateGenerators' method, and working examples are here: COMMUNITY TIP
User avatar
Yincognito
Posts: 1609
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Suggestion] Enhancements to Include

Post by Yincognito »

eclectic-tech wrote:
April 30th, 2020, 12:45 am
Yingonito referenced a post from a few years ago, that used a script measure with an option#/value# scheme to generate measures and meters. It was not very user-friendly because you had to convert each line of an 'ini' formatted measure or meter to an option#/value# format used in the script :uhuh:

I recently came across a script from alatsombath's Ocean visualizer, 'GenerateBands' which can create incremental sections from a template created in standard 'ini' measure/meter format.
Yeah, I knew about alatsombath's method too - his code is among the hardest to debug for this very reason, apart from the extreme abbreviations he uses to "shortcut" to bangs, measures and meters, LOL. I worked recently with one of his skins here.

That being said, these scripting methods, while doing what it has been requested, are relatively difficult to grasp for regular users. The interesting thing is that even power users / developer types like element weren't interested in them and prefer to push the feature into Rainmeter itself, which is a bit strange, given that the methods do accomplish what it was needed for them to accomplish. But then, besides the ability to do the job, simplicity is also a criteria for folks choosing one method over another...

Anyway, the more alternatives to do this thing, the better, so :thumbup: to all "contributors", including yourself. Personally, I find that this is the easiest approach on it, particularly the "one set" (actually, there can be "multiple sets" as well) approach of reusing measures with the help of dynamic variables. Unfortunately this can't be applied to meters, since each one of them has to exist individually, and be different from the rest, but then, this is only about creating / writing a skin, and that is generally a one time process, and copy pasting stuff isn't that hard, after all.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3929
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: [Suggestion] Enhancements to Include

Post by eclectic-tech »

Yincognito wrote:
April 30th, 2020, 2:10 am
...
That being said, these scripting methods, while doing what it has been requested, are relatively difficult to grasp for regular users. The interesting thing is that even power users / developer types like element weren't interested in them and prefer to push the feature into Rainmeter itself, which is a bit strange, given that the methods do accomplish what it was needed for them to accomplish. But then, besides the ability to do the job, simplicity is also a criteria for folks choosing one method over another...
...
Yes, I agree it needs to simple and as straightforward as possible.
I created simplified template generator methods and posted more details...
User avatar
Yincognito
Posts: 1609
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [Suggestion] Enhancements to Include

Post by Yincognito »

eclectic-tech wrote:
May 2nd, 2020, 6:02 pm
Yes, I agree it needs to simple and as straightforward as possible.
I created simplified template generator methods and posted more details...
Good idea, to post it in the Tips & Tricks section. :thumbup: I'll have to think about doing this in Rainmeter code as well, just for the sake of an alternative (this is not to say that you should do this too, by the way - it's just a thought of mine).