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: foo_uie_single_column_playlist (Read 728693 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

foo_uie_single_column_playlist

Reply #25
Is there a way to define the color for the background and text of the currently selected item? I know how to do this with $rgb() but not $font(). Though to be honest I think I'd be more happy if I could do something like:

$if(%selected%,$drawrect(0,0,0,0,pencolor-233-233-233),)

To retain whatever colors are already there and just draw a border.

Pretty please, with sugar on top, add the function to middle-mouse click an entry to add it to the playback queue.

foo_uie_single_column_playlist

Reply #26
Quote
Thanks, I like it. Looks very promising! I also have a feature request: Grouping by multiple fields e.g. first by %artist% and then by %album% which would result in an header for each artist and one for each album.


I'll have to think about this one some more. I would think having just one header makes it easier to see where things fit it with less scrolling.

Quote
EDIT: and configurable header height would be great also biggrin.gif


The listview limits the size of rows to be the same, but I think I may be able to make the headers occupy 2 (or more) rows.

Quote
EDIT2: Found a bug also:
Shortcuts seem not to work - I have 'P' set as shortcut for Properties when I use it the selection jumps up to the header and that's it. But when I open the properties window manually and close it and then press 'P' instantly it works as expected.


fixed.

Quote
# The playlist view only allows a single instance, but uses a popup configuration window.
# The aforementionted configuration window is modal.


I will try to get this fixed for the next version. I used the trackinfo code as a skeleton, hence the similarities.

Quote
# The initial defaults after installing the component come up blank here. Changes in row height in this state only took effect after resizing the playlist view.
# The component uses its own custom color code format. It is not possible to use the existing color code generation and manipulation functions provided by foobar2000 itself ($rgb, $hsl, $blend).
# No focus rectangle for the active item. I really don't care, if this can be achieved using some formatting code; I don't want to have to read through the documentation to get something as simple as that.


fixed, added, and fixed (with some default code). Eventually I want to be able to remove this and use the columns ui "globals" for the various colors.

Quote
one little suggestion : when we click on an album header , i think it would be better if it could automatically select the whole album instead of only the first track.


I think this is doable. I need to make some other tweaks to the selection code as well.

Quote
1. Being able to change the selection color.


added.

Quote
2. Ability to make basically mini columns for the item and group display. Maybe this is possible, but as of now, I don't know how. If that isn't clear, I mean, basically for each thing (like track number, track name, and track length) to have its own static width. I think this might be possible with some regular code formats that one can use in trackinfo (paddng and cut?), but the ablity to possibly create specific boxes (possibly just like the current columns_ui?) would make setting it up far, far easier.


you can kinda have columns using $alignabs(x,y,width,height,h-align,v-align).

Quote
3. Ability to display album art (or any sort of picture) inside the group/item (mainly group) display.


you can already display .pngs using $imageabs

Quote
provide us with some group-related info (summary tags) - like number of group items, group length (time), group size (in bytes), group average bitrate etc. maybe even function to test whether given tag varies among group items (like %artist% - for properly detecting variable artists albums). it could be just few of them, or general functions like $group_sum(tag) and $group_varies(tag).


interesting idea. I will add it to the list.

foo_uie_single_column_playlist

Reply #27
Quote
separate height for group display and item display. if it could change the height from the formatting, that would be great (so we could have more detailed group display when there's additional information available and less detailed when not).


row heights have to all be the same.... but maybe I can hack it where the some lines could occupy 2 or more rows. I like the idea of expanding the height based on formatting though.. for example the height could be tripled for the playing song to display more detailed info, etc...

Quote
i'm sure people would like to be able to display album art for example as background under group items or draw rectangle over all of them etc. imho some sort of "group items display" supplementing item and group display would be nice ...


unfortunately, I don't think this is going to be feasible with the listview control as drawing occurs row by row.

Quote
vertical padding in $padding has to be negative to pad content from the border into the rectangle. that's not consistent with the horizontal padding and coordinates ...


fixed. good catch.

Quote
Is there a way to define the color for the background and text of the currently selected item? I know how to do this with $rgb() but not $font(). Though to be honest I think I'd be more happy if I could do something like:

$if(%selected%,$drawrect(0,0,0,0,pencolor-233-233-233),)

To retain whatever colors are already there and just draw a border.


it's like you can read my mind

Quote
Pretty please, with sugar on top, add the function to middle-mouse click an entry to add it to the playback queue.


can this be added through the foobar preferences and I would pass on the middle click, or would it need to be added separately?

**************************

New version uploaded with some of the aforementioned fixes.

Default code for "Item Display"

Code: [Select]
$if(%_selected%,$drawrect(0,0,0,0,brushcolor-SYSCOL-13 pencolor-null))
$if(%_focused%,$drawrect(0,0,0,0,brushcolor-null pencolor-SYSCOL-6))
$if(%_selected%,$textcolor(SYSCOL-9),$textcolor(SYSCOL-8))
$padding(4,0)
$align(left,top)%list_index%$align(right,top)%title%


Default code for group display:

Code: [Select]
$drawrect(0,0,0,0,brushcolor-130-130-255 pencolor-null)
$padding(4,0)
$align(left,top)$font(,,bold,64-0-0)%album% '['%date%']'
$align(right,top)$font(,,bold,0-64-0)%composer%

foo_uie_single_column_playlist

Reply #28
Quote
Pretty please, with sugar on top, add the function to middle-mouse click an entry to add it to the playback queue.


can this be added through the foobar preferences and I would pass on the middle click, or would it need to be added separately?


This is an existing feature with the regular ColumnsUI playlist and I rather miss it. I poked around foobar a bit and found the command "Add to Playback Queue" available for context menus and buttons. Maybe a more elegant solution would be to have this component allow the user to link doubleclick and middle button to any standard foobar event. I believe the original playlist did this for doubleclick.  But yes as far as I can tell the whole adding to queue bit is already built into foobar you'd just need to hook the mouse buttons and trigger the existing events.

EDIT: There was some talk about this in the past and it sparked a great deal of interest; would it be possible to doubleclick on the header and collapse/expand all the entries under that header? So you could view a playlsit that contained only a bunch of headers that can be expanded to view their contents?

Keep up the good work, this and your trackinfo_mod really expand the flexibility of the foobar interface.

foo_uie_single_column_playlist

Reply #29
This isnt specific to this plugin, but can anyone confirm if %isplaying% breaks if the currently playing track also exists in the playback queue? (add a song to the queue more than once then cycle to the first entry)  I've notice d the behavior in both this component and the ColumnsUI playlist.  Can anyone suggest an alternative way to determine if a track is playing?

foo_uie_single_column_playlist

Reply #30
skelly831, thanks, but it's terrestrial who made this great plugin


mazy, just want to add that i too am a big fan of your wok. you do stuff that i can't even conceive. bravo!

PS could you please share the code that you used?


foo_uie_single_column_playlist

Reply #32
just a test using the track info mod and foo_uie_single_column_playlist:



formatting for the playlist. the overlay image is here. you would need some fonts used (CubicFive10 and CubicFive12 among with Calibri). row height is 23.

it's just a test. that album / artist split box doesn't handle situations when there's not enough space; there's no selection / focus indication and insufficient playing item indication; i don't use album rating so for testing i just did $rand.

item display:

Code: [Select]
$if($strcmp($mod(%_playlist_number%,2),1),
$drawrect(,,,,brushcolor-245-245-245 pencolor-null))

$padding(2,0)
$font(calibri bold,9,$if(%isplaying%,underline,),170-170-170)
$replace(%title%,'(',$font(,,bold italic,204-204-204)'(')

$alignabs(6,13,%_width%,%_height%,,)
$font(CubicFive10,6,nocleartype,190-190-190)
[%length% | ]
[%bitrate% kbps]

$alignabs(0,-1,$sub(%_width%,2),%_height%,right,)
$font(CubicFive10,6,nocleartype,190-190-190)
[%play_count%x]
$if(%cwb_queueindex%, '['%cwb_queueindexes%/%cwb_queuelength%']')

$alignabs(0,10,$sub(%_width%,2),%_height%,right,)
$font(Wingdings,9,glow-190-190-190 glowexpand-1,250-250-250)
$repeat(«,%rating%)
group display:

Code: [Select]
$padding(1,0)
$drawrect(,,,,brushcolor-119-213-249 pencolor-51-191-238)$padding(4,1)

$align(left,center)$font(calibri bold,9,,255-255-255)
$font(,,bold glow-18-173-224 glowexpand-1,)
%album%

$align(right,center)$font(,,bold,255-255-255)
%artist%
$puts(ar_w,$calcwidth(%artist%))

$drawrect($sub(%_width%,$get(ar_w),18),-1,3,%_height%,brushcolor-51-191-238 pencolor-null)
$drawrect($sub(%_width%,$get(ar_w),17),-1,1,%_height%,brushcolor-250-250-250 pencolor-null)

$alignabs(6,13,%_width%,%_height%,,)
$font(CubicFive12,6,nocleartype,18-173-224)
[%date% | ][%genre%]

$alignabs(0,10,$sub(%_width%,$get(ar_w),13),%_height%,right,)
$font(Wingdings,10,,)
$repeat(«,$rand(5))

$imageabs($sub(%_width%,$get(ar_w),98),0,data\misc images\playlist-refl.png,)
$imageabs($sub(%_width%,87),0,data\misc images\playlist-refl.png,)

foo_uie_single_column_playlist

Reply #33
looks good, mazy

could you do me a favor and check if the same character problems happen in this plugin as trackinfo_mod? thanks.

foo_uie_single_column_playlist

Reply #34
My request: Collapsible headers.
Im going to play around with this tonight, see what designs I can come up with.

Also I think this needs a wiki


foo_uie_single_column_playlist

Reply #36
i second collapsable headers


foo_uie_single_column_playlist

Reply #38
a restart should fix it. There are still some settings glitches I'm working on.

foo_uie_single_column_playlist

Reply #39
I'm not very familiar with the modified trackinfo formatting code. I was just wondering if it is possible to specify a background image using tagz. If so, we could integrate album art into the playlist itself, which would be awesome. For example: $replace(%path%,%filename_ext%,)folder*

foo_uie_single_column_playlist

Reply #40
$imageabs(,,images\backdrop.png,)

If you would like to place the image at a specific place you can put the x,y coordinates in the first two parameters:

$imageabs(10,5,images\backdrop.png,)

As mentioned before, the images are currently restricted to .png format and if I am not mistaken they must reside relative to the main foobar directory (in the above example x:\path\to\foobar2000\images). Also I do not believe there is currently any way to resize images from their original dimensions.

I havnt played around with images yet but I would suspect you may also be limited to fitting the image inside the current row.

EDIT: I did a little exprimenting and any image is indeed clipped so that it only appears in the current row.

foo_uie_single_column_playlist

Reply #41
Oh, ok. I just remembered that the group headers need to be the same height as the items, so it wouldnt be really practical anyway (uness, of course he added an option to set the header and item heights independently). Kind of strange that only PNG is supported, also.

foo_uie_single_column_playlist

Reply #42
EDIT: I did a little exprimenting and any image is indeed clipped so that it only appears in the current row.

If you based the image on tracknumber you could make an image spread across the album. e.g. a shift by y depending on tracknumber

Like this:


Code: [Select]
$imageabs(0,  $add(25,$mul(-26,%tracknumber%)),images/test.png,)

I put this at the end. Of course at the beginning it would be beneath the songs. 26 is my row height.

Also on this logic, knowing how many items are in a group becomes very helpful - assigning images for first and last group items will allow a custom border for that group. Combine this with a genre specific border (as from the tags) and now we are talking some pretty sweet and functional foobar looks.

Bugs and Feature Requests:
* Different size definition for header - I'd like to include lots more info here
* One annoyance / bug I have found is that whenever I press a normal key the playlist resets its display to the first item.
* There is a redraw bug. I have an auto hide feature, when this is shown the panel shrinks and a scroll bar appears on the right, when the auto hide disappears again the scroll bar goes away but the panel stays in its squished shape until the window is resized.

foo_uie_single_column_playlist

Reply #43
So basically each row automatically offsets the image so that it's "slice" lines up with all the others based on track number.. that's pretty slick :)

foo_uie_single_column_playlist

Reply #44
I'm having quite a bit of fun with this plug-in, just as with your track_info_mod plug-in.

However, I'm having a problem.  Maybe it's something you haven't implemented, or maybe it's dumb scripting on my part, but I'm trying to make a script that handles albums playlists and singles playlists.  For singles playlists, I have an exclamation point (!) precede the playlist name (for example, !Rock), while albums playlists are normally named (for example, Story of the Year).

Here is my code.

Group By
Code: [Select]
$if($stricmp($left(%playlist_name%,1),!),%playlist_name%,%album%)


Item Display
Code: [Select]
$ifequal($mod(%list_index%,2),0,
$drawrect(0,0,0,0,brushcolor-40-40-40 pencolor-null),)
$if(%_selected%,$drawrect(0,0,0,0,brushcolor-SYSCOL-13 pencolor-null))
$if(%_focused%,$drawrect(0,0,0,0,brushcolor-null pencolor-SYSCOL-6))
$if(%_selected%,$textcolor(SYSCOL-9),$textcolor(SYSCOL-8))
$if(%isplaying%,$drawrect(0,0,0,0,brushcolor-null pencolor-255-255-255))
$padding(10,0)
$font(,16,,230-230-230)
$align(left,middle)$if($stricmp($left(%playlist_name%,1),!),%list_index%,%tracknumber%)
$font(,10,,230-230-230)
$align(left,top) '['%length%']'$align(right,top)%title%
$font(,8,,230-230-230)
$alignset() - $align(right,middle)%artist%[ '['Arr. - %arranger%']']


Group Display
Code: [Select]
$drawrect(0,0,0,0,brushcolor-130-130-255 pencolor-null)
$padding(4,0)
$if($stricmp($left(%playlist_name%,1),!),
$align(left,top)Playlist: $right(%playlist_name%,$sub($len(%playlist_name%),1)),
$align(left,top)%album%[ '['%date%']']$align(right,top)%composer%)


It's supposed to display album information for albums playlists, while showing only the playlist name for singles playlists.  Any help would be appreciated.

Edit: Here is what my foobar2000 currently looks like.
Singles view
Albums View

foo_uie_single_column_playlist

Reply #45
Using FofR's idea for embedding images beyond the row, I played around and came up with some nice borders on the side of my playlist:

 
Images Used:
     
column.left.png, column.right.png

Group By
Code: [Select]
$if(%tracknumber%,%album%%discnumber%,)
Item Display
Code: [Select]
// -- Backgrounds -- //
$if(%tracknumber%,$drawrect(0,0,0,0,brushcolor-140-186-236 pencolor-null),)
$if(%cwb_queueindex%,$drawrect(0,0,0,0,brushcolor-58-110-165 pencolor-null),)
$if(%isplaying%,$drawrect(0,0,0,0,brushcolor-10-36-106 pencolor-null),)
$if(%_selected%,$drawrect(0,0,0,0,brushcolor-null pencolor-233-233-233),)

// Side Art
$puts(art.width,30)
$puts(art.height,60)
$puts(art.num,$add($div($mul(%list_index%,%_height%),$get(art.height)),1))
$puts(art.offset,-$sub($sub($mul(%list_index%,%_height%),$mul($sub($get(art.num),1),$get(art.height))),%_height%))
$imageabs(0,$get(art.offset),images\column.left.png,)
$imageabs($sub(%_width%,$get(art.width)),$get(art.offset),images\column.right.png,)

// -- Text -- //
$font(tahoma,8,,)

// Track Number
$alignabs(50,,%_width%,%_height%,,)
$if(%tracknumber%,
$if(%isplaying%,$font(,,,233-233-233),$font(,,,10-36-106))
%tracknumber%$font(,,,233-233-233).
$if(%isplaying%,$font(,,,233-233-233),$font(,,,0-0-0))

// Title
$alignabs(75,,%_width%,%_height%,,)
$if(%title%,$trim($left(%title%,$sub($strrchr(%title%,$char(40)),1))),)

$if($strrchr(%title%,$char(40)),
$font(,,,233-233-233) $char(40)
$if(%isplaying%,$font(,,,233-233-233),$font(,,,10-36-106))
$substr(%title%,$add($strrchr(%title%,$char(40)),1),$sub($strrchr(%title%,$char(41)),1))
$font(,,,233-233-233)$char(41)
$if(%isplaying%,$font(,,,233-233-233),$font(,,,0-0-0))
)
,
$if(%isplaying%,$font(,,,233-233-233),$font(,,,0-0-0))
[%artist% - ]%title%
)


// Queue Indicator
$if(%cwb_queueindex%,
$alignabs($sub(%_width%,$calcwidth(%cwb_queueindexes%),150),,%_width%,%_height%,,)
$font(,,,233-233-233)Q
$if(%isplaying%,$font(,,,233-233-233),$font(,,,140-186-236)):
$font(,,,233-233-233)$char(91)$if(%isplaying%,$font(,,,233-233-233),$font(,,,140-186-236))%cwb_queueindexes%$char(47)%cwb_queuelength%$font(,,,233-233-233)$char(93)
$if(%isplaying%,$font(,,,233-233-233),$font(,,,0-0-0))
,)

// Length
$padding(50,0)
$align(right,)%length%
Group Display
Code: [Select]
$if(%tracknumber%,
$drawrect(0,0,0,0,brushcolor-0-0-0 pencolor-null)$padding(4,0)
$font(tahoma,7,,233-233-233)
$align(left,middle)$if(%CDID%,$char(91)$font(,,,140-186-236)%CDID%$font(,,,233-233-233)$char(93),)
$align(center,middle)

$if(%album artist%,
$if($strrchr(%album artist%,$char(12300)),
$font(,,,140-186-236)$char(12300)$font(,,,233-233-233)$substr(%album artist%,2,$sub($len(%album artist%),1))$font(,,,140-186-236)$char(12301)
,%album artist%)
,)

$if($and(%album artist%,%album%),$font(,,,140-186-236) - $font(,,,233-233-233),)
$trim($left(%album%,$sub($strrchr(%album%,$char(40)),1)))
$align(right,middle)[$char(91)$font(,,,140-186-236)[%genre%]$if($and(%genre%,%date%), - ,)[%date%]$font(,,,233-233-233)$char(93)]
,
$drawrect(0,0,0,0,brushcolor-130-130-255 pencolor-null)$padding(4,0)
$align(center,)$font(tahoma,7,italic,0-0-0)~ Singles ~
)

This component is a bit of fun once you get going :)

foo_uie_single_column_playlist

Reply #46
Nice idea using the %list_index%, I hadn't thought of that. Some pretty code also
I added these tricks to the wiki.

foo_uie_single_column_playlist

Reply #47
I want to add some details about $drawrect to the wiki, should I put it on the trackinfo mod panel page where all the other tags are currently or on the single column playilst page?

I am thining panel page plus link on playlist page. This way tags that work in both only appear once and the playlist page can keep to neat tricks and techniques.

What are the specific attributes of $drawrect?
Code: [Select]
$drawrect(0,0,0,0,brushcolor-0-0-0 pencolor-null)

The first four zeros, do these correspond to pos-x, pos-y, width, height?

foo_uie_single_column_playlist

Reply #48
Great plugin!
But why don't you allow us to change the order by draging items?
And can you write a function list for us?
Thanks!

foo_uie_single_column_playlist

Reply #49
Why doesn't this component have an every second update option?