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: Help with formatting strings (Read 2018 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Help with formatting strings

I've just begun using Columns UI and formatting strings to change fb2k's appearance. There are plenty of formatting strings (both for Columns UI and the default UI) that look great when using playlists which contain full ablums. However, these strings make a playlist which contains a mix of songs from all over the place look like a mess. The playlist becomes both unattractive and less useful.

Is there any way to apply a different formatting string on playlists which do not contain full albums? This seems like an issue that might have been discussed before, since it seems quite obvious, but I couldn't find anything in the search.

Help with formatting strings

Reply #1
On a playlist basis, you can add e.g. -s- to the start of the playlist name and use it as a condition in the formatting. At least that's what I decided to use as an indicator...

An example from my global string for Columns UI:
Code: [Select]
// --SINGLETRACK--DECISION  ---------------------------------------------------------------------
$if(%singletrack%,$puts(is_single,1),
$if($stricmp($left(%_playlist_name%,3),'-s-'),$puts(is_single,1),
$if($stricmp($right(%_directoryname%,3),'=s='),$puts(is_single,1),
$if($strstr(%_directoryname%,'=SINGLES='),$puts(is_single,1),
))))

This code will format a track as a single (not as a part of an album) if one or more of the following conditions are met:
1) %singletrack% tag is present
2) playlist name starts with -s-
3) directory name ends with  =s=
4) directory name is  =SINGLES=

Note:
The use of $puts() here is because I want to be able to use is_single in the rest of the global string, before turning it into a real global variable with:
Code: [Select]
$if($strcmp($get(is_single),1),is_single=1,)
E]

1), 2) and 3) are also the conditions I use to format single tracks in mixed playlists (a combination of single tracks and complete albums in the same playlist). But, such single tracks are always treated as singles, so if I want to create a playlist with tracks form different albums, I do it in a playlist that starts with -s-
This forces every track to show artist and title info (and more).

Edit: Can a moderator please have a look at the E] after the last code block? For some strange reason it is undeleable. 

Help with formatting strings

Reply #2
Thanks, but I'm afraid I don't quite get it entirely.

Do I put the contents of both code block anywhere in Display > Columns UI >  Globals > Variables?

Where would I put the formatting string that would apply to these single tracks?

Edit: Well, I just found out that gummy supports single playlists, so I guess I'll just use that.

 

Help with formatting strings

Reply #3
upNorth: Here's how I do it (in Columns UI too)
Basically it's just the same as your code, but more configurable. I know it should be cleaned up, but I haven't got any interest in it as it already works well

Code: [Select]
// formatting mode | 1 = album/single, 0 = single
$puts(formatting_mode,1)

// single mode indicators
$puts(single0,$puts(genre,$strstr($upper(%genre%),$upper(%_playlist_name%)))$substr(%genre%,$get(genre),$sub($add($len(%_playlist_name%),$get(genre)),1)))
$puts(single1,'favs')
$puts(single2,'temp')
$puts(single3,'top')
$puts(single4,'rare')
$puts(single5,'New playlist')
$puts(single6,'random')
$puts(single7,'recent')

// check if forced singlemode
$if($strstr($upper(%_playlist_name%),$upper($get(single0))),$puts(formatting_mode,0))
$if($strstr($upper(%_playlist_name%),$upper($get(single1))),$puts(formatting_mode,0))
$if($strstr($upper(%_playlist_name%),$upper($get(single2))),$puts(formatting_mode,0))
$if($strstr($upper(%_playlist_name%),$upper($get(single3))),$puts(formatting_mode,0))
$if($strstr($upper(%_playlist_name%),$upper($get(single4))),$puts(formatting_mode,0))
$if($strstr($upper(%_playlist_name%),$upper($get(single5))),$puts(formatting_mode,0))
$if($strstr($upper(%_playlist_name%),$upper($get(single6))),$puts(formatting_mode,0))
$if($strstr($upper(%_playlist_name%),$upper($get(single7))),$puts(formatting_mode,0))

// set the variable
formatting_mode=$get(formatting_mode)