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.

JRMC plugin module (v 0.7, 7/4/09)

If you have a question or need help, this is the place to be.
stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: JRMC plugin module

Post by stottle »

Ok, I think the problem is a particular try loop.
1) The try loop's exception handling is hiding the problem in JRMC
2) The except case has an error which still throws.

Would you be willing to change (in EventGhosh/eg/Classes/PluginInfo.py, line 196) from this:

Code: Select all

        try:
            module = pluginInfo.ImportPlugin(pluginInfo.pluginName)
        except:
            eg.PrintTraceback(
                "Error while loading plugin-file %s." % pluginInfo.path,
                1
            )
            return
to this:

Code: Select all

        module = pluginInfo.ImportPlugin(pluginInfo.pluginName)
That should give me the call stack in JRMC as well as the line number that causes the problem.

It also looks like the line:

Code: Select all

                "Error while loading plugin-file %s." % pluginInfo.path,
should be

Code: Select all

                "Error while loading plugin-file %s." % pluginInfo.pathname,
but if you change that it will just say "Error while loading ..." and not give any more info.

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

Re: JRMC plugin module

Post by Livin »

Brett,
Does JRMC need to be in memory when the EG plugin is loaded?
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: JRMC plugin module

Post by stottle »

Short answer, no.

Longer answer - the COM Automation is able to start JRMC's COM server if I ask it to. I have it set up so that under normal operation it will try to connect to a running JRMC instance, and stop the action if JRMC isn't running (gives a message to that effect as well). For configuration of an action (i.e. selecting a playlist) it WILL start the COM instance if necessary, but if it started the instance it will stop it a moment later when it gets the information (the available playlists) it needs.

Not having JRMC running should not cause any problems.

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

Re: JRMC plugin module

Post by Livin »

Brett,
you may want to read over your post... first you ask me to remove the try/except & traceback, then after that you ask me to modify a line I just removed.

Not sure what you are asking but I did remove the try/except & traceback... the log gives the same traceback.
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: JRMC plugin module

Post by stottle »

Sorry, I should have been clearer. I meant the 2nd correction for BitMonster's benefit, as that looks like a bug in EG. I intended to point that out for him, not have you make the change.

You shouldn't get the same output if you remove that try statement - the line with PluginInfo.path won't exist any more. Can you try closing EG and restarting? Also, make sure EG disappears from the TaskBar. I've had to go in and kill it from TaskManager occasionally when there's a problem loading. When that happens, it doesn't restart correctly until killed.

Thanks a lot for the help debugging - its always a challenge when I can't reproduce the error.

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

Re: JRMC plugin module

Post by Livin »

new log info (mostly the same with a little bit new)...

Code: Select all

10:37:41 AM   Traceback (most recent call last):
10:37:41 AM     File "EventGhost.pyw", line 31, in <module>
10:37:41 AM     File "C:\Program Files\EventGhost\eg\__init__.py", line 71, in Main
10:37:41 AM       eg.Tasklet(eg.app.MainLoop)().run()
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Classes\MainFrame\__init__.py", line 822, in OnCmdAddPlugin
10:37:41 AM       eg.UndoHandler.NewPlugin().Do(self.document, result[0])
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Classes\UndoHandler\NewPlugin.py", line 38, in Do
10:37:41 AM       file=pluginInfo.pluginName
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Classes\TreeItem.py", line 80, in Create
10:37:41 AM       self = eg.actionThread.CallWait(partial(cls, parent, node))
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Classes\ThreadWorker.py", line 72, in __call__
10:37:41 AM       self.returnValue = self.func()
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Classes\PluginItem.py", line 60, in __init__
10:37:41 AM       self.info = info = eg.PluginInfo.Open(pluginStr, ident, args, self)
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Classes\PluginInfo.py", line 293, in Open
10:37:41 AM       if not pluginInfoCls.LoadModule():
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Classes\PluginInfo.py", line 196, in LoadModule
10:37:41 AM       module = pluginInfo.ImportPlugin(pluginInfo.pluginName)
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Classes\PluginInfo.py", line 116, in ImportPlugin
10:37:41 AM       module = __import__(moduleName, None, None, [''])
10:37:41 AM     File "C:\Program Files\EventGhost\plugins\JRMC13\__init__.py", line 199, in <module>
10:37:41 AM       class JRMCEvents(jrmc.IMJAutomationEvents):
10:37:41 AM   AttributeError: 'NoneType' object has no attribute 'IMJAutomationEvents'
10:37:41 AM   Traceback (most recent call last):
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Classes\MainFrame\__init__.py", line 344, in FuncWrapper
10:37:41 AM       func()
10:37:41 AM     File "C:\Program Files\EventGhost\eg\Utils.py", line 176, in Wrapper
10:37:41 AM       eg.Tasklet(func)(*args, **kwargs).run()
10:37:41 AM   TaskletExit
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
theforce
Posts: 9
Joined: Tue Jun 02, 2009 6:27 pm

Re: JRMC plugin module

Post by theforce »

I'm using version 12 :P

would be nice if you also upload the v0.3 changed to jrmc 12 :)
Thanks :)
stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: JRMC plugin module

Post by stottle »

@Livin,

Ok, from that I see what the problem is. There's a python COM command that reads in the JRMC Automation information, and that function is failing. I'll get a new version out when I figure out the fix.
theforce wrote:I'm using version 12 :P

would be nice if you also upload the v0.3 changed to jrmc 12 :)
Thanks :)
I should be able to get the next version to work with 12 and 13.

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

Re: JRMC plugin module

Post by stottle »

@Livin,

I'm guessing your running Vista or Win7, with UAC enabled and an account that isn't an administrator? For the COM Automation to work through python, I need python to create a wrapper class. EG puts that in a directory that needs admin rights to write to. I'm guessing that is failing, which keeps me from connecting to the COM object, which causes the exception.

Am I right? If so, if you run EG once as an administrator to create the wrapper, you should be able to run as a non-priveleged user after that. You could also try this, but that probably isn't necessary once the wrapper is created.

Brett
If not, here's what I originally wrote before I thought of UAC:

Ok, I've got a strange question for you. You've installed and run JRMC 13, haven't you? And started it at least once?

I did a clean install of Win 7, then installed JRMC 13 and the newest EG and everything worked with no extra steps. I can look in the registry and see that JRMC installed keys for its COM interfaces. When the plugin runs, it looks for HKEY_CLASSES_ROOT\TypeLib\{03457D73-676C-4BB0-A275-D12D30ADB89A} to build a python wrapper for the JRMC Automation interface. It looks like either that registry key isn't found, or the typelib that it points to (should be "Media Center 13.tlb" for JRMC 13) isn't found.

I will put in a check to make sure that key exists, but the best I can do if it isn't is output a message like "It looks like JRMC is not installed on this computer."

The only help I can find is an old (2007) message about the registry keys only getting installed after the 1st time JRMC is run. That's here.
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: JRMC plugin module

Post by Livin »

running XP SP3
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: JRMC plugin module

Post by stottle »

1) Do you have a registry key HKEY_CLASSES_ROOT\TypeLib\{03457D73-676C-4BB0-A275-D12D30ADB89A}?
2) Do you have the following file on installed?
"C:\Program Files\J River\Media Center 13\Media Center 13.tlb" [if you installed in a non-standard location, this file should be in the same directory as the executable]
3) Is there are gen_py sub-directory with your EG config files?
C:\Documents and Settings\<USER>\Application Data\EventGhost
The "Application Data" folder is hidden, so you may need to set folder options to see it....
4) If there is a gen_py directory, is there a file named 03457D73-676C-4BB0-A275-D12D30ADB89Ax0x1x0.py in it?

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

Re: JRMC plugin module

Post by stottle »

I've updated the initial post and moved to version 0.4 of the plugin. It should work for 12 and 13. I also changed how the JRMC Automation was loaded. If nothing else, this should allow the plugin to load without error. It hopefully fixes the problem Livin is having as well?

Brett
theforce
Posts: 9
Joined: Tue Jun 02, 2009 6:27 pm

Re: JRMC plugin module

Post by theforce »

In the first post, there is only Version 0.1 (at least Eventghost says that it is v0.1) and the three new functions are also not availabe with the versions of the first post. Also the forum declares the 2 files as "(old)".

(Or I'm just too tired to see where now the v0.4 is attached / downloadable :P )
stottle
Plugin Developer
Posts: 636
Joined: Sun Apr 26, 2009 10:59 pm

Re: JRMC plugin module

Post by stottle »

theforce -

Thanks for the heads up. I tried to add it earlier and the forum replied that I could only have three attachements. So I deleted V0.3 ... and forgot to re-add V0.4.

Sorry about that.

Brett
theforce
Posts: 9
Joined: Tue Jun 02, 2009 6:27 pm

Re: JRMC plugin module

Post by theforce »

Hey :)

Thanks again :)
But in the verison 0.4, you can't select from the "Add action"-menu (in the "J River Media Center"-Folder) the actions "next track" and "select track". Think you forget them.

(Although the functions are still available, because if I manually add the old actions/macros in my xml (from the old version, called "JRMC13.Replay()" and "JRMC13.Skip()"), the plugin still execute these actions.)

Really thanks for all your work!
And the playlist function is just too nice, thanks for that one especially :)

theforce

P.S.: Wasn't there also a shuffle function in the older version?
Post Reply