Skip to main content
Topic: Internal linking/referencing with custom Foobar synthax? (Read 450 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Internal linking/referencing with custom Foobar synthax?

Not sure if this will turn into a feature request or if it is already possible with one of the millions ways Foobar is tweakable already.

I would love to build a way to somewhere show clickable "internal" text links which would work like a search/filter for the same title or artist or record, etc or like an internal reference (how wikipedia works). I am flexible how and where this should be possible. Maybe in a custom text box, or in a playlist column custom field view or via Monkey panel or lua scripting. The foo_run option over contextrual right click is too much steps ahead IMHO and not inutitive and becomes messy over the time of multiple things. I would rather see a link somewhere in a column to click on if possible.

Apart from that I wonder if there is any way to turn text into links one way or the other just to know if possible. I know there is hte text display panel which claimed to support custom functions like $applink and $doclink but I never got this to work these days. Since this component is quite old I am not sure if it still works and apart from that I would rather go for something native foobar future proof.

NOTE: We would like to avoid Column UI. We build everything UI here with native foobar interface, facets and simple playlist. But we are not scared to write complex code and have experience in extending applications with some custom code, if needed.

Re: Internal linking/referencing with custom Foobar synthax?

Reply #1
Maybe a textlink component is worth another discussion? Similar to HTML "mailto:" and "http://" or the "goto:" in other scripting languages? So we could add funtional synthax declaring the type of clickable link:

  • mailto: mail the content declared in the function via system default email application.
  • http:// | https:// use content declared in the function to open as webadress in default browser.
  • filter: use content declared in function to create a new filtered playlist.
  • goto: use content declared in function to simply jump to another song.

Sub parts of each function:
  • mailto: has subject and body to fill with %content%.
  • http(s): has urlencode of %content% to build a link or google search.
  • filter: has functionality to fill in the filter or search of foobar to create a new view or playlist.
  • goto: has functionality to decide which priority declares the jump the next closest song.

Apart from this spontaneous thoughts I still would like to know if there is a workaround to achieve parts of it natively already.

Re: Internal linking/referencing with custom Foobar synthax?

Reply #2
EDIT: (Cannot edit the start post OT no more) I wrote "to not use Columns UI" but if it is required and the only option to get there, so please let me know...

Re: Internal linking/referencing with custom Foobar synthax?

Reply #3
I wonder if there is any way to turn text into links one way or the other just to know if possible.

[...]

NOTE: We would like to avoid Column UI. We build everything UI here with native foobar interface, facets and simple playlist. But we are not scared to write complex code and have experience in extending applications with some custom code, if needed.

As far as I know there are only two components which allow you to create custom text buttons: panel stack splitter and spider monkey panel.
The first one is easier to learn, because it uses a sort of titleformatting, but it requires columns UI and it has many limitations because the code basically works only within panel stack splitter panels.
The best way to go is spider monkey panel, which is much more powerful, but also harder to learn if you are new to javascript.
That said, your work will not be limited to coding the hyperlink button, but likely the whole configuration will have to be rearranged accordingly.
I'm late

Re: Internal linking/referencing with custom Foobar synthax?

Reply #4
@davideleo Thanks for your fast reply and careful layed out thoughts and details on this! Yeah, that makes absolutely sense. If CUI is required than we'll fit our requirements for it of course. No dealbreaker. And, yes, I assumed it will become more than on step to get close. So, your options are very good pointed out. We are not scared to touch JS since we use it already on different spots of our media management several audio/video editing suites, but we surely would love to avoid it as often as possible since code needs to be maintained. This is time consuming and can come back frequently when components using the code change over the time.

I will take a closer look to the panel stack splitter options you have mentioned. It seems we have overseen something there.

Thanks a million! That was very helpful! Have a nice weekend.

Re: Internal linking/referencing with custom Foobar synthax?

Reply #5
We are not scared to touch JS since we use it already on different spots of our media management several audio/video editing suites, but we surely would love to avoid it as often as possible since code needs to be maintained. This is time consuming and can come back frequently when components using the code change over the time.

I will take a closer look to the panel stack splitter options you have mentioned. It seems we have overseen something there.

If you are familiar with javascript already, I'd go for the spider monkey panel. Code maintenance is not really an issue if you use your own scripts. Panel stack splitter is not nearly as powerful, the only advantage it has over spider monkey panel is that it works as a UI, therefore it can contain all sorts of foobar2000 panels, including spider monkey, which is why most often the two components are combined.
I'm late

Re: Internal linking/referencing with custom Foobar synthax?

Reply #6
To get you started in SMP, have a look at properties.js script in the 'samples/complete' folder. It somewhat replicates the Selection Properties DUI element, but every value is clickable to create a filtered auto-playlist.

(Not that I have any idea how it works mind you, most the action seems to takes place in list.js and deciphering that is beyond me! :D )

Of course a new component, or new title formatting $link function that works throughout foobar, would be ideal. ;) Incidentally, the three foo_textdisplay commands do still work for me, at least in my limited testing, including http: and mailto: links, and the odd menu command -

Code: [Select]
$if(%path%,$cmdlink(Next Track,main_next))$crlf()
$if(%artist%,$doclink(Discogs,'https://www.discogs.com/en/search/?q='$urlencode(%artist%)))$crlf()
$if(%album%,$doclink(Email,'mailto:someone@somewhere.com?subject='$urlencode(%album%)))$crlf()

Cheers

Re: Internal linking/referencing with custom Foobar synthax?

Reply #7
Thank you so much, @davideleo and @anamorphic - very kind of you. We will take a look into it (both). With SMP we already worked a lil' bit before and tweaked the library cover view to our needs, but felt it was a kinda performance hit. But that's rather the covers fault, not JS. I will also take a look for how it can be cached somehow.

Panel stack splitter is not nearly as powerful, the only advantage it has over spider monkey panel is that it works as a UI, therefore it can contain all sorts of foobar2000 panels, including spider monkey, which is why most often the two components are combined.

That's an interesting approach. Thanks for pointing me to this combination!

Of course a new component, or new title formatting $link function that works throughout foobar, would be ideal. ;)

Well, since foo_textdisplay last version is from 2011 we should start discussion about a newer implementation. But time will tell. If I hit this border frequently enough I will maybe start to think about it. :-)

Incidentally, the three foo_textdisplay commands do still work for me, at least in my limited testing, including http: and mailto: links, and the odd menu command

That's interesting! o.Ô ... Non of the commands have worked here and only printed [APPLINK] or [UNKNOWN FUNCTION] on the end as a result ... :/ But we didn't tested it deeply to be honest. Maybe I should test more around with it. But I think SMP would be the best future proof method to go for finally after all.



Re: Internal linking/referencing with custom Foobar synthax?

Reply #10
^ Hahah, you can have the +1  :D

That's interesting! o.Ô ... Non of the commands have worked here and only printed [APPLINK] or [UNKNOWN FUNCTION] on the end as a result ... :/

Re: foo_textdisplay
It seems picky about the syntax. I did get $applink to work as well, but could not get (Win10) explorer.exe to open to the music folder for some reason. (Oh well, no matter)

Cheers

Re: Internal linking/referencing with custom Foobar synthax?

Reply #11
Ooops! ... *facepalm* -.- sorry.   But I think you both deserve even more +1's than only one :-) Thank you so much you both for all the help on this. Apart from the fact that I have more than one work around for now, I will further think about the feature request I mentioned in the 2nd comment when I have somemore free time.

Have a wonderful Sunday evening!

Re: Internal linking/referencing with custom Foobar synthax?

Reply #12
Does it need to be in the form of buttons?

Also, if you've given up on the Default User Interface and decided to go with a ColumnsUI solution afterall (although I can understand wanting to stick to DUI, it definitely has its advantages over CUI) then there actually is a ColumnsUI component that has the option to show tracks based on what is currently playing, it's named Library Tree (not to be confused with the script component from WillB).  and you find it here http://foo2k.chottu.net/#csp
(page is in Chinese, but component names are in plain English so it's easy to spot.)

It's an album list like component in that it shows 4 branches (Library, Active Playlist, Playlists and Auto Playlists)
It can be linked to its own dedicated playlist view so you can maintain the selection in your current active playlist/view

it has a function $nowplaying{} (Note: it actually uses accolades instead of parenthesis to enclose the argument) which you can use to create filters in either the Library branch or Active Playlist branch to show matching tracks

a few examples:
%title% IS $nowplaying{%title%} AND NOT %artist% IS $nowplaying{%artist%} = Same Title excluding currently playing version
%artist% IS $nowplaying{%artist%} AND NOT %title% IS $nowplaying{%title%} = Same Artist excluding currently playing version
%title% IS $nowplaying{%title%} AND %artist% IS $nowplaying{%artist%} AND NOT %filename% IS $nowplaying{%filename%} = Same Title and Artist excluding the currently playing version
etc.
of course you could also drop the AND NOT parts if you do want to include the currently playing version but that's just personal preference.

Since you can use the standard title formatting syntax, you can customize filters and how the result is shown pretty much to whatever you want.

Sadly never found something similar for DUI

 
SimplePortal 1.0.0 RC1 © 2008-2020