NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 5 6 7 8 9 … 93 Next »
Noobie Here!

 
  • 0 Vote(s) - 0 Average
Noobie Here!
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#111
2014-03-25, 04:07 PM
jrockow Wrote:I would also like to be able to use the PLAY key (CTRL-P) to play the file immediately, without going to the popup.
Can you get me started on that. I'm not sure how to code in specific keyboard commands.
You could override the OnKeyDown method, check for the key, and if it's PLAY, then start playback of the selected item.

Quote:Also, I assume I need some sort of timer to keep my list up to date.
Is it enough for the timer to just PopulateList, or do I need to do more.
What interval do you suggest I use for updating the screen?
It'd have to be done from the current thread. Timers often use a background thread. When I need to do this, I often override the NeedsRendering() call (which is called continuously while the plugin is visible), to check the time since last update, and run PopulateList or whatever you need to when you go past a certain time.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#112
2014-03-25, 04:08 PM
jrockow Wrote:I assume you probably have some built-in commands to write back to the database.
(a lot easier than me doing it my clumsy way!)

i.e. I would like to rename the selected file and some of it's epg events.
You can update data on the ScheduledRecording objects, then call Save() on them.
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#113
2014-03-26, 02:54 PM
I have spent a few hours trying to come up with a simple fool-proof procedure with no good solution yet.
I'm trying to get a count of the individual "name"s in the recordings collection. (if that's the right term?)
i.e. How many episodes of "Castle" do I have recorded, how many of "CSI" etc.

I've played with simple loops but usually it's not fool-proof.
Sometimes I'll miss the last show, for example.

I realize this isn't a problem with NPVR, but I was hoping you might suggest some code that would keep me from going crazy Smile
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#114
2014-03-26, 04:14 PM
Do something like

Code:
List<string> uniqueNames = new List<string>();
foreach (ScheduledRecording recording in ScheduledRecording.LoadAll())
{
    if (uniqueNames.Contains(recording.Name) == false)
    {
        uniqueNames.Add(recording.Name);
    }
}
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#115
2014-03-26, 07:19 PM
If I understand your sample, this will give me a list of the unique NAMES, but not how many times each appears?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#116
2014-03-27, 12:02 AM
Sorry, I'd misunderstood (skim reading let me down again). Use something like a "Dictionary<string, List<String>>" to hold a list of filenames keyed by name.
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#117
2014-03-27, 09:21 PM
Having a problem updating the epg_events.
I am using this code:

epgEvent__1.Subtitle = recording.Name
recording.Name = "MOVIE"
recording.Save()

The NAME field gets updated, but the Subtitle event is not changed.

I assume I may have to be working with the EPG EVENT table?
Doesn't appear as though they share the same OID?
Can you give me an example of what I need to do.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#118
2014-03-27, 09:32 PM
The scheduled recording object holds a cached copy of the EPGEvent, since it'll be deleted out of the EPG_EVENT table eventually, and you want to retain this info.

If you need to update this cached info, you'd probably need to something like this:

Code:
EPGEvent epgEvent = EPGEvent.Parse(recording.CachedEventDetails);      
epgEvent.Subtitle = "test";
recording.CachedEventDetails = epgEvent.ToString();
recording.Save();
jrockow
Offline

Senior Member

Posts: 718
Threads: 112
Joined: Nov 2005
#119
2014-03-28, 06:36 PM
Getting closer to finishing this first screen.

Current problem;
I can't seem to separate the control of the right/left arrow keys, from the 2nd button strip and the list of shows/episodes.
I have included a screenshot to hopefully help me better explain this.


Ideally what I want to do is arrow up to the 2nd button strip; ("Diane" "John" "Both" "ALL") and then cursor right or left to select which group I want to display. So far the methods I have tried have the cursor selection moving right or left in the 2 list columns at the same time.
I would like the cursor movement to only apply to the 2nd button strip, or the 2 list cloumns, but not both at the same time.
I hope you can make sense from my explanation.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#120
2014-03-28, 06:54 PM
jrockow Wrote:I would like the cursor movement to only apply to the 2nd button strip, or the 2 list cloumns, but not both at the same time.
This will come down to your OnKeyDown method. You only want to pass OnKeyDown to the control that is selected. It sounds like you're passing it to them both?
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (17): « Previous 1 … 10 11 12 13 14 … 17 Next »
Jump to page 


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

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

Linear Mode
Threaded Mode