Page 1 of 8 123 ... LastLast
Results 1 to 10 of 71

Thread: MC12 COM Module

  1. #1
    Join Date
    Nov 2006
    Posts
    116

    Lightbulb MC12 COM Module (2007-07-29)

    -- Updated 2008-08-21 --
    Version 3b is available
    1. Bugfixing
    2. GML demo file included


    -- Updated 2008-08-10 --
    Version 3a is available
    1. More stable operation
    2. Support for searches
    3. Improved NetRemote Communication


    Please notice that the windows help file is no longer deliverd with version 3. Instead there is an example .gml file that demonstrates all functions.
    -- Updated 2007-07-29 --
    • More informations from JRMC are exported into the tables, incl. playback-states
    • Eventhandlers to allow control by sending events
    • Netremote export now supporting cover-art
    • Multiple PCs can act as "zones"
    • Bugfixes

    ----
    Hi folks,

    I use Girder 4 together with JRMC12, Netremote and Mediabridge... So I have the full package installed and was still not satisfied. That's why I decided to learn the lua-language and write my own extension that will fill the gap.

    Now it's time to share what has been achived so far and it's time to say thank you to the very great support from Promixis and the users in this forum. I hope that my code is useful for some of you.

    However I have to say that it's a very early state to share. All functions should work, but maybe not with your configuration (no intensive testing was done by me). Also there is no big error handling and one or two functions are not fully implemented now. But I believe it's already good enough that some guys can use it as a back-bone to do their own development on it, so I decided to upload already.

    BTW: I was not sure where to post, and I did not decide to post in the developer forum, because I am not a registered developer (even not a professional programmer) and also it's not *really* a plug-in or something like that. However, if this is the wrong place, please move it to the right one. Thanks!

    I managed to write a documentation in a windows helpfile, so you'll have something more to read than I am writing here.

    So, what can I say in a few words to this code?

    First of all it uses Lua COM to access JRMC, so who is interested in this will find some demonstration inside. Also it's using Eventhandlers from JRMC instead of timers, so this is maybe also interesting for some users.

    The most advantage is, that it's not only sending windows-messages, but can also retrieve status information to add new functions and allow a smarter programming.

    For example it's easy now to have a workaround for the MediaBridge CLSID-problem that still comes up (sorry@Promixis for this, but it's true!). By using this code you can link the eventstring "MC12Open" to a file execute action to make sure that MediaBridge is startet after JRMC is open.

    Also with it you have some new functions available, like changing your library on the fly, starting a playlist from Girder etc.

    Any comments are welcome.
    Best Regards,
    Marc
    Attached Files Attached Files
    Last edited by Marquis; August 21st, 2008 at 03:36 AM. Reason: New version

  2. #2
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    Very nice. Great stuff for JRMC.

  3. #3
    Join Date
    Jul 2006
    Location
    Mountain View, CA
    Posts
    175

    Default

    Thanks for sharing. I would like to implement the mc12.setlibrary(name) command in order to change JRMC libraries with NR.

    I am not exactly sure how to get the mp.mc12.lua to be activated in Girder.

    I initially placed it in the treescript directory but, although I could see the mp.mc12 variable names in Girder's Variable Inspector, the values were blank and executing a mc12.setlibrary(Dudley) action in Girder just produced:

    Girder Log:
    Time Date Source Details Payloads
    14:12:52:875 6/11/2007 Set Library Dudley Lua Success (Nothing Triggered)JRMC12 Controls.gml:\Library\Set Library Dudley

    Lua Console:
    unknown library

    I am running JRMC 12.0.251 so it should integrate well with it once I get it working in Girder.

    Dudley

  4. #4
    Join Date
    Nov 2006
    Posts
    116

    Default

    Hi Dudley,

    don't know if it's a typo, but if not then make sure you write the library name in ""
    Code:
    mc12.setlibrary("Dudley")
    And also make sure the name is exactly written like it appears in the library manager, including case sensitivity and spaces.

    The message "unknown library" shows, that the function was executed, but it has not found the library in the JRMC's lib-manager.

    Also check if you executed the mc12.open() command before using the setlibrary function.

    Cheers,
    Marc

  5. #5
    Join Date
    Jul 2006
    Location
    Mountain View, CA
    Posts
    175

    Default

    Mark -

    Thanks. Lack of quotes around the libraryname was part of my problem.
    So each time I want to change to another MC12 library when MC12 is running, I just need to issue an action in Girder containing the following code, correct?

    mc12.open()
    mc12.setlibrary("libraryname")

    I have 4 libraries, one for each member of the family. When I issue a Girder action containing the above code, MC12 changes to another library but for 3 of the 4 librarynames, MC12 changes to the wrong library.
    In addition, Girder logs a stream of the following message when I trigger one Girder action:

    Time Date Source Details Payloads
    17:36:01:875 6/12/2007 MC12 COM Event received

    I'm quite lua impaired so I haven't been able to debug this.

    Dudley

  6. #6
    Join Date
    Nov 2006
    Posts
    116

    Default

    Dudley,

    the mc12.open() command is only needed for the first time. It will initialize the connection. Also you should use mc12.close() to terminate the object, when it's no longer needed.

    After the open command you only need to use mc12.changelibrary(). I have three libraries here and it works fine. Will you post the names of your libs so that I can try to reproduce here?

    The message in the log is just an information that JRMC has sent an event to Girder. It has nothing to do with the library change itself. Is there any text in the interactive lua scripting console?

    BR/Marc

  7. #7
    Join Date
    Jul 2006
    Location
    Mountain View, CA
    Posts
    175

    Default

    Marc -

    Thanks for the help.

    I attached the small .gml that has my library names in it.

    The message in the log is just an information that JRMC has sent an event to Girder. It has nothing to do with the library change itself. Is there any text in the interactive lua scripting console?
    I was getting about 60 to 80 of those messages each time I fired the setlibrary command in Girder. If that is normal then I won't worry about it.
    Nothing was showing in the lua console when I executed:

    mc12.open()
    mc12.setlibrary("libraryname")

    When I added a mc12.close() to that and then fired the action, the lua console put out the text shown the attached file (MClua.txt) and the string of MC12 COM Event received logged messages dropped to about 15.

    Dudley
    Attached Files Attached Files

  8. #8
    Join Date
    Nov 2006
    Posts
    116

    Default

    Dudley,

    I identified the problem and it has to do with the library index. My program can not find out the correct library index. This depends peoples configuration and that's why it works on some pc's and on others not. I need to find another way to solve this. So far you have two possible ways to get a workaround now.

    1. If the application is *not* running you can use
    Code:
    mc12.open("LibName")
    This will change the lib before the application starts, so that JRMC will not use the latest library before you closed it, but the named one.

    2. If the application is already running and you opened already a connection just use:
    Code:
    mc12.sendmsg("library_change",<index>)
    Replace <index> with the index of your lib. To find out the index you have to open the library manager. The first library in the list is index 0, the second one is index 1, third=2 etc. This will only work with JRMC 12.0.251 or later.

    BR/Marc

  9. #9
    Join Date
    Jul 2006
    Location
    Mountain View, CA
    Posts
    175

    Default

    Marc -

    Hey thanks for debuging this.

    I'm traveling at the moment but will try out your suggestions late this weekend. Number 2) seems like it could be a permanent fix for me. I leave JRMC up all the time (and just put the PC into standby at the end of each day). And my library structure is very static so assigning an index number to library name would work fine.

    Again, thanks for creating this lua script and sharing it. It is going to help improve the spousal acceptance factor of my home theater system greatly.

    Dudley

  10. #10
    Join Date
    Jul 2006
    Location
    Mountain View, CA
    Posts
    175

    Default

    Marc -

    Using an index number to call a particular JRMC library worked really well. Thanks

    I am working on some further integration of your MC12 lua into my ccf and have a couple of questions:

    1) Once I change to a new JRMC library, the contents of the new library don't get pushed out to NetRemote running on my PPC. This seems to be a MediaBridge and/or NetRemote problem but I am wondering if you ran into this and if there is a way to force a refresh of the information using MC12.lua. I have tried adding an action to reconnect to MB and to Girder following a library change but it does not reliably update the new library information. The only thing that will get it to display the new library information is a full shutdown and restart of NetRemote.

    2) I have created buttons in my ccf to select each of the available libraries. I would like to add a frame that contains a variable name that would display the library that is currently active in JRMC. Your help documentation references that mc12.getlibraries() returns two tables with the second table containing the name of the current library. I can find mc12.getlibraries in the Girder variable inspector but the value column for mc12.getlibraries is blank. I am using NRD to design my ccf. It also has a variable inspector but no MC12.lua variable names or values appear there.

    Any suggestions on how I could accomplish these two items?

    Thanks

    Dudley

Page 1 of 8 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •