Question about hyphen showing

Topics for the MainLobby 4 client
User avatar
simonmason
Expert
Expert
Posts: 855
Joined: Tue Dec 26, 2006 9:06 pm
Contact:

Question about hyphen showing

Postby simonmason » Thu Apr 14, 2016 10:00 pm

I am displaying the below variables for Now Playing for one of my sources playing in the audio. The last variable - {{MLHSPlugin_{{{{clientname}}_source}}}} - is either CHA1 to CHA6. When it is CHA3 I want this to display, and all other channels I don't. So I have the value CHA3 in the local off state variable field. When it is not channel 3 the variables either side of the hyphen don't display but the hyphen remains. I am probably missing something obvious but how do I get the hyphen to hide when the value is not CHA3? Thanks.

{{music_currentartistname_{{MLHSPlugin_{{{{clientname}}_source}}}}}} - {{music_currenttrackname_{{MLHSPlugin_{{{{clientname}}_source}}}}}}{{MLHSPlugin_{{{{clientname}}_source}}}}~730~50
Simon D. S. Mason

randyf
Member
Member
Posts: 55
Joined: Fri Jun 13, 2014 7:57 am
Location: Northern Virginia
Contact:

Re: Question about hyphen showing

Postby randyf » Fri Apr 15, 2016 10:56 am

Based on what you have here, the hyphen is a string literal and will always display. One thing you might do for this is to create a variable for the hyphen and set that variable based on the condition when you want it to display. So when the condition is true, the variable would contain the hyphen string and spaces and when false, it would be empty. Something like:

if|IsEqual##<condition>##<true_value>##SetVariable|NowPlayingHyphen~ - ##SetVariable|NowPlayingHyphen~!

Then in your logic, add the variable:

Code: Select all

{{music_currentartistname_{{MLHSPlugin_{{{{clientname}}_source}}}}}}{{NowPlayingHyphen}}{{music_currenttrackname_{{MLHSPlugin_{{{{clientname}}_source}}}}}}
{{MLHSPlugin_{{{{clientname}}_source}}}}~730~50

I don't know if the above syntax is accurate since I don't have access to my ML machine at the moment. But hopefully you get the idea.

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Question about hyphen showing

Postby CinemarDave » Fri Apr 15, 2016 12:21 pm

Randy is correct. The hyphen is a string literal so it will always show. His solution is the way to go.

User avatar
simonmason
Expert
Expert
Posts: 855
Joined: Tue Dec 26, 2006 9:06 pm
Contact:

Re: Question about hyphen showing

Postby simonmason » Sat Apr 16, 2016 8:31 am

Thanks Randy and Dave. I do have some issues with this approach. When I set the variable this way then it doesn't display correctly in MainLobby. Let me explain:

I am displaying {{TextVariable1}} {{NowPlayingHyphen}} {{TextVariable2}}

When I set {{NowPlayingHyphen}} to - (a hyphen) using the setvariable command:

if|IsEqual##{{MLHSPlugin_{{{{clientname}}_source}}}}##None##SetVariable|NowPlayingHyphen~##SetVariable|NowPlayingHyphen~-

then the second text string {{TextVariable2}} doesn't display. If I go to the server and update the variable manually and type in the hyphen then everything displays fine in MainLobby. So the setvariable command from the client is including something else in the variable that is impacting the display of the trailing variables.

Thoughts? Thanks.
Simon D. S. Mason

RZajcew
Intermediate
Intermediate
Posts: 257
Joined: Mon Jul 21, 2008 6:31 pm
Contact:

Re: Question about hyphen showing

Postby RZajcew » Sat Apr 16, 2016 8:15 pm

You could create a new MLServer variable called symbol_hyphen, and initialize it to -

Then change the invocation to:

if|IsEqual##{{MLHSPlugin_{{{{clientname}}_source}}}}##None##SetVariable|NowPlayingHyphen~##SetVariable|NowPlayingHyphen~{{symbol_hyphen}}

- Roman

User avatar
simonmason
Expert
Expert
Posts: 855
Joined: Tue Dec 26, 2006 9:06 pm
Contact:

Re: Question about hyphen showing

Postby simonmason » Sun Apr 17, 2016 5:54 pm

Thanks, I finally got it working by fiddling around. My issue is that I was trying to get it to work with 1 OFF state and 2 OFF states. I messed around with the variables in the background to clear them out under certain circumstances so I needed only 1 on and 1 off.
Simon D. S. Mason


Return to “MainLobby 4 Client”

Who is online

Users browsing this forum: No registered users and 1 guest