NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 46 47 48 49 50 … 93 Next »
Pre Recording Hook

 
  • 0 Vote(s) - 0 Average
Pre Recording Hook
Reznor
Offline

Junior Member

Posts: 15
Threads: 5
Joined: Sep 2005
#1
2007-02-17, 03:20 AM
I was wondering if there any way I could get GBPVR to be able to do something right when it starts to record a show and right when it finishes. Such as call a method or something within the API itself. I've been looking around the docs but have yet to find anything.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#2
2007-02-17, 03:27 AM
No, there isnt anything that does this.

The closest to this is the ParallelRecording.bat, which is run when the recording starts.
Reznor
Offline

Junior Member

Posts: 15
Threads: 5
Joined: Sep 2005
#3
2007-02-17, 03:41 AM
Yeah I just noticed that one and also RecordingStatus.bat. I was looking to develop a sort of webservice that will connect to my website to have GBPVR submit the activities it is doing in realtime. Because my GBPVR is on a slower system I would much rather have it report its activities to the site as opposed to having the site query it to see what its doing. This would result in a faster presentation of the website and less use of bandwidth.

So I can code an app that can be called by recordingstatus to post when something is being recorded and such. How about anything that gets called when a show is being watched. Does that exist? I supposed this would be simpler to track via a webservice request.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#4
2007-02-17, 03:51 AM
Sorry, there is nothing for that. Plugins can receive notification about several events, but these are more about use initiate things - primarily because these plugins run in the gbpvr.exe process instead of the recording service process, so they dont have visibility of these things occurring.

Quote:How about anything that gets called when a show is being watched. Does that exist?
Yes, if your plugin implements the IEventNotification interface, then it gets notified about this.
Reznor
Offline

Junior Member

Posts: 15
Threads: 5
Joined: Sep 2005
#5
2007-02-18, 02:52 AM
so in order to use the IEventNotification interface I sould code something to this effect
Code:
using System;
using System.Collections.Generic;
using System.Text;
using GBPVR.Public;
using GBPVR.Backend.Common;

namespace TunerReporter
{
    public class TunerMonitor : IEventNotification
    {
        private static TunerMonitor instance;

        public static TunerMonitor Instance
        {
            get
            {
                if (null == instance) instance = new TunerMonitor();
                return instance;
            }
        }
        
        public TunerMonitor() {
            instance = this;
        }

        public void Notify(EventTypes eventType, string eventText)
        {
                Logger.Verbose("Test to see if I was notified of something");
        }
    }
}

This is what I've gathered from looking through the forums. and sometimes this will work and sometimes it wont. How can I get it to log the even name in the logs using this concept. Just so I can get a feel for how this whole interface works ?

Am I even going about this properly?

Any help would be appreciated.
Reznor
Offline

Junior Member

Posts: 15
Threads: 5
Joined: Sep 2005
#6
2007-02-18, 08:08 AM
So I seem to have my little script recording the logs of certain activities however it only seems to be recording the activities that occur on my MediaMVP and not on the main GBPVR system. When I put it on live tv or watch a recording on the main system it is not making an entry in the log. But when I try these actions on the MediaMVP then it does make an entry in the GBPVR log. Any Ideas ???
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#7
2007-02-18, 05:27 PM
Yeah, that sample code above looks about right. I'm not sitting in front of my development PC at the moment, but in the Notify() method you can check the type with a simple "if (eventType == EventTypes.EventBlahBlah)...".

This will give you notification about most front end events, like starting live tv, playing a file etc.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,708
Threads: 767
Joined: Nov 2003
#8
2007-02-18, 05:59 PM
Reznor Wrote:So I seem to have my little script recording the logs of certain activities however it only seems to be recording the activities that occur on my MediaMVP and not on the main GBPVR system. When I put it on live tv or watch a recording on the main system it is not making an entry in the log. But when I try these actions on the MediaMVP then it does make an entry in the GBPVR log. Any Ideas ???
Both should generate the events.

Its important to remember that you can have multiple instances of GB-PVR running, so the events can be occuring in multiple processes. Only the first instance of GB-PVR produces logs.
Reznor
Offline

Junior Member

Posts: 15
Threads: 5
Joined: Sep 2005
#9
2007-02-18, 06:27 PM
Ohhhh, I see so what your saying is I'm most likely not seeing the log from the main GBPVR System is because the instance started by the recording service is the one actually generating logs. Not because my code isn't working.

OK Cool sub thanks, I thought I was losing my mind for a while there. LOL
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Custom recording tomx 2 557 2025-02-07, 09:14 AM
Last Post: tomx
  API call for Recording Complete linustorvalds 1 376 2025-01-19, 02:11 PM
Last Post: mvallevand
  Manual recording API mvallevand 2 1,018 2023-11-09, 02:14 PM
Last Post: mvallevand
  Recording direct to GPhotos API rgonzalez 0 1,465 2020-06-29, 04:45 AM
Last Post: rgonzalez
  Recurring Recording URL Parameters jcole998 2 2,989 2019-09-19, 01:08 PM
Last Post: jcole998
  Get recording length from stream skogl 46 13,976 2019-08-15, 09:34 PM
Last Post: sub
  Unexpected result when deleting a pending recording scJohn 5 3,770 2018-05-06, 10:09 PM
Last Post: sub
  How to best verify success when adding a recurring recording drmargarit 1 2,817 2017-03-02, 03:13 PM
Last Post: mvallevand
  Change recording filename programmatically immediately before recording starts? craigrs84 5 6,097 2015-07-13, 09:28 PM
Last Post: patco444
  Recording a specific episode based on season and episode number cbgifford 26 10,308 2014-12-19, 10:28 PM
Last Post: cbgifford

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

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

Linear Mode
Threaded Mode