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: Titleformatting help—display custom results in Columns UI Filter panel (Read 10968 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Titleformatting help—display custom results in Columns UI Filter panel

Title-Formatting help needed - display custom results in a "Columns UI" Filter panel.

In my previous post, I showed a method of storing multiple metadata sections in the %comments% tag of a CUE sheet by creating pseudo-tags (using < and > as delimiters).
Here is the example I posted before:
Code: [Select]
<COMPOSER>> Bach; Mozart; Brahms / <PERFORMER> Jascha Heifetz; Erick Friedman; William Primrose; Gregor Piatgorsky; New Symphony Orchestra of London; RCA Victor Symphony Orchestra; Malcolm Sargent; Izler Solomon; Alfred Wallenstein / <MEDIA> CD Audio (Hybrid SACD) - 2006 - Sony BMG / <RIP> Software: ExactAudioCopy v0.99pb4 (July 2009) / <DISCID> 7710AC09


This "scheme" becomes VERY useful if I can find a way to extract selected "string sections" from the %comments% tag.

So, for example, I would like to display all the text after the pseudo-tag <MEDIA> (and ignore the <COMPOSER>, <PERFORMER> sections).

If I go to: "foobar2000 preferences > Columns UI > Filter (tab)" , I would like to do this...

Create a new "Field" and name it:   Artist - Album - Date - <MEDIA>

Create a title-formatting script for the new "Field",   like this example:
Code: [Select]
%artist% - %album% - %date% - ?????

Yes, I put the question marks there, because I can't solve it. Whatever script I have tried has failed !

I thought I had found a solution after reading this:
Code: [Select]
http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Titleformat_Examples

Foobar2000:Titleformat Examples - Hydrogenaudio Knowledgebase:

Examples of general title format usage. Can be useful in Masstager or other components.
Please make sure you rejoin scripts that have been split into multiple lines, before pasting them...
...
...
...
NOTE: In the next few strings I have decided to make it possible to define the %tag% that should be edited and the character or string that is used to determine where to trunctuate as variables in the beginning of the string as $puts(tag,%tag%), $puts(char,X), etc. Basically the reason I have done this is to make it simpler to edit these strings, to what you exactly want them to do at the very moment, in the rather narrow masstager input field. That way it is possible to enter the needed tags and characters only once in the beginning of the line. Again simply replace %tag% and X by the desired values. Also all of these strings will trim off the trailing and leading spaces of the output (in case there are any).
...
...
...
Finds first occurence of string XYZ in %tag% field and returns everything after XYZ:
---------------------------------------------
$puts(string,XYZ)$puts(tag,%tag%)
$puts(spacer,$strstr($get(tag),$get(string)))
$trim($right($get(tag),$sub($len($get(tag)),
$add($get(spacer),$len($get(string))))))
---------------------------------------------
Example: blah XYZ bleh returns bleh


That example code did not work !!

I really would love to solve this, because it would help me manage a complex library of (CUE+IMAGE) files using the foobar2000 interface.
If anbody here is a title formatting guru, please leave a reply, it would be really helpful.

Thanks for reading.

Titleformatting help—display custom results in Columns UI Filter panel

Reply #1
YES !! I got it to work.

I now have (another) custom field for my "Columns UI" Filter panel, especially useful for extracting maximum information from .CUE sheets .

Here is the code for the Field of the "Columns UI" Filter panel:
Code: [Select]
$if2(%artist%,<Artist>) — $if2(%date%,<Date>) — $if2(%album%,<Album>) $trim($if($strstr(%comment%,<MEDIA>),— $right(%comment%,$sub($len(%comment%),$add($strstr(%comment%,<MEDIA>),$len(<MEDIA>),))))))


And here is a screenshot of how it presents itself to me in foobar2000:



By the way, if anybody is curious... I have 70 different "Columns UI" Filter Fields !! ...(now 71)
I access them by right clicking on the grey header section just below the "Filter Results" tab (see the screenshot).


I would also like to thank the author of the page at "Foobar2000:Titleformat Examples - Hydrogenaudio Knowledgebase".
It did help in the end (with a bit of head scratching from me).

______________________________________________________________________________

P.S. -- There is one last field I want to create... The "Filter Field" I just created above grabs all text to the right of a specified string (aka "Pseudo-Tag").
I also want to make a "Filter Field" that grabs all text BETWEEN two "Pseudo-Tags". Anybody here got some code to share (or I guess I'll scratch my head for a few more hours :-).

P.S.S -- For a larger overview of this topic and CUE+IMAGE manipulation in general, I would suggest you read another thread at HA forums where I have also left a few "previous" posts:
Code: [Select]
http://www.hydrogenaudio.org/forums/index.php?showtopic=88932

Titleformatting help—display custom results in Columns UI Filter panel

Reply #2
Can somebody here please confirm if I am blind please...

I am trying to use this page as a reference:
Code: [Select]
http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Titleformat_Examples


and a lot of the code written on that page does not work, and in places, the code for different functions looks EXACTLY THE SAME !
have a look at these two codes and tell where they are different (I believe they are not different).
Code: [Select]
------------------------------ code 1 -------------------------------------------------------
// -- Finds first occurence of character X in %tag% and returns everything in front of X
// -- Example: blah X bleh or blah X bleh X bluh returns blah

$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strchr($get(tag),$get(char)))$trim($left($get(tag),$sub($get(spacer),1)))


------------------------------ code 2 -------------------------------------------------------
// -- Finds last occurence of character X in %tag% and returns everything in front of X
// -- Example: blah X bleh returns blah and blah X bleh X bluh returns blah X ble

$puts(char,X)$puts(tag,%tag%)$puts(spacer,$strrchr($get(tag),$get(char)))$trim($left($get(tag),$sub($get(spacer),1)))


UPDATE: -- I'm sorry, there is a difference, I just noticed $strchr and $strrchr are not the same.
But still, the codes on that page seem simple enough, but they don't seem to create functional output.
Have any of you guys managed to use the code examples from that page (without modification) in working scripts ?

Titleformatting help—display custom results in Columns UI Filter panel

Reply #3
Title Formatting Reference

Your two example can be written shorter:
$left(%tag%,$sub($strchr(%tag%,X),1))
$left(%tag%,$sub($strrchr(%tag%,X),1))

Optionally apply $trim(...).

Titleformatting help—display custom results in Columns UI Filter panel

Reply #4
@herojoker, thanks a lot. Your reply gave me food for thought +++

So, my next "Field" for the "Filter Panel" is this:

LOSSLESS:   Artist   [<COMPOSER>   <PERFORMER>]
Code: [Select]
// ---------------------------------------------------------------------------------------------------------------
// Display only Lossless files, and list: Artist(tag) and <COMPOSER>(pseudo-tag) and <PERFORMER>(pseudo-tag) .
// --------- Find first occurence of string <MEDIA> in %comment% tag and return everything before <MEDIA>
// --------- and If <MEDIA> tag is missing, do not display anything from the %comment% tag .
// -------------- $char(8195) = Unicode space, extra wide --- see: http://en.wikipedia.org/wiki/Space_%28punctuation%29

$if($stricmp($info(encoding),lossless),$if2(%album artist%,<Artist>)$if($strstr(%comment%,<MEDIA>),$char(8195)$left(%comment%,$sub($strstr(%comment%,<MEDIA>),1)),))


I must admit, I'm still flying off the seat of my pants here :-)
I'm trying to understand how the number 1 is modifying the code overall and in $sub

@herojoker, would you like to show me some sample code which will grab all text between two pseudo-tags?
for example all text between <PERFORMER> and <MEDIA>, in effect trying to output only the <PERFORMER> section (of the %comment% tag).

Titleformatting help—display custom results in Columns UI Filter panel

Reply #5
Here is a collection of Filter Panel Fields:

(Note: You may want to remove the color codes ($RGB...); In my CUI Filter panel, I'm rendering the text  in white over a dark brown background).
(Note: The code "$char(8195)" is "Unicode space, extra wide" --- see: _http://en.wikipedia.org/wiki/Space_%28punctuation%29

User Stats — Artist-Track
Code: [Select]
$char(8195)$rgb(255,255,41)$if($stricmp($date(%last_played%),),<NO_DATE>,$date(%last_played%)) $time(%last_played%) $char(8195) %artist%' ' ' '—' ' ' '%title% $char(8195)$char(8195) '(' $if($ext($if3(%__referenced_file%,%filename_ext%)),'.'$lower($ext($if3(%__referenced_file%,%filename_ext%))),$if($stricmp(%codec%,'mp3'),'.mp3',)) ')'


User Stats — Directory
Code: [Select]
$char(8195)$rgb(255,255,41)$if($stricmp($date(%last_played%),),<NO_DATE>,$date(%last_played%)) $char(8195) $directory_path(%path%) $char(8195)$char(8195)$char(8195) '(' $if($ext($if3(%__referenced_file%,%filename_ext%)),'.'$lower($ext($if3(%__referenced_file%,%filename_ext%))),$if($stricmp(%codec%,'mp3'),'.mp3',)) ')'


User Stats — Play Count
Code: [Select]
$char(8195)$rgb(255,255,41)%play_count%


User Stats — Ratings
Code: [Select]
$char(8195)$rgb(255,255,41)$puts(rating,' ♦ ' )$if(%rating%,$repeat($get(rating),$ifgreater(%rating%,5,5,%rating%)),$ifgreater($div(%play_count%,10),4,,$repeat($get(rating),$div($mod(%play_count%,10),5)))$repeat($get(rating),$min($div(%play_count%,10),5)))


Library Stats — File Types and Encoding Qualities  (lossy or lossless)
Code: [Select]
$rgb(255,255,41)$padcut('.'$ext(%path%),12)$padcut($if($ext($if3(%__referenced_file%,%filename_ext%)),$UPPER($ext($if3(%__referenced_file%,%filename_ext%))),$if($stricmp(%codec%,'mp3'),'.mp3',)),12)$rgb(255,255,255)$pad($directory_path(%path%),20)' ' —————— ' '$rgb(25,255,41)$padcut($info(encoding),12)$padcut('('[%codec%]$if(%bitrate%, %bitrate% Kbs,)$if(%__extrainfo%, VBR,)$if(%codec_profile%, %codec_profile%,)')',35)))


Library Stats — File Type [.CUE] exists in directory
Code: [Select]
$rgb(255,255,41)$ifequal($stricmp($ext(%path%),cue),1,$directory_path(%path%),)


Library Stats — Length of Time  (of files)
Code: [Select]
$char(8195)$rgb(255,255,41)$left('00:00:00',$sub(8,$len(%length%)))%length%


Library Stats — ReplayGain status  (of files)
Code: [Select]
$char(8195)$if(%__replaygain_album_gain%,$if(%__replaygain_album_gain%,$rgb(0,153,0)YES - AlbumGain is applied to these tracks,$rgb(204,51,0)AlbumGain = NO),$if(%__replaygain_track_gain%,$rgb(0,153,0)YES - TrackGain only is applied to these tracks,$rgb(204,51,0)NO - These tracks have no ReplayGain applied)))


Library Stats — Size of Files  (in Mb)
Code: [Select]
$char(8195)$rgb(255,255,41)$if($strstr([$upper($ext(%path%))],CUE),CUE,$div(%filesize%,1048576)'.'$substr($muldiv(%filesize%,100,1048576),2,3)' Mb'))


Library Stats — Technical Profile  (of files)
Code: [Select]
$char(8195)$rgb(255,255,41)%__channels% $ifgreater(%__channels%,1,'Channels','Channel') $char(8195) %codec% $char(8195) %samplerate%' Hz' $char(8195) $if($stricmp(%codec%,'mp3'),$caps(%__mp3_stereo_mode%),$if($stricmp(%codec%,'Musepack'),$replace(%__codec_profile%,'',),$if($stricmp(%codec%,'Vorbis'),,$if($stricmp(%codec%,'Monkey'$char(39)'s Audio'),%__codec_profile% %__bitspersample%' Bits',$if($stricmp(%codec%,'FLAC'),%__bitspersample%' Bits',$if($stricmp(%codec%,'Windows Media Audio v7/v8'),,$if($stricmp(%codec%,'Windows Media Audio V9 (Lossless Mode)'),,$if($stricmp(%codec%,'PCM'),%__bitspersample%' Bits',$if($stricmp(%codec%,'ATSC A/52'),)))))))))


TAG String Exists: Artist Name — [RED=NO] [GREEN=YES]
Code: [Select]
$if($meta(artist),$rgb(0,255,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%,$rgb(255,0,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%)


TAG String Exists: Track Title — [RED=NO] [GREEN=YES]
Code: [Select]
$if($meta(title),$rgb(0,255,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%,$rgb(255,0,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%)


TAG String Exists: Album Title — [RED=NO] [GREEN=YES]
Code: [Select]
$if($meta(album),$rgb(0,255,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%,$rgb(255,0,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%)


TAG String Exists: Date — [RED=NO] [GREEN=YES]
Code: [Select]
$if($meta(date),$rgb(0,255,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%,$rgb(255,0,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%)


TAG String Exists: Album Artist — [RED=NO] [GREEN=YES]
Code: [Select]
$if($meta(album artist),$rgb(0,255,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%,$rgb(255,0,0)$puts(va_string,'VA')$if($stricmp($meta(va),'1'),$puts(va,1))$if($stricmp($meta(various),'1'),$puts(va,1))$if($stricmp($meta(various artists),'1'),$puts(va,1))$if($stricmp($meta(album artist),'va'),$puts(va,1))$if($stricmp($meta(album artist),'various'),$puts(va,1))$if($stricmp($meta(album artist),'various artists'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va-'),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va '),$puts(va,1))$if($stricmp($left(%directoryname%,3),'va_'),$puts(va,1))$if($strstr($lower(%path%),'\va\'),$puts(va,1))$if($strstr($lower(%path%),'\various\'),$puts(va,1))$if($strstr($lower(%path%),'\various artists\'),$puts(va,1))$if($strstr($lower(%path%),'\_va\'),$puts(va,1))$if($strstr($lower(%path%),'\_various\'),$puts(va,1))$if($strstr($lower(%path%),'\_various artists\'),$puts(va,1))$if(%tracknumber%,$if(%album%,$if($stricmp($get(va),1),$get(va_string),$upper($if2($meta(album artist),%artist%)) ) ['   ?   '%date%]['   ?   '%album%], $replace(%path%,%filename_ext%,)), $replace(%path%,%filename_ext%,)) [%totaldiscs%'CD']' ' ' ' ' ' ' ' '|||' ' ' ' ' ' ' ' '%path%)

Titleformatting help—display custom results in Columns UI Filter panel

Reply #6
Assuming a text accessible via %someTag% contains the strings "<coolTag>" and "<blaTag>", in this order, you can get everything between them (e.g. "xyz" from <coolTag>xyz<blaTag>) by the following code:

$substr(%someTag%,$add($strstr(%someTag%,<coolTag>),$len(<coolTag>)),$sub($strstr(%someTag%,<blaTag>),1))

What does it do?
$substr(%someTag%,X,Y)
yields everything of %someTag% from the Xth character to the Yth character

In this case we have:

X = $add($strstr(%someTag%,<coolTag>),$len(<coolTag>))
i.e. the position of <coolTag> in %someTag% plus the length of the word "<coolTag>"

Y = $sub($strstr(%someTag%,<blaTag>),1)
i.e. the position of <blaTag> in %someTag% minus one; omitting to subtract 1 would later yield "<" as last character (the first character of "<blaTag">) in the cut out string

Titleformatting help—display custom results in Columns UI Filter panel

Reply #7
@herojoker, a superb answer; highly educational ++++ . That answer deserves to be appended to "HA Titleformatting examples" page !

So, with that knowledge, I have (possibly) found the  final "Filter Field" I need to manage and present complex information using foobar2000 and Columns UI.


LOSSLESS:    Artist    [<PERFORMER> (pseudo-tag)]
//    Assuming we have strings (and pseudo-tags):  "<COMPOSER> AAA <PERFORMER> BBB <MEDIA> CCC <RIP>"  in that order, placed in the %comment% tag,
//    display only Lossless files, and list:  "Artist (tag)" and "BBB" (i.e. <PERFORMER> pseudo-tag),
//    and if "<PERFORMER> pseudo-tag" does not exist, do not display anything from the %comment% tag .
//    NOTE: $char(8195) = Unicode space, extra wide --- see: _http://en.wikipedia.org/wiki/Space_%28punctuation%29
Code: [Select]
$if($stricmp($info(encoding),lossless),$if2(%album artist%,<Artist>)$if($strstr(%comment%,<PERFORMER>),$char(8195)<PERFORMER> $substr(%comment%,$add($strstr(%comment%,<PERFORMER>),$len(<PERFORMER>)),$sub($strstr(%comment%,<MEDIA>),1)),))

Titleformatting help—display custom results in Columns UI Filter panel

Reply #8
@herojoker, a superb answer; highly educational ++++ . That answer deserves to be appended to "HA Titleformatting examples" page !
Sure, why not? I have done that, and I have also considerably improved its wiki markup, which left a lot to be desired. I strongly encourage any users with what they think are useful examples to create an account and to contribute, as with any page that they feel able to improve (or create if it does not yet exist).

Re: Titleformatting help—display custom results in Columns UI Filter panel

Reply #9
Hi, please help me with filter format.
In Filter Album some times have 2 and more albums with same "album name" and same "artist". I want to create filter with count of same albums. If exist more than one albums with same name filter return like > "album name" [amount of same named albums], If albums has no "twins" displayed normally like  > "album name"
Thanks in advance...
PEACE, Me.

Re: Titleformatting help—display custom results in Columns UI Filter panel

Reply #10
Hi, please help me with filter format.
In Filter Album some times have 2 and more albums with same "album name" and same "artist". I want to create filter with count of same albums. If exist more than one albums with same name filter return like > "album name" [amount of same named albums], If albums has no "twins" displayed normally like  > "album name"
Thanks in advance...
No body help? Too complicated? Impossible?
PEACE, Me.



Re: Titleformatting help—display custom results in Columns UI Filter panel

Reply #13
%path% is unique to each track. Perhaps you're thinking of $directory_path(%path%) which is the full path to the containing folder? Do you really want to display that inside a filter panel?

Re: Titleformatting help—display custom results in Columns UI Filter panel

Reply #14
%path% is unique to each track. Perhaps you're thinking of $directory_path(%path%) which is the full path to the containing folder? Do you really want to display that inside a filter panel?
Paths in panel? No, really don't want :) ....Marc, I'm not a programmer. Why is problem to do the filter?
If two same "albums name" exist, but them has a different "directory path" count it how much...
Other things, in my media library for tagging used just ".CUE" files, all metadata from files completely removed. May be it helps?
PEACE, Me.

Re: Titleformatting help—display custom results in Columns UI Filter panel

Reply #15
Repeating the question isn't going to change the answer.

Re: Titleformatting help—display custom results in Columns UI Filter panel

Reply #16
If exist more than one albums with same name filter return like > "album name" [amount of same named albums], If albums has no "twins" displayed normally like  > "album name"
You can display number of (sub)items using foo_facets, but it is for Default UI only (you can only view it in a separate popup window when using Columns UI). CUI Filter panel has no such option and you can't do much about it.

Re: Titleformatting help—display custom results in Columns UI Filter panel

Reply #17
Repeating the question isn't going to change the answer.
Inability to explain causes repetition of the question.

You can display number of (sub)items using foo_facets, but it is for Default UI only (you can only view it in a separate popup window when using Columns UI). CUI Filter panel has no such option and you can't do much about it.
Thank you VERY MUCH!
PEACE, Me.