It is currently February 23rd, 2024, 3:19 am

Next and Previous Track's Names

General topics related to Rainmeter.
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Next and Previous Track's Names

Post by Aryx »

I was just thinking, as NowPlaying can not write the Track's name other than the one already playing, that I could do something like this:

I) For Next Track:
If Track is not changed, then it will be empty.

If Track is changed:
1. When the Track is changed - It is changed as 2 Tracks Ahead and Back 1 time.
2. Writing 2nd Track's name to some variable.
3. Referencing it to some meter as String.

If Shuffle is On, and is not jumbled always (Single Shuffle - till the end of the playlist), we can or can not repeat the same steps as above.
If Repeat is On, then it will be empty.

II) For Previous Track:
1. Writing the Current Track to some variable.
2. Referencing it to some meter when the track changes to next.

Would this work? If yes, then how can I implement this? I have not seen anyone do this so far and I'm not tech savvy.

Edit: Just noticed I posted this in Tips & Tricks Section - where defined ones go.. How can I change/shift this topic to General Discussion? Done ✓
Last edited by SilverAzide on December 21st, 2023, 4:46 pm, edited 1 time in total.
Reason: Moved at OP's request.
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Next and Previous Track's Names

Post by Yincognito »

Aryx wrote: December 21st, 2023, 9:46 am I was just thinking, as NowPlaying can not write the Track's name other than the one already playing, that I could do something like this:

I) For Next Track:
If Track is not changed, then it will be empty.

If Track is changed:
1. When the Track is changed - It is changed as 2 Tracks Ahead and Back 1 time.
2. Writing 2nd Track's name to some variable.
3. Referencing it to some meter as String.

If Shuffle is On, and is not jumbled always (Single Shuffle - till the end of the playlist), we can or can not repeat the same steps as above.
If Repeat is On, then it will be empty.

II) For Previous Track:
1. Writing the Current Track to some variable.
2. Referencing it to some meter when the track changes to next.

Would this work? If yes, then how can I implement this? I have not seen anyone do this so far and I'm not tech savvy.

Edit: Just noticed I posted this in Tips & Tricks Section - where defined ones go.. How can I change/shift this topic to General Discussion?
I believe both things can be achieved:
I. Just use [!CommandMeasure YourNowPlayingMeasure "Next"] two times one after another, and the "Previous" equivalent once (possibly with a [!Delay NumberOfMilliseconds] between them), and do your thing at the desired moment
II. Use an OnChangeAction or and OnUpdateAction on the track measure and add a [!SetVariable LastTrack "#CurrentTrack#"][!SetVariable CurrentTrack "[YourTrackMeasure]"] to it (in that order), then use the variable as desired
The above might need some DynamicVariables=1 lines in the sections where those volatile variables (or [section variables]) are used, potentially the nested syntax for [#variables] or [&measures] if the value of the just changed variable/ measure is needed on the same line, but other than that, it shouldn't be hard to achieve what you want.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: Next and Previous Track's Names

Post by Aryx »

I can't understand after Dynamic Variables part - Section/Volatile Variables and Nested Syntax part. Can you please explain it like explaining it to a child? :-(

It might sound funny, but, I am not a programming guy too and this piece of software is new to me.. It's just that Rainmeter Codes/Coding (?) are simple and the help is abundant here. :thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Next and Previous Track's Names

Post by Yincognito »

Aryx wrote: December 21st, 2023, 6:07 pm I can't understand after Dynamic Variables part - Section/Volatile Variables and Nested Syntax part. Can you please explain it like explaining it to a child? :-(

It might sound funny, but, I am not a programming guy too and this piece of software is new to me.. It's just that Rainmeter Codes/Coding (?) are simple and the help is abundant here. :thumbup:
I think I have something even better: the manual. It does exactly that. You don't have to read everything, just the few paragraphs of concern. For example, see the relevant info at dynamic variables, section variables or nested syntax. If you still don't understand after reading those explanations about them, come back here and I'll fill in the blank spots. ;-)

P.S. "Volatile" was just a synonym I used for variables that are dynamic (i.e. ever changing) in nature, no hidden mystery there.
Last edited by Yincognito on December 21st, 2023, 6:47 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: Next and Previous Track's Names

Post by Aryx »

Will probably have a look at it after the holidays! Cheers till then! :cheers:
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Next and Previous Track's Names

Post by Yincognito »

Aryx wrote: December 21st, 2023, 6:46 pm Will probably have a look at it after the holidays! Cheers till then! :cheers:
Alrighty then. Have a great time during the holidays, and see you when the time will come. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16007
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Next and Previous Track's Names

Post by balala »

Aryx wrote: December 21st, 2023, 6:07 pm I can't understand after Dynamic Variables part - Section/Volatile Variables and Nested Syntax part. Can you please explain it like explaining it to a child? :-(
In addition to the links posted by Yincognito above and your discussion, here are a few details.
You have to add the DynamicVariables=1 option to any meter or measure where:
  • You are using a variable, whose value is set by a !SetVariable bang, wherever in the code. No need for it if the value of the variable used into the meter or measure is not altered by the !SetVariable bang. So if you have a variable declared into the [Variables] section as MyVar=25 and you want to use this declared value of the variable into a [MyVarMeasure] measure, you don't have to add the DynamicVariables=1 option to this measure. But if you have on any meter of your code for instance a LeftMouseUpAction=[!setVariable MyVar "10"] option, when you click this meter, the value of the variable is set to 10, but the [MyVarMeasure] can't follow this dynamic alteration of the variable, unless you're adding the DynamicVariables=1 option to it.
  • You are using section variables, like [MyMeasure], [MyMeter:X] or [MyTimeMeasure:TimeStamp] (obviously just three examples, there might be used plenty of such section variables).
  • You can't use dynamic variables into a few sections like [Rainmeter], [Variables], [Metadata], iTunes plugin measures, MediaKey measures and Power plugin measures. Adding a DynamicVariables=1 option to any of these sections is useless, they can't work with such dynamic variables. Take care that this also means that you can use this option only on measures and meters.
  • No need for DynamicVariables=1 option on measures and meters which are altered by !SetOption bang (interesting thing!). Unlike !SetVariable, this bang sets the section to which it is applied dynamic, for one update cycle.
Obviously these are just the basic things. There are lot of details, but if you keep using Rainmeter, you'll figure out many (all?) of them. Wish you good luck!
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Next and Previous Track's Names

Post by Yincognito »

There you go, balala just summarized what the manual said about these. You escaped reading from it... this time. :sly:
Just joking, of course. Maybe you'd be lucky a second time too. :lol:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16007
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Next and Previous Track's Names

Post by balala »

Yincognito wrote: December 21st, 2023, 7:19 pm There you go, balala just summarized what the manual said about these. You escaped reading from it... this time. :sly:
:confused: :Whistle
Aryx
Posts: 34
Joined: December 20th, 2023, 9:18 am

Re: Next and Previous Track's Names

Post by Aryx »

Welp! Thanks for summarizing it!
It would be a little better if I had some foundation-code or something to go on - even if the fragments are understood, I yet have nothing to glue the puzzle pieces - if you get what I mean.. I have yet to learn the basics to Rainmeter.

Don't mean to bother, if I get it all working, then I'll post it here if no one would..