Rockbox Technical Forums

Support and General Use => Theming and Appearance Customization => Topic started by: JdGordon on January 07, 2010, 02:56:36 AM

Title: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 07, 2010, 02:56:36 AM
bertrik got this silly idea into my head today that it would be relativly simple to implement a playlist viewer for the WPS...
well it turns out it was :)
(http://www.rockbox.org/tracker/task/10898?getfile=21179)

Thats a simple example as usual... the 4 lines are in a viewport which dumps many upcoming tracks as will fit (or are in the playlist).
The top three show the title and track length because they have been buffered already. The bottom one shows the filename because its not on the buffer yet.

My goal is to make it very customisable, so while its in development I need help figuring out the syntax for the wps token.

Right now you just add %Vp in a viewport and it will display in the whole viewport. I'm thinking something like the following would be good...
%Vp|<start offset>|<WPS code to display if ID3 is loaded>|<display if not loaded>
start offset is the first track to start the listing.. I want to allow this to be negative so you can see the previous tracks also, but that doesnt work yet, 0 would be the current track and 1 is the next track
I really want to make this flexible which means putting in a very simple skin parser for the text (limited to pretty much just %i* tokens and a few others)
Right now none of the lines scroll... if a skin parser is used we can probaly get scrolling happening, but maybe its not needed? a flag for scroll all or scroll none could be enough?
do we need to bother showing the current track differently? like with an icon or shading like the lists? I'm thinking not really...

anyway, have a play with the patch, or come up with ideas on what to add...
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 07, 2010, 12:52:10 PM
nuts... Its looking very likely that without major work of som sort or another, I wont be able to aadd the full customisability I want.
so instead I'll just hard code two versions which you can chose from (suggestions welcome)

the first will be one line per track, like the screenshot but the time display aligned on the right and the title scrolling (if enabled)
the second will be 2 lines per track, the first being the artist (scrolling if enabled) or the directory if no id3 is avilable, the second line will be the title/filename

That should be enough to waste screen space :)
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: ew on January 07, 2010, 01:21:49 PM
Since you invited ideas.... ;D

What about a line for totals (number of tracks, time)

It would also be nice if this (or something similar) could be available from the WPS context menu.  That way, it would be available even if one does not want to allocate space on the wps for the viewport for the playlist viewer.

Just my $.02 for what it is worth.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 07, 2010, 01:24:49 PM
the point of this is to add more info which isnt available in the standard WPS tokens. number of tracks is easily available, and total time isnt ever going to be (without reading every track in the playlist there is no way to know this, and thats a nodo)

you have the real playlist viewer available in the wps context menu which is much more useful than this.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: BdN3504 on January 07, 2010, 01:31:42 PM
I'd suggest dropping the "start value" and just check if there's already a %X (X stands for Next in playlist info) tag used. Then only the end value has to be defined and the start value will always be either track 3 or track 2 (if no %X tag is used). Do you read me?
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 07, 2010, 01:55:46 PM
nope, I have no idea what you are trying to say :)
by the way, the end value isnt defined, it goes by the size of the viewport, so if there is enough for 3 lines, 3 lines will be displayed.

I originally wanted to be able to display something like:
4: previous
5: current <- the track that is currently playing
6: next
7: next+1

which is why the start offset is important (not everyone is going to want to see the previous and current track).

Also, from a codeing point of view, looking back to see if any tokens were used is bad.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: ew on January 07, 2010, 02:48:39 PM
the point of this is to add more info which isnt available in the standard WPS tokens. number of tracks is easily available, and total time isnt ever going to be (without reading every track in the playlist there is no way to know this, and thats a nodo)

you have the real playlist viewer available in the wps context menu which is much more useful than this.

I see your point about not reading time for all of the tracks in the playlist - perhaps it would be useful to display a total time for the tracks available in the buffer.  The playlist viewer does not display any times at all.

Anyway, thanks for all of your contributions in making Rockbox a great product.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: soap on January 07, 2010, 09:17:46 PM
I see your point about not reading time for all of the tracks in the playlist - perhaps it would be useful to display a total time for the tracks available in the buffer. 
As much as I too wish there were a way to display a total time for all tracks in the buffer (don't worry!  I understand why it's a nodo) I do not see the value in displaying the total playtime left in the buffer.

I can not think for an honest use for this, outside the entertainment of watching the number go down and up, down and up.
;)
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 07, 2010, 11:05:25 PM
oh yeah! I got a very limited parser/displayer working :D

(http://imagebin.ca/img/DyqnHRD1.bmp)

Those top 3 lines are being drawn from the skin line "|%pp.%ia - %it|"
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: ew on January 08, 2010, 10:49:21 AM
I can not think for an honest use for this, outside the entertainment of watching the number go down and up, down and up.
;)


Heaven forbid that we would think a feature be added to Rockbox just for entertainment.  ;D
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: [Saint] on January 10, 2010, 11:22:40 AM
Could there be a way to implement this conditionally?
Like when Hold is on for instance?

I'm thinking from the viewpoint of limited screen size.
Just curious, no importence.


[St.]
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 10, 2010, 01:22:14 PM
of course. just put it in a conditional viewport.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 12, 2010, 01:15:02 AM
well bugger the lot of you.... I'm having fun implementing this wehether you want it or not! :D

(http://imagebin.ca/img/U8AzZB.bmp)

I've come up with a clever way to make it extremely customisable (including partial scrolling) without making the code complex :D
Everything under "Up next:" in that screenshot is this playlist viewer. except there are 3 of them! One does the playlist number, one does the track title/filename (could be scrolling if you wanted but I tihnk that looks crap), and one does the track time (-- is because those tracks havnt been buffered yet).

I've attached my wps to give you an idea how it looks... the skin language is now looking like:
%Vp|<offset>|<code to show if id3>|<show me otherwise>|
the offset is how far from the current track to start displaying. 0 is the current track, 1 is the next track, etc

The code in the next two parts is a very limited skin code. NO conditionals, and just about no tags are supported... the following list are supported:
<free text>
%pp - playlist position
%fn - file name
%fp - file path
%ia - artist
%it - track title
%pt - track length
%s - scroll the whole line


add suggestions for which other tags to add support for.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: Ste- on January 12, 2010, 02:28:17 AM
Good work. I also like the look of this and cant wait to get started themeing with it.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: perfectdrug on January 12, 2010, 07:39:38 AM
I'm looking forward to try this out  :)
thanks
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: Biont on January 12, 2010, 09:17:00 AM
I'm definetely going to use this in my theme as well - as soon as I can.
It looks very nice and seems pretty customizable by now
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: karashata on January 12, 2010, 06:16:28 PM
I have to admit I rather like where this is going, I only regret I own a DAP with very little screen space, though I may still have to play with it when I get a chance anyway to see if I can't make something work...
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 13, 2010, 01:04:03 AM
This just got commited :) I'll put my example wps on the theme site
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 15, 2010, 02:37:53 AM
Blame [St.] for this post....

The attached wps shows off more of this feature :p
I'm now using sublines and conditional viewports to display (alternativly) the title, author and genre of each track (with the playlist number and track time always shown)

This will be on the theme site as soon as checkwps lets me upload it :/
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: psycho_maniac on January 15, 2010, 09:53:12 PM
you know whats crazy? i remember when the rockbox for the h1xx series was being developed and we were talking about UI. it had this kind of feature, but photoshopped. Users said that this would never be implemented and now look how far we have come? this is great!
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: yapper on January 15, 2010, 10:16:37 PM
This is a very nice addition - now we need some of the more artistic types to come up with themes  :)
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: bakseetdrivr on January 16, 2010, 12:17:15 AM
once 3.5 comes out, I'm going to modify amarok for the ipod video, deleting some of the lower stuff and replacing it with playlist info :)
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: raudonkepuraite on January 16, 2010, 01:04:01 PM
A question: how many viewers can be used per screen? I understand that I am able to put them to conditional vps... right?
I have some freakn' neat wps ideas :D
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 16, 2010, 08:53:31 PM
bakseetdrivr: why wait for 3.5? (especially when it looks like there is no interest in releaseing for a while anyway)

raudonkepuraite: there is no limit to the amount of these you can put on the screen, the demo a few posts up has 5... anyone using more than 20 will get a special prize from me :D

psycho_maniac: you wouldnt like to find that discussion would you? would be pretty funny to look back on



If there are any tags which you really want but don't work now, let me know.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: [Saint] on January 17, 2010, 02:53:06 AM
Blame [St.] for this post....

w00t!

Happy to take the blame for that :D


[St.]
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: raudonkepuraite on January 17, 2010, 11:16:11 AM
If there are any tags which you really want but don't work now, let me know.

I really want %C tag... is it possible?
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 17, 2010, 12:03:29 PM
its not possible
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: Biont on January 25, 2010, 10:16:48 AM
(http://img62.imageshack.us/img62/4595/fidelityplaylist.jpg)

Works great, thanks for this feature.
This will be even better when I can display it "along" with Album Art instead of instead of it :D
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: Chronon on January 26, 2010, 02:59:50 PM
As much as I too wish there were a way to display a total time for all tracks in the buffer (don't worry!  I understand why it's a nodo)
Can you explain why it's a no-do?  Is it due to the expense of opening each file just to determine its runtime?  What about EXTM3U tags in the playlist?  There's an old patch on the tracker that's probably out of sync now that adds support for EXTM3U tags.  http://www.rockbox.org/tracker/task/7652

However, I guess this doesn't actually help for getting the total runtime unless the entire playlist is scanned when it's loaded.  I'm not sure whether or not that's the case.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 26, 2010, 03:05:09 PM
even using the EXTM3U (which doesnt guarentee correctness), there is nowhere to store these numbers, remember the playlist could be very large.
and yes, we don't want to open every file to see their length
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: Chronon on January 26, 2010, 03:15:54 PM
Yes, it may contain all tracks on the player (or more even). 

The discussion just caught my eye and reminded me of this patch, in particular these comments by the author:
Quote
Supporting EXTM3U format has several potential benefits:
1. Instead of displaying filenames, track title and length can easily be viewed when viewing playlist (currently I think there is a patch that does it by opening each file).
2. Length of playlist can be readily calculated by summing, which can have some interesting applications such as finding how much time is left in current playlist. (Currently this is not possible yet with this patch, but I'm still thinking of possible solutions).
I can see that finding the total playtime for playlists of arbitrary length could be problematic even without the problem of opening each file.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on January 26, 2010, 03:21:40 PM
I havnt looked at the extm3u patch, and I wouldnt have any problem accepting it if its done correctly, especially now we have this which would put it to good use. the hard thing is storing all that extra info safely.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: Biont on February 14, 2010, 08:05:08 PM
... anyone using more than 20 will get a special prize from me :D

Do 18 viewports qualify if they're conditional viewports? ;D

(http://themes.rockbox.org/themes/320x240/breeze/1-2.png)

I obviously had some fun with your playlist viewer today and I noticed some things:

1. The %fn tag works like the %fm tag (->it does show the file extension) while %fm does not work at all.
Being able to leave out the file extension would be nice since file names tend to be pretty long and screen space is limited

2. The %d1,%d2,... tags would also be nice. Assuming a proper folder structure (Artist/Album/title.mp3), you could still provide useful information even without ID3-tags in most cases.

Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on February 14, 2010, 08:22:56 PM
Post the wps.. looks gooood
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: Biont on February 14, 2010, 09:53:39 PM
It's on the theme site for Cowon D2 (and iPod Video, I guess)

http://themes.rockbox.org/index.php?themeid=508&target=cowond2
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on February 14, 2010, 11:03:44 PM
haha right. I forgot it lets you choose the offset :p and no, you need to get to 20 for the prize.
I'll fix %fn/m and I want to fix %d but there isnt much that can be done without a bit of extra work (which is planned, but no time just yet)
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: Biont on February 17, 2010, 07:08:26 PM
Alright, 21 viewports!

(http://img27.imageshack.us/img27/5420/neu3.png)

Actually, there are 22 viewports in the viewer, but the track info on the top is a normal viewport that displays the %it tag. I noticed some rare cases when the viewer would show nothing at all if the id3 info is missing. Now there's at least one line that says "unknown" in that case.

The theme is ready for upload, but the theme site's checkwps won't let me upload it at the moment.

Now what's my prize? ;D


I'm looking forward to your fixes and I hope getting the %d tag to work won't cause too much struggle.
And thank you for all the work you put in the wps/sbs stuff. You surely know how to keep me interested in making themes for rockbox :)

 
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on February 18, 2010, 03:38:30 PM
you got your prize yesterday! your very own copy of the win32 d2 sim :)

%d is going to be a struggle so it wont happy any time soon I think. And I had a look at fn/m and its not so simple either :/
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: Biont on February 21, 2010, 04:26:20 PM
Hehe, I knew you'd say that :) Thanks again for helping me out.

Aligning works nicely for items with ID3 tags. Not sure about when there's no info, though. It seems it doesn't work there (yet)
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: iPodFoo on May 01, 2010, 10:39:39 AM
Any particular reason why the playlist viewer doesnt display the last track?

Im using Rockbox r24777-1002.

Ive tried several albums, always doesnt display the last track.
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: JdGordon on May 01, 2010, 10:41:38 AM
that was a bug which I fixed maybe 2 weeks ago...
Title: Re: new toy to play with... playlist viewer in WPS (FS#10898)
Post by: iPodFoo on May 01, 2010, 11:12:34 AM
Quote
that was a bug which I fixed maybe 2 weeks ago...

Ok cool. Thanks. Just need to find a more up to date sim then. Cheers.