Hydrogen audio fcs

Picmixer created the .fcs, and Lyx helped him to do the smart "walker" trick, The original .fcs could be found here: Related topic foo_ui_columns configurations, official thread
It is essentially an album mode, (but hybrid in fact). What is really interesting is that depending on the existing tag fields, the length of the information given about an album changes (See above). Quite simple idea, but really nice feature. The idea came from picmixer and was modded to be smarter by Lyx.

Global tab/Variables

Let's see how picmixer (and Lyx) did that trick. For the definition of colours, it's quite common, I let you discover it by yourself. Then, for the Artist column it creates a variable that will be shown in the album column..

It uses a new additional variable: "walker" to display the fields only if they exists, as a consequence, it doesn't waste any line. It is what we could call a recursive process. It does exactly the same thing for each field but the line where the field is displayed depends on what did the script before.

Image //////////////////////
///Artist Column///

$select(%tracknumber%,%album artist%,%album%)
$if(%disc%,$select($sub(%tracknumber%,$get(walker)),Disc %disc%)
$codec()$char(9)$if2(%__replaygain_album_gain%,X.XX dB))
Image Image
You can improve the code for your needs
  • adding something like (before the //CODEC part):
    Image // NEW FIELD TO ADD
    $if(%FIELD TO ADD%,$select($sub(%tracknumber%,$get(walker)),
    Image Image
  • Suppressing information that you don't want. (for example, I don't want to know the discnumber of an album).
    Warning !! Rather than really deleting the code, just put "//" before the corresponding part. If you ever change your mind, it will be easier to recover the code unused!!

Tracknumber column

Another interesting trick about colors. It just hides padding "0" before the tracknumber for tracknumber before 10 giving them the background color. And by the way it makes something nice for first tracks.
Image $if(%isplaying%,
//Color transition for the playing file
//for tracks greater than 9, he does nothing
//else it uses the function replace to give the background color to padding "0"
Image Image

Title column

Another nice thing about colors. (I simplified it a bit to make things more clear.)
Image %title%
//If for example if it is a Various artist album.
//The artist of the track is added but with another color to make it more visible

$if(%track artist%,$get_global(text_faint_2)- %track artist%)
Image Image

Artist column

There it only gets the variable "artist" created in the Global tab.
Image $if($get_global(is_single),
//if the file is a single track, it displays only the album artist
[%album artist%],
//else it gets the artist variable created in Global/variable
Image Image
And for colors. the "walker" variable is quite interesting
Image $set_style(back,$ifequal(%track%,1,
//Background color for the first line
//here it checks if the tracknumber is greater than walker
//if it's greater a color
//if not, another one
Image Image

Previous page


August 30 2007 02:10:47.