Author Topic: Change scale for size column, remove "khz" & "k" from bit/sample rate column.  (Read 1740 times)

mrbenn

  • Full Member
  • ***
  • Posts: 168
I try and squeeze as many columns in on one screen when browsing in track view, and the "khz" and "k" seem a bit redundant to me. Is there / could there be a way to just show "96" or "44.1" or "320" as numbers in the column.

Also, same question for showing the file size in kilobytes as an option.

I know I can shrink the column more, but the ... pops up and eats up almost as much space.


Thanks

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
I believe you'll have to make a Virtual Tag for this.

Code
$IsNull(<Sample Rate>,,$RxReplace(<Sample Rate>,"khz|k","")

mrbenn

  • Full Member
  • ***
  • Posts: 168
MB didn't take it as posted, but it worked with

Code
$RxReplace(<TAG_TO_CHANGE>,"TEXT_TO_REMOVE","")

in the virtual tag formula box.


thanks for your help!

hiccup

  • Sr. Member
  • ****
  • Posts: 7856
The Incredible Boom Boom's formula would work better in case there is no data available from the source tag.
(it only didn't work because parentheses work in pairs, and so there should be an additional closing one at the end of the formula)

Another approach could be this:

Code
$RxReplace(<Sample Rate>,"([a-z])","")

It will strip all alphabetic characters, so you won't have to add specific exceptions. (such as VBR, if you would use this on bitrate)

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
The Incredible Boom Boom's formula would work better in case there is no data available from the source tag.
(it only didn't work because parentheses work in pairs, and so there should be an additional closing one at the end of the formula)

Another approach could be this:

Code
$RxReplace(<Sample Rate>,"([a-z])","")

It will strip all alphabetic characters, so you won't have to add specific exceptions. (such as VBR, if you would use this on bitrate)

Oops, that's correct, I missed the last parentheses.

Also, yes, a little modification of @hiccup's $RxReplace formula would be best to get rid of all alphabetical characters.

Code
$RxReplace(<Sample Rate>,"([A-Za-z])","")

hiccup

  • Sr. Member
  • ****
  • Posts: 7856
Also, yes, a little modification of @hiccup's $RxReplace formula would be best to get rid of all alphabetical characters.
Code
$RxReplace(<Sample Rate>,"([A-Za-z])","")

That modification is not needed.
Just try out my formula, it works fine on e.g. both kHz and VBR.

Not sure why it does though, technically the additional A-Z should be necessary, but it looks like MusicBee is case insensitive here.
(bug or feature....?)


The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1269
Not sure why it does though, technically the additional A-Z should be necessary, but it looks like MusicBee is case insensitive here.
(bug or feature....?)

Hmmm I wonder if this is why I've had expressions that work elsewhere not work in MusicBee. I can't remember any specific examples now, but I'll keep it in mind for the future.

hiccup

  • Sr. Member
  • ****
  • Posts: 7856
Not sure why it does though, technically the additional A-Z should be necessary, but it looks like MusicBee is case insensitive here.
(bug or feature....?)

Hmmm I wonder if this is why I've had expressions that work elsewhere not work in MusicBee. I can't remember any specific examples now, but I'll keep it in mind for the future.

I only noticed it trying out this specific solution.
Regex is more of an enemy than a friend of mine.
So if you or anybody else is able to deduct some off-standard behaviour, it would probably be good to specify and report it.

hiccup

  • Sr. Member
  • ****
  • Posts: 7856
So if you or anybody else is able to deduct some off-standard behaviour, it would probably be good to specify and report it.

Ah, f-it.
Being in some rowdy mood I reported this as a bug.
https://getmusicbee.com/forum/index.php?topic=33622.msg183747#msg183747