Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Online radio/location syntax (Read 1432 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Online radio/location syntax

Is there a syntax (or a component that adds a similar syntax) for checking if what is being played is local or being streamed over the internet, that would work similar to %ispaused%? I'm customizing foo_discord_rich and want to automatically switch the second line when listening to a online radio.

Currently it looks like this in the attached pictures.
FIrst line:
Code: [Select]
🎧%title%[ '//' %artist%]
Second line:
Code: [Select]
[💿%album%$ifgreater(%totaltracks%,1, '['%tracknumber%/%totaltracks%']',)]

I was planning of something like "$if(%islocal%, *insert old second line here* ,📻[%path% *or* %radioname%])", but I've looked at the title formatting syntax reference document that comes with foobar2000 and didn't find something that could solve this.

Re: Online radio/location syntax

Reply #1
 Update: I tried using $ifequal and $substr to detect if %path% started with "http", but it didn`t work because apparently $ifequal is for numbers only...?
Code: [Select]
$ifequal($substr(%path%,1,4),http,📻,💿)

So then I converted "http" to a number and IT WORKED!
Code: [Select]
$ifequal($replace($substr(%path%,1,4),http,1337),1337,📻,💿)

I don't know if there is a better way to do this, but at least it is working as expected for now :D

The final result looks like this. I really don't know how to format, so here is a beautiful and awkward long line
Code: [Select]
$ifequal($replace($substr(%path%,1,4),http,1337),1337,📻,💿)[%album%[ '('$year(%date%)')']$ifgreater(%totaltracks%,1, '['%tracknumber%/%totaltracks%']',)]

 


Re: Online radio/location syntax

Reply #4
$if($stricmp($left(%path%,4),http),