NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 29 30 31 32 33 … 93 Next »
multiple instances of a plugin

 
  • 0 Vote(s) - 0 Average
multiple instances of a plugin
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#1
2008-09-05, 07:16 AM
I am wondering how I can have multiple instances of a plugin.

I am thinking that I can get the user to set the name of the plugin and that then will be used for the name that is displayed in the config applet and the menubutton off root, of course logging and config.xml settings can be set to the selected name, the only thing I am stuck at is how does the code get to know the name of the plugin if there are multiple instances?
I was wondering if there is a method I can call that when the plugin loads it will read the name of the button that the user selected from the main menu, is there such a method and is this the best way of doing this?

Cheers
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#2
2008-09-05, 07:52 AM
it'd proabably have to be a new dll I guess. I think sub would poll the directory for dlls with the ImenuTask interface and keep an array/collection of them.

Then call the various IMenuTask methods when needed.
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#3
2008-09-05, 09:42 AM
I figured that cloaning the dll, skin.xml and keymapping file is easily achieved by IO/file manipulation. however there seems to be a circular issue that comes in to play, as the plugin sets the name that it will be named as and presents this to PVRx2 for inclusion in the main menu.
From the plugin point of view I am trying to workout how I could tell the plugin what its name was, thought around working out what dll name has been strated but not sure if its possible to get this from within the plugin?

Doing my head in I seem so close yet so far Sad
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#4
2008-09-05, 09:50 AM
Can;t you set the name of the plugin the name of the dll?

so in GetName do something like:
return System.IO.Path.GetFilenameWithoutExt(CallingAssembly.location)

Although you're VB or vb.net??
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#5
2008-09-05, 11:26 AM
Tried using the assembly.location and it uses the properties of the dll which are set at compile time so it doesnt provide the actual name of the filename that is being used Sad
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#6
2008-09-05, 05:13 PM
Yeah, there is nothing built in that would do, so you'd have to come up with some scheme like described above, then find a way to dynamically detect the assembly name.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#7
2008-09-05, 09:56 PM
idkpmiller Wrote:Tried using the assembly.location and it uses the properties of the dll which are set at compile time so it doesnt provide the actual name of the filename that is being used Sad

there is definitely one that gets the name of the assembly, I just couldn't remember it last night.

Are you using vb.net ?
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#8
2008-09-05, 11:02 PM
yes vb.net. I tried a few last night myself and couldnt get one to tell me the actual dll filename, I did come across one that saifd it did this then had a note to say it wouldnt change if the filename was renamed :-)

Thanks
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#9
2008-09-06, 01:48 AM
Ok, location wasn't the right one.

This got me the name of my plugin:

string dllName = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;

I did this inside the Constructor. But I think this might take a re-compile to name the name change properly, i.e. not just a rename of the DLL.

Sorry i had a look at the .location property and it didn't seem to be filled. Must be something to do with the fact that this is a plugin or a larger executable. As I've used the location variable before without any problems - but not on a gbpvr plugin.

Hope that helps. What about having one plugin that hold multiple instances of itself internally?? And when sub calls GetRenderlist you loop through and call the GetRenderList of your arrayed internal plugins....
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 2,726 2022-10-17, 12:44 AM
Last Post: sgilani
  is there a service?method which returns listings for multiple channels? reven 16 6,793 2022-04-11, 04:30 PM
Last Post: mandai
  New Systems Plugin kirschey 10 3,293 2020-11-14, 08:01 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,421 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,857 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,735 2013-06-08, 06:14 PM
Last Post: sub
  Multiple genres in npvr.db3 bgowland 5 2,813 2013-04-16, 09:53 PM
Last Post: ACTCMS
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,027 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,931 2013-03-12, 06:48 AM
Last Post: psycik
  Plugin problems with started from the command line mvallevand 11 4,930 2012-08-12, 07:56 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode