Menu

Can't enter into plugin mode

Dora
2010-10-30
2013-05-14
  • Dora

    Dora - 2010-10-30

    First, I want to congratulate you for the initiative with writing a c# wapper for the imon API library.
    Many of us wated for an oficial API to be available, and now, it is released, a .net wrapper is also available (thanks to you) which should make developing clients for iMon a very task.
    Unfortunately, I can't make the imon to enter plugin mode.
    Here is what I do:
    1. make an instance of iMonWrapperApi.
    2. add two handlers for the Error and StageChanged events.
    3. Initialize imon object (Initialize funtion).
    4. What for a handler funtion to be triggered (which never happens)

    When I qeury the imon status I get IsInitialized==true and isPluginModeEnabled==false.
    Am I missing something???
    When using SoundGraph demo app (DisplayTest.exe), everything is working well, so it look like the problem is not with the hardware.
    Further investigation revealed that even iMonWrapperApi.WndProc didn't get any messages from imon.
    Maybe you have an idea what I'm doing wrong?
    It will very useful if you can supply a simple c# test app which demonsrates the use of your API.
    Thanks,
    Gil

     
  • Montellese

    Montellese - 2010-10-31

    Hey shapgil

    Sorry for your inconvenience.
    Generally it looks like you are doing it correctly. I'm developping an application which handles XBMC information ("XBMC on iMON Display" on SourceForge as well) which does the following:

    iMonWrapperApi imon = new iMonWrapperApi();
    imon.StateChanged += wrapperApi_StateChanged;
    imon.Error += wrapperApi_Error;
    imon.Initialize();
    

    And these are the event handling methods

    private void wrapperApi_StateChanged(object sender, iMonStateChangedEventArgs e)
    {
        if (e.IsInitialized) {
            // do something
        }
        else {
            // do something else
        }
    }
    private void wrapperApi_Error(object sender, iMonErrorEventArgs e)
    {
        switch(e.Type) {
            // check the different error types
        }
    }
    

    You can get the code from the Git repository if you want to take a closer look but it is all tangled up with the handling of XBMC information.

    I actually never had a problem with entering plugin mode so far (unless I manually deactivated it in iMon Manager).

    I will see if I can throw together a simple test application (I once had one but when everything seemed to work fine I threw it away) if I find the time.

     
  • Montellese

    Montellese - 2010-10-31

    I just released a new version at http://sourceforge.net/projects/imonapi-sharp/files/iMonDisplayApiWrapper%23/v0.1/imon-displayapi-wrapper-sharp-v0.1.0.5-beta.rar/download.

    It provides two events "Log" and "LogError" which will return debug and error log messages. This might make it easier to look for problems in my wrapper.
    Furthermore IsInitialized now returns an internal state and not the state of the display itself. I noticed that the display sometimes says that it is initialized although it is black and doesn't show anything.

     
  • Dora

    Dora - 2010-10-31

    I noticed that you're writing a client for the xbmc but that was only after I've already submitted my question.
    You know what… it's very funny because that's what I wanted to do…. writing a client for the xbmc.
    I'm still in the very early stage of my work and since you're quite a head of me, I decided to wait for a while and see where your work will lead to….
    I'll be happy to give you a hand though it looks like you're doing fine without me so far.
    I didn't have time to test your demo so I'm not familiar with its features.
    Does your app show the current menu on the lcd screen? so one can control the xbmc by using a remote control without turning on the tv?

     
  • Montellese

    Montellese - 2010-10-31

    Hehe maybe it's because XBMC is THE best free media center software ;-)

    Unfortunately I don't know of a way to get the current menu from XBMC. Last time I inquired the topic (must be like a year ago) the devs said that it wouldn't be possible because there are too many different and custom views with skinning and plugins. But maybe that has changed. At least the JSON RPC API certainly does not support this.
    Do you know of a way to do it?

     
  • Dora

    Dora - 2010-11-01

    Yes,
    You can use System.GetInfoLabels to get System.CurrentControl.
    I don't know if it is a skin dependent, I just tested it with aeon skin and it looks like it's working.
    My plan was to query xbmc status 4 times a second and display the info on imon screen.
    I couldn't find a way for xbmc to signal a client if its status was changed with json.
    There is another option, a more complex one. I think xbmc can communicate with lcd proc. My other plan was to change xbmc code so it will be able to communicate with other lcd servers except lcdproc and then to implement a server for imon. But it was just an idea.

     
  • Montellese

    Montellese - 2010-11-01

    I already looked at the info lables but didn't have the time yet to find out which one to use. Thanks for the hint I will have a look at it using different skins.

    Yeah an announcement would be nice but I guess it won't happen anytime soon.

    I first considered writing this as an XBMC addon but realized that it's windows only and therefore not suitable as an addon.
    I wasn't sure about implementing it directly in XBMC either because it is windows only. But it might be worth asking Team XBMC if they would accept a patch. This would be the perfect solution as you can get rid of the delay from calling JSON RPC methods and you have access to more information.

     
  • Montellese

    Montellese - 2010-11-01

    I just had a look and System.CurrentWindow and System.CurrentControl return exactly what is needed to display navigation information (independent of the used skin). Polling these labels every 500ms seems to be enough as long as you don't rush through your movie collection or something similar.
    I just added it to my application (not uploaded yet) and it works rather nicely :)

     
  • Dora

    Dora - 2010-11-02

    There are good news.
    I really should find time to give your app a try.
    Maybe you should make the polling frequency configurable because I suspect that if you'll want to display a movie or a music play time, 500ms delay is too much.
    But on the other hand, maybe the user don't need to be bothered by this parameter and it should be fine tuned by the developer when all the features are been  implemented.

     
  • Montellese

    Montellese - 2010-11-02

    Ah no the 500ms are only for polling the System.CurrentControl.  Other intervals will be configurable. I first wanted to make that interval configurable as well but I noticed that everything above 750 ms results in quite a noticable delay so I took the configuration option out and hardcoded it to 500ms.

     
  • Dora

    Dora - 2010-11-02

    cool,
    as I said before, if you need any help with this project, I'm willing to give you a hand.

     
  • Montellese

    Montellese - 2010-11-03

    I have sent you a message over SourceForge. Hope it reached you.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.