PDA

View Full Version : CreateInstance



iolaus
January 9th, 2009, 07:21 PM
I'm trying to create a SageTV MediaBridge Plugin but I've run into a problem on my first trial where CreateInstance is being called repeatedly once NetRemote is fired up. Also, MediaBridge keeps jumping between 0,1, and 2 connections and the port number continually increments. Is there something specific I need to do to prevent this from happening?

Also, I don't suppose there is source code for a functioning example of a MediaBridge Plugin(preferably one that supports multiple zones) available?

Thanks,
Ryan

Rob H
January 10th, 2009, 06:34 AM
Let's deal with the client connections issue first - does this occur when your SageTV plugin isn't loaded?

Have you seen this thread - http://www.promixis.com/forums/showthread.php?t=17285

iolaus
January 10th, 2009, 11:30 AM
Let's deal with the client connections issue first - does this occur when your SageTV plugin isn't loaded?

It only seems to take place when my SageTV plugin is selected. The only other plugin I have tried is WMP but it seemed to work fine. I am running MB and NR2 on the same box and NR2 does seem to pull the test data I've built into my SageTV plugin.

Rob H
January 10th, 2009, 03:19 PM
I'll try to take a look at this tomorrow or Monday.

It would probably help if you could send me the current version of your SageTV plugin if you're happy to do that.

iolaus
January 11th, 2009, 09:32 PM
Here is the code.

Rob H
January 12th, 2009, 06:25 AM
Okay, it's your SageZone class - it's returning null for CurrentPlaylist which MB is treating as an error.

There should be an error message about this in your output window when running under VS.

BTW I'd recommend building your plugin for the x86 target as AnyCPU may have problems when running on a 64-bit OS.

One other thing that may or may not be a problem - I'm using VS2005 to build Mediabridge for .Net 2.0 - in SageUserPlaylist the Name property uses "get; set;" - I'm not sure that's supported in .Net 2 (it's certainly not supported by VS2005). I'd recommend changing it to


public string Name
{
get
{
return name;
}
set
{
name = value;
}
}

iolaus
January 12th, 2009, 11:38 AM
Thanks for the help Rob. I changed my zone to return an empty playlist which seemed to cause problems so I added an entry item to the playlist and it appears to be working now. Is there a specific way I'm supposed to handle an empty playlist? I would think it would be a situation that needs to be handled.

Also, is it possible to extend my SageTV Media Bridge beyond the standard MB interfaces and access that functionality from NetRemote? I'd eventually like to expose the SageTV EPG through NetRemote.

Rob H
January 12th, 2009, 12:41 PM
I've made a change here to convert a null playlist to a 'new MBItem[0]' so this shouldn't be a problem in future.

I don't think what you want is possible directly - you'd need to write a plugin for NetRemote itself to do what you want, that could talk to your MB plugin using COM or a socket.

iolaus
March 10th, 2009, 04:24 PM
I've run into some trouble again developing my SageTV MediaBridge plug-in and I was hoping somone could help. The biggest issue I'm having right now is trying to figure out how MediaBridge plays a file. I've got to the point where my MBInstance.GetLibrary() is working but when I select one of the Library's returned MBItems in NetRemote and hit "Play" I don't know what it is supposed to trigger in my MB plug-in. I would imagine the play command would have to pass through the active zone someone but I haven't been able to figure it out.

One other point of confusion for me is the difference between a Playlist and a UserPlaylist.

Rob H
March 10th, 2009, 05:33 PM
You need to implement the IMBPlayback (may be called MBPlayback if you're using an older version of Mediabridge) interface in your Zone class.

A UserPlaylist is a named playlist that can be saved (sometimes by the player itself, as in the case of JRMC) or perhaps to a file.

iolaus
March 10th, 2009, 07:19 PM
Rob,

The MBPlayback.Play() method seems like it would just be for telling the player to play whatever is already loaded (perhaps to restart playback after pausing). What is the method for telling the player to play a specific file and how is it called from NetRemote?

Rob H
March 11th, 2009, 07:17 AM
That would be the IMBZone method PlayFile which is called by sending the command


X PLAYFILE filename

from NetRemote

iolaus
March 11th, 2009, 03:11 PM
That would be the IMBZone method PlayFile which is called by sending the command


X PLAYFILE filename

from NetRemote

Thanks Rob,

It seems using the default skin and my testing method it was actually calling MBZone.PlayLibrary(). That said, I've now got to the point where I can successfully select a file from the library, click play, and SageTV fires up the video (which is awesome).

A couple more questions if you don't mind...

First, I re-downloaded the MediaBridge SDK from the developer section since you mentioned some updates but I didn't see any changes (ie. no "I" in front of the interfaces). Is there somewhere else I should be getting the SDK?

Second, I'm not very clear on the distinction between MBZone.PlayFile() and MBZone.PlayLibrary(). Also, I'm not totally clear on how a zone should handle playlists and the PlayMode parameter passed to the aforementioned methods.

I think a more fully implemented plug-in example would help clear up a lot of the issues I'm running into. Any chance of getting a hold of something along those lines?

Thanks again for you help.

Rob H
March 11th, 2009, 04:25 PM
Looks like we need to update the SDK.

I'll have a chat with Ron soon about a better example plugin