INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: mhwlng: LUA scripting problem with MC automation  (Read 1625 times)

mhwlng

  • Regular Member
  • World Citizen
  • ***
  • Posts: 235
  • nothing more to say...
mhwlng: LUA scripting problem with MC automation
« on: January 07, 2013, 06:51:06 am »

COM automation is broken for me, since a recent version.(not sure when it started)

MCA:GetCurPlaylist() and pl:GetNumberFiles() still work ok, but pl:GetFile(k) stopped working (always returns null)

MCA:GetPlaylists() and pl:GetNumberPlaylists() still work ok, but pl:GetPlaylist(n); stopped working (always returns null)

Marcel
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42442
  • Shoes gone again!
mhwlng: LUA scripting problem with MC automation
« Reply #1 on: January 09, 2013, 01:22:11 pm »

MCA:GetCurPlaylist() and pl:GetNumberFiles() still work ok, but pl:GetFile(k) stopped working (always returns null)

I can't reproduce this.

What language are you using?  Could you share a sample we could compile and test?

This .NET code works:
Code: [Select]
MediaCenter.IMJFileAutomation f = mc.GetCurPlaylist().GetFile(0);
Console.WriteLine("Name: " + f.Name);
Logged
Matt Ashland, JRiver Media Center

mhwlng

  • Regular Member
  • World Citizen
  • ***
  • Posts: 235
  • nothing more to say...
mhwlng: LUA scripting problem with MC automation
« Reply #2 on: January 09, 2013, 02:41:13 pm »

I can't reproduce this.

What language are you using?  Could you share a sample we could compile and test?

This .NET code works:
Code: [Select]
MediaCenter.IMJFileAutomation f = mc.GetCurPlaylist().GetFile(0);
Console.WriteLine("Name: " + f.Name);

I'm using girder with the built-in lua scripting language and luacom library for COM interface.

This code worked fine for many years and stopped working with a recent build  for some reason ?

Thanks,

Marcel

Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42442
  • Shoes gone again!
Re: mhwlng: LUA scripting problem with MC automation
« Reply #3 on: January 10, 2013, 12:14:13 pm »

Would it be easy to share instructions or a configuration file that let me test this same thing easily?

We had to rewrite how automation is handled when we did the MFC switch:
http://yabb.jriver.com/interact/index.php?topic=75971.0

Hopefully LUA doesn't rely on IDispatch::GetTypeInfo, because we were hoping to not support this (C++ and .NET don't use it).

Logged
Matt Ashland, JRiver Media Center

mhwlng

  • Regular Member
  • World Citizen
  • ***
  • Posts: 235
  • nothing more to say...
Re: mhwlng: LUA scripting problem with MC automation
« Reply #4 on: January 11, 2013, 02:28:32 am »

you can't reproduce the problem if you don't have girder (http://www.promixis.com/) & luacom (http://lua-users.org/wiki/LuaCom)

I'll try to rewrite my code this weekend, using vbscript (vbs)

Marcel
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: mhwlng: LUA scripting problem with MC automation
« Reply #5 on: January 11, 2013, 08:32:31 am »

I'll try to rewrite my code this weekend, using vbscript (vbs)

If it helps, I have a C# "wrapper" class for MC most of the way done, which makes accessing the MC object from .NET pretty simple.  I haven't set it up as it's own DLL (yet) but if you know C#, you could easily use it.  If you want a copy, just poke me via PM.

I'm intending to release it publicly when it is further along, but I'm not quite there yet.

It wraps the entire Automation interface, and provides many additional methods to make accessing it easier (things like auto-parsing Playlist paths and whatnot).  The main thing it doesn't do, yet, is handle MC's events in any way, so if you need that, you'd be out of luck.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up