Creating a plugin For BeyondTV

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
ijourneaux
Experienced User
Posts: 102
Joined: Wed Feb 17, 2010 2:20 am

Creating a plugin For BeyondTV

Post by ijourneaux » Sat Mar 20, 2010 9:19 pm

I have eventshost up and running well on my HTPC system where I have XBMC and BeyondTV running. The XBMC plug works like a champ. I was thinking of diving into creating a plugin for BeyondTV. Don't know much about python but have programmed in C/C++ and VB. Thought I would dive it.

I tried to us the SageTV and Windows Media Player Classic plugins as models.

The WindowClass for BeyondTV is Streamzip.WM.D3D.

Unfortunately when I try and execute commands in the plugin I get an error message 'Appliction is not running".

I am sure it is something simple that I am missing.

What is the best way to debug the python based plugins.

User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: Creating a plugin For BeyondTV

Post by Livin » Sat Mar 20, 2010 11:22 pm

Since you use XBMC and know C, why not build the PVR interface into XBMC? There is already a framework being built for XBMC for other PVRs - if you build the BTV interface I'd DEFINITELY use it! I'm sure MANY others will too.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system

stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: Creating a plugin For BeyondTV

Post by stottle » Sat Mar 20, 2010 11:47 pm

That error message is usually because a plugin (most likely the one you are working on) is trying a SendKeys operation on a FindWindow. If the target application isn't running, that message is displayed. Searching your plugin code for the string should get you there.

As for debugging, it is a little tricky because EG works to not show the user error messages and debugging output. I will often open the python shell (under EG's help) and try to run commands manually, where errors aren't trapped.

Brett

ijourneaux
Experienced User
Posts: 102
Joined: Wed Feb 17, 2010 2:20 am

Re: Creating a plugin For BeyondTV

Post by ijourneaux » Sun Mar 21, 2010 1:03 am

The error is coming from the plugin I am working on. I used WinSpy to get the window class of the BeyondTV window. That came back as Streamzap.WM.D3D

The code seems to be pretty simple at this point so I am missing something obvious.

class ActionPrototype(eg.ActionClass):
def __call__(self):
try:
hWnd = FindWindow("Streamzap.WM.D3D")
return SendMessageTimeout(hWnd, WM_COMMAND, self.value, 0)
except:
raise self.Exceptions.ProgramNotRunning

I haven't had a chance to play with the PVR functionality in XBMC. Development on that branch was pretty quiet for a while but there have been several mentions of it recently. I believe they are currently interfacing the the recording functionality in MediaPortal.

stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: Creating a plugin For BeyondTV

Post by stottle » Sun Mar 21, 2010 1:47 am

If you add an action the "Find a Window" to your config (you can cancel once you get the info), you can use that to get the parameters you need for find window. Just drag the bullseye thingy (the technical term) to the target window. I'm guessing you are using the classname instead of the window name.

Brett

Post Reply