Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support
Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support Windows 7, Vista & Linux Media Center Support


Go Back   Australian Media Center Community > XP Media Center 2005 > XP Media Center 2005 - Plugins & Addons > Other MCE Addons

Community Information

Reply
 
Thread Tools
Old 29th April 2006, 09:09 PM   #1 (permalink)
MC Journeyman
No Avatar
Status headkaze is Offline:
Location Perth
ActivityPosts: 156
Reputation & Thanks Support Rating:
headkaze
Points Earned: 45

headkaze has been Thanked 4 times in 4 posts
Coding for MCE

I'm a C# coder who is gaining interest in writing some apps/games for MCE. The problem that strikes me is the butt ugly interfaces that 3rd party applications have. Not only are they butt ugly, but they seem to be unresponsive and slow. The fonts also look horrible and unreadable. My guess is that this is because they are mostly written in HTML+Java.

As a C# programmer it makes sense for me to want to write my applications using the .NET framework alongside an API like MDX. But if I did write my application using MDX there is the problem that my application would not work with a Media Centre extender because streaming 3D accellerated graphics is not possible. Also, it would mean MCE would need to close when launching my application to give me exclusive access to the video card in full screen mode.

So with this dilemma in mind (and putting aside the possibility of better API support using the "real" MCE interface in Vista), I have some idea's I'd like to throw around. I'm hoping some experts like Monster could step in and give some advice about it too.

Recently I noticed a hack for XBox 360 that allowed you to play a NES emulator on the XBox 360 using it as an extender to an MCE machine. This is possible because the emulator (NESCafe) is a Java applet running in a HTML page. This caused me to wonder...

Why havn't I seen games and applications written for MCE using Java (applets) or Flash or Director? Surely using these technologies for writing a simple API with *much* better graphical capabilities would be possible. I wonder if there is a particular reason we don't see applications written using Java applets (not javascript) for example. Is this because the MCE SDK only has the ability to use C# with it's limited output to message boxes or HTML+Java if you want to have an interface?

What are your thoughts on this, and do you think we will see a full graphical API for MCE available for C# in the near future? I am considering writing a Java applet that will have a much more responsive interface (with animated bar and background etc.) with a much closer graphical look to the "real" MCE interface and make it available to other developers to write better looking MCE apps. Perhaps I'm missing something here otherwise surely someone would have done something like this already?

Last edited by headkaze; 30th April 2006 at 06:07 AM.
  Reply With Quote
Old 30th April 2006, 01:51 AM   #2 (permalink)
MCE Journeyman
No Avatar
Status Ignorance is Offline:
ActivityPosts: 178
Reputation & Thanks Support Rating:
Ignorance
Points Earned: 63

Ignorance has been Thanked 0 times in 0 posts
Re: Coding for MCE

One of the key points is that the remote control does NOT act as a keyboard. You could probably only play the games if you had a wireless keyboard out there (which many of us do have, but it's not quite the 10" way).

But if you have a favourite java or flash game (perhaps the ones from homestarrunner would be a good starting place) there's no reason you can't try it - just make an MCL file that points off to the site that hosts the control and see what happens!

You can always try to make a matching Java+HTML interface, if you want. You could write some Javascript and some stylesheets to make the best match you possibly can, take some screenshots of the interface to get something that matches up as well as can be managed. I'd love an Open Source project to make a look and feel that matches MCE as closely as possible - perhaps we should look into starting one?

To be honest, while I'd LOVE a graphical API, I'm not going to hold my breath. If Microsoft want to get application developers really interested, we really need to be able to interact with the DirectX interface. But MCE doesn't even allow you to combine digital and analogue TV cards - now long do you think it'll be before a really good SDK? Give up now!
  Reply With Quote
Old 30th April 2006, 03:49 AM   #3 (permalink)
MC Journeyman
No Avatar
Status headkaze is Offline:
Location Perth
ActivityPosts: 156
Reputation & Thanks Support Rating:
headkaze
Points Earned: 45

headkaze has been Thanked 4 times in 4 posts
Re: Coding for MCE

I think the major problem is the way Remote Desktop works. It can't stream Direct 3D and utilize the video card accelleration on the remote extender. I've heard that Open GL has ways around this using non-MS technologies, but that's from memory so I'm not sure how well it works.

MS needs to improve the way RD works before anyone can even consider using DX for MCE application development. Then again, makes you wonder how the actual MCE interface is translated through to an extender? Anyone know how that works?

As for the remote control, it's interesting to consider that Javascript can't interface with it. Can it? (of course it can otherwise current applications would not be possible in HTML). If it can then surely the applet could use some sort of intercommunication with javascript to process remote control signals.

The question is now, if a java applet or even a Flash or Director embedded object can interact with javascript (which I know Flash and Director for example can and it only makes sense that a Java applet can too), then we can use javascript to process the remote control and send on the signals to the java applet/flash/director object. Then it's just a matter of developing an API in Java(applet)/Flash/Director that looks as good as the "real" MCE interface. Or am I dreaming here?

Last edited by headkaze; 30th April 2006 at 06:18 AM.
  Reply With Quote
Old 30th April 2006, 07:04 PM   #4 (permalink)
MCE Journeyman
No Avatar
Status Ignorance is Offline:
ActivityPosts: 178
Reputation & Thanks Support Rating:
Ignorance
Points Earned: 63

Ignorance has been Thanked 0 times in 0 posts
Re: Coding for MCE

You know, it may be possible.

MCE applications all use JScript to run them. The key is using the onRemoteEvent function, which is passed the code of the key.

Now what you'll find is that the 'onkeydown' event of the body of the HTML page is NOT fired from the remote control - try as you might, nothing happens. But it turns out that MCE internally calls the 'onRemoteEvent' function and passes a numerical code of the key pressed - most of which map to standard keyboard events.

So yes, if you are able to send key presses from Javascript/JScript to Flash, then you should be quite capable of routing a press from the remote-control and to the flash object. Interesting idea.
  Reply With Quote
Old 2nd May 2006, 08:15 AM   #5 (permalink)
MC Journeyman
No Avatar
Status headkaze is Offline:
Location Perth
ActivityPosts: 156
Reputation & Thanks Support Rating:
headkaze
Points Earned: 45

headkaze has been Thanked 4 times in 4 posts
Re: Coding for MCE

I decided to try this out and see if I can get a simple MCE type interface working in Flash. Well, it's alot easier than I thought - there is no special javascript required (even though you can do intercommunication between JS<->Flash) it's not necessary to process the Remote Control. Flash reads the keys as Left, Right, Up, Down, Enter (OK) and the number buttons as the usual number keys.

I compared my app to MCE Soduku which is written in HTML+JS and one of the better looking apps I've seen on MCE (which even has an animated selection bar). So far I can get the same look in Flash with the animated selector bar (and background if I wanted to), but also with smooth fonts, sounds and a much more solid feeling interface.

The outlook looks good so far, this could mean better looking apps for MCE that should still work through an extender. I believe an even better effect could be produced by using Shockwave, but judging by my results so far I think I can safely say that I've proved my point.

All I can say is that if your a Flash or Director developer, FORGET THE MCE SDK!, it seems you already have one the best weapons to write games and apps for MCE

Check out the attached file to see what's possible with Flash & MCE.
Attached Files
File Type: zip ehome.zip (59.4 KB, 56 views)
  Reply With Quote
Old 2nd May 2006, 10:07 AM   #6 (permalink)
MCE Guru
 
benneh's Avatar
Status benneh is Offline:
Location Canberra
ActivityPosts: 1,206
Reputation & Thanks Support Rating:
benneh benneh benneh
Points Earned: 258

benneh has been Thanked 18 times in 5 posts
Re: Coding for MCE

headkaze, that is some nice work on the flash interface. easily looks better than any html/javascript I have seen.

I have never done anything in flash or director, is it possible to do things like

a) embed a video or media player window
b) have it call other programs on your computer

One thing I would be really interested in trying to build is a much better music interface for MCE, it would need to be able to call a database of some sort and be able to execute programs locally, can flash applets do that kind of thing or are they restricted in what they can do as they were only intended to run in the security boundaries of a browser window?
__________________

  Reply With Quote
Old 2nd May 2006, 10:34 AM   #7 (permalink)
 
monster's Avatar
Status monster is Offline:
Location Sydney
ActivityPosts: 1,963
Reputation & Thanks Support Rating:
monster monster monster monster monster monster monster
Points Earned: 759

monster has been Thanked 19 times in 12 posts
Re: Coding for MCE

u can embed video and calling other programs u can use fscommand but its very limited.

there is in application (cant remember name) that allows u to wrap the swf and do all sorts of wonderful things far more powerful then MM's functions.
__________________
Case: Sliverstone LC10B Motherboard: Abit AA8XE Processor: Intel P4 3G Video: Leadtek 6600GT TDH Extreme Memory: Kingmax 1G DDR2 533 Hard Drives: 2 x Maxtor SATA 200g NCQ Tuners: Dual AverTV DVB-T MCE Optical Drive: LG 4163BB DVD-R/W Software: Windows Vista MCE, Cyberlink HD Decoder, BladeRunner Pro v4, TheCollector, WebGuide 4, MovieMe Display: Sanyo Z2, 92" 16:9 Screen
  Reply With Quote
Old 2nd May 2006, 10:39 AM   #8 (permalink)
MC Journeyman
No Avatar
Status headkaze is Offline:
Location Perth
ActivityPosts: 156
Reputation & Thanks Support Rating:
headkaze
Points Earned: 45

headkaze has been Thanked 4 times in 4 posts
Re: Coding for MCE

Flash can interop with Javascript, so anything a standard HTML/JS app can do, Flash can do also. Flash can call Javascript directly or call functions embedded in the HTML. Some complicated stuff might require an ActiveX component, but I don't actually know much about ActiveX. There is also vb script. I noticed MCE File Browser (written by Treason) uses a vb script file to "unhide" the "My Computer" sercurity zone in IE. So there are a few ways to get around these sort of things.

EDIT: About playing video in Flash, you can do it, in fact Google Video uses Flash to play it's videos.
  Reply With Quote
Old 2nd May 2006, 11:02 AM   #9 (permalink)
MCE Journeyman
No Avatar
Status Ignorance is Offline:
ActivityPosts: 178
Reputation & Thanks Support Rating:
Ignorance
Points Earned: 63

Ignorance has been Thanked 0 times in 0 posts
Re: Coding for MCE

Don't worry about Shockwave/Director - Macromedia and Adobe aren't all that keen on them, since Flash keeps getting more and more powerful they are looking at just dropping the other products and just running with Flash.

Good news about the remote-control handling the input right out-of-the-box without any special things needing to be done. I'm interested.

I wonder if it's possible to create SWF files on the fly? That would give the ultimate control.
  Reply With Quote
Old 2nd May 2006, 11:15 AM   #10 (permalink)
MC Journeyman
No Avatar
Status headkaze is Offline:
Location Perth
ActivityPosts: 156
Reputation & Thanks Support Rating:
headkaze
Points Earned: 45

headkaze has been Thanked 4 times in 4 posts
Re: Coding for MCE

Quote:
Originally Posted by Ignorance
I wonder if it's possible to create SWF files on the fly? That would give the ultimate control.
What do you mean by create SWF files on the fly?
  Reply With Quote
Old 2nd May 2006, 11:33 AM   #11 (permalink)
MCE Journeyman
No Avatar
Status Ignorance is Offline:
ActivityPosts: 178
Reputation & Thanks Support Rating:
Ignorance
Points Earned: 63

Ignorance has been Thanked 0 times in 0 posts
Re: Coding for MCE

Hmmm..nice - it CAN be done, for earlier versions of Flash anyway.

OK, my idea is an ActiveX control that you can use to build the SWF flash document at runtime. Rather than everyone writing an MCE app needing a copy of Flash, they use this ActiveX file and simply say 'Interface.AddMenuButton("Back","history.go(-1);")' - allowing you to make Flash interfaces that look like MCE, but in JScript.

You can then get the best of both worlds - the great looks of a Flash, while still being able to add elements at runtime.

It's not going to be dead easy - it would give you a great looking, versatile interface. And it looks like languages like PERL already can create SWF files. You can even download the SDK cheaply (or by SWF Scout for a small fortune). Who's up for some hard-core C++ coding? I think there's some REAL potential there.

headkaze, keep up the good work. If this works, we could assemble an outstanding MCE addin interface.
  Reply With Quote
Old 2nd May 2006, 01:38 PM   #12 (permalink)

 
arkay's Avatar
Status arkay is Offline:
Location Melbourne
ActivityPosts: 7,240
Reputation & Thanks Support Rating:
arkay arkay arkay arkay arkay arkay arkay arkay arkay arkay arkay
Points Earned: 1613

arkay has been Thanked 273 times in 213 posts
arkay's
Media Center
Re: Coding for MCE

Is it just me that thinks it's odd that Web technologies seem to be the only way of getting things going...

WTF happened? The web's fine don't get me wrong but we are talking about applications on a standalone computer. Why the hell do we need the overheads of HTML, javascript, flash, director etc etc for ANY application that runs on the local machine?

Just seems a little bizarre to me..

Cheers,

Arkay.
__________________

The box said 'Requires Windows XP or better' - so I installed Linux . . .
  Reply With Quote
Old 2nd May 2006, 02:28 PM   #13 (permalink)
MCE Journeyman
No Avatar
Status Ignorance is Offline:
ActivityPosts: 178
Reputation & Thanks Support Rating:
Ignorance
Points Earned: 63

Ignorance has been Thanked 0 times in 0 posts
Re: Coding for MCE

Two reasons - remote controls, and just because we want it make it LOOK like Media Center.

You could always write your own DirectX-powered pretty addin as an EXE - there's nothing stopping you. The only catch? It has to actually look like the real thing, that that annoying flicker as the screen changes resolutions, the black screen as MC exits and your program starts and the fact that Media Center has to restart afterwards is a REAL turnoff

But yes - Microsoft should have pulled their finger out and done it properly the first time. Having to write EVERY interface in HTML is complete garbage. They are obviously using reusable controls inside Media Center, why couldn't they have let US try them?

Or if all else fails, why didn't they make an SDK that already had the Media Center look and feel? People don't WANT radical changes in colour or appearance as they navigate - they want their Media Center to look like a single, integrated unit.

Eh - MS. To understand them is to know that you've gone completely mad.
  Reply With Quote
Old 2nd May 2006, 03:54 PM   #14 (permalink)

 
arkay's Avatar
Status arkay is Offline:
Location Melbourne
ActivityPosts: 7,240
Reputation & Thanks Support Rating:
arkay arkay arkay arkay arkay arkay arkay arkay arkay arkay arkay
Points Earned: 1613

arkay has been Thanked 273 times in 213 posts
arkay's
Media Center
Re: Coding for MCE

Quote:
Originally Posted by Ignorance

Eh - MS. To understand them is to know that you've gone completely mad.
Amen.....
__________________

The box said 'Requires Windows XP or better' - so I installed Linux . . .