Help - Search - Members - Calendar
Full Version: Append Function?
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
wolfsong
Is there someway to do
CODE
$if(%mood%,%mood%';'Move,Move)

and have FB2K recognize that there are multiple values instead of a single string? I need to do something like this in both Masstagger and Track Info Mod but can't figure out how.
gfngfgf
Check out the $meta_num() function in the documentation. Off the top of my head, it'd look something like:

CODE
$ifgreater($meta_num(mood),1,etc,...)
wolfsong
QUOTE(gfngfgf @ Dec 1 2006, 00:48) *

Check out the $meta_num() function in the documentation. Off the top of my head, it'd look something like:

CODE
$ifgreater($meta_num(mood),1,etc,...)


$meta_num returns the number of values. I'm trying to append a value not find out how many currently exist.
foosion
Exactly what are you trying to append to what?
wolfsong
QUOTE(foosion @ Dec 1 2006, 02:25) *

Exactly what are you trying to append to what?

There are 3 fields where this applies that I store multiple values; ARTIST, STYLE and MOOD. Basically I want to use masstagger to move any featured artist to the ARTIST tag

Existing Artist; Featured Artist

but doing a regular format values from existing field would overwrite the existing value.

CODE
$if(%mood%,%mood%';'Move,Move)

The above IF statement works except that FB2K sees the new value as a string instead of multiple values as if it were entered from the Properties window.
Frank Bicking
Can't you just use "Add value"?

Another idea: "Split field by separator", Field name: "MOOD", Separator: ";"

It would really help to narrow down your problem if you could offer more examples.
wolfsong
QUOTE(Frank Bicking @ Dec 1 2006, 08:39) *

Can't you just use "Add value"?

Another idea: "Split field by separator", Field name: "MOOD", Separator: ";"

It would really help to narrow down your problem if you could offer more examples.

OK with MT I'd like to change
CODE
ARTIST Patti LaBelle
TITLE On My Own (feat. Michael McDonald)

to
CODE
ARTIST Patti LaBelle; Michael McDonald
TITLE On My Own

I already using a script that changes
CODE
TITLE Provider (Zero 7 Remix)

to
CODE
TITLE Provider
VERSION Zero 7 Remix

so the basic concept should be the same.

For MOOD and STYLE I'd like to create a track info mod that can simply set multiple values.
IPB Image
The code behind this uses titleformatting to append the value:
CODE
// Info Heading Color e.g. "Title:"
$puts(head,$rgb(61,129,193))

// Info Color e.g. "Black Dog"
$puts(info,$rgb(255,255,255))

// Follow Cursor Color
$puts(followcursorcol,$rgb(200,150,50))
$puts(text2,$rgb(255,255,255))
$puts(text1,$if(%_trackinfo_nowplaying%,$rgb(61,129,193))$if(%_trackinfo_followcursor%,$get(followcursorcol)))

$align(center,)$get(text1)Current Mood: $get(text2)$if2(%mood%,NONE)

$button2(0,30,0,0,$calcwidth( Freeform ),13,'$font(tahoma,8,,255-255-255)Move','$font(tahoma,8,,61-129-193)Move',TAG:SET:mood:$if(%mood%,%mood%';'Move,Move),)
$button2(0,45,0,0,$calcwidth( Freeform ),13,'$font(tahoma,8,,255-255-255)Sing','$font(tahoma,8,,61-129-193)Sing',TAG:SET:mood:$if(%mood%,%mood%';'Sing,Sing),)

This "works" in the sense that the value is appended but it's interpreted as
"Original Value;New Value"
instead of
"Original Value"; "New Value"
fabiospark
Maybe too obvious to ask but...

Have you tried removing the spaces before and after the ";" ?
Have you set those fields as multi values ones in the advanced FB preferences page?

wolfsong
QUOTE(fabiospark @ Dec 1 2006, 11:36) *

Maybe too obvious to ask but...

Have you tried removing the spaces before and after the ";" ?
Have you set those fields as multi values ones in the advanced FB preferences page?

There are no spaces in the code, I think it just looks that way in the codebox.
Yes. These fields are all set as multi value. If I go into the preferences window and retype the semicolon each value is recognized.
wolfsong
BUMP
wolfsong
BUMP
fabiospark
If you are using a MT script, you should put two lines in the script:
- first, a "Format" with your $if statement, no need for the spaces though (" ; " > ";")
- then a "Split field by separator" as Frank Bicking wrote.







I took the freedom of correcting my name.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.