NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 50 51 52 53 54 … 93 Next »
Changing channel from a plugin

 
  • 0 Vote(s) - 0 Average
Changing channel from a plugin
Snarky
Offline

Junior Member

Posts: 43
Threads: 7
Joined: Oct 2005
#1
2006-04-03, 10:21 PM
Is there some way in the API to change the channel programmatically, so that I can do it in a plugin?

The relevant method appears to be IChannelChanger.setChannel(int channel), but I don't know how to get hold of an IChannelChanger instance.

The best thing I can think of is IScheduleHelper.ScheduleRecording() with start time and end time set to right now (or a second into the future), but it seems a bit ugly.

Any help would be appreciated!
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,823
Threads: 769
Joined: Nov 2003
#2
2006-04-03, 10:36 PM
You could try the IPluginHelper.StartLiveTV(Channel channel); API, but it wasnt really intended for this purpose, so I'm not sure it'll work or not. I think maybe yes.
Snarky
Offline

Junior Member

Posts: 43
Threads: 7
Joined: Oct 2005
#3
2006-04-04, 12:11 AM
Ha! That works. Most excellent...

Thanks!
23skidoo
Offline

Member

Posts: 120
Threads: 9
Joined: Sep 2006
#4
2006-09-20, 04:04 PM
How about just getting a list of available channels? Still searching. Some sort of high-level object model doc might be nice.... Did I just say that out loud? lol
WinTV PVR-150 / ATI X1600 512 / 3GHz P4 / 2GB RAM
23skidoo
Offline

Member

Posts: 120
Threads: 9
Joined: Sep 2006
#5
2006-09-20, 04:05 PM
Of course, there may be something like that floating around on the wiki. But the wiki is down.... :-(
WinTV PVR-150 / ATI X1600 512 / 3GHz P4 / 2GB RAM
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,823
Threads: 769
Joined: Nov 2003
#6
2006-09-20, 04:12 PM
There isnt really any functionality provided for plugins to get a list of channels. Stuff like channels and recordings etc are pretty much internal things to GB-PVR, so not really exposed to plugins. That said, there is some stuff I made accessible so the web admin was possible...

The closest you can get is call for getting the listings for a time period. If you add a reference to GBPVRBackendCommon.dll, then you'll be able to call ScheduleHelper.getInstance() to get an object that implements IScheduleHelper. Calling IScheduleHelper.GetListingsForTimePeriod() will return you a list of Channel objects, and each of those channels will have a list of zero or more Programme objects.

If you need to see this in use, the source code for the web admin uses it.
23skidoo
Offline

Member

Posts: 120
Threads: 9
Joined: Sep 2006
#7
2006-09-20, 04:22 PM
sub Wrote:There isnt really any functionality provided for plugins to get a list of channels. Stuff like channels and recordings etc are pretty much internal things to GB-PVR, so not really exposed to plugins. That said, there is some stuff I made accessible so the web admin was possible...

The closest you can get is call for getting the listings for a time period. If you add a reference to GBPVRBackendCommon.dll, then you'll be able to call ScheduleHelper.getInstance() to get an object that implements IScheduleHelper. Calling IScheduleHelper.GetListingsForTimePeriod() will return you a list of Channel objects, and each of those channels will have a list of zero or more Programme objects.

If you need to see this in use, the source code for the web admin uses it.
That might be exactly what I was looking for. I'll give it a shot. Thanks.
WinTV PVR-150 / ATI X1600 512 / 3GHz P4 / 2GB RAM
23skidoo
Offline

Member

Posts: 120
Threads: 9
Joined: Sep 2006
#8
2006-09-20, 05:36 PM
Alright. Check this out. Works perfect.

Code:
private string SetNextShow()
{
    try
    {
        ArrayList ChannelListings = (ArrayList) ScheduleHelper.getInstance().GetListingsForTimePeriod(DateTime.Now, DateTime.Now.AddMinutes(1));
        
        m_SelectedChannel = (Channel)ChannelListings[m_ChannelIndex.Next(ChannelListings.Count - 1)];
    }
    catch
    {
        MessageBox.Show("Hmm...");
    }
}

Now, how do I shut down live TV? :-)

Seriously, I've been digging and digging.
WinTV PVR-150 / ATI X1600 512 / 3GHz P4 / 2GB RAM
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,823
Threads: 769
Joined: Nov 2003
#9
2006-09-20, 05:44 PM
Again, this isnt really stuff I'd intended to be done from a plugin, so I'm not sure if it will work, but you can try IPluginHelper.GetActiveVideoPlayer().stop();
Snarky
Offline

Junior Member

Posts: 43
Threads: 7
Joined: Oct 2005
#10
2006-09-20, 07:05 PM
What I do is to just send an ESC keypress programmatically to the application. (System.Windows.Forms.SendKeys.Send()). The plugin needs to be deactivated first, of course.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  API channel.stream.start mvallevand 2 1,568 2023-05-07, 09:40 PM
Last Post: mvallevand
  PIP plugin for Kodi sgilani 2 3,224 2022-10-17, 12:44 AM
Last Post: sgilani
  Way to tell programmatically if channel load in from NPVR has finished... gdogg371 3 2,586 2021-03-11, 03:59 PM
Last Post: mvallevand
  New Systems Plugin kirschey 10 3,827 2020-11-14, 08:01 PM
Last Post: sub
  What is being sent when using /live?channel=3.1 scJohn 2 2,082 2020-01-30, 04:51 PM
Last Post: sub
  Web command to create recurring any channel mvallevand 2 2,777 2019-02-04, 03:09 PM
Last Post: mvallevand
  XMLTV Channel Number Option gdogg371 12 7,348 2018-07-18, 04:32 PM
Last Post: sub
  Channels List by Channel Group Name scJohn 1 2,920 2018-01-05, 10:45 PM
Last Post: mvallevand
  Channel List (native controller) psycik 2 3,256 2017-06-19, 09:14 AM
Last Post: psycik
  Getting all channel listings - decimal channel numbers psycik 11 8,796 2015-12-13, 02:17 AM
Last Post: seejaydee

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

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

Linear Mode
Threaded Mode