It is currently August 8th, 2022, 11:28 pm

WordWrap possible with quote plugin?

General topics related to Rainmeter.
falconwing64
Posts: 4
Joined: June 24th, 2010, 7:40 pm

WordWrap possible with quote plugin?

Post by falconwing64 »

First off, I'd like to say that I just started using rainmeter no less than 3 days ago, so you'll have to excuse me if anything I've coded is a bit...roundabout.

I've been searching for a good lyrics grabber for rainmeter, I found one at http://rainmeter.net/forum/viewtopic.php?f=28&t=1281, but it a) requires an exterbal .vbs script to be functioning, b) is a bit slow and inaccurate.

That having been said, I downloaded EvilLyrics, which is capable of grabbing the current playing song, finding the lyrics for it, and inserting them into the ID3 tag. It also conveniently temporarily writes them to "nowplaying.txt" inside the EvilLyrics folder.

I looked around in the manual, but I couldn't find a simple way to display a text file in its entirety. Eventually, Google pointed me to a 4-year-old exploit(?): http://customize.org/rainmeter/skins/44166 I think what happened was the author searched for a nonexistent seperator "\t". So I put this on my desktop and it displays the lyrics nicely and all, but the lines won't wrap! The size of the skin keeps on changing relative to the "size" of the lyrics. This is frustrating, because they sometimes spill over into the next skin.

tl;dr
Is there an easy way to wordwrap a full text file and display it?
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: WordWrap possible with quote plugin?

Post by JpsCrazy »

In the Tips 'n Tricks section on the front page...

http://rainmeter.net/cms/Tips-WrappingText

It should work,
Just make sure you include DynamicVariables because you're getting multiple lyrics.
falconwing64
Posts: 4
Joined: June 24th, 2010, 7:40 pm

Re: WordWrap possible with quote plugin?

Post by falconwing64 »

Thanks, that did the trick!

I'm still kind of failing to understand why I need DynamicVariables=1, I'm just grabbing all the text, so shouldn't this only be 1 thing...?

Here's the code I'm using:

Code: Select all

[MeasureNote]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName=#NotePath#
Disabled=0
Separator=\t

[MeterNote]
Meter=STRING
MeasureName=MeasureNote
x=5
y=5
H=700
W=350
Clipstring=1
;DynamicVariables=1
StringStyle=NORMAL
StringAlign=LEFT
StringEffect=Shadow
FontFace="Trebuchet MS"
FontSize=7
FontColor=255,255,255
AntiAlias=0
As a follow-up, is there a way to make this text scroll? It sometimes goes off the screen :(
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: WordWrap possible with quote plugin?

Post by JpsCrazy »

I'm not %100 sure you need it...
But here's what I'm thinking - the song changes, and the new lyrics need to pop up.
Problem is, the skin always saves the lyrics to the same file. (at least that's what I assumed. And I do intend to make and ass out of you and me.)
Problem is - the lyrics were loaded and saved and therefore the file won't change to the new ones without a refresh. DynamicVariables should read the new text on the next update.
Or, if there's multiple lyric files (good luck pairing them up correctly...) it would load the new path, again because without it it would load the original file.

Now, I'm not 100% sure this is true, but I'm pretty sure it is.

And scrolling isn't easy...
See Smurfier's Scrolling RSS Reader
It's not exactly the easiest thing to understand, but when you break it down and see what's going on it's not too hard.
Be sure to ask permission to use his codes!

Alternatively - make a bigger W and H.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: WordWrap possible with quote plugin?

Post by Chewtoy »

At the least you can make it move.

Code: Select all

[Variables]
Update=50
OriginalY=300
TotalMove=300
X1=2

;-----------------
;Down and up
;-----------------

[MeasureMove]
Measure=Calc
Formula=Counter%#TotalMove#
AverageSize=1

[NewPosition]
Measure=Calc
Formula=#OriginalY#-MeasureMove

[Motor]
Measure=Calc
Formula=Counter%2
IfBelowValue=1
IfBelowAction=!Execute [!RainmeterMoveMeter #X1# [NewPosition] ScrollingText]
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterMoveMeter #X1# [NewPosition] ScrollingText]
DynamicVariables=1

[ScrollingText]
Meter=String
X=#X1#
Y=#OriginalY#
FontColor=255, 0, 0, 150
FontFace=Tahoma
Fontsize=10
AntiAlias=1
StringAlign=Left
StringEffect=Shadow
Text="This is a string of text that I want to scroll"
I don't think, therefore I'm not.
falconwing64
Posts: 4
Joined: June 24th, 2010, 7:40 pm

Re: WordWrap possible with quote plugin?

Post by falconwing64 »

JpsCrazy wrote:I'm not %100 sure you need it...
But here's what I'm thinking - the song changes, and the new lyrics need to pop up.
Problem is, the skin always saves the lyrics to the same file. (at least that's what I assumed. And I do intend to make and ass out of you and me.)
Problem is - the lyrics were loaded and saved and therefore the file won't change to the new ones without a refresh. DynamicVariables should read the new text on the next update.
Or, if there's multiple lyric files (good luck pairing them up correctly...) it would load the new path, again because without it it would load the original file.

Now, I'm not 100% sure this is true, but I'm pretty sure it is.

And scrolling isn't easy...
See Smurfier's Scrolling RSS Reader
It's not exactly the easiest thing to understand, but when you break it down and see what's going on it's not too hard.
Be sure to ask permission to use his codes!

Alternatively - make a bigger W and H.
But if my skin is updating every 5 seconds, it automatically refetches the .txt file? I'm not sure if I'm understanding what you're saying... On another note, thanks for the link to the scrolling reader, I'll take a look at it.
User avatar
Alex2539
Rainmeter Sage
Posts: 642
Joined: July 19th, 2009, 5:59 am
Location: Montreal, QC, Canada

Re: WordWrap possible with quote plugin?

Post by Alex2539 »

JpsCrazy wrote:I'm not %100 sure you need it...
But here's what I'm thinking - the song changes, and the new lyrics need to pop up.
Problem is, the skin always saves the lyrics to the same file. (at least that's what I assumed. And I do intend to make and ass out of you and me.)
Problem is - the lyrics were loaded and saved and therefore the file won't change to the new ones without a refresh. DynamicVariables should read the new text on the next update.
Or, if there's multiple lyric files (good luck pairing them up correctly...) it would load the new path, again because without it it would load the original file.

Now, I'm not 100% sure this is true, but I'm pretty sure it is.
That's absolutely, 100% wrong. Rainmeter has nothing to do with the file itself except, in this case, writing to it. Then, QuotePlugin reads the file at EVERY update, just like any other measure would, no matter who wrote to it. Then at every update whatever meter is set to read from it will show that new value. The only way dynamic variables would come into this at all is if the path to the file is changing, which according to the description provided in the first post, it isn't. Rainmeter gets all of the information, it writes it to the file and in an update or two, the Quote measure reads those changes and the meter shows it. Simple.

Dynamic variables are only used if you are:
A) Using a #Variable# that has had its value changed using !RainmeterSetVariables. Otherwise
B) Using the name of a [Measure] directly as a value (as opposed to using MeasureName)

If you don't know, don't make assumptions. Either try it out yourself so that you know for sure or wait for someone who does know to answer.
ImageImageImageImage
User avatar
jsmorley
Developer
Posts: 22533
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WordWrap possible with quote plugin?

Post by jsmorley »

Alex2539 wrote: If you don't know, don't make assumptions. Either try it out yourself so that you know for sure or wait for someone who does know to answer.
Agreed.

Here is the point. Every time someone posts a solution to a problem or gives advice on how to accomplish something without bothering to test it and be sure it works, then that wrong solution is forever in the forums. Now when a new user comes along, and like a good forum citizen does a search before asking how to do something, what do they get? It's like poisoning the well.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: WordWrap possible with quote plugin?

Post by JpsCrazy »

I apologise. D:
I've had problems (that I thought were) similar to this, where dynamic variables were needed.
All I remember is it read the data once, got the data from it, then next update the data changed but it was still using the old data. I don't remember what it was, chances are a variable.

All in all, adding DynamicVariables=1 to that wouldn't really do any harm (at least I don't see how it could.) And it's not a serious issue.
But nonetheless, I'll refrain from answering posts unless I know for certain I'm correct.