IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

 
Reply to this topicStart new topic
Help me with my formatting string.
/\/ephaestous
post Sep 28 2003, 02:45
Post #1





Group: Members
Posts: 648
Joined: 25-October 02
From: Colombia
Member No.: 3620



Hi
I need some help with my formatting string, the problem is that some of my files don't have tags but are named 'Artist - Title', so I came up with this code to split them in two fields and store them in variables, this works ok, but the columns are not aligned with the other columns (of the files that have tags)

this is my formatting string:
CODE
$puts(title_from_filename,$right(%_filename%,$sub($len(%_filename%),$add($strchr(%_filename%,'-'),1))))
$puts(artist_from_filename,$left(%_filename%,$sub($strchr(%_filename%,'-'),2)))

$num(%_playlist_number%,$len(%_playlist_total%)).

$if(%title%,
       $if2(%artist%,unknown artist)
       $tab(3)
       %title%
       $tab(3)
       $if(%album%,%album%[ #[%disc%/]$num(%tracknumber%,2)])

       ,

       $get(artist_from_filename)
       $tab(3)
       $get(title_from_filename)
       )

$tab(4)
$if(%_isplaying%,'◊ ')
[['['$if2(%__codec%,$upper($ext(%_path%)))']' ]$pad_right(%_length%,5,0)]


Screenshot here

First two files don't have tags on them

Thanks.

This post has been edited by /\/ephaestous: Sep 28 2003, 02:55


--------------------
"You have the right to remain silent. Anything you say will be misquoted, then used against you."
Go to the top of the page
+Quote Post
/\/ephaestous
post Sep 28 2003, 03:04
Post #2





Group: Members
Posts: 648
Joined: 25-October 02
From: Colombia
Member No.: 3620



Oh, never mind, I found out, thanks anyway.

it was missing a $tab(3)

CODE
$puts(title_from_filename,$right(%_filename%,$sub($len(%_filename%),$add($strchr(%_filename%,'-'),1))))
$puts(artist_from_filename,$left(%_filename%,$sub($strchr(%_filename%,'-'),2)))

$num(%_playlist_number%,$len(%_playlist_total%)).

$if(%title%,
       $if2(%artist%,unknown artist)
       $tab(3)
       %title%
       $tab(3)
       $if(%album%,%album%[ #[%disc%/]$num(%tracknumber%,2)])

       ,

       $get(artist_from_filename)
       $tab(3)
       $get(title_from_filename)
       $tab(3)
       )

$tab(4)
$if(%_isplaying%,'◊ ')
[['['$if2(%__codec%,$upper($ext(%_path%)))']' ]$pad_right(%_length%,5,0)]



If an admin sees this feel free to delete this thread and this one where I uploaded the screenshot

This post has been edited by /\/ephaestous: Sep 28 2003, 03:06


--------------------
"You have the right to remain silent. Anything you say will be misquoted, then used against you."
Go to the top of the page
+Quote Post
mazy
post Sep 30 2003, 12:56
Post #3





Group: Members
Posts: 680
Joined: 11-July 03
From: Brno, Czech Rep.
Member No.: 7705



/\/ephaestous,

could you explain $tab(x) to me? i can't see it in official tagz help, but it seems to do variable columns which would be cool for non-fixed width fonts

thank you in advance wink.gif


--------------------
info about my tag guesser script for foo_lua (preview version available):
http://www.hydrogenaudio.org/index.php?showtopic=16987
Go to the top of the page
+Quote Post
musicmusic
post Sep 30 2003, 13:13
Post #4


Columns UI developer


Group: Developer
Posts: 3034
Joined: 20-December 02
From: United Kingdom
Member No.: 4177



QUOTE (mazy @ Sep 30 2003, 12:56 PM)
/\/ephaestous,

could you explain $tab(x) to me? i can't see it in official tagz help, but it seems to do variable columns  which would be cool for non-fixed width fonts

thank you in advance wink.gif

not /\/ephaestous, but $tab(x) seems to be same as $repeat($char(9),x) except limited upto 16. These columns have been around for a while, but not documented..

A higher value creates a wider column, sort of. You put the $tab(x) after the column contents, but the very last $char(9) will indicate right aligned text, so dont put one after %_length% or whatever is there if you want it right aligned.

This post has been edited by musicmusic: Sep 30 2003, 13:19


--------------------
.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th September 2014 - 04:50