NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 11 12 13 14 15 … 93 Next »
Where and how are plugin settings done now?

 
  • 0 Vote(s) - 0 Average
Where and how are plugin settings done now?
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#1
2011-11-16, 04:47 AM
Title says it all. For some plugin specific settings, what's the preferred method of a, reading and writing them, and b, where are they put? With the plugin, or in the config.xml.

In the old days it was in the config.xml. And do they get reloaded automagically on change as there's no config app any more, and i know sub was toying with the idea of a settings interface.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,666
Threads: 767
Joined: Nov 2003
#2
2011-11-16, 05:19 AM
Back in the GBPVR I did look into settings interface you could drive with a remote. Too much work though, and never got finished. I wasnt keen to revisit that in NPVR.

In your plugin, implement the IPluginConfiguration interface, where the GetSettingsPage() method returns a SettingsPage class. In Dev Studio implement your own UserControl derived from the NUtility.SettingsPage. I think one of the example plugins shows this in action. The user can access the SettingsPage via the Settings -> Plugins screen. If the plugin supports the IPluginConfiguration interface the Settings button is accessible. When the user clicks it, the app calls the IPluginConfiguration.GetSettingsPage() method where you create and instance of your SettingsPage and return it. When the user hits ok in the SettingsPage, the SaveSettings() method is called.

In your SettingsPage you can save the settings wherever you like. ie, your own configure file or database, or in config.xml. If you're storing in config.xml, you save your settings somewhere within the <PluginSettings> tag. This config.xml is retained during upgrades so that settings are remembered during upgrades.
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#3
2011-11-16, 07:46 AM
The save settings method, do I override that inthe User Control I've created?
McBainUK
Offline

Posting Freak

Posts: 4,711
Threads: 429
Joined: Sep 2005
#4
2011-11-16, 08:57 AM
The start of some related API docs here: http://www.nextpvr.com/nwiki/pmwiki.php?...figuration
Wiki profile
My Projects
Programs Plugin [SIZE=2](retired)
| Volume OSD Plugin (retired) | Documentation Wiki (retired)
[/SIZE]
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#5
2011-11-16, 10:14 AM
Attached is the source for AutoRefresh, which is probably the simplest example I have of doing this. Note that it uses a helper class - ConfigHelper - to do the IPluginConfiguration bit, because it's not possible (yet) to have a plugin that doesn't have a UI to also be allowed to show a settings screen. This workaround (from Martin I think originally) allows it.

Iain
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,847
Threads: 954
Joined: May 2006
#6
2011-11-16, 07:17 PM
I've used an external plugin specific config files outside of config.xml in GB-PVR (even my ML3 rewrite) and NPVR, I don't see real advantage to using it in config.xml if you know how to manage xml files and if you don't you probably shouldn't mess with config.xml either. The only thing I would change is I would use NPVR.db3 to store values specific to a tuning plugin.

GBPVR didn't really reload the plugin values, config.exe just forced the recording service to restart killing the running PVRx2 apps.

There is one gotcha on this SaveSetting too, it will fire whenever any plugin or NPVR causes the OK to be clicked so you might need to set flags if you want a specific action on OK.

Martin
« 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,781 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,325 2020-11-14, 08:01 PM
Last Post: sub
  VIdeo playback from plugin mvallevand 5 3,435 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,876 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,755 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,053 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,941 2013-03-12, 06:48 AM
Last Post: psycik
  Best way to load settings for NPVR? reven 4 2,138 2012-11-01, 01:13 AM
Last Post: reven
  Plugin problems with started from the command line mvallevand 11 4,964 2012-08-12, 07:56 PM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,229 2012-02-11, 05:42 PM
Last Post: mvallevand

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

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

Linear Mode
Threaded Mode