NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Old Stuff (Legacy) Slimm GB-PVR and GBPVRcli v
« Previous 1 2 3 4 Next »
how are you getting data for recording items?

 
  • 0 Vote(s) - 0 Average
how are you getting data for recording items?
Wakalaka
Offline

Posting Freak

Posts: 926
Threads: 161
Joined: Jan 2007
#1
2007-04-21, 09:01 AM
I'm working on my Tuner Status plugin, and know if a tuner is recording and the show name that is being recorded. I also want to get the channel # so I can display the channel icon and show description.

IList mRecordingScheduleList = null;
DateTime mRecordingScheduleListLoadedTS = DateTime.Now;
Programme mProgramme = null;
Channel mChannel = null;
mRecordingScheduleList = GBPVR.Backend.Common.ScheduleHelper.getInstance().LoadRecordingSchedule();

This gives me an array of scheduled recordings, and I can search for a matching name and try to guess the date and time it started vs DateTime.Now. There has to be an easier way to know that if something is recording, for it to return specific info on what is being recorded: channel #, show name, show description.

What's your secret to display the data in the tooltip?
NPVR 4.1.0.180302 o Kodi 17.6 o EventGhost 0.5.0.rc4 o SAF 6.3.2 o SchedulesDirect
[SIZE="1"]
Case: Apevia X-Qpack HTPC o Motherboard: Asus P8H67-MLE o CPU: Intel Core i3-2100 o RAM: 8 GB o OS: Win7 64-bit
Tuner: HDHomeRun dual tuner o Leaf SkyHDTV antenna o Remote: Microsoft MCE
Hard drives: Samsung 500 GB SSD, Seagate 2 TB SATA2, Samsung 540 GB SATA2 o Input: Logitech USB keyboard & mouse
Video: ATI Radeon 7750 o Monitor: Viewsonic 27" VX2703MH-LED, LG 55" LCD TV
[/SIZE]
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#2
2007-04-21, 04:00 PM
Code:
[FONT=Courier New][COLOR=#0000ff]public [/COLOR][COLOR=#0000ff]bool[/COLOR] getScheduledRecordingInProgress()[/FONT]
[FONT=Courier New]{[/FONT]
[FONT=Courier New][COLOR=#0000ff] bool[/COLOR] inProgress = [COLOR=#0000ff]false[/COLOR];[/FONT]
[FONT=Courier New] ScheduledRecording sr = getScheduledRecordingObject(mProgramme.getOID());[/FONT]
[FONT=Courier New][COLOR=#0000ff] if[/COLOR] (sr != [COLOR=#0000ff]null[/COLOR])[/FONT]
[FONT=Courier New] {[/FONT]
[FONT=Courier New][COLOR=#0000ff]   int[/COLOR] status = (sr == [COLOR=#0000ff]null[/COLOR] ? -1 : sr.getRecordingStatus());[/FONT]
[FONT=Courier New][COLOR=#0000ff]   if[/COLOR] (status == ScheduledRecording.STATUS_IN_PROGRESS)[/FONT]
[FONT=Courier New]     inProgress = [COLOR=#0000ff]true[/COLOR];[/FONT]
[FONT=Courier New] }[/FONT]
[FONT=Courier New][COLOR=#0000ff] return[/COLOR] inProgress;[/FONT]
[FONT=Courier New]}[/FONT]
Mister Slimm
Offline

Senior Member

Posts: 437
Threads: 41
Joined: Nov 2005
#3
2007-04-22, 01:25 PM
Continually loading the recording schedule places a large load on the processor so I only ever reload it when absolutely necessary.

I monitor the tuner status using the code I gave you before and extract the number of recordings ongoing at any one time. If the number of active recordings changes then I reload the recording schedule and pull out the recordings whose .getRecordingStatus() == ScheduledRecording.STATUS_IN_PROGRESS.

I think these are the two bits that should point you in the right direction.

Code:
#region RecordingStatus
    /// <summary>
    /// Enumeration of possible recording status values for a <see cref="ScheduledRecording"/>.
    /// </summary>
    public enum RecordingStatus
    {
      /// <summary>Indicates a <see cref="ScheduledRecording"/> completed successfully.</summary>
      Completed = ScheduledRecording.STATUS_COMPLETED,
      /// <summary>Indicates a <see cref="ScheduledRecording"/> did not complete successfully.</summary>
      CompletedWithError = ScheduledRecording.STATUS_COMPLETED_WITH_ERROR,
      Conflict = ScheduledRecording.STATUS_CONFLICT,
      Deleted = ScheduledRecording.STATUS_DELETED,
      /// <summary>Indicates a <see cref="ScheduledRecording"/> is currently being recorded.</summary>
      InProgress = ScheduledRecording.STATUS_IN_PROGRESS,
      /// <summary>Indicates a <see cref="ScheduledRecording"/> is scheduled to be recorded in the future.</summary>
      Pending = ScheduledRecording.STATUS_PENDING,
      Placeholder = ScheduledRecording.STATUS_PLACE_HOLDER,
      /// <summary>Used to tell <see cref="Schedule(RecordingStatus)"/> to return all recordings regardless of RecordingStatus.</summary>
      Any = int.MaxValue
    }
    #endregion

    public static System.Collections.ArrayList Schedule(
                               RecordingStatus Status,
                                           int NumberOfRecordings)
    {
      ArrayList RecordingList = new ArrayList();
      // Make sure a schedule is loaded
      if (NeedToRefreshSchedule) { RefreshSchedule(); }
      // Now run through schedule and return information required
      try
      {
        for (int RecordingCount = 0;
             _ScheduleListGeneric != null && RecordingCount < _ScheduleListGeneric.Count;
             RecordingCount++)
        {
          try
          {
            //ScheduledRecording Recording = (ScheduledRecording)_ScheduleList[RecordingCount];
            if ((RecordingList.Count < NumberOfRecordings)
            && ((_ScheduleListGeneric[RecordingCount].getRecordingStatus() == (int)Status) || (Status == RecordingStatus.Any)))
            {
              // Add this recording to the recording list
              RecordingList.Add(_ScheduleListGeneric[RecordingCount]);
            }
          }
          catch (Exception ex)
          {
            Trace.TraceError("ERROR: Failed to analyze RecordingScheduleList for status=" + Status.ToString()
                        + "\nLOCAL: RecordingCount=" + RecordingCount.ToString()
                        + "\nLOCAL: RecordingList.Count=" + _ScheduleListGeneric.Count.ToString()
                        + "\nLOCAL: Recording=" + _ScheduleListGeneric[RecordingCount].ToString()
                        + "\n" + ex.ToString());
          }
        }
      }
      catch (Exception ex)
      {
        Trace.TraceError("ERROR: Failed to analyze RecordingScheduleList."
                     + "\nLOCAL: RecordingList.Count=" + _ScheduleListGeneric.Count.ToString()
                     + "\n" + ex.ToString());
      }
      return RecordingList;
    }

I've also PM'd you the source code for Slimm GBPVR. Note that the source code for Slimm.GBPVR.dll (which is where the above functions are) are in a folder called SlimmGBPVRHelper. Also, note that there are sections of code which belong to other people who will need to be credited somewhere on your project if you use them. The code is reasonably well commented and there is the technical documentation called SlimmGBPVRDoc.chm in the SlimmGBPVR/Documentation folder.
[SIZE="1"]Akasa Zen case, AMD Phenom II X3 720, 4.00Gb Ram, Sapphire ATI Radeon 4890, Terratec Terratec Cinergy 2400i Twin Digital Tuner, 1050Gb storage, Windows 7 Home Premium.
See my blog for releases, HD wallpapers, movie, game and anime reviews and more.[/SIZE]
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Tray icon inactive during recording FirstTeamOPS 0 5,050 2009-12-18, 02:26 AM
Last Post: FirstTeamOPS
  Recording status erroneously remains on keith_leitch 1 5,253 2009-06-13, 07:22 AM
Last Post: keith_leitch
  SlimmGBPVR doesn't prevent standby during recording rob11252 34 21,061 2008-07-28, 10:41 AM
Last Post: Mister Slimm
  SlimmGBPVR - Blacked-out Menu Items. JavaWiz 8 4,765 2007-11-20, 08:18 PM
Last Post: gEd
  Disable auto-restart recording service, green light stuck on and no standby problems pvruser 10 6,996 2007-10-01, 10:39 AM
Last Post: Mister Slimm
  Restarting Recording Service and Logging Out macgyver 7 5,147 2007-08-06, 07:17 PM
Last Post: macgyver
  "Recording has started" when watching Live TV & Conflict csc12345678 9 5,595 2007-07-13, 05:19 PM
Last Post: sub
  Have systemtray icon pop up only when recording? Bwangster12 5 3,805 2007-07-08, 05:32 PM
Last Post: Bwangster12
  Disable Request to Delete Recording betbest1 3 3,270 2007-06-01, 11:21 AM
Last Post: Mister Slimm
  tooltip display bug with multiple tuners recording Wakalaka 5 3,955 2007-04-14, 01:56 AM
Last Post: FirstTeamOPS

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

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

Linear Mode
Threaded Mode