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

foo_uie_single_column_playlist

Reply #1225
you need to use more specific (and complex) sort algorithms.
I tried to oversimplify things during my previous example maybe that was a bad choice. I am not siimply using column headings like the previous post but instead trying to apply different sorting strings to change the view of the playlist between albums, singles, and online radio streams. This is my current code:
Code: [Select]
$drawrect(0,0,0,0,brushcolor-210-210-210 pencolor-null)

$alignabs(2,2,%_width%,%_height%,,)$font(tahoma,7,,0-0-0)Sorting$font(,,,128-128-128):$rgb()

$button2(50,1,0,0,37,13,'$rgb()$char(91)$font(tahoma,7,,128-128-128)Albums$rgb()$char(93)','$font(tahoma,7,shadow,255-255-255)Albums',
'SORT:Albums|
%album artist% - $if(%tracknumber%,%date%,0) - $if(%tracknumber%,%cdid%,) - $if(%tracknumber%,%album%, ) - %discnumber% - %tracknumber%
:dummy',)

$button2(90,1,0,0,35,13,'$rgb()$char(91)$font(tahoma,7,,128-128-128)Singles$rgb()$char(93)','$font(tahoma,7,shadow,255-255-255)Singles',
'SORT:Singles|
%artist% - %title%
:dummy',)

$button2(128,1,0,0,29,13,'$rgb()$char(91)$font(tahoma,7,,128-128-128)Radio$rgb()$char(93)','$font(tahoma,7,shadow,255-255-255)Radio',
'SORT:Radio|
$if($strstr($replace($lower(%genre%),$char(39) , ),goa),Goa,
$if($strstr($replace($lower(%genre%),$char(39) , ),trance),Trance,
$if($strstr($replace($lower(%genre%),$char(39) , ),techno),Trance,
$if($strstr($replace($lower(%genre%),$char(39) , ),anime),Anime,
$if($strstr($replace($lower(%genre%),$char(39) , ),japanimation),Anime,
$if($strstr($replace($lower(%genre%),$char(39) , ),jpop),JPop,
$if($strstr($replace($lower(%genre%),$char(39) , ),jrock),JPop,
$if($strstr($replace($lower(%genre%),$char(39) , ),japanese),JPop,
$char(255))))))))) - %codec% - $num($sub(1000,%bitrate%),3)
:dummy',)

This more or less works with the exception that I have to go and click reset between each button. This is why I have added the :dummy entry at the end to reveal the popup. Ideally I would like to find a way that the button would auto-reset the sort string after the sorting is performed so that I can eliminate the menu completely and use the different buttons to toggle different playlist views.

foo_uie_single_column_playlist

Reply #1226
hi all
been searching for a solution to this but can't really figure a way out
for singles/singletracks, i use a SINGLETRACK tag to distinguish them

what can i type in the Group column
so under a playlist with both albums and singles
the singles will be all grouped together without headers
or if there's a header, it's under a common header called SINGLES

thanks!

foo_uie_single_column_playlist

Reply #1227
wilflare: First you need to change your sorting string so that the singles appear together. add %SINGLETRACK% toward the beginning of your sort string:

File> Preferences> General> "Sort incoming files by:"
(for new playlists) -or- (for existing playlists)
Edit> Sort> Sort By...

Once your playlist is sorted you can change your group by code to something like this:
$if(%SINGLETRACK%,!noheader!,%album%%discnumber%)

foo_uie_single_column_playlist

Reply #1228
Can you add standard UI behavior to SCP? Specifically, have tab cycle back and forth to SCP? As if right now, if track in SCP is selected, you cannot tab away to anything else within the :B window.

This becomes necessary for remote control operation.

Thx!

foo_uie_single_column_playlist

Reply #1229
hi all
been searching for a solution to this but can't really figure a way out
for singles/singletracks, i use a SINGLETRACK tag to distinguish them

what can i type in the Group column
so under a playlist with both albums and singles
the singles will be all grouped together without headers
or if there's a header, it's under a common header called SINGLES

thanks!


Then if you want to group adjacent single tracks together, you can do something like:
$if(%singletrack%,%singletrack%,%labum%)

Then in the group display box, something like:
$if(%singletrack%,SINGLES,Code for displaying non-singletrack songs)

foo_uie_single_column_playlist

Reply #1230
What I currently do for sorting is to have a ColumnsUI playlist above my Single Column Playlist that is so small that only the column titles are showing.  You could define your own columns with your own customized sorting strings and name them however you want.  This strategy allows much flexibility and you don't have to reset anything like you do with the SORT command in Trackinfo mod buttons. 

I find it's also handy to have a ColumnsUI playlist to the side of my Single Column Playlist because with all the images I use in Single Column Playlist, it scrolls kind of slowly, whereas ColumnsUI scrolls about as fast as my mouse can move ;-)

foo_uie_single_column_playlist

Reply #1231
HI,
    how I can eliminate those "square"chracters  from lyrics tag?
    thanks
    Flavio

I believe those square characters are what is displayed for a character that is not defined in the particuar font you are using.  Try swithing the font to Arial Unicode.  If something other than square characters are displayed, then it's just a matter of using a font that has those characters.

foo_uie_single_column_playlist

Reply #1232
adrosenth: This situation has been discussed several times already please read the earlier posts before posting. Many (including myself) have requested a minimum rows/minimum group height option. Until such a feature emerges you can have the cover art removed for groups not large enough to display full image like this: ...

You can alternatively have the image sized to either the dimesnsoins of width x width [width being the width that you choose to set aside to be available for album art] when there is enough room [when $mul(%height%,$get(numrows)) is greater than the width], or to the dimensions of height x height when the width that you allow is greater than the available height. [I hope that made sense]

foo_uie_single_column_playlist

Reply #1233
I've tried searching, and can't come up with a definitive answer (although I've muddled through) - what exactly do blank or 0 values mean in an $imageabs2() function?  It's explained in the wiki for $imageabs(), but not abs2.


either 0s or full width/height.


Terrestrial, I'm having a problem that cropped up with the new version. Stretched images have a fade to the right or bottom, depending on which way its stretched. I know how to fix it, but I obviously don't have access to the code. Check your GDI+ graphics object and make sure that your quality and interpolation settings are correct.


everything is pretty much default. I can't reproduce it either... maybe post an example image/code?


So I've had some fun learning about the sort command however I am having a bit of difficulty. To begin with I do not want a sorting context menu I just want the button to perform the sort. I found out that by specifying only one item/value combo, that value will auto execute. First hurdle cleared. However it appears that when using multiple buttons their sorting accumulates. So if you click a button to sort by %artist%, then click a button to sort by %album% this is the same as only clicking a button for %artist%%album% (or did I get that reversed?).

What I would like to do is have each button's sort isolated from each other. So that when I click on a button to sort by %artist% the list will sort by artist and if I then click on a button to sort by %album% the list is then resorted by album regardless of artist. (The difference in this example is slight, becomes apparent with various artist albums, but the problem is amplified with complex sort strings).  There is an option called "reset" available from the context menu which will allow the user to manually clear each tag from the sorting string however I can find no way to automate the process.

Does anyone have any ides on how to create buttons that will sort the playlist regardless of which buttons have been clicked before?


you can click the button again and that particular sort string will be removed. alternatively append "RESET" to the sort string. there's also a button to reset the sort string, I think.

foo_uie_single_column_playlist

Reply #1234
...
you can click the button again and that particular sort string will be removed. alternatively append "RESET" to the sort string. there's also a button to reset the sort string, I think.

I think this appending of RESET is exactly what I am after, however I am having a bit of trouble making it work.

I have tried the following as the button2 command with no success:

'SORT:Singles|%artist% - %title%RESET:dummy'
'SORT:Singles|%artist% - %title% RESET:dummy'
'SORT:Singles|%artist% - %title%:dummy RESET'
'SORT:Singles|%artist% - %title%:dummy' RESET
'SORT:Singles|%artist% - %title%"RESET":dummy'

foo_uie_single_column_playlist

Reply #1235
'SORT:Singles:RESET %artist% - %title%' should do it.

foo_uie_single_column_playlist

Reply #1236
Quote
everything is pretty much default. I can't reproduce it either... maybe post an example image/code?


Here's an example of what it looks like. Notice the right sides of the black group image, selection and now playing images. They all have a faded stretched look, which is not intentional.

[img=http://img213.imageshack.us/img213/7968/scpl2ik.th.jpg]

Here's the code I use to generate my playlist.

Row Height: 22
Group Rows: 2
Edge Style: Grey
Background: White
Group By: %album%%discnumber%

Group Headers:
Code: [Select]
$imageabs2(%_width%,%_height%,0,0,0,0,0,0,C:\Program Files\foobar2000\images\header.png,NOKEEPASPECT)
$font(Segoe UI,9,bold glow-0-0-0 glowexpand-1,255-255-255)
$alignabs(6,6,$sub(%_width%,100),%_height%,left,)%artist%
$alignabs(6,24,$sub(%_width%,100),%_height%,left,)%album%$ifgreater(%totaldiscs%,1,' (Disc' %discnumber% of %totaldiscs%')',)
$alignabs(-10,6,%_width%,%_height%,right,)%genre%
$alignabs(-10,24,%_width%,%_height%,right,)%date%


Items:
Code: [Select]
$drawrect(0,0,230,%_height%,brushcolor-111-117-143 pencolor-null)
$ifgreater(%_itemcount%,10,$puts(artsize,220),$puts(artsize,$sub($mul(%_height%,%_itemcount%),10)))
$ifequal($mod(%_itemindex%,2),0,$drawrect(230,0,$sub(%_width%,230),%_height%,brushcolor-231-233-239 pencolor-null),)
$if(%_isplaying%,
$imageabs2(27,22,0,0,0,0,230,0,C:\Program Files\foobar2000\images\nowplayingleft.png,)
$imageabs2($sub(%_width%,259),%_height%,0,0,0,0,257,0,C:\Program Files\foobar2000\images\nowplayingmiddle.png,NOKEEPASPECT)
$imageabs2(2,22,0,0,0,0,$sub(%_width%,2),0,C:\Program Files\foobar2000\images\nowplayingright.png,)
)
$if(%_selected%,
$imageabs2(27,22,0,0,0,0,230,0,C:\Program Files\foobar2000\images\selectionleft.png,)
$imageabs2($sub(%_width%,259),%_height%,0,0,0,0,257,0,C:\Program Files\foobar2000\images\selectionmiddle.png,NOKEEPASPECT)
$imageabs2(2,22,0,0,0,0,$sub(%_width%,2),0,C:\Program Files\foobar2000\images\selectionright.png,)
)
$if($fileexists($replace(%path%,%filename_ext%,folder.*)),$imageabs2($get(artsize),$get(artsize),0,$ifequal(%_itemindex%,1,0,$sub($mul(%_height%,%_itemindex%),$sub(%_height%,-5))),,%_height%,5,$ifequal(%_itemindex%,1,5,0),$replace(%path%,%filename_ext%,folder.*),),)
$font(Segoe UI,8,,0-0-0)
$alignabs(233,0,20,%_height%,right,middle)$num(%tracknumber%,1).
$alignabs(262,0,$sub(%_width%,300),%_height%,left,middle)%title%
$alignabs(-10,0,%_width%,%_height%,right,middle) [%playback_time% / ]%length%


The code used is nothing special. The images that are being stretched are small, less than 30 pixels in width.

You should be able to reproduce it. I'm surprised no one else has this problem as well.

Here's a bit of VB.Net sample code I use for the proper tiling of an image.

Code: [Select]
        Dim G As Graphics = Graphics.FromHwnd(Me.Handle)
        Dim Img As Image = Image.FromFile("C:\Program Files\foobar2000\images\selectionmiddle.png")
        Dim IA As New System.Drawing.Imaging.ImageAttributes
        IA.SetWrapMode(Drawing2D.WrapMode.Tile)

        Dim dstRect As New Rectangle(0, 20, Me.Width, Img.Height)
        G.DrawImage(Img, dstRect, 0, 0, Img.Width, Img.Height, GraphicsUnit.Pixel, IA)

        Img.Dispose()
        G.Dispose()


So maybe you can add a TILE option to the $imageabs2() function?

foo_uie_single_column_playlist

Reply #1237
can you post the image that you're stretching


foo_uie_single_column_playlist

Reply #1239
I think I've found a bug with adding to the playback queue.

If I enqueue a track in ColumnsUI or the defaultUI it will switch playback to the playlist where I enqueued the file.

However if I do the same thing in SCP it goes back to where it was before. Also while playing the enqueued item %_isplaying% returns 0 and %cwb_queue_end_playlist% returns an empty string.

It's kind of annoying as I use add to playback queue to gaplessly change playlists.


Any chance of getting this fixed? It's just a bit of a blocker for me.

foo_uie_single_column_playlist

Reply #1240
'SORT:Singles:RESET %artist% - %title%' should do it.


I am sorry but I am still having problems implementing this reset command. I tried the code you posted but all it did was create a second menu item called "RESET %artist% - %title%". I tried replacing the second colon with a pipe because this appeared to be more in line with the syntax of the wiki:
"SORT:Singles|RESET %artist% - %title%'
However this still is not executing the reset. This is my current button code I am using for testing:
Code: [Select]
$button2(90,1,0,0,35,13,'$rgb()$char(91)$font(tahoma,7,,128-128-128)Singles$rgb()$char(93)',
'$font(tahoma,7,shadow,255-255-255)Singles',
'SORT:Singles|RESET %artist% - %title%:Dummy',)

After the button is clicked and "Singles" is selected, the menu no longer displays "Singles" unless you choose "Reset".

foo_uie_single_column_playlist

Reply #1241

I think I've found a bug with adding to the playback queue.

If I enqueue a track in ColumnsUI or the defaultUI it will switch playback to the playlist where I enqueued the file.

However if I do the same thing in SCP it goes back to where it was before. Also while playing the enqueued item %_isplaying% returns 0 and %cwb_queue_end_playlist% returns an empty string.

It's kind of annoying as I use add to playback queue to gaplessly change playlists.


Any chance of getting this fixed? It's just a bit of a blocker for me.


seems to work fine for me...


'SORT:Singles:RESET %artist% - %title%' should do it.


I am sorry but I am still having problems implementing this reset command. I tried the code you posted but all it did was create a second menu item called "RESET %artist% - %title%". I tried replacing the second colon with a pipe because this appeared to be more in line with the syntax of the wiki:
"SORT:Singles|RESET %artist% - %title%'
However this still is not executing the reset. This is my current button code I am using for testing:


yep, that's a typo on my part. here's some code that should work:

Code: [Select]
$if($sorted(Title),$drawrect(0,0,40,12,pencolor-0-0-0 brushcolor-null))
$button2(0,0,0,0,40,12,
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,0-0-0)Title',
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,255-0-0)Title',
    'SORT:Title|%title%',)

$if($sorted(Artist),$drawrect(50,0,40,12,pencolor-0-0-0 brushcolor-null))
$button2(50,0,0,0,40,12,
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,0-0-0)Artist',
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,255-0-0)Artist',
    'SORT:Artist|RESET %artist%',)

$alignabs(0,14,100,14,center,middle)$font(tahoma,7,bold,0-0-0)%sortstring%


Quote
After the button is clicked and "Singles" is selected, the menu no longer displays "Singles" unless you choose "Reset".


that's by design (since "Singles" is already added to the sort string).

foo_uie_single_column_playlist

Reply #1242
Thank you for your help this appears to be working now. I do have a few more questions though. Am I right in assuming that by placing the RESET at the beginning, the sorting string isn't reset until the beginning of the next sort? I tried to expand upon the idea by using $sorted(Title) in the SCPL group by code but have once again come upon a stumbling block. I tried to expand on your previous example like this:

Code: [Select]
$if($sorted(Title),$drawrect(0,0,40,12,pencolor-0-0-0 brushcolor-null))
$button2(0,0,0,0,40,12,
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,0-0-0)Title',
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,255-0-0)Title',
    'SORT:Title|%title%',)

$if($sorted(Artist),$drawrect(50,0,40,12,pencolor-0-0-0 brushcolor-null))
$button2(50,0,0,0,40,12,
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,0-0-0)Artist',
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,255-0-0)Artist',
    'SORT:Artist|RESET %artist%',)

//$if($and($sorted(Artist),$sorted(Title)),$drawrect(100,0,40,12,pencolor-0-0-0 brushcolor-null))
$if($sorted(Both),$drawrect(100,0,40,12,pencolor-0-0-0 brushcolor-null))
$button2(100,0,0,0,40,12,
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,0-0-0)Both',
    '$alignabs(0,0,40,12,center,middle)$font(tahoma,7,bold,255-0-0)Both',
//    'SORT:Artist|RESET %artist% - %title%',)
    'SORT:Both|RESET %artist% - %title%',)

$alignabs(0,14,100,14,center,middle)$font(tahoma,7,bold,0-0-0)%sortstring%
But this is giving me odd behavior. The "Title" and "Artist" buttons behave as expected however the "Both" button has somewhat unpredictable behavior. Although I would have thought that with the RESET at the beginning of the string, clicking on either of the first two for a second time wouldnt clear the sorting. Also, does %sortstring% only return the first field of the current sort string?
Sorry, it appears $sorted() and %sortstring% refer to the name before the pipe, not the fields included in the sort string. I renamed the last command and realized this. I actually prefer this :)

Is %sortstring% and $sorted() available outside of the panel in which the buttons appear that set them? I keep getting ? or [UNKNOWN FUNCTION] when trying to use these in a different panel than the one the buttons are in.

foo_uie_single_column_playlist

Reply #1243
thanks Yotsuya for the sorting code
just one last thing
i don't need my singletracks to display track number
so is there anyway, for it to display the artist name in the column instead.

using bbmartini's config.

here's the item display for the single column playlist
$ifequal($mod(%tracknumber%,2),0,
$imageabs(,,\images\LE5\reluna1.png,),   
$imageabs(,,\images\LE5\reluna2.png,))

$if(%_selected%,$imageabs(,,\images\LE5\relunagreen.png,),)

$if(%isplaying%,$imageabs(,,\images\LE5\relunablue.png,),)
$if(%isplaying%,$font(Calibri,8,bold,0-0-200),$font(Calibri,8,,0-0-0))

$alignabs(277,2,%_width%,20,left,)
$if(%isplaying%,%_time_remaining%,%length%)

$padding(7,)
$align(left,middle)
[%tracknumber%]

$alignabs(28,2,%_width%,20,left,)
[%title%]

$ifgreater($mul(%_height%,%_itemcount%),88,
$imageabs2(100,90,0,$sub($mul(%_height%,%_itemindex%),$add(%_height%,1)),,%_height%,175,,images\ART_cd.png,)
$imageabs2(80,79,0,$sub($mul(%_height%,%_itemindex%),$add(%_height%,5)),,%_height%,190,,$replace(%path%,%filename_ext%,folder.jpg),)
$imageabs2(100,90,0,$sub($mul(%_height%,%_itemindex%),$add(%_height%,1)),,%_height%,175,,images\case.png,)
,)

sorry for the trouble but really appreciate the help!

foo_uie_single_column_playlist

Reply #1244


I think I've found a bug with adding to the playback queue.

If I enqueue a track in ColumnsUI or the defaultUI it will switch playback to the playlist where I enqueued the file.

However if I do the same thing in SCP it goes back to where it was before. Also while playing the enqueued item %_isplaying% returns 0 and %cwb_queue_end_playlist% returns an empty string.

It's kind of annoying as I use add to playback queue to gaplessly change playlists.


Any chance of getting this fixed? It's just a bit of a blocker for me.


seems to work fine for me...


Any ideas why it doesn't work like this for me?

I've got the latest SCPL (0.4.5 beta), ColumnsUI (0.1.3 beta 1v7) and Foobar.

foo_uie_single_column_playlist

Reply #1245
i don't need my singletracks to display track number
so is there anyway, for it to display the artist name in the column instead.

I do not use bbmartini's config but this looks like the chunk of code that controls the tracknumber and title columns:
Code: [Select]
$padding(7,)
$align(left,middle)
[%tracknumber%]

$alignabs(28,2,%_width%,20,left,)
[%title%]

This would be my suggestion on how to adapt this code for use with your SINGLETRACK tag, replacing the track number with artist name for those singles:
Code: [Select]
$padding(7,)
$align(left,middle)
$if(%SINGLETRACK%,
[%album artist% - ]%title%
,
[%tracknumber%]
$alignabs(28,2,%_width%,20,left,)
[%title%]
)

foo_uie_single_column_playlist

Reply #1246
How do I put a $drawrect on the line above selected?

 

foo_uie_single_column_playlist

Reply #1247
Hey, I have pretty much no experience coding and would like some help.  What I want to do is have the song title aligned to the left when the genre is Classical, and to the right for everything else.  Is it possible?  Thanks in advance.

foo_uie_single_column_playlist

Reply #1248
How do I put a $drawrect on the line above selected?

As far as I know there is no way to code one line based on another, however you may be interested in something like this:
$if(%_selected%,$drawrect(0,0,0,1,brushcolor-0-0-0),)


Hey, I have pretty much no experience coding and would like some help.  What I want to do is have the song title aligned to the left when the genre is Classical, and to the right for everything else.  Is it possible?  Thanks in advance.

$alignabs(0,0,%_width%,%_height%,$if($strcmp($lower(%genre%),classical),left,right),)%title%

EDIT: too many languages swimming in my head

foo_uie_single_column_playlist

Reply #1249
$alignabs(0,0,%_width%,%_height%,$if($strcmp($tolower(%genre%),classical),left,right),)%title%

Little change to that.
Code: [Select]
$alignabs(0,0,%_width%,%_height%,$if($strcmp($lower(%genre%),classical),left,right),)%title%