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.
I would like to revise MediaMonkey plugin so that communication with the COM object was in a separate thread (as a plugin DVBviewer). I spent this many hours, but I do not have success. I did two test plugins. Are attached. Plugin "MMTestWithoutThread" works as expected, while the plugin "MMTestWithThread" does not work. There is this error:
Error in Action: "MMTestWithThread: Play"
Traceback (most recent call last) (851):
File "D:\Programs\E\EventGhost\eg\Classes\ActionBase.py", line 166, in CallWrapper
File "D:\Programs\E\EventGhost\plugins\MMTestWithThread\__init__.py", line 126, in __call__
File "D:\Programs\E\EventGhost\plugins\MMTestWithThread\__init__.py", line 108, in SendCommandThroughCOM
File "win32com\client\dynamic.pyc", line 500, in __getattr__
AttributeError: SongsDB.SDBApplication.Player
This won't work. You call Play() in the actionThread and then push the result of Play() to your worker thread. So even if it wouldn't crash before, it would crash after this, because the result of Play() isn't a callable.
Also you have to make sure, that your COM object access is only initiated from the thread that created the COM object. So you have to implement something like this in your worker thread:
@Bitmonster
Thank you very much for substantial assistance.
When he knows how to do it, it's simple .
Now it works nicely and I soon found out, how to set or get some value (eg volume).
However, for the complete revision of the plugin I'll need some time.