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 739424 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_uie_single_column_playlist

Reply #350
Sorry if this has been asked before, but how do I not have the cover image show if there aren't enough songs for that album in the playlist?

for example: http://www.envenom.net/uploads/foobarplayl...roblem49348.jpg
In the playlist, the album art wouldn't show if there are less than 7 tracks from the album in the playlist.

I am using this code:
Code: [Select]
$imageabs2(150,150,0,$add(-23,$mul(%tracknumber%,23)),,,,,$replace(%path%,%filename_ext%,folder.jpg),)

foo_uie_single_column_playlist

Reply #351
Code: [Select]
$ifgreater(%totaltracks%,6,
$imageabs2(150,150,0,$add(-23,$mul(%tracknumber%,23)),,,,,$replace(%path%,%filename_ext%,folder.jpg),)
,)


This assumes your albums are properly tagged with %totaltracks%.

foo_uie_single_column_playlist

Reply #352
Nevermind... Yotsuya's too quick.

foo_uie_single_column_playlist

Reply #353
And an additional tip, I assume the "23" in your code is because you are using a line height of 23? You can change that to %_height% so that the code dynamically adjusts if/when you change your line height.

foo_uie_single_column_playlist

Reply #354
Good tip.

foo_uie_single_column_playlist

Reply #355
Here's my albumart code if anyone is interested, it's rather small and makes albums look like cd cases. I stole the empty cd case image from the nocover thread:

Code: [Select]
// Album Art
$ifgreater(%totaltracks%,3,
$imageabs2(110,110,0,$add($mul(%_height%,$sub(%tracknumber%,2)),29),,,40,,images\nocover.png,)
$imageabs2(85,85,0,$add($mul(%_height%,$sub(%tracknumber%,2)),$muldiv(%_height%,5,6)),,,55,,$replace(%path%,%filename_ext%,$if2(%cdid%,[%artist% - ]$replace(%album%,?,,:,)).png),)
$imageabs2(85,85,0,$add($mul(%_height%,$sub(%tracknumber%,2)),$muldiv(%_height%,5,6)),,,55,,$replace(%path%,%filename_ext%,$if2(%cdid%,[%artist% - ]$replace(%album%,?,,:,)).jpg),)
$imageabs2(85,85,0,$add($mul(%_height%,$sub(%tracknumber%,2)),$muldiv(%_height%,5,6)),,,55,,$replace(%path%,%filename_ext%,$if2(%cdid%,[%artist% - ]$replace(%album%,?,,:,)).gif),)
,)

  images\nocover.png

foo_uie_single_column_playlist

Reply #356
foxhawk:
Can you be more specific about what you mean by "grey resizing grips"? Maybe a picture? If you are referring to the separator lines added by ColumnsUI between each panel then this is a known issue and we hope it's corrected in future versions of ColumnsUI. The best you can do is try to mask it by choosing similar colors in your panels or windows visual style.

If you are referring to something specific to this component please provide more detail.


Thanks Yotsuya, that's exactly what I'm talking about. 'Shame there's such a mistake in visual mod, but oh well.  Columns UI is certainly worth the ugliness 

foo_uie_single_column_playlist

Reply #357
Which is not the desired result. Perheps this component does not fit with those who like hybrid playlists


well there you go. i like keeping my album/single playlists seperate. means i don't have to worry about resizing or omitting album art in my code. i'm all for the easy life.

foo_uie_single_column_playlist

Reply #358
All my tracks, Regardless of their nature, Are tagged to allow such a check be made. All single tracks have the aforementioned TOTALTRACKS=1 tag, While all other albums have a correct TOTALTRACKS tag for their size.

Your point still remains invalid, mquander.

foo_uie_single_column_playlist

Reply #359
All my tracks, Regardless of their nature, Are tagged to allow such a check be made. All single tracks have the aforementioned TOTALTRACKS=1 tag, While all other albums have a correct TOTALTRACKS tag for their size.

Your point still remains invalid, mquander.


My point was that when I put track 7, "Disposable Parts," from my Enon album "High Society" with 13 tracks, and I put it on a playlist with 9 tracks from 9 other albums to put in my car, no detection in the world will tell the playlist that it's supposed to be displayed as a "single."  That seems to be a usage pattern that would be almost impossible to avoid, and it is going to look pretty silly.

foo_uie_single_column_playlist

Reply #360
Hi,


I should have a white text color when the text is selected but the $textcolor and $font(,,,color) don't change the color, i don't know why.

My item display code :

Code: [Select]
$if($strcmp($num(%tracknumber%,1),$add($div(%totaltracks%,2),-1)),$repeat(' ',57)$font(,,bold,108-120-135)%artist%,)
$if($strcmp($num(%tracknumber%,1),$add($div(%totaltracks%,2),0)),$repeat(' ',57)$font(,,bold,108-120-135)%date%,)
$if($strcmp($num(%tracknumber%,1),$add($div(%totaltracks%,2),2)),$repeat(' ',57)$font(,,bold,108-120-135)'('%codec% %bitrate% kbps[ %codec_profile%]')',)
$padding(300,0)
$align(left,middle)$font(,,,139-154-173)%tracknumber%. $font(,,,108-120-135)%title%
$padding(-240,0)
$align(right,middle)%length%
$padding(-60,0)
$align(right,middle)$font(Wingdings,8,glow-0-0-0 glowalpha-20,108-120-135)$repeat(«,%rating%)

$imageabs2(103,103,,$add(-$add($div($mul(%totaltracks%,15),2),-30),$mul(%tracknumber%,15)),,,10,,images\shadow.png,)
$imageabs2(100,100,,$add(-$add($div($mul(%totaltracks%,15),2),-30),$mul(%tracknumber%,15)),,,10,,$replace(%path%,%filename_ext%,)front.png,)
$imageabs2(100,100,,$add(-$add($div($mul(%totaltracks%,15),2),-30),$mul(%tracknumber%,15)),,,10,,images\artoverlay.png,)

$if(%_selected%,$drawrect(297,0,380,0,brushcolor-null pencolor-108-120-135))
$if(%_selected%,$font(,,,255-255-255))


Thanks

foo_uie_single_column_playlist

Reply #361
I should have a white text color when the text is selected but the $textcolor and $font(,,,color) don't change the color, i don't know why.


that's because you've left the colour code until after the text has already been written.....  the code is executed line by line as it's written.

omit that last line and change your code that writes the title to this...

$if(%_selected%,$font(,,,255-255-255),$font(,,,108-120-135))%title%


foo_uie_single_column_playlist

Reply #362
I never said it should mquander, But that is NOT the case here. I have songs SPECIFICALLY tagged as singles, and songs SPECIFICALLY tagged as albums. If I'll pick a random album song and move it to somewhere else, I don't expect it to become a single. If i move a single into a playlist which has the same album as he does, I don't expect that single to become part of the album either. All I'm asking for is a hybrid playlist. Singles get no headers, Album do get headers. Thats all there's too it. Nothing impossible, I assure you.

foo_uie_single_column_playlist

Reply #363
I never said it should mquander, But that is NOT the case here. I have songs SPECIFICALLY tagged as singles, and songs SPECIFICALLY tagged as albums. If I'll pick a random album song and move it to somewhere else, I don't expect it to become a single. If i move a single into a playlist which has the same album as he does, I don't expect that single to become part of the album either. All I'm asking for is a hybrid playlist. Singles get no headers, Album do get headers. Thats all there's too it. Nothing impossible, I assure you.


edit: removed. i typed this in a hurry and wasn't thinking straight. i was spouting nonsense. apologies for wasting time.... 

foo_uie_single_column_playlist

Reply #364
You know what would be awesome? An option in the imageabs() thing for tiling.

Do you know how much memory 535 instances of a 25x850 png uses, especially when scrolling?

foo_uie_single_column_playlist

Reply #365
Do we want to know?

marc2003: Odd. So there's no reason for the "group by" section at all? I think I'm misunderstanding something here.

foo_uie_single_column_playlist

Reply #366
@yotsuya:

thanks for album art code!

foo_uie_single_column_playlist

Reply #367

I should have a white text color when the text is selected but the $textcolor and $font(,,,color) don't change the color, i don't know why.


that's because you've left the colour code until after the text has already been written.....  the code is executed line by line as it's written.

omit that last line and change your code that writes the title to this...

$if(%_selected%,$font(,,,255-255-255),$font(,,,108-120-135))%title%




Thank you marc2003, it's ok now

foo_uie_single_column_playlist

Reply #368
Code: [Select]
$ifgreater(%totaltracks%,6,
$imageabs2(150,150,0,$add(-23,$mul(%tracknumber%,23)),,,,,$replace(%path%,%filename_ext%,folder.jpg),)
,)


This assumes your albums are properly tagged with %totaltracks%.


that doesnt work

for example. if i have an album with 12 tracks and i put just song #1 in my playlist, it'll still show

foo_uie_single_column_playlist

Reply #369
Do we want to know?

marc2003: Odd. So there's no reason for the "group by" section at all? I think I'm misunderstanding something here.


see my edit above. sorry.... 

you have a choice - either headers on or headers off regardless of your files and their tags. that's the way i see it? once you introduce at least one header into a playlist, any files that follow will also have headers... i think.....

i should stop posting on this subject now.... 



Code: [Select]
$ifgreater(%totaltracks%,6,
$imageabs2(150,150,0,$add(-23,$mul(%tracknumber%,23)),,,,,$replace(%path%,%filename_ext%,folder.jpg),)
,)


This assumes your albums are properly tagged with %totaltracks%.


that doesnt work

for example. if i have an album with 12 tracks and i put just song #1 in my playlist, it'll still show


that's because the condition in your $if statement has been met. track #1 does have totaltracks more than 6 so an image will be rendered. as for a solution, i don't know.

perhaps condition your code so that an image only gets displayed depending on the name of your playlist? you cannot differentiate between single and album tracks in the same playlist when the files are tagged with both %tracknumber%, %album% and %totaltracks%.

foo_uie_single_column_playlist

Reply #370
Seems so, at least by current code. Let's hope it will change later on

foo_uie_single_column_playlist

Reply #371
earlier I had posed a request for a %group index% and I think the recent debates about placing partial albums in playlists could benefit from this so I'll rephrase and reiterate my previous request.

I would like to request the addition of two variables for this component:
%_group_index%: A variable similar to %list index% that would resolve to an integer representing an item's position in it's group.
%_group_total%: A variable that would resolve to an integer representing the total number of items in the current group.

By using something such as $if($strcmp(%tracknumber%,%_group_index%),[probably album view],[probably singles view]) or $if($strcmp(%totaltracks%,%_group_total%),[probably album view],[probably singls view]), a combination of the two, or something more thought out we would be able properly mix and match single tracks from albums.

Also we would be able to use things such as $ifgreater(%_group_total%,4,[display art],[dont display art]) to determine if a group is large enough for the art and we could use %_group_index% instead of %tracknumber% and display art for items that do not have track numbers (such as online radio genre groups).

This sort of request will inevitably fuel fire to the old eyecandy vs. functionality debate but I thought I'd put forth the request. If anyone has any refinements or a better idea please speak up.

foo_uie_single_column_playlist

Reply #372
I love the idea Yotsuya.  That is exactly what I would want for lists that have full albums, as well as individual tracks from albums (not necessarily single tracks).

foo_uie_single_column_playlist

Reply #373
Can you make it so one doesn't? GDI+ lags my games :'(


gdi+ shouldn't make a difference... have you noticed the same lag when using the new version?


Is there any way I can wrap or ellipsize text in a rectangle? I am having overwriting problems with long title songs...


you can use $alignabs to wrap and prevent overwriting.

Since one of the main attractions of this component appears to be displaying album art, and because loading and resizing the images as the playlist is scrolled is slow and a strain on the disc drive, I think it might be a good idea to implement caching of resized images, in the same way as explorer does with Thumbs.db. 'cached' could be an option for the $image* functions, and when this parameter is specified, the first time the function is run for that file, the image will be loaded, resized and saved in an 'image database' file. Subsequent accesses would read the cached data from the database. The modification date of the image could be stored to detect when the image needs to be re-loaded (if it has been changed/deleted).
Of course if someone decides to change from 150x150 display of images to 160x160 the database would no longer be of any use, for this situation there could be a 'Clear database' button on the settings page.

Keep up the good work, thanks for this wonderful component.


to be honest, I haven't tried album art so I don't know how slow it is when scrolling (initially)... it should be significantly faster the second time through as the images are loaded, resized and cached in memory. Nevertheless, it seems to be a good idea, and I will try to get to it when I get the chance.


Excellent idea, david_dl.

As a fellow programmer, here are some of my thoughts...

Correct me if I'm wrong, but I think the playlist is an owner-drawn ListView common control? Whether it is or not, wouldn't a custom control be more efficient? So that you can draw the whole album art image in one step, and everything could be more customizable, such as different row heights and other things. The whole playlist viewport could respond to events, and only repaint when and where needed. The display language could be improved upon to be easier to read and write as well. Something resembling XML would be cool, and could be stored in files to be imported/exported.

Obviously that would be a lot of work, but it would make FB2k the best audio player ever if the whole UI could be done like this.

Regardless, this is incredible work, Terrestrial!


yep, owner drawn listview. A custom control isn't necessarily going to be more efficient, although it will be more customizable- but a lot more work for me ;) also, I'm not a big fan of XML, so nothing like that from me.

I should also remind everyone to properly use clipping for images. Leaving the clipping height blank when doing slices for album art is inefficient as more of the image than necessary may get drawn and then clipped- whereas using a proper clipping height will only draw the necessary part of the image. use something like:

Code: [Select]
$imageabs2(150,150,0,$sub($mul(%_height%,$sub(%_itemindex%,1)),5),,%_height%,4,0,$replace(%path%,%filename_ext%,folder.jpg),alpha-80)


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

I've upload a new version. few fixes, some new features.

 

foo_uie_single_column_playlist

Reply #374
Quote
Sep 24, 2006

+ fixed centering/resizing bug
+ option to span group display over one or more rows
+ !noheader! to suppress header
+ readded updating every second
+ selectable playlist
+ columns ui globals (untested..)
+ _itemcount _itemindex


Thank you terrestrial for another impressive update, I'd like to especially thank you for the %_itemcount% and %_itemindex%. Lots of new toys to play with in this one :)

Edit: That first one means all the ugly lines are gone from images resized with different aspect ratios.. yay!
Edit: Image files are no longer locked, so you can update album art without closing foobar.. yay!