INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Help with an expression  (Read 604 times)

forbigd

  • Galactic Citizen
  • ****
  • Posts: 259
Help with an expression
« on: October 30, 2018, 08:56:09 am »

All, I have what I consider to be a pretty complicated setup. I play Audio, Music Videos, and DTS files, all pickable from one list.
I want a way to show that the file about to play is either normal stereo, DTS, or a video.
I have used colors to show that the track was a video using
if(isequal([Media Type], Video, 1), <font color="00aaff"> [Name],  <font color="ffffff"> [Name])
So all videos in the list are Blue. I put that in the Name field.
I also use colors to show a track is DTS.
if(isequal([Channels], 6, 1), <font color="00FF00"> [Album],  <font color="ffffff"> [Album])

But if I use the second expression it has to be in a different field. I chose Album, but my making Album an expression, the cool little arrow taking me back to the whole album is missing. So I want to put both expressions in one field, NAME.

I want the NAME field to be black font for stereo, blue font for a video, and green font for a dts.
Is that possible? I have tried combining them, stacking them, all sorts of tricks, and none do what I want.
I am attaching my main screen so you get what I am going for. I don't want to have to use two fields to show the two different status. (statii? :))
This is for Playing Now, but if it worked I would use it on the main display too. I just switched DTS to Duration, but it is too small. I want the whole song title in Green, or Blue, etc.

Thanks for looking.

Don
Logged

swiv3d

  • Guest
Re: Help with an expression
« Reply #1 on: October 30, 2018, 10:43:59 am »

You probably need to use
IfElse(test1, action1, test2, action2, test3, action3, …) to get the results you want.
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8963
Re: Help with an expression
« Reply #2 on: October 30, 2018, 10:57:58 am »

What swiv3d said :)

Use the "ifelse" funtion to string these together... (https://wiki.jriver.com/index.php/Conditional_Functions#IfElse)

ifelse(isequal([Media Type], Video, 1), <font color="00aaff"> [Name]<//font>,isequal([Channels], 6, 1), <font color="00FF00"> [Name]<//font>,isequal([Channels], 2, 1), <font color="000000"> [Name]<//font>,1,<font color="FFFFFF"> [Name]<//font>)

The beauty of "ifelse" is that you can just keep adding conditions to the string as the need arises and the expression doesn't get out of control with the need of a whole heap of closing brackets at the end. You only ever need just the one, to close the "ifelse" funtion off and the job is done. You'll notice that I've ended with "1", make the font white, which basically says if nothing else applies, the font will be white.

Remember also, that order is important. As the test for video is performed first, if you have six channel video, it will still display the colour for video as once it finds a positive match, it considers the result complete and moves on to the next file.

forbigd

  • Galactic Citizen
  • ****
  • Posts: 259
Re: Help with an expression
« Reply #3 on: October 30, 2018, 11:08:51 am »

Wow, rattled it off in less time than it took to ask, it seems.
I had worked on it (off and on) for days. I will learn from this, I will figure out how it ticks and use it for other things. Already I can see how I can use this in another place.
Thanks alot!!

Don
Logged

Mike Foran

  • World Citizen
  • ***
  • Posts: 212
Re: Help with an expression
« Reply #4 on: October 30, 2018, 12:31:27 pm »

Off topic, but how did you get your panels to align like that, with the three verticals on the left, and the 'Playing Now' on the right? Is that a function of the skin you are using or can it be done with any skin?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8963
Re: Help with an expression
« Reply #5 on: October 30, 2018, 12:38:47 pm »

Hi Mike, can be done with any skin. Experiment with "View > Split view"

-marko

Mike Foran

  • World Citizen
  • ***
  • Posts: 212
Re: Help with an expression
« Reply #6 on: October 31, 2018, 03:02:40 pm »

Ah cool thanks! Never used that feature somehow.
Logged
Pages: [1]   Go Up