|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Trying to get a "Watch this Channel" button added... help?
I've got this MOSTLY working... I'm just missing something.
Ok, the rundown: Because of WAF, I have been confronted to 'add' a new button to the Program Guide TVShow options of "Watch Channel #" when "Watch Now" is not an option. This happens when you select a TV Show that is about to start in like 5 minutes or so, but there is NO button to start watching THAT channel (so when the show starts, you are already on the channel). Makes sense, right? Well, I've got it mostly working... with one bad glitch. The button when "Watch Now" isn't an option, says like instead "Watch Channel 28" when you are viewing a tv show guide entry on channel 28 that isn't on right now (or pre-recorded). That works fine! However, when clicking it, it simply goes to video playback of the last channel sage was tuned too on whichever tuner card it happens to decide on (two cards both have the same guide). The half working part though, is if sage is currently watching some OTHER channel at the time you select "Watch Channel #"... it WILL change to that channel and start watching it! Pretty weird huh? I've looked and looked and cannot figure out why it wont work when nothing is currently being viewed at the time, yet works fine when something is on, even a prerecorded show I was watching. This is a rundown of what I added in "THEME ORGANIZER/PanelThemes/EPGCell/Mouseclick...etc.../Options Panel/Basic Options Panel": Code:
IF ((GetAiringStartTime(Airing) > Time()) || (GetAiringEndTime(Airing) < Time())) && (MediaFile == null) Watch Channel {item} ChannelChange {attr} ChannelChange = GetAiringChannelNumber(Airing) {action} ChannelSet(ChannelChange) {action} !DisplayInfo {alias} MediaPlayer OSD {alias} DefaultFocus {attr} Watch Channel Panel {graphic setup} "Watch Channel " + GetAiringChannelNumber(Airing) {action text} Play Icon Panel {alias} I have tried using the live tv command, then issuing a channel change to the selected tv show's channel... but that resulted in the exact same behavior. I tried linking out to aliases used in Watch Now, but that resulted in errors of "This show isnt aired yet" (obviously)... Stumped! Any ideas oh great gurus of ... gurudom? |
#2
|
|||
|
|||
I would instead 'Watch(airing)' where airing is the current program on the channel in question. There is an api 'GetAiringsOnChannel...' that can get you the airing and I believe there is one called GetAiringsOnChannelAtTime or something like that but look at the API. I seem to remember it in either the Database branch or the Global branch.
BobP. |
#3
|
|||
|
|||
Quote:
Code:
- Airings = GetAiringsOnChannelAtTime(ChannelChange, Time(), Time() + (60*1000), false) +- Watch(GetElement(Airings, 0)) Dirk |
#4
|
|||
|
|||
Quote:
|
#5
|
|||
|
|||
Quote:
Thanks to both... I will try messing with the code posted to see if I can get that working instead. On a side note, I stumbled across being able to change aspect ratio during playback without having to bury myself into option menus So, some good came out of having me work for it! LOL. |
#6
|
|||
|
|||
Agh.... I cant get it to work. Actually, cant get it to work at all lol!
Keeps giving me "error -12 there was a null object requested to playback". I've tried various ways of using the airing that should be on that channel 'now'... but each time it breaks. Once it actually 'cleared out' the program guide ! Woops. As I was overwriting the object of Airing with the one 'now'... which was null for some reasons. I have to take a break, but will dive back into it later after some mythbusters |
#7
|
|||
|
|||
SageTV 6 must be busted ?
No matter how I go about it, "GetAiringsOnChannelAtTime" always returns null. I've tried dynamic channel numbers, hard set numbers, I've tried higher time frames, lower, I've tried true and false on must start within timeframe... it always, reptitively returns null. I even stuck that in the title of the button to see what it comes with, and its null! AGH! The channel number shows up fine, lol. I'm going to go back to idea #1: watch live tv and change the channel. At least that worked halfway... just have to figure out why it doesnt work when nothing is currently playing. |
#8
|
||||
|
||||
Most likely you're not calling it correctly. Note that the first argument to GetAiringsOnChannelAtTime is not an integer (channel number) or String (channel name), it's a Sage.Channel, which you must obtain from the ChannelAPI, e.g. by calling GetChannelForStationID.
That said, it seems from your description that what you really want is not "watch this channel" but "watch this program as soon as it starts". That might actually be easier to code, since it can be done by simply forking off a thread that sleeps for a bit and then jumps to "Watch Now".
__________________
-- Greg |
#9
|
||||
|
||||
Quote:
public sage.Channel GetChannel(sage.Airing Airing) public sage.Airing[] GetAiringsOnChannelAtTime(sage.Channel Channel, long StartTime, long EndTime, boolean MustStartDuringTime) |
#10
|
|||
|
|||
Try this:
Code:
- Airings = GetAiringsOnViewableChannelsAtTime(Time(), Time() + 1, false) +-Airings = FilterByMethod(Airings, "GetAiringChannelNumber", "<your channel number string here>", true) +- Watch(GetElement(Airings, 0)) |
#11
|
|||
|
|||
Found it! Thanks for the hints about Channel Key instead of channel number. TOTALLY makes sense... didn't think it was that way, but now that I see if, it makes perfect sense!
When I do this it works: Code:
Watch(GetElement(GetAiringsOnChannelAtTime(GetChannel(Airing), Time(), Time()+60000, false), 0)) Code:
ChanOBJ = GetChannel(Airing) AirLIST = GetAiringsOnChannelAtTime(ChanOBJ, Time(), Time()+60000, false) AirELM = GetElement(AirLIST, 0)) Watch(AirELM) Now, this allows them to easily tune to that channel and sit like a couch potatoe for the show to come on. Lol. Me, I just have everything recorded and I never watch live tv ha! Thanks for all the help guys! I was totally missing that one teeny little thing. PS: 60000 is a bit much really... 1000 hours worth ? I'm sure doing like 10 hours would be sufficient enough, I would hope... I've never seen a show on for longer than 10 hours LOL. Last edited by IncredibleHat; 01-09-2007 at 07:04 PM. |
#12
|
||||
|
||||
Quote:
__________________
-- Greg |
#13
|
|||
|
|||
Oy. Gotcha.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|