PDA

View Full Version : Help getting started on a MediaBridge plugin



Tim Harvey
January 16th, 2005, 09:10 PM
Greetings,

I just recently came across NetRemote and love the concept. I have a few ideas for plugins to control media center applications not necessarily hosted on windows (mythTV, XBoxMediaCenter, and possibly another). I've downloaded the SDK and glanced at the sample plugin and I believe I can see from that how to 'control' an application, but I'm not sure I understand how to feed NR a media list such as is done in the 'Library' panel. This doesn't seem to be documented, or am I missing something? Could we get the source for the MediaBridge plugin in the SDK? That would go a long way as far as documenting the process. The post from 'avid' on the thread:http://www.promixis.com/phpBB2/viewtopic.php?t=9695 gives an excellent description of the general concept for application control, but I need a little more info.

Also, I done a lot of windows development, but never any PocketPC. Am I correct in assuming that I will need to download and install some sort of Microsoft Pocket PC Development SDK before that target becomes available to MSVC.NET?

Thanks for any assistance!

Tim

avid
January 17th, 2005, 02:18 AM
Tim,

Two answers for you.

For a richer set of samples (including some library management stuff) see my (freely stealable) source from the distribution page on my site (see sig).

For Pocket PC development, you will need Embedded Visual C++ (EVC) 3 (not the current version 4) and the Pocket PC 2002 SDK. Both of these can be downloaded from Microsoft (unless they've been withdrawn recenty).

Welcome to the (so far rather small and exclusive) NR drivers development club!

Brian

Tim Harvey
January 17th, 2005, 12:59 PM
Brian,

Thanks for the quick reply. Why is v3.0 needed vs 4.0? At the MS download site: http://msdn.microsoft.com/mobility/downloads/updates/default.aspx I find 'visual tools' 3.0 but I couldn't find any downloads for embedded VisC 3.0.

Thanks,

Tim

avid
January 17th, 2005, 02:51 PM
Tim,

I *think* that's the right one. V4 is for PPC 2003 onwards. V3 supports PPC 2002 onwards. Also, the NR library you will need to link with is for V3.

Brian

Ben S
January 18th, 2005, 09:38 PM
Hi Tim - sorry for the delay.

Yes, embedded visual tools 3.0 includes VB and C++. You should download the one that comes with the PPC2k2 SDK, as well.

Right now the MediaBridge plugin (on the NetRemote side) talks the MediaBridge protocol to either JRMC (9-11) or the MediaBridge app. The best way to support the other media players would be to write a plugin for MediaBridge if the app is on Windows, or to write a server app that speaks the same protocol.

I've asked the rest of the team if that protocol is "top secret" or whether I can fully document the protocol and release details freely.

Otherwise you would need to have your plugin create a list or tree view to populate. Right now there isn't a generic list or tree view that you can populate, unfortunately.

Tim Harvey
January 19th, 2005, 02:00 AM
Right now the MediaBridge plugin (on the NetRemote side) talks the MediaBridge protocol to either JRMC (9-11) or the MediaBridge app. The best way to support the other media players would be to write a plugin for MediaBridge if the app is on Windows, or to write a server app that speaks the same protocol.

I've asked the rest of the team if that protocol is "top secret" or whether I can fully document the protocol and release details freely.


All three of the apps that I'm interested in support for are not on windows, but they all three have their own TCP/IP interfaces. All three apps have their own media database that I will want to grab and send to NetRemote. I'll need this MediaBridge protocol for that correct?



Otherwise you would need to have your plugin create a list or tree view to populate. Right now there isn't a generic list or tree view that you can populate, unfortunately.

I would rather not have to do that, although that leads me to some more questions:

- The 'tree view' that does exist in NetRemote gets populated how? (Is that part of the currently non released protocol?)

- Personally I hate the current tree view when run on a PocketPC as the +/- is difficult to click on, as are double clicks. I would much rather see a larger 'down arrow'/'side arrow' interface that is more common on touch-screen platforms. Is this something that may be addressed in future versions of NetRemote?

- I've seen references to 'GAC' as an alternative to the tree view but I haven't been able to determine what that stands for or what exactly it means. I'm using the 'OpusNR' interface which uses this, but I haven't been able to get it to work . The 'ablums for artist' and 'tracks for artist' panels don't show me what I would expect (what I get from within JRMC). I'm trying to follow along with the design of the CCF via tonto but I'm not quite understanding it. It would seem as if there is scripting built into the CCF button actions? Where can I find more documentation on this format in the CCF?
Here is an example: of what I don't understand: This is tied to a button in the 'Albums for artist panel':
[IR] MP.GACStart,0:Set it back to 0
[IR] MP.GACScheme,{MP.GACAlbumPath_<LoopIndex>};Set GAC Parent
[IR] GAC {MP.GACScheme} {MP.GACStart} {MP.GACCount} {MP.GACSize}
I've read over the CCF file format from the tonto site and I believe this stuff is completely out of band from that spec - is this LUA scripting and something that only NetRemote understands? Looks like there is some object MP with a bunch of properties. Where is this stuff documented?

Thanks for the reply. I really hope you guys choose to release documentation as it would really add to the possible uses of NetRemote. Here are the plugins that I am willing to write:

* XBMC (XBoxMediaCenter) - hopefully offering control and populating of the library tree
* MythTV - hopefully offering control and populating of the library tree
* CreativeLabs Soundblaster Wireless (this product is severely cripped by the crappy implementation of their remote which is extremely slow and works up about 30 ft... a joke) - I hope to offer control and populating of the library tree but I'll have to reverse engineer their protocol to do so

Sorry about the barrage of questions but I feel like I stumped onto a cool product but can't seem to find any development docs.

Tim

avid
January 19th, 2005, 03:49 AM
Tim,

If you look at some of my sources, you will see examples of sending lists/trees from a server to NR drivers. I have 4 such drivers:
1) Zoom - which uses the published Zoom TCP interface as its server. But that doesn't send any lists.
2) WMP9 - which has an Artist/Album/Track tree.
3) PlayPick - which lists media (e.g. MPG) files to be played.
4) DigiTV TPG - which lists TV programmes.

The WMP9 development pre-dates MediaBridge and is totally independent of it , but shows one way in which you *might* use a private protocol over TCP. Ideally, Ben will release the MediaBridge protocol and you could write your server to use that. That way, you would use the MediaBridge driver as-is. Alternatively, you will need to write both the server and the driver parts and design your own protocol as I did.

Both my WMP9 driver and MediaBridge use the standard built-in implementation of tree views using "+" characters. It would be a much larger task to change the look and feel.

I hope this helps

Brian

Promixis
January 19th, 2005, 07:14 AM
Hi Tim,

We will get something to you shortly. Documentation is something that is in short supply here :( but we are actively working to fix that.

Tim Harvey
January 20th, 2005, 09:44 PM
Tim,

If you look at some of my sources, you will see examples of sending lists/trees from a server to NR drivers. I have 4 such drivers:
1) Zoom - which uses the published Zoom TCP interface as its server. But that doesn't send any lists.
2) WMP9 - which has an Artist/Album/Track tree.
3) PlayPick - which lists media (e.g. MPG) files to be played.
4) DigiTV TPG - which lists TV programmes.

The WMP9 development pre-dates MediaBridge and is totally independent of it , but shows one way in which you *might* use a private protocol over TCP. Ideally, Ben will release the MediaBridge protocol and you could write your server to use that. That way, you would use the MediaBridge driver as-is. Alternatively, you will need to write both the server and the driver parts and design your own protocol as I did.

Both my WMP9 driver and MediaBridge use the standard built-in implementation of tree views using "+" characters. It would be a much larger task to change the look and feel.

I hope this helps

Brian

Brian, these examples are great! I think I understand the paradyme now. Please correct me if I'm wrong:

The NetRemote 'MediaBridge Plugin' (what you would call a driver) talks over TCP/IP with the 'MediaBridge Server', which is a stand-alone app only available on win32. The 'MediaBridge Server' has a currently unsupported plugin-architecture that has plugins for the following:
* JRMC - talks to JRMC via (I assume) a protocol defined by JRMC and translates/relays this to the NR MediaBridge Plugin, via the MediaBridge protocol
* WMP - talks to WMP via (I assume) the WMP9 published protocol and translates/relays this to the NR MediaBridge Plugin, via the MediaBridge protocol

The advantage of writing a 'MediaBridge server' plugin is that I wouldn't have to write a (Win32/PPC) plugin for NetRemote (driver).

Your examples predated MediaBridge (but even now, without there being a 'MediaBridge SDK' one can't write a plugin for MediaBridge server) so you had to write your own driver AND server and develop the protocol between them. Looking at your driver, NetRemote gives you the window, so you can do whatever you want with it, which you have used to get mouse input and perform your own rendering for a tree view.

I think my confusion up to this point has been that of terminology. 'MediaBridge' can refer to either the NetRemote plugin or the stand alone server, which itself can technically have plugins. What you call a 'driver' is a NetRemote plugin (I like the term driver better).

The architecture makes sense now, accept I still am not able to understand the CCF linkage. I've read over your post here http://www.promixis.com/phpBB2/viewtopic.php?t=9695 but I'm still not comprehending it all. Where can I find a list of 'built-in' button actions? I assume that these built-ins are 'additions' the CCF spec that only NetRemote uses, so it should be part of NetRemotes documentation right? Also, your explanation talks about IR codes like they are always a series of numbers, but thats not what I'm seeing in the CCF's. Instead I'm seeing references to what look like objects and variables of those objects.

For example, refering to your WMP9Demo.ccf, could you explain the button action '[IR] Jukebox.PlayPause'? I'm guessing that this somehow invokes the 'ReleaseAction' function in your driver with param2 = 10, but I'm not clear how the name 'Jukebox' gets linked to your driver by NetRemote, nor how 'PlayPause' is linked to '10'. Additionally, where is the 'WMP9' object defined?

Thanks for all the guidance!

Tim

Tim Harvey
January 20th, 2005, 09:47 PM
Hi Tim,

We will get something to you shortly. Documentation is something that is in short supply here :( but we are actively working to fix that.

Ben,

So does this mean you guys will be releasing an SDK or source for the MediaBridge server? I would think you would want to if you want third parties like me to expand the support for NetRemote. Sourcecode for the MediaBridge Server would probably be enough documentation for now, if you guys are willing to release that (I would be happy to sign an NDA and even help you with the SDK by providing source and documentation for a sample if its a matter of that)

Tim

Promixis
January 21st, 2005, 01:51 AM
Yes, we will be releasing this.

Tim Harvey
January 21st, 2005, 02:55 AM
I still am not able to understand the CCF linkage. I've read over your post here http://www.promixis.com/phpBB2/viewtopic.php?t=9695 but I'm still not comprehending it all. Where can I find a list of 'built-in' button actions? I assume that these built-ins are 'additions' the CCF spec that only NetRemote uses, so it should be part of NetRemotes documentation right? Also, your explanation talks about IR codes like they are always a series of numbers, but thats not what I'm seeing in the CCF's. Instead I'm seeing references to what look like objects and variables of those objects.

For example, refering to your WMP9Demo.ccf, could you explain the button action '[IR] Jukebox.PlayPause'? I'm guessing that this somehow invokes the 'ReleaseAction' function in your driver with param2 = 10, but I'm not clear how the name 'Jukebox' gets linked to your driver by NetRemote, nor how 'PlayPause' is linked to '10'. Additionally, where is the 'WMP9' object defined?


I appologize for my ignorance... I read over the NetRemote docs a little closer this time and I see that all of this is explained. I just wasn't paying enough attention and playing around with Tonto enough.

Looks like all the 'built-in' functions are listed in Tonto. I now see how the IR codes link to the driver and parameters as well. The only thing I don't quite understand is the purpose of 'name' property of the actions. Is that simply for readability?

Thanks,

Tim

avid
January 21st, 2005, 02:57 AM
Please correct me if I'm wrong:

The NetRemote 'MediaBridge Plugin' (what you would call a driver) talks over TCP/IP with the 'MediaBridge Server', which is a stand-alone app only available on win32. The 'MediaBridge Server' has a currently unsupported plugin-architecture that has plugins for the following:
* JRMC - talks to JRMC via (I assume) a protocol defined by JRMC and translates/relays this to the NR MediaBridge Plugin, via the MediaBridge protocol
* WMP - talks to WMP via (I assume) the WMP9 published protocol and translates/relays this to the NR MediaBridge Plugin, via the MediaBridge protocol
Yes

The advantage of writing a 'MediaBridge server' plugin is that I wouldn't have to write a (Win32/PPC) plugin for NetRemote (driver).
Yes

Your examples predated MediaBridge (but even now, without there being a 'MediaBridge SDK' one can't write a plugin for MediaBridge server) so you had to write your own driver AND server and develop the protocol between them. Looking at your driver, NetRemote gives you the window, so you can do whatever you want with it, which you have used to get mouse input and perform your own rendering for a tree view.
Yes - The "window" is the screen area occupied by a button whose first action is directed to your driver. you don't have to do everything with the window, but that is an option. Another option is to respond to requests, but to let NR handle the painting of how it looks.

I think my confusion up to this point has been that of terminology. 'MediaBridge' can refer to either the NetRemote plugin or the stand alone server, which itself can technically have plugins. What you call a 'driver' is a NetRemote plugin (I like the term driver better).
In the SDK, they are called drivers. In the NR UI, they are called plugins

The architecture makes sense now, accept I still am not able to understand the CCF linkage. I've read over your post here http://www.promixis.com/phpBB2/viewtopic.php?t=9695 but I'm still not comprehending it all. Where can I find a list of 'built-in' button actions? I assume that these built-ins are 'additions' the CCF spec that only NetRemote uses, so it should be part of NetRemotes documentation right? Also, your explanation talks about IR codes like they are always a series of numbers, but thats not what I'm seeing in the CCF's. Instead I'm seeing references to what look like objects and variables of those objects.

For example, refering to your WMP9Demo.ccf, could you explain the button action '[IR] Jukebox.PlayPause'? I'm guessing that this somehow invokes the 'ReleaseAction' function in your driver with param2 = 10, but I'm not clear how the name 'Jukebox' gets linked to your driver by NetRemote, nor how 'PlayPause' is linked to '10'. Additionally, where is the 'WMP9' object defined?
The dirver gets to see three pieces of information for an action: the two numbers and the IR name string. It does not need to use all of them. In this case, the param2 number is enough. The IR name helps a bit only as a comment in the CCF by making it clear what the purpose ought to be. But this string is ignored by the driver.

Thanks for all the guidance!
You are welcome - I hope this helps clear things up

Tim
Brian

avid
January 21st, 2005, 03:03 AM
The only thing I don't quite understand is the purpose of 'name' property of the actions. Is that simply for readability?

We "crossed in the post". Yes - in the WMP9 case its is just for readability. But see the Zoom driver's handling of fnXXX codes, where the name is very meaningful. Lots of choices ....

Brian

Tim Harvey
January 25th, 2005, 12:51 AM
Yes, we will be releasing this.

After thinking about my options I realized that mostly what I want is a media server with a plugin architecture that is not dependent on windows (I dislike windows as a server platform, but I do have several linux servers). I ended up writing my own MediaServer for NetRemote in Java.

I've still got some work to do, as well as finish up my plugins for controlling the devices I want to control (wich may be difficult because their interfaces are limitted) but basic playlist, treelist, and GAC messaging is working.

I used a packet sniffer to figure out the protocol. Is the protocol implemented solely in the NR MediaServer, or in the case of JRMC does it simply relay to JRMC? (I noticed JRMC has some sort of 'server' that supposidly sits on the same 20002 port, but I haven't located any documentation on its protocol).

There are still a few fields that I haven't completely figured out in the GAC messages... is it ok to ask questions about the protocol here?

Thanks,

Tim

Ben S
January 25th, 2005, 07:55 AM
I've still got some work to do, as well as finish up my plugins for controlling the devices I want to control (wich may be difficult because their interfaces are limitted) but basic playlist, treelist, and GAC messaging is working.
Awesome, Tim!



I used a packet sniffer to figure out the protocol. Is the protocol implemented solely in the NR MediaServer, or in the case of JRMC does it simply relay to JRMC?

In the case of JRMC, NetRemote talks directly to the RemoteServer.dll within JRMC, the MediaBridge only bootstraps JRMC.


I noticed JRMC has some sort of 'server' that supposidly sits on the same 20002 port, but I haven't located any documentation on its protocol
Yes. JRMC has a "RemoteServer" that can talk HTTP, but also includes Promixis's code to act as it's own "MediaBridge".



There are still a few fields that I haven't completely figured out in the GAC messages... is it ok to ask questions about the protocol here?

Absolutely. But why don't you email me directly so I can turn around answers faster to you.

I'll start filling in the documentation better, as well.