HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: Jalan on 2011-03-18 11:46:09

Title: Omitting colons, semi-colons and the like
Post by: Jalan on 2011-03-18 11:46:09
So I make use of %discnumber%: for multi-disc sets. In some cases I've needed to account for subtitles/etc. (not sure of the proper term) so I took to using %discsubtitle%: (value) and in the cases of bonus discs %bonusdisctitle%: (value) keeping in mind to account for whether the fields are present or not. Unfortunately, for the all the thought put in I seem to have neglected the eventuality that a field would be used while the other two would be left out (or a combination of the two, leaving a third out - hard to explain coherently).

Essentially leaving me with:

<album> (%discsubtitle%:)

or similar (hopefully that makes sense - mainly where it leaves a hanging colon when one of the remaining fields is not present).

What I'm using currently (grouping and move patterns) -

Code: [Select]
[%album artist%[ - $year(%date%)] - %album%[ '('[Disc %discnumber%':' ][%discsubtitle%':' ][%bonusdisctitle%]')']]


and

Code: [Select]
%album artist% - %album% '('$year(%date%)')' '['[$if($stricmp(%codec_profile%,CBR),%bitrate%,) ]%codec%[ %codec_profile%]']'\[Disc %discnumber%[ - %discsubtitle%][ - %bonusdisctitle%]]\]%tracknumber% - %title%[ '('%version%')']


I considered bypassing it entirely and just using a series of individual parentheses per field and making sure to add the discard next to each when not present but something about that seemed like it'd make for a needless mess in terms of organization (personally, that is).

It's more likely I'm overlooking something obvious (or my scripts are poor - likely both) so any help in pointing out what it is would be appreciated.
Title: Omitting colons, semi-colons and the like
Post by: Purple Monkey on 2011-03-18 15:02:55
Use the $and and $or functions for if statements:
Code: [Select]
$if($and(%discnumber%,$or(%discsubtitle%,%bonusdisctitle%)),': ')
&
Code: [Select]
$if($and(%discsubtitle%,%bonusdisctitle%),': ')

Title: Omitting colons, semi-colons and the like
Post by: Jalan on 2011-03-19 04:43:22
Thanks.

I'm no good at $if statements, so I modified the grouping pattern like this -

Code: [Select]
[%album artist%[ - $year(%date%)] - %album%[ '('$if($and(%discnumber%,$or(%discsubtitle%,%bonusdisctitle%)),': ')]]


Which killed the separation of discs (now in a multi-disc set they all just group together under one main header).

I'd like to keep them grouped apart (ex. Album (Disc 1), Album (Disc 2: subtitle)), if any fields are present.

(http://i.imgur.com/TlpTK.jpg)

(http://i.imgur.com/gjZUn.jpg)
Title: Omitting colons, semi-colons and the like
Post by: Purple Monkey on 2011-03-19 12:12:35
Ah no, I should have been a bit clearer sorry.

The if statement I gave only controls the visibility of the colon, so you would use it like so:
Code: [Select]
[%album artist%[ - $year(%date%)] - %album%[ '('[Disc %discnumber%]$if($and(%discnumber%,$or(%discsubtitle%,%bonusdisctitle%)),': ')[%discsubtitle%]$if($and(%discsubtitle%,%bonusdisctitle%),': ')[%bonusdisctitle%]')']]
Title: Omitting colons, semi-colons and the like
Post by: Jalan on 2011-04-29 19:59:49
Thanks, this worked for the grouping but following the layout you gave for the move preset I listed in my opening post seems to output the directory in an odd way. Likely my fault again no doubt as I replaced parts of the move preset like so -

Code: [Select]
%album artist%\%album% '['[$if($stricmp(%codec_profile%,CBR),%bitrate%,) ]%codec%[ %codec_profile%]']'\[Disc %discnumber%]$if($and(%discnumber%,$or(%discsubtitle%,%bonusdisctitle%)),': ')[ - %discsubtitle%]$if($and(%discsubtitle%,%bonusdisctitle%),': ')[ - %bonusdisctitle%]]\]%tracknumber%[ - %track artist%] - %title%[ '('%version%')']


Title: Omitting colons, semi-colons and the like
Post by: sollniss on 2011-04-30 01:02:46
(http://i.imgur.com/TlpTK.jpg)

(http://i.imgur.com/gjZUn.jpg)

May I ask for that color scheme?
Title: Omitting colons, semi-colons and the like
Post by: marc2003 on 2011-04-30 01:08:32
it's one of the built in colour schemes for default UI. view>layout>quick setup>colors.
Title: Omitting colons, semi-colons and the like
Post by: Purple Monkey on 2011-04-30 17:20:58
Thanks, this worked for the grouping but following the layout you gave for the move preset I listed in my opening post seems to output the directory in an odd way. Likely my fault again no doubt as I replaced parts of the move preset like so -

I take it you are seeing "_ - " when you only want a dash. Just replace the colon and space between the single quotes (': ') with the separator you want, in this case I'm guessing space-dash-space(' - '). Then remove the spaces and dash in the square brackets ([]) and it should do what I think you want it to.
Title: Re: Omitting colons, semi-colons and the like
Post by: DayTrooper on 2020-01-14 04:09:35
Very sorry for resurrecting this old thread, but how do you add subtitles to cue sheets?

I've tried different forms of 'DISCSUBTITLE' but I can't get it to work.  Thanks!