Help - Search - Members - Calendar
Full Version: foo_uie_single_column_playlist
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28
shakey_snake
QUOTE(HiFiRE @ Jan 15 2007, 10:07) *

QUOTE(shakey_snake @ Jan 14 2007, 22:13) *

try using single quotes


I still get unknown variable in this case.

WFM
HiFiRE
QUOTE(shakey_snake @ Jan 15 2007, 07:57) *

QUOTE(HiFiRE @ Jan 15 2007, 10:07) *

QUOTE(shakey_snake @ Jan 14 2007, 22:13) *

try using single quotes


I still get unknown variable in this case.

WFM


Sorry for the trouble, I had to update my scp dll.
vlada
VeaaC
Could you please help me with 2 little problems? I tried you config because I really like it. Unfortunately it looks like this:

IPB Image

So my 2 questions:

1) Why is the album name cropped? Probably because of using 100dpi fonts. So how do I fix it?

2) My album art images are named after following scheme: %album% - front.jpg. Sometimes it is different, in the case I'd like to display any .jpg image in the album folder.

And one more question: In the code I found a link to a file "images\minidisc.png". What is this image good for? Where can I get it?

I'm sorry for my laziness, I would be probably able to find the answers by studying the code more deeply. But I hope the questions will be really easy to answer for you.

Thanks in advance.
alphaex32
Could you please make options to change the default clicking behavior in the playlist? Especially for double clicking, because this would make it possible to use jonpb's new component to have a true "Now Playing" playlist.
http://www.hydrogenaudio.org/forums/index....st&p=464523
shakey_snake
I'd like to request an %_isgroupplaying% variable.
asciughino
HI,
how I can eliminate those "square"chracters from lyrics tag?
thanks
Flavio

IPB Image
kockroach
QUOTE(asciughino @ Jan 17 2007, 19:08) *

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

Try this:
CODE
$if(%unsynced lyrics%,[$replace(%unsynced lyrics%,$char(13),)]
You might need to change to the proper "lyrics" tag name.
alphaex32
QUOTE(shakey_snake @ Jan 17 2007, 13:01) *

I'd like to request an %_isgroupplaying% variable.
I wrote some code which will determine if a group is playing:
CODE
$if($strcmp(%playlist_name%,%cwb_playinglist%),$ifgreater($num(%cwb_playing_index%,2),$sub(%list_index%,1),$ifgreater($Add(%list_index%,%_itemcount%),$num(%cwb_playing_index%,2), 'GROUP IS PLAYING',),),)
The only problem is that this information only seems to update after you switch playlists and switch back. I'm not sure why, but I have a feeling it has something to do with foo_cwb_hooks.
shakey_snake
Sounds like SCPL could be made compatible with foo_cwb_hook updates

i dunno, maybe not.
asciughino
QUOTE(kockroach @ Jan 18 2007, 02:30) *

Try this:
CODE
$if(%unsynced lyrics%,[$replace(%unsynced lyrics%,$char(13),)]
You might need to change to the proper "lyrics" tag name.


Thank you! It works... biggrin.gif I used it this way..

CODE
$alignabs(125,32,%_width%,500,center,)$replace(%lyrics%,$char(13),))

VeaaC
QUOTE(vlada @ Jan 16 2007, 16:54) *

VeaaC
Could you please help me with 2 little problems? I tried you config because I really like it. Unfortunately it looks like this:

IPB Image

So my 2 questions:

1) Why is the album name cropped? Probably because of using 100dpi fonts. So how do I fix it?

2) My album art images are named after following scheme: %album% - front.jpg. Sometimes it is different, in the case I'd like to display any .jpg image in the album folder.

And one more question: In the code I found a link to a file "images\minidisc.png". What is this image good for? Where can I get it?

I'm sorry for my laziness, I would be probably able to find the answers by studying the code more deeply. But I hope the questions will be really easy to answer for you.

Thanks in advance.


Hi, I've set the row height to 17 and the the header height to 3 rows:
IPB Image
to display images labeled %album% - front.jpg just exchange every occurence of folder.jpg in the code with %album% - front.jpg ... very easy indeed. To display any .jpg found in the folder is another case... don't know if it is possible... but you can check if a file exists, but you have to know what alternate names the jpgs can have.
The minidisk.png is there to display albums stretching acrossmultiple discs... it is diplayed beneath the disc number...:
IPB Image


I hope it helped a bit.
beto
I am having a strange issue: some of my images do not display in SCPL using $imageabs2 and absolute paths.
They do however if you use album art display.

IPB Image
IPB Image

See my foobar screenshot. The top trackinfo shows the output of the following command:
CODE
$replace(%path%,%filename_ext%,folder.jpg)


This is the key code for album art in single column playlist:
CODE
$ifgreater($mul(%_height%,%_itemcount%),88,
$imageabs2(250,90,0,$sub($mul(%_height%,%_itemindex%),$add(%_height%,1)),,%_height%,175,,images\ART_cd.png,)
$imageabs2(230,79,0,$sub($mul(%_height%,%_itemindex%),$add(%_height%,5)),,%_height%,190,,$replace(%path%,%filename_ext%,folder.jpg),)
$imageabs2(250,90,0,$sub($mul(%_height%,%_itemindex%),$add(%_height%,1)),,%_height%,175,,images\case.png,)
,)


All my album art is a file called folder.jpg stored in the same folder that contains the tracks. The strange thing is that this only happens for some albums..... unsure.gif

Any help is appreciated.
shakey_snake
SCPL and Trackinfomod have issues with #

remove the # from the path and they will work.
Yotsuya
beto: I suspect the proble is that your path name for the album art contains a pound sign '#'. This is a known issue with SCPL. Avoid using the # character in path names and this should resolve your problem.
beto
thanks for the reply smile.gif
Are there any other signs that should be avoided?
I have problems with the following directory too:
CODE
D:\Media\Audio\Lossy\My Rips\Midnight Oil\1997 - 20,000 Watt R.S.L
shakey_snake
not that I know of.
I don't know what the deal with that one is.
Fractal_Mortality
Just wondering... Is it in the works for Single Column Playlist to utilize sorting columns like in WMP?
Example

IPB Image
kockroach
QUOTE(Fractal_Mortality @ Jan 20 2007, 13:26) *

Just wondering... Is it in the works for Single Column Playlist to utilize sorting columns like in WMP?

That would mean that it is no longer "Single Column". You can always use the "Edit>Sort>" menus to do the sorting.
Fractal_Mortality
QUOTE(kockroach @ Jan 20 2007, 14:33) *

QUOTE(Fractal_Mortality @ Jan 20 2007, 13:26) *

Just wondering... Is it in the works for Single Column Playlist to utilize sorting columns like in WMP?

That would mean that it is no longer "Single Column". You can always use the "Edit>Sort>" menus to do the sorting.


Is there a way to achieve that WMP playlist view with any other plugin?
alphaex32
QUOTE(Fractal_Mortality @ Jan 20 2007, 15:04) *
Is there a way to achieve that WMP playlist view with any other plugin?
What you could do is make a row of buttons using a trackinfo_mod panel and put it right over the playlist. Then you could make them perform sorting to simulate column headers. Of course its still not true resizable columns, but it's better than nothing.
Yotsuya
alphaex32: Is there a way to hardcode the sorting strings into the button function? Can you give a code example of your concept for sorting buttons? This sounds like an interesting idea.
shakey_snake
check the wiki.
Yotsuya
Thanks, I need to check the wiki more often :)
QUOTE
Example with SORT command:
CODE
$button2(DstX,DstY,X,Y,W,H,TEXT,HOVER TEXT,
'SORT:source|!source!:genre|%genre%:artist|%artist%:album|%album%',)

Sorting

CODE
SORT:name_1|value_1:name_2|value_2:...:name_n|value_n

Enables a sorting context menu which shows name_1, name_2, etc, corresponding to sorting by value_1, value_2, etc. SORT sorts the currently selected playlist, which manifests itself in all playlist views of that active playlist.

CODE
$sorted(field)

Returns a sort index of the field, ie if the playlist is sorted first by genre, then artist, then by album, $sorted(artist) will return 3. If the playlist is not sorted by 'field' through the SORT command described above, then $sorted(field) will be evaluated as false and produce '[UNKNOWN FUNCTION]' as text output.


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?
shakey_snake
you need to use more specific (and complex) sort algorithms.

Sorting by %artist% is incomplete. What happens when two songs are by the same artist? Then how does foobar decide which comes first? By default it (rather intelligently) then uses the previous sort method. Columns (and the rest of windows for that matter) does the same thing.

To avoid the problem, each sort string needs to have all tags found in all other strings.
wraithdu
QUOTE(beto @ Jan 18 2007, 20:36) *

thanks for the reply smile.gif
Are there any other signs that should be avoided?
I have problems with the following directory too:
CODE
D:\Media\Audio\Lossy\My Rips\Midnight Oil\1997 - 20,000 Watt R.S.L


My guess would be the comma in the Album Title.
Yotsuya
QUOTE(shakey_snake @ Jan 21 2007, 00:54) *
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
$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.
wilflare
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!
Yotsuya
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%)
ciaran
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!
eboomer
QUOTE(wilflare @ Jan 21 2007, 02:00) *

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)
eboomer
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 ;-)
eboomer
QUOTE(asciughino @ Jan 17 2007, 20:08) *

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.
eboomer
QUOTE(Yotsuya @ Jan 12 2007, 01:43) *

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]
terrestrial
QUOTE(wraithdu @ Jan 12 2007, 15:20) *

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.


QUOTE(jimbo11883 @ Jan 12 2007, 17:21) *

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. smile.gif


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


QUOTE(Yotsuya @ Jan 20 2007, 22:00) *

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.
Yotsuya
QUOTE(terrestrial @ Jan 22 2007, 01:03) *
...
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'
terrestrial
'SORT:Singles:RESET %artist% - %title%' should do it.
jimbo11883
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

$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

$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

        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?
terrestrial
can you post the image that you're stretching
jimbo11883
QUOTE(terrestrial @ Jan 22 2007, 11:08) *

can you post the image that you're stretching


Sure. Here's the three that I stretch.

IPB Image
IPB Image
IPB Image
Purple Monkey
QUOTE(Purple Monkey @ Dec 7 2006, 22:10) *

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.
Yotsuya
QUOTE(terrestrial @ Jan 22 2007, 10:46) *

'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
$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".
terrestrial
QUOTE(Purple Monkey @ Jan 22 2007, 12:28) *

QUOTE(Purple Monkey @ Dec 7 2006, 22:10) *

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...

QUOTE(Yotsuya @ Jan 23 2007, 00:08) *

QUOTE(terrestrial @ Jan 22 2007, 10:46) *

'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

$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).
Yotsuya
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
$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.
wilflare
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!
Purple Monkey
QUOTE(terrestrial @ Jan 23 2007, 06:40) *

QUOTE(Purple Monkey @ Jan 22 2007, 12:28) *

QUOTE(Purple Monkey @ Dec 7 2006, 22:10) *

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.
Yotsuya
QUOTE(wilflare @ Jan 23 2007, 10:51) *
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
$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
$padding(7,)
$align(left,middle)
$if(%SINGLETRACK%,
[%album artist% - ]%title%
,
[%tracknumber%]
$alignabs(28,2,%_width%,20,left,)
[%title%]
)
mil3s
How do I put a $drawrect on the line above selected?
Paxo
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.
Yotsuya
QUOTE(mil3s @ Jan 24 2007, 18:34) *

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),)


QUOTE(Paxo @ Jan 24 2007, 20:32) *

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
wraithdu
QUOTE(Yotsuya @ Jan 24 2007, 20:38) *

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

Little change to that.
CODE
$alignabs(0,0,%_width%,%_height%,$if($strcmp($lower(%genre%),classical),left,right),)%title%
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.