Empeg XML Playlist - halfway to EWL party interface

Posted by: cushman

Empeg XML Playlist - halfway to EWL party interface - 06/12/2005 02:33

Ok, I got sidetracked while working on my Bluetooth project to take a look at the web party interface and what kind of work it would take to make it a reality. One thing is missing to make the party interface work, and that is a list of the current running order - a before and next view on steroids, basically. That data exists on the dynamic data partition, and I got some code from tonyc a while ago to pull fids out from it. THAT gave me the idea of creating a web service on the Empeg to output a list of tracks in XML based upon a track number. The idea is this:

Read /proc/empeg_notify to find out what track number we are on (notify_Track)
Pass that track on to the web service, which gives an XML representation of the current running order
Integrate the current running order into the Empeg Web Lite interface

So I wrote the web service. This is attached, it's called xmlplaylist. Please consider this a pre-alpha, it hasn't been tested a lot because of reasons I'll go into later. The binary should be run from telnetd while the player is running. After starting the program, point your web browser to:

http://empeg:8080/?track=0&len=20&prev=4

and you will get an XML file representing the first 20 tracks of your current running order. len tells the service how many tracks to get back, and prev tells it how many tracks to get before the current track (to show a few tunes before the currently playing one).

Here's the problem.

I can't use it like it is in EWL because of Mozilla's Same Origin policy. This is a good thing for Mozilla users, bad for my web interface. It basically says a script on http://empeg/ will NEVER have permission to access data coming from http://empeg:8080/ because they are different websites. I have the data, but I can't use it.

Any suggestions?
Posted by: JBjorgen

Re: Empeg XML Playlist - halfway to EWL party interface - 06/12/2005 03:25

Quote:
Any suggestions?

Beg Mark to include it in khttpd?
Posted by: SE_Sport_Driver

Re: Empeg XML Playlist - halfway to EWL party interface - 06/12/2005 12:21

Just in time for some Christmas and New Year's parties!
Posted by: mlord

Re: Empeg XML Playlist - halfway to EWL party interface - 06/12/2005 12:44

I thnk that having access to the current running order from khttpd on the empeg would be a Good Thing(tm), and I'm willing to add such to Hijack.

I'm thinking of perhaps a "playlist" view, similar in formatting/XML to existing Hijack playlist views, except this one is special for the current running order.

I wonder if it should only show the next "n" tracks, though, where "n" is TBD or a parameter?

Cheers
Posted by: cushman

Re: Empeg XML Playlist - halfway to EWL party interface - 06/12/2005 13:32

Quote:
I thnk that having access to the current running order from khttpd on the empeg would be a Good Thing(tm), and I'm willing to add such to Hijack.

Awesome!

Quote:
I'm thinking of perhaps a "playlist" view, similar in formatting/XML to existing Hijack playlist views, except this one is special for the current running order.

It can be formatted in any way. In the zip file I attached above I included sample output for how I formatted the output. As long as it's XML it doesn't matter too much, just as long as all the data is there. The only differences from the playlist view is that each track in the running order has a track number.

Quote:
I wonder if it should only show the next "n" tracks, though, where "n" is TBD or a parameter?

A parameter I think would be best. That way you request and get back the exact number of tracks you need. Since you have to get the tags from disk for each track it probably cuts down on disk I/O, too. It would be preferable also to be able to show x tracks before the current track, to show a Now and Next view. "Give me X tracks starting at track T" would be best, that way we could scroll forward and backwards through the entire running order (could be slow, though).

My intention for the web interface would be to only update the running order on screen if A. The current track changes or B. The total running order length changes. This makes it so I only have to monitor /proc/empeg_notify for state changes and probably update the running order list only once per song. If an insert/append/enqueue/replace happens, this would trigger an update because the running order length would change, but a tweak order would not (unless it happens through the web interface).

This would rock, Mark! If you add this to Hijack, I'll make you your "entire remote" web interface widget.
Posted by: mlord

Re: Empeg XML Playlist - halfway to EWL party interface - 06/12/2005 14:13

Okay, sounds good. I'll put it in the queue for the Christmas "break" -- just got a phone call here from a client willing to pay double+ if I can fit his stuff into this week with the other contracts I'm already busy on..

Cheers
Posted by: JBjorgen

Re: Empeg XML Playlist - halfway to EWL party interface - 06/12/2005 18:38

Quote:
just got a phone call here from a client willing to pay double+...


note to self: I need to become a highly in-demand kernel hacker when I grow up.
Posted by: pgrzelak

Re: Empeg XML Playlist - halfway to EWL party interface - 07/12/2005 09:32

...wait for it...
Posted by: SE_Sport_Driver

Re: Empeg XML Playlist - halfway to EWL party interface - 11/12/2005 00:12

Quote:
Okay, sounds good. I'll put it in the queue for the Christmas "break"


Mark, I think you should take the next 15 days off ! You've deserved it!
Posted by: AndrewT

Re: Empeg XML Playlist - halfway to EWL party interface - 15/12/2005 01:05

Quote:
...wait for it...
I'm worried, perhaps he's not very well ATM?
Posted by: mlord

Re: Empeg XML Playlist - halfway to EWL party interface - 15/05/2007 22:14

I made a start on this tonight, but have run out of time.

Nag me again in a couple of weeks to finish it.

Cheers
Posted by: mp3freak

Re: Empeg XML Playlist - halfway to EWL party interface - 20/07/2007 14:40

Hi Mark,

I'll provide the nagging, personally I'd love this functionality and can't wait to use it!

Thanks much, John
Posted by: techtom

Re: Empeg XML Playlist - halfway to EWL party interface - 12/08/2007 04:15

Since I've been working in the kernel on my Seeburg driver, I'm interesed in helpling out on the XML playlist in EWL. I probably cannot port Cushman's code into hijack. But I was thinking it might be possible to add the dynamic data as a /proc entry using the file /proc/empeg_playlist.

I've patched my source tree to the latest v77 version and I've looked at the code so I have some idea of how to add the /proc entry. But I have no XML knowledge, so I wouldn't be able to modify EWL to add playlist support.

The /proc/empeg_playlist could be implemented in two ways: 1)return the raw bytes of the playlist from the dynamic data partition. 2) have /proc/empeg_playlist return xml data for the entire playlist. "Track" from /proc/empeg_notify, would identify which item in the playlist was currently playing.

Thoughts/Comments...

-Techtom
Posted by: mlord

Re: Empeg XML Playlist - halfway to EWL party interface - 18/08/2007 13:00

Quote:
I made a start on this tonight, but have run out of time.

Nag me again in a couple of weeks to finish it.


Well, it was more like a couple of months than weeks, but it's here now: v478.
Nagging no longer required.

-ml