Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Columns UI - how to make 'now playing' bold (Read 12030 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Columns UI - how to make 'now playing' bold

I am not a programmer so I have been customizing Foobar2K slowly and without much confidence. Using columns ui, how and where do I go to make the line in my playlist that shows the currently playing song to have bold text? As an alternative, I could change the color of the background of that line -- the default colors does this already, but only faintly and if I have another line selected it is already is darker than the now playing line. I could not tell in the columns ui preferences which line I was formatting for the tume 'now playing.'  I'm not sure what 'inactive selection' means in this context, as I assume I am looking for the 'active selection". Thanks for everybody's help. Little by little I am getting this program to do what I want, but it's not easy for a non-technical person.  arnstein

Columns UI - how to make 'now playing' bold

Reply #1
Generally speaking you can use $if(%isplaying%,$rgb(r1,g1,b1,r2,g2,b2),) where r1,g1,b1 is the color of the now playing text normally, and r2,g2,b2 is the color of the text when selected. This will change the color of the text however I do not know of anyway to change font attributes such as bold and italic with the columnsui playlist.

However, if you change to the single column playlist you can use $if(%isplaying%,$font(,,bold,),)

Edit: When I used the columnsui playlist I would use $set_style() to change the background color of the now playing item. However, I have since switched to single column playlist.

Columns UI - how to make 'now playing' bold

Reply #2
Thanks for this, however, forgive my utter ignorance, where do I write that string -- and I realize I will have to choose color values for the rgb.  One other question -- is there a way to save my entire configuration and reload it in case I screw up something as I a m tinkering around?  Thanks for helping me out. arnstein

Columns UI - how to make 'now playing' bold

Reply #3
First you need to pick some colors for your backgrounds. Then we can go define those colors as global playlist variables and make it easier to use those colors.

File> Preferences> Display> Columns UI> Playlist View> "Globals" Tab

About halfway down the page, select the "Variables" tab.  Here we can set the colors you want to use like this:

Code: [Select]
$set_global(color.bg.single,$rgb(166,202,240))
$set_global(color.bg.album,$rgb(140,186,236))
$set_global(color.bg.playing,$rgb(58,110,165))
$set_global(color.bg.selected,$rgb(10,36,106))

Toward the top of the page make sure this box is checked so that we can use these variables in the column display:
  • Use global variables for display

File> Preferences> Display> Columns UI> Playlist View> "Columns" Tab

Now that we have defined some colors to use (replace those above with whatever makes you happy) we can put them in our columns.  On the left side of the page there should be a box called "Columns". Select the column you would like to change the color for.

Toward the center of the page there should be a few tabs, select the tab called "Style". If you already have a bunch of code then paste it and we can help you modify it, but basically you need to add a line like:

Code: [Select]
$set_style(back,
$if(%isplaying%,$get_global(color.bg.playing),
$if(%tracknumber%,$get_global(color.bg.album),$get_global(color.bg.single))
),
$get_global(color.bg.selected)
)

Toward the top of the page make sure this box is checked so that we can use the style in the main display:
  • Use Custom Style Spec

You'll need to define the style for every column you would like to color. Select the different columns from the "Columns" box and repeat the style code in the "Style" tab for each column. Copy/paste is your friend.

Once you have defined the style for each column click [Apply], [Save All], and [Close].

Columns UI - how to make 'now playing' bold

Reply #4
Hmm. I tried what you said but nothing changed.  Here's a link to what foobar looked like after I made your changes.  Exactly like it did before.  Unless the colors you suggested were identical to defaults.  The highlit song hides the now playing color, unfortunately, but it's the slightly bluer version of the alternating foobar stripe.  Gratefully, arnstein

http://img228.imageshack.us/my.php?image=foobar2kkq0.jpg

Columns UI - how to make 'now playing' bold

Reply #5
Could you post the style and global pages for your current config? Maybe other code is overriding what we added?

Columns UI - how to make 'now playing' bold

Reply #6
OK - almost there. I hadn't checked 'use custom style spec" on all the columns. 
Looks very nice, but with a couple of issues. 
1. #69 - Stone Crazy is the selected file, not the one playing. This looks OK. But #70 - I'm Set Free -- I wish to change the font color as the black does not read well under the darker blue; should be red perhaps, something to make it different from both selected and all non selected. I like the darker color here for the background, nice choice.

2. For some unknown reason #77 - Generation 05 is highlighted with a lighter color, and I don't know why, as it is neither selected nor playing.

Here are my globals for variables:

$set_global(color.bg.single,$rgb(166,202,240))
$set_global(color.bg.album,$rgb(140,186,236))
$set_global(color.bg.playing,$rgb(58,110,165))
$set_global(color.bg.selected,$rgb(10,36,106))

Here are my globals for style:

$if(%_isplaying%,

$puts(back,$offset_colour(%_back%,$offset_colour($calculate_blend_target(%_back%),ff0000,20),25))
$puts(back-selected,$offset_colour(%_selected_back%,$offset_colour($calculate_blend_target(%_selected_back%),ff0000,20),25))
$puts(back-selected-no-focus,$offset_colour(%_selected_back_no_focus%,$offset_colour($calculate_blend_target(%_selected_back_no_focus%),ff0000,20),25))
,

$ifequal($mod(%_playlist_number%,2),0,
$puts(back,$offset_colour(%_back%,$calculate_blend_target(%_back%),12))
$puts(back-selected,%_selected_back%)
$puts(back-selected-no-focus,%_selected_back_no_focus%)
,
$puts(back-selected,$offset_colour(%_selected_back%,$calculate_blend_target(%_selected_back%),7))
$puts(back-selected-no-focus,$offset_colour(%_selected_back_no_focus%,$calculate_blend_target(%_selected_back_no_focus%),7))
$puts(back,%_back%)
)

)
$set_style(back,$get(back),$get(back-selected),$get(back-selected-no-focus))

http://img136.imageshack.us/my.php?image=foobarbluecb7.jpg

Can't thank you enough, Yotsuya.  Let me know if you need any other info.  Arnstein

Columns UI - how to make 'now playing' bold

Reply #7
Issue #1: Text Color

Above, all we played around with were the background colors, but text color can be manipulated very similarly.
Pick some colors and add them to your global variables like we did before:

Code: [Select]
// Text
$set_global(color.txt.single,$rgb(0,0,0))
$set_global(color.txt.album,$rgb(0,0,0))
$set_global(color.txt.playing,$rgb(233,233,233))
$set_global(color.txt.selected,$rgb(233,233,233))

// Backgrounds
$set_global(color.bg.single,$rgb(166,202,240))
$set_global(color.bg.album,$rgb(140,186,236))
$set_global(color.bg.playing,$rgb(58,110,165))
$set_global(color.bg.selected,$rgb(10,36,106))

A note about the style tab, the code in there is the default code which you can see the effect of in your existing "number" column. We are overriding these settings with our display style. When you have everything set up the way you like you may want to clear out the style tab, or you may wish to leave it as the default for any future columns. Or, you can copy/paste one of the individual column style tabs into the global style tab so that your new settings become the default for all columns.

Basically, all columns use the style defined in the global style tab unless you check the box for "use custom style spec" for the column.. in which case it uses the style defined in it's own tab.

Now that we have defined some text colors we need to go back to the column style tabs and set the styles to use the colors. Similar to before we can add code like this:

Code: [Select]
// Text
$set_style(text,
$if(%isplaying%,$get_global(color.txt.playing),
$if(%tracknumber%,$get_global(color.txt.album),$get_global(color.txt.single))
),
$get_global(color.txt.selected)
)

// Backgrounds
$set_style(back,
$if(%isplaying%,$get_global(color.bg.playing),
$if(%tracknumber%,$get_global(color.bg.album),$get_global(color.bg.single))
),
$get_global(color.bg.selected)
)

Issue #2: Number 77

I suspect the reason item number 77 is appearing with a lighter color is because the code I have given includes the ability to color tracks differently depending on wether or not they have a track number defined in their tag. Right click on number 77 and select properties, I think you will find that it has no track number.  The reason I did this is because with a proper sorting string you can group tracks together that belong to albums and have those albums colored differently to set them apart from loose single tracks. Many people use this method and I am actually helping another user accomplish that.

If you do not wish to utilize this behavior replace the lines of code that look like this:
Code: [Select]
$if(%tracknumber%,$get_global(color.bg.album),$get_global(color.bg.single))
with something that simply sets the color like this:
Code: [Select]
$get_global(color.bg.single)
or if you like the alternating line colors like the default style:
Code: [Select]
$ifequal($mod(%_playlist_number%,2),0,$get_global(color.bg.single),$get_global(color.bg.album))

As always feel free to change those colors to anything you like, the colors I have given you are from a blue color scheme I used before I switchd to foo_uie_single_column_playlist.. because that's the code I have laying around in my columnsui playlist config.

Columns UI - how to make 'now playing' bold

Reply #8
I like the blue format, Yotsuya, not a big fan as some are here of the intense, black backgrounds, flashing lights and buzzers. Everything works as it should for now. My only question not yet answered is what do you do if you like a format such as this and want to save it, and then want to fiddle around some more with colors, etc. Is there a way to reload the saved format or do you have to note all the code changes and hand code them back? As for the lighter bar for those items without track numbers, what a great way for me to clean up my database and get all those pesky track numbers in.  Thanks again. Foobar 2K's an amazing thing but what a learning curve for the non-coders out there.  arnstein

Columns UI - how to make 'now playing' bold

Reply #9
File> Preferences> Display> Columns UI> "Main" Tab

There are two buttons [Import] and [Export] that will allow you to manage .fcs files.  .fcs files do not manage all foobar settings but they do manage most of the ColumnsUI settings including the playlist style we just discussed. You can use this to "back up" your columns ui config and restore it later.

Alternatively you can zip up your entire foobar directory. If you installed with per-user settings you'll need to grab your appdata folder too.
C:\Program Files\foobar2000
C:\Documents and Settings\USERNAME\Application Data\foobar2000

Columns UI - how to make 'now playing' bold

Reply #10
just wanted to drop in and say I found this thread extremely useful for my own needs, thank you arnstein for raising the question in the first place and thank you yotsuya for breaking the topic down for us non-programmers in the audience.

Columns UI - how to make 'now playing' bold

Reply #11
Quote
This will change the color of the text however I do not know of anyway to change font attributes such as bold and italic with the columnsui playlist.

So is there a way to set in Columns UI a particular bit of text to bold, or any other font variation?

I am trying to get the Artist column to be bold, everything else regular...

If not, seems quite a failing of what is otherwise a ridiculously powerful interface config!

Columns UI - how to make 'now playing' bold

Reply #12
thanks yotsuya for that explanation.

Columns UI - how to make 'now playing' bold

Reply #13
Quote
This will change the color of the text however I do not know of anyway to change font attributes such as bold and italic with the columnsui playlist.

So is there a way to set in Columns UI a particular bit of text to bold, or any other font variation?

I am trying to get the Artist column to be bold, everything else regular...

If not, seems quite a failing of what is otherwise a ridiculously powerful interface config!



I'd like to know that too.
because when I play something in a large playlist, and I click on another song I can't find the song I play at the moment!
so I need something so I can see easily the song that I play.

Columns UI - how to make 'now playing' bold

Reply #14
This can help: Preferences > Columns UI > Status bar/Systray tab. Set the 'Action to perform when doubleclicking on status bar:' combo to View/Columns playlist/Activate now playing.
If age or weaknes doe prohibyte bloudletting you must use boxing

Columns UI - how to make 'now playing' bold

Reply #15
I'm trying to use yotsuya's style script and I want to customize the alternating lines part to be a bit more like the default.
If I understand correctly, the default config has a blend function - where it takes two colours and blends them together??

I want to have a greyish tinge to the blue colour (or any other colour i choose at a later date) that I have chosen.

Could somebody explain how the %offset_colour and $calculate_blend_target strings work

Any help would be greatly appreciated

Columns UI - how to make 'now playing' bold

Reply #16
Incredibly helpful, Yotsuya. I appreciate the depth of detail and patience with its explanation. 10/10