INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Modifying Web Remote to serve up XML instead  (Read 3727 times)

apranger

  • Regular Member
  • Member
  • *
  • Posts: 4
Modifying Web Remote to serve up XML instead
« on: July 02, 2002, 05:24:00 pm »

Anyway, I've been digging through MediaJukebox's web remote plugin source, and a fun project occured to me. I have decided to wade through the code and hack it into a sort of XML server. I know someone has already added CSS support to a version of this plugin, but I'd rather just ship out some XML data, run it through an XSL transform, and dump it into a webpage of my own design.

This way, people could write whatever sort of frontend they want (my choice would be ASP.NET) as long as they can deal with processing the XML stuff that comes back from MJ.

However, I do have some questions for those interested:

1) What sort of XML structure should I go with? Something designed similarly to MJ's browsing structure?

2) Does it matter how you send the commands to MJ, as long as XML comes back? Right now, I'm imagining something similar to what the stock web remote uses, which is stuff encoded into the URL.


I'm pretty sure I can handle any sort of XML implementation. What I'm not sure about is creating a solid XML design. I think it's about time to read up on some beginners XML design.
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Modifying Web Remote to serve up XML instead
« Reply #1 on: July 02, 2002, 06:32:49 pm »

What do you think about creating a project on Sourceforge and involve as many people as possible.

Does anybody else want to help APranger? zigguratt?

MJ development team will help as much as we can with our knowledge of XML and design.

Nikolay
Logged

zigguratt

  • Regular Member
  • World Citizen
  • ***
  • Posts: 114
RE:Modifying Web Remote to serve up XML instead
« Reply #2 on: July 03, 2002, 03:17:07 am »

Actually, I'm well on my way to doing exactly that.  I've got Web Remote producing the XML that my Flash front-end (Glissando) expects.  I've altered the CHTTPMJServer::AcceptThread() method to route XML requests properly and to maintain the socket connection if XML is detected.  This allows real-time control of MJ.  For example, the volume slider on Glissando changes the volume continuously as it's moved - even over the network.  It currently expects XML requests but the same methods (functions? I'm a Java guy) could be called from a URL with the right support code.

There's one problem I've come across: the CMJFileAutomation->GetImageFile() method is supposed to accept a "number" as a parameter but I get "cannot convert parameter 1 from 'const int' to 'enum MJImageFileFlags'" when I supply a zero...
Logged
The latest version of Glissando can be had here.

zigguratt

  • Regular Member
  • World Citizen
  • ***
  • Posts: 114
RE:Modifying Web Remote to serve up XML instead
« Reply #3 on: July 03, 2002, 07:40:38 am »

Here's an example of one of the XML responses I've come up with.  When the client requests track information:



where '0' is the track number in the current playlist, Web Remote returns this XML (depending, of course, on what track is playing):


D:\Music\Enya\Watermark\04 - Storms In Africa.mp3
Enya
Watermark
Storms In Africa
3917604
244
New Age
1989
Exact Audio Copy
128
0
1007666673



0
1025699847
0
mp3




This represents all of the properties associated with CMJFileAutomation.  There seems to be a problem currently with CMJFileAutomation->GetImageFile() so the image information isn't included.
Logged
The latest version of Glissando can be had here.

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Modifying Web Remote to serve up XML instead
« Reply #4 on: July 03, 2002, 12:40:46 pm »

Hey guys, maybe you can combine your efforts?

Does it matter how you send the commands to MJ, as long as XML comes back? Right now, I'm imagining something similar to what the stock web remote uses, which is stuff encoded into the URL.

MJ does not receive any commands. Web Remote does.  Then Web Remote translates the commands to the MJAutomation language.

There seems to be a problem currently with CMJFileAutomation->GetImageFile() so the image information isn't included.

You have to use one of the enumerators instead of numbers.
GetImageFile(IMAGEFILE_IN_DATABASE) works fine. Take a look at the Track Info plug-in code.  It uses this call to retrieve the image info.

Nikolay
Logged

zigguratt

  • Regular Member
  • World Citizen
  • ***
  • Posts: 114
RE:Modifying Web Remote to serve up XML instead
« Reply #5 on: July 05, 2002, 03:26:42 am »

Thanks Nikolay. I was able to use GetImageFile(IMAGEFILE_IN_DATABASE) to retrieve the image filename. Perhaps this would be a good addition to the documentation? ;)

Adam (APranger) and I are discussing things via email right now. I've sent him the modified source to Web Remote. We'll be coming up with an XML "data model" and posting about it here.
Logged
The latest version of Glissando can be had here.
Pages: [1]   Go Up