Author Topic: Conditional fields  (Read 1329 times)

late

  • Full Member
  • ***
  • Posts: 133
Basically how can I show in track information that file X is a 24/16bit file when applicable, and then only show <Kind> for tracks that do not have bit depth information (MP3 vs FLAC for example)?

I believe it is possible since I've seen (long ago) someone scripting something that used track data to output different data depending on the track properties.

At the moment I have a simple "<Bit Depth> bit <Kind>" string that outputs "24/16 bit FLAC audio file" for example.  However the few MP3's I have are outputted as " bit MPEG audio file". This is a minor nuisance at best, but I'd like to see how I can code the "<Bit Depth> bit " part of the script only show up for FLAC files.

Thanks in advance.

psychoadept

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 10690
You will probably find this page helpful: https://musicbee.wikia.com/wiki/Functions

Off the top of my head, it sounds like you need to use $IsNull(<Bit Depth>,etc,etc).
MusicBee Wiki
Use & improve MusicBee's documentation!

Latest beta patch (3.5)
(Unzip and overwrite existing program files)

frankz

  • Sr. Member
  • ****
  • Posts: 3876
This is how I display "Last Played" and "Play Count"  For "Last Played," it shows the last played date or "Never" if it's never been played.  For "Play Count" it shows the count if it's greater than zero and doesn't show up if it's zero.

You could do something similar, obviously, with any field.

Played:$If(<Last Played>="Unknown"," Never"," "<Last Played>" "$If(<Play Count>>0," ("<Play Count>"x)",))

The functions Wiki page referenced above describes all these useful things.

late

  • Full Member
  • ***
  • Posts: 133
Thanks a lot, it was as easy as "$IsNull(<Bit Depth>,<Kind>,<Bit Depth> bit <Kind>)"

Though I have only tested it with MP3 and FLAC files.