NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 15 16 17 18 19 … 93 Next »
Plugin Additions and notes

 
  • 0 Vote(s) - 0 Average
Plugin Additions and notes
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,783
Threads: 954
Joined: May 2006
#1
2011-05-08, 05:17 PM
Hi sub, I have been working on MusicBox while you are away and the SetVisibleIndex() helps manage things nicely. You have down some amazing work in NPVR I have to far less work to keep track of what needs to be rendered. What I did in a few weekends would have taken much longer before.

I have a few smaller things that I have noticed and some questions but

1. Can I detect if audio playback is paused?

2. Can I stop the screen saver from closing a popup?

3. The audio queue doesn't seem to get cleared when it ends on its own. Ctrl-S does clears it.

4. Just a reminder that the button bar doesn't have Visible set when open

5. For the OK and Cancel on the config setting there are lots of things.

- can I identify if the OK is for my settings screen?

- is there a cancel event?

- if so can the cancel event be rejected?

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2011-05-08, 05:42 PM
mvallevand Wrote:1. Can I detect if audio playback is paused?
I'm not sure on this one. I'll have to check.

Quote:2. Can I stop the screen saver from closing a popup?
Unfortunately no. It works by making itself the current popup.

Quote:3. The audio queue doesn't seem to get cleared when it ends on its own. Ctrl-S does clears it.
Ok, I've changed it to clear the list when it reaches the end.

Quote:4. Just a reminder that the button bar doesn't have Visible set when open
I've changed the UiButtonStrip's Visible property to also return true if it is marked as 'visible until x', which until now has been treated separately.

Quote:5. For the OK and Cancel on the config setting there are lots of things.

- can I identify if the OK is for my settings screen?
The OK button the Settings screen applies to all settings screen.

I typically have "private bool pageLoaded = false;" in my settings page, do "pageLoaded = true;" in the xxxxx_Load() method, then have a SaveSettings method like this:

Code:
public override void SaveSettings()
        {
            base.SaveSettings();
            
            // only save settings if this page has been populated
            if (pageLoaded)
            {
                SettingsHelper settings = SettingsHelper.GetInstance();
                settings.SetSetting("/Settings/Recording/RecordingDirectory", textBoxRecordingDirectory.Text);
                settings.SetSetting("/Settings/Recording/UseRecordingService", checkBoxBackgroundRecordingService.Checked);
                //...etc              
            }
        }



Quote:- is there a cancel event?

- if so can the cancel event be rejected?
No, there is no cancel event. For my settings screens I just dont save any settings until SaveSettings() is called (so there has never been a need to 'undo' something when the user clicks cancel)
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,783
Threads: 954
Joined: May 2006
#3
2011-05-08, 06:31 PM
sub Wrote:I'm not sure on this one. I'll have to check.

Ok thanks, I used this in GBPVR to tell me when it was paused so I could turn off the timer for playing time on the PCH, on the PC the positions just reports the same time.

Quote:Unfortunately no. It works by making itself the current popup.

Is there any chance that a Plugin could disable the screen saver?

Quote:Ok, I've changed it to clear the list when it reaches the end.

I've changed the UiButtonStrip's Visible property to also return true if it is marked as 'visible until x', which until now has been treated separately.

Thanks.

Quote:I typically have "private bool pageLoaded = false;" in my settings page, do "pageLoaded = true;" in the xxxxx_Load() method, then have a SaveSettings method like this:

Ok, I will try and deal with this manually. It is really the Cancel event I need most. I am afraid of the user messing with setting figuring they have cancelled, then saving something else in NPVR but with pageLoaded == true the "bad" settings will still be saved.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#4
2011-05-08, 07:13 PM
Quote:Is there any chance that a Plugin could disable the screen saver?
If you remind me closer to the next release, I'll add a method for plugins to disable the screensaver. Cant do it as a patch - I'd have to change too many files, and would make it difficult to make any further patches to 2.0.3.

mvallevand Wrote:I am afraid of the user messing with setting figuring they have cancelled, then saving something else in NPVR but with pageLoaded == true the "bad" settings will still be saved.
As long as you dont store any settings from GUI controls on your settings page until SaveSettings() is called, then you wont have any problems - since the config.xml should have exactly the same values as before the Setting screen was originally shown. When 'Cancel' is click, it doesnt call SaveSettings() on the various settings screens, and doesnt save the config.xml, so should be exactly as it was originally. You shouldnt be setting any values in config.xml before SaveSettings() is called.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,783
Threads: 954
Joined: May 2006
#5
2011-05-08, 07:32 PM
sub Wrote:As long as you dont store any settings from GUI controls on your settings page until SaveSettings() is called, then you wont have any problems

I don't use config.xml I always use my own after bad experience with other plugins. I still think there is a problem

IPluginConfiguration only gets callbacked on init

1) public SettingsPage GetSettingsPage() reads default xml values.

2) User changes default values and if they cancel those changes, they are still in the internal buffers

3) User goes to NPVR an hour later changes the skin clicks Save and the cancelled changes from 2 are applied.

To avoid this on cancel could you reissue all the GettSettingsPage() calls?

This reminds me of another question. I find that GetButtonList() is only called on init. Is there any way to make it context sensitive by forcing a reload?

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#6
2011-05-08, 07:54 PM
It shouldnt matter that you're not using config.xml, the same should apply to other stores of configuration information.

Quote:2) User changes default values and if they cancel those changes, they are still in the internal buffers

3) User goes to NPVR an hour later changes the skin clicks Save and the cancelled changes from 2 are applied.
I dont see a problem in there, but depending on how you implement your Settings screens, you could probably make it a problem.

ie, in my plugins GetSettingsPage() returns a *new* Form each time, so it reads the configuration at that time, it there is no old values hanging around in "internal buffers". That configuration is then populated into the Form's various GUI controls, when the user interacts with the GUI it doesnt store any of those values back into my configuration files (or into plugin variables)... until the user clicks OK and SaveSettings() is called. If user had clicked Cancel, those forms are closed/destroyed and any setting changes in their GUI was lost forever. ie, these values aren't put anywhere that'll be seen later. If the user goes into the Settings screen an hour later to change the skin, the correct settings are there, not setting changes the user might have fiddled with before hitting Cancel on a previous viewing of the Settings scree.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#7
2011-05-08, 07:55 PM
BTW, I did see that you can tell if a Cancel was clicked though. In thise case your settings page will have OnClose() called without having first had SaveSettings() called. So if you really wanted to handle a Cancel event, you could just set a flag in SaveSettings, then use that flag in OnClose() to see if you need to run your Cancel logic.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,783
Threads: 954
Joined: May 2006
#8
2011-05-08, 08:54 PM
Sorry for the confusion, you'd think I had been away from this for a couple of weeks. I put some more debugging info in and my settings class does instantiate each time the config Windows form is loaded. I guess I was expecting something just when my my own tabs display, now I understand it is already populated by that time.

The OnClose() is great though, I will be able to give a message box if the user changes are thrown out.

Thanks, and sorry. BTW did you notice the other question on GetButtonList(); Am I missing something there too?

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#9
2011-05-08, 10:02 PM
mvallevand Wrote:This reminds me of another question. I find that GetButtonList() is only called on init. Is there any way to make it context sensitive by forcing a reload?
If your needed to change the button list, you could probably do something like:

Code:
uiButtonStrip.Dispose();
uiButtonStrip = new UiButtonStrip("ButtonList", yourButtonList, this, new HashTable(), skinHelper);
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,783
Threads: 954
Joined: May 2006
#10
2011-05-08, 10:48 PM
sub Wrote:If your needed to change the button list, you could probably do something like:

Code:
uiButtonStrip.Dispose();
uiButtonStrip = new UiButtonStrip("ButtonList", yourButtonList, this, new HashTable(), skinHelper);

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 2,736 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,296 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,861 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,737 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,028 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,932 2013-03-12, 06:48 AM
Last Post: psycik
  Plugin problems with started from the command line mvallevand 11 4,936 2012-08-12, 07:56 PM
Last Post: sub
  Get NextPVR data directory from outside a plugin McBainUK 3 2,213 2012-02-11, 05:42 PM
Last Post: mvallevand
  Weather Plugin imilne 0 1,406 2012-01-15, 08:33 PM
Last Post: imilne

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

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

Linear Mode
Threaded Mode