PDA

View Full Version : processing event from myhtpc (Got TV plugin)



cpnkirk
April 15th, 2004, 04:19 PM
I'm trying to do something that should be very simple, so I assume I'm overlooking something obvious:

I have set the GotTV plugin from MyHTPC to send events to girder. The only event I'm interested in is "WTTV.SetChannel". When Girder gets this event, I simply want it to change the STB to that channel by sending the appropriate IR codes through my USB UIRT.

I can make a command that will send any of the digits 0-9 to the box, and they work. I can tell that Girder is receiving the commands, because if I use the "WTTV.vischange" event, Girder sends out whatever I key I "learned".

The setchannel event includes several payloads, but the only one I need is pld1, which will hold the channel number. I can have GotTV send one message w/ the entire channel #, or several messages, each one have a digit of the channel.

My first thought was to set the event string to "WTTV.SetChannel[0]" and the command to transmit IR "0" to the STB. Then duplicate this for the rest of the digits. That way, Got TV could send one message per digit of the channel, and girder would send each digit to the set top box. Apparently, this doesn't work. So, I thought maybe putting [0] at the end of the message wasn't the right way to do it...perhaps I should use an "if" statement in the Lua scripts to do this (if pld1=0 then triggerevent("0"), etc...) But, this doesn't work either - in fact, the scripting engine won't even let me "apply" my script. Apparently I have a syntax problem, although I've virtually copied script examples from the online help files.

So, now I'm asking for help: surely there is a way to do this easily. Any pointers?

Hesse
April 15th, 2004, 06:13 PM
GotTV has the capability to send an event for each digit. Did you look in the settings dialog, under the channels tab? You can use the "Channel change event string/path (Use [c] for cahnnel number/digit" line for your girder event. Then check "Send each digit". That is the easiest way to do it.

Or you can use a for loop in LUA script to send each digit. This is the lua scipt I used to use before the other capability was added to GotTV.



LASTCHANNEL = pld1
for i=1,strlen(LASTCHANNEL) do
TriggerEvent("CableBox." .. strsub(LASTCHANNEL,i,i),18)
end
TriggerEvent("CableBox.Enter",18)


I had events called "CableBox.1", "CableBox.2", etc that entered each digit.

Jesse

cpnkirk
April 16th, 2004, 05:00 AM
Thanks for your help, Jesse...I tried your script, making slight changes to match the events I had already made, and it works...turns out that part of the problem was my test involved using the channel up button, which apparently doesn't trigger the SetChannel event...

Does anyone know what event is triggered by the channel up or channel down buttons?

Hesse
April 19th, 2004, 09:40 PM
Thanks for your help, Jesse...I tried your script, making slight changes to match the events I had already made, and it works...turns out that part of the problem was my test involved using the channel up button, which apparently doesn't trigger the SetChannel event...

Does anyone know what event is triggered by the channel up or channel down buttons?

I would just use the event configuration within GotTV (see previous post). You can set all of those things and not have to know the event names.

Jesse

randomforumguy
July 10th, 2004, 05:34 PM
I am using GotTV and the native EPG with xmltv automate and it works great as a digital vcr with my pvr250 for analogue channels. For scheduled recordings, though I want to also be able to record from my cable box for the digital channels on the s-video input. I figured out how to get GotTV to use channels.ini to change to s-video automatically input=1 for certain channels. I also found an excellant channel.gml for my cable box that changes the STB using USB-UIRT when a girder event "channel###" command is executed in the command line window.
It seems like I should let GotTV execute this in the channel tab in the settings but it doesn't work. I checked "send event to girder" then i put "c:\Program Files\Girder32\event.exe" channel[c] in the first blank. When i run the same command except ...channel401 for instance in the c: prompt dos window girder changes my channel so it seems like this should work but not from GotTV.

Promixis
July 11th, 2004, 06:33 AM
Should there be a space between channel and the channel number?

randomforumguy
July 11th, 2004, 08:37 AM
Now it seems obvious. I didn't need to have "c:\Program Files\Girder32\event.exe", just needed channel[c] . GotTV did the first part internally. I got confused from another post.
Now it works like a charm with the cablebox.gml i downloaded Gottv executes the event channel### and puts the number in. There is an event for each channel and USB-UIRT tunes the cablebox. Thanks.