Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Possible NOOB Question - Plug-in Development

If you have a question or need help, this is the place to be.
Post Reply
landj9697
Posts: 6
Joined: Mon Nov 10, 2008 10:32 pm

Possible NOOB Question - Plug-in Development

Post by landj9697 »

I am working on creating a plug-in for Arcsoft's TotalMedia Theatre, which I use for DVD, HD-DVD, and Blu-ray playback on my HTPC. I currently have things working reasonably well using keyboard emulations for the remote commands. However, there is an issue with this program and certain High Def discs that seems to prevent keyboard commands from being processed by the system during playback.

For example, on the "Sleeping Beauty" Blu-ray, once the movie begins, pressing on the keyboard shortcuts for Next Chapter and Previous Chapter (PageUp and PageDown) results in nothing happening. However, if the OSD is brought up, and the chapter buttons themselves are clicked, the system will skip through the chapters. Therefore, the problem seems to lie in the transfer of keyboard strokes to system commands, not in the program's actual execution of the command.

What I would like to do is associate a macro with the program's internal command, similar to how the XBMC plug-in is set up. However, I am not sure of how I would find out what the commands would be or how the system calls them. Would anyone be able to assist with this, or point me in the right direction/
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Possible NOOB Question - Plug-in Development

Post by Bitmonster »

I haven't really understood it all. Do the chapters work, if you use the normal keyboard? If not, this seems to be simply a bug of TMT.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Possible NOOB Question - Plug-in Development

Post by CollinR »

Also since you are doing keyboard emulation you may be sending them to the wrong window.

As Bitmonster said, try pressing the keys on the keyboard. If that doesn't work then the problem is inside TMT.
Windows XP Pro sp3 - Several Machines usually latest beta but who knows.
Inputs: TCP / IR (USBUIRT) / RF(X10 Remote) / CLI-Batch / CCTV Motion / Ocelot
Outputs: TCP / IR (USBUIRT) / SageTV / SageTV Clients / YAC CallerID / HAL v3.7.3 / Ocelot
landj9697
Posts: 6
Joined: Mon Nov 10, 2008 10:32 pm

Re: Possible NOOB Question - Plug-in Development

Post by landj9697 »

It is indeed a known issue in TMT. Pressing the keyboard directly results in the same errors. But what I was thinking (perhaps incorrectly) was that there was some way to map the events directly to the commands that the program receives internally when a user presses the "Next" or "Previous" button on the On Screen Display. Basically, while the program may not function properly from keystrokes, it works fine as long as you use the OSD buttons (Play, Stop, Pause, FF, Rewind, etc.). I just didn't know if there was some way to feed directly to those commands...
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Possible NOOB Question - Plug-in Development

Post by CollinR »

Oh it can but do you know those actions? Sendmessage is a term you may search their forums for, if you can figure out what those messsages are EventGhost can recreate them on demand.
Windows XP Pro sp3 - Several Machines usually latest beta but who knows.
Inputs: TCP / IR (USBUIRT) / RF(X10 Remote) / CLI-Batch / CCTV Motion / Ocelot
Outputs: TCP / IR (USBUIRT) / SageTV / SageTV Clients / YAC CallerID / HAL v3.7.3 / Ocelot
landj9697
Posts: 6
Joined: Mon Nov 10, 2008 10:32 pm

Re: Possible NOOB Question - Plug-in Development

Post by landj9697 »

Well, I'm starting to get somewhere. I did what you suggested and found a post where someone had discovered some of the more common commands. They seemed to state that TMT was not as responsive to Sendmessage as much as Postmessage. I'm going to try to play with this for a while and see what I can come up with. Thanks for the help!
landj9697
Posts: 6
Joined: Mon Nov 10, 2008 10:32 pm

Re: Possible NOOB Question - Plug-in Development

Post by landj9697 »

I realize that this may be starting to move towards a plug-in development thread, so please feel free to move it appropriately:

I have gotten some work done on this TMT plug-in, but I have really hit a snag. Everytime I try to execute a command using the attached code, I receive the following from EventGhost:

Plugin: ArcSoft TotalMedia Theatre
Play
ArcSoft TotalMedia Theatre: Play
Error in Action: "ArcSoft TotalMedia Theatre: Play"
Traceback (most recent call last) (1485):
File "C:\Program Files\EventGhost\eg\Classes\ActionClass.py", line 157, in CallWrapper
File "C:\Program Files\EventGhost\plugins\ArcSoftTotalMedia Theatre\__init__.py", line 40, in __call__
File "C:\Program Files\EventGhost\plugins\ArcSoftTotalMedia Theatre\__init__.py", line 18, in SendCommand
File "C:\Program Files\EventGhost\eg\WinApi\Utils.py", line 313, in PySendMessageTimeout
ArgumentError: argument 1: <type 'exceptions.TypeError'>: wrong type


I admit that I am learning this as I go along, so I may have something waayy off. What I am trying to do is send the commands to 0x8D52. The wParam and lParam values are what actually decide which action is executed. Can anyone lead me out of the darkness here?

EDIT - Removed pasted code and attached document.
Attachments
__init__.py
(2.93 KiB) Downloaded 265 times
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Possible NOOB Question - Plug-in Development

Post by Bitmonster »

eg.WindowMatcher returns a list everytime, even if you only need one match.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
m3flyin2lo
Plugin Developer
Posts: 22
Joined: Sun Nov 23, 2008 3:22 am

Re: Possible NOOB Question - Plug-in Development

Post by m3flyin2lo »

There is a potentially simpler approach.
Instead of writing a plug-in for this, just use the SendMessage action. This assumes that TMT is your top window; if it's not, you could search for it and bring it up, but you would only have to do it once, not on each action. Considerably more efficient, I think.

I have TMT and tried the messages you have in your plugin, they seem to work.
landj9697
Posts: 6
Joined: Mon Nov 10, 2008 10:32 pm

Re: Possible NOOB Question - Plug-in Development

Post by landj9697 »

m3flyin2lo wrote:There is a potentially simpler approach.
Instead of writing a plug-in for this, just use the SendMessage action. This assumes that TMT is your top window; if it's not, you could search for it and bring it up, but you would only have to do it once, not on each action. Considerably more efficient, I think.

I have TMT and tried the messages you have in your plugin, they seem to work.
I'm pretty sure that I have tried this with no results. Can you walk me through or post some screen shots of what you are inputting on the "Add Action - SendMessage" dialog screen?
landj9697
Posts: 6
Joined: Mon Nov 10, 2008 10:32 pm

Re: Possible NOOB Question - Plug-in Development

Post by landj9697 »

Never mind, I figured out what I was doing wrong.

I didn't realize that you could change the values in the message box manually. I thought that you had to choose one of the 4 options in the dropdown box. Thanks for this. It will help get my system set up, but I was still hoping to get a plug-in developed just so other people wouldn't have to go through everything that I have in order to get things working. I will probably continue to tinker with it...
m3flyin2lo
Plugin Developer
Posts: 22
Joined: Sun Nov 23, 2008 3:22 am

Re: Possible NOOB Question - Plug-in Development

Post by m3flyin2lo »

Cool, please let me know how it goes. I am also looking at ways to control TMT through Eventghost. The main thing to figure out when going the SendMessage route is what all the messages are. Arcsoft will not share that kind of information unfortunately and TCP/IP control seems to be down on their list.
stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: Possible NOOB Question - Plug-in Development

Post by stottle »

It sounded like some people had success with the postmessage parameters described above. They don't do anything for me. I'm not sure if I have a bug, or if the parameters changed in TMT 3 (I don't have TMT 2 installed anymore).

Any hints from people that have this working?

Attached is my __init__.py script. It has the PostMessage actions, as well as an exit shortcut using eg.SendKeys(). The SendKeys action works, the others don't.

Brett
[edit] Someone seemed to say that the SendMessage action (not incode, but via addAction in eg) worked. How is this possible, since it doesn't let you send the command (0x8D52), only WM_COMMAND, etc.. Am I missing something?
[/edit]
Attachments
__init__.py
Test plugin for TMT
(1.45 KiB) Downloaded 299 times
stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: Possible NOOB Question - Plug-in Development

Post by stottle »

Here's a version of the plugin that just uses the hotKeys, no windows messages. I haven't tested it extensively, but what I've tried has worked. As noted above, there are some discs that stop keyboard shortcuts - when that happens these mappings won't work either. That's just a limitation of TMT right now. These shortcuts are from TMT3, so I don't know if they work for TMT2.

Brett
Attachments
__init__.py
keyboard shortcuts for TMT3 as a plugin
(5.07 KiB) Downloaded 825 times
CuFk
Posts: 4
Joined: Fri Jul 31, 2009 1:42 pm

Re: Possible NOOB Question - Plug-in Development

Post by CuFk »

I have a question regarding this plugin. I've put the plugin into the folder and loaded it into Eventghost. What am I supposed to do next? When I load i.e. the XBMC plugin they load all the key commands in a folder as well. I need that kinda folder since I use LircServer to controll all remote actions.

Cheers!
Post Reply