Plugins that add more UPNP devices to UPnPServer (1 Viewer)

McGoober

Retired Team Member
  • Premium Supporter
  • August 13, 2006
    122
    105
    Cambridge, UK
    Home Country
    United Kingdom United Kingdom
    I'm in the process of creating a plugin that will add a new UPNP device and device services to the MP2 server. But currently, access to the UPnPServer object in the MP2 server isn't exposed. UPnpBackendServer inherits from UPnpServer, and it's instance is held in BackendServer. My current workaround for this is to expose a getter property called UPnpServer in BackendServer and in IBackendServer to allow access whilst I develop the plugin. A simple call to ServiceRegistration.Get<IBackendServer>().UPnpServer solves my problem, but is there another, more elegant way?
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    45
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: Plugins that add more UPNP devices to UPnPServer

    Ok, I'll see what I can do to give you public access to the UPnPServer or UPnP root device. I think it will be something similar as you already did.
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    45
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: Plugins that add more UPNP devices to UPnPServer

    My current workaround for this is to expose a getter property called UPnpServer in BackendServer and in IBackendServer to allow access whilst I develop the plugin. A simple call to ServiceRegistration.Get<IBackendServer>().UPnpServer solves my problem, but is there another, more elegant way?

    That's exactly the way I will do it. I'll also expose the UPnPServer property in IFrontendServer.
    I'll do that change after I have finished my current bugfixing session, which can take maybe one or two more days.
     

    McGoober

    Retired Team Member
  • Premium Supporter
  • August 13, 2006
    122
    105
    Cambridge, UK
    Home Country
    United Kingdom United Kingdom
    Sweet, thanks Albert.
    Just one thing, I think there was a cut and paste error in the name of the property in IBackendServer. Should the property be called "UPnPBackendServer" rather than "UPnPFrontendServer"?
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    45
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: Re: Plugins that add more UPNP devices to UPnPServer

    Sweet, thanks Albert.
    Just one thing, I think there was a cut and paste error in the name of the property in IBackendServer. Should the property be called "UPnPBackendServer" rather than "UPnPFrontendServer"?

    :oops:

    Fixed. Thanks.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Re: AW: Re: Plugins that add more UPNP devices to UPnPServer

    Sweet, thanks Albert.
    Just one thing, I think there was a cut and paste error in the name of the property in IBackendServer. Should the property be called "UPnPBackendServer" rather than "UPnPFrontendServer"?

    :oops:

    Fixed. Thanks.

    Albert,

    After this fix, server does not build anymore :

    Services\BackendServer\BackendServer.cs(40,16): error CS0535: 'MediaPortal.Backend.Services.BackendServer.BackendServer' doesn't implement interface member 'MediaPortal.Backend.BackendServer.IBackendServer.UPnPBackendServer' [D:\Smeulf\Desktop\MP2 GIT\MediaPortal\Source\System\MediaPortal.Backend\MediaPortal.Backend.csproj]

    Cheers.
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,989
    3,712
    Stuttgart
    Home Country
    Germany Germany
    AW: Plugins that add more UPNP devices to UPnPServer

    The class BackendServer needs a rename of the property, too ;)
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    45
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: Plugins that add more UPNP devices to UPnPServer

    Strange. Off course, I also renamed the property in the implementation class. I'll take a look at it tonight.
     

    Users who are viewing this thread

    Top Bottom