Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1162

Bugs & Feature Suggestions • Re: [Friendly Resource] If PlayerType=Lyrics needs an update, LRCLIB can be used

$
0
0
This is a bit embarrassing to admit, and I don't mean to be a downer, but I feel like I don't know what I'm doing anymore (which, as a coder, happens to me a lot). I've tried every tip, but I feel like I'm not making any progress. I'm not sure if this is correct, but here's what my current code looks like. Feel free to edit anything. :???:
Don't worry, it's ok, it happens to everyone once in a while. Yeah, you mostly did well, apart from the Substitute options in [MeasureTotalLines] and [MeasureCurrentLine].

For example, the first one of these measures should look something like (notice the presence of RegExpSubstitute=1, to enable regex in the following Substitute option):

Code:

[MeasureTotalLines]Measure=StringString=[MeasureLyrics]RegExpSubstitute=1Substitute="\N*(?:\R|$)":"+1"DynamicVariables=1
In the substitute, \N is any char that's not a newline one, \R is a newline char (either \r\n or just \n, as you probably know already), and $ is the end of the string. So basically we're replacing each line with "+1" in order to compute the resulting sum in [MeasureCountTotalLines].

For the [MeasureCurrentLine], you'll have to apply the same idea, except that before you replace lines with "+1" you'll have to 'trim' the string to include only the part between the start of the string and the currently played line (something like "(?siU)^(.*)\[\x005B][MeasurePosition].*\R.*$":"\1", but further refinements will have to be made to account for the possibility of not having the current track position in the lyrics string, and the fact that Rainmeter replaces the empty captures with the literal \1, \2 and so on as the note here explains).

Once you do the above (start with the total lines first, as it's simpler), you should get some meaningful results in the corresponding Calc measures and fill the blanks bit by bit (watch the About > Skins tab's values for your measures). ;-)

Statistics: Posted by Yincognito — Today, 1:05 pm



Viewing all articles
Browse latest Browse all 1162

Trending Articles