Skin element watcher (1 Viewer)

Jay_UK

Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi all,

    My setup consists of multiple "disks" (one set for movies, one set for TV series, etc) that spin down after an idle period, which is great for saving energy, but has a downside of taking +5seconds to spin up.

    What this translates into with various plugins (TVSeries, Moving Pictures, Mediabrowser, etc), is that when my wife presses play, nothing happens for a while. At this point she doesn't know if its loading, hung, not received the remote command, etc - and starts pressing more remote buttons! :O

    So ideally, what should happen, is that when the plugin screen for that type of media is loaded the disks should spin up in advance, ready for when the content is clicked to play.

    There are some plugins that detect when a plugin screen/window loads and will do something (eg WOL Power Manager), but the issue I have is that it only works down to Window level (WindowID). There are some plugins that use a single window for access to different types of media (eg the MediaBrowser plugin uses a single window for both TV Series and Movies). In my case I need to detect what disks to spin up (did not want to spin up both movie and TVSeries disks).

    To solve this issue, this plugin monitors specific use of WindowID/PluginID and window "element/tag name" and its value. So in the case of MediaBrowser plugin, I can detect the use of the Plugin/WindowID and if the plugin is using the "all-movies" windows element/tag/value on the screen - I can spin up the movie disks. I can also monitor the same Plugin/WindowID and if the plugin is using the "show" windows element/tag/value - I can spin up the TVseries disks.

    Yes, there is a slight overhead in doing this.

    I know the time delay/spinup is a trivial thing.... but it gave me an excuse to learn "plugin" writing :)

    This is a basic process plugin that has a config window to define the things to monitor and the actions to perform.

    The configurable options are:

    WindowsID
    Element
    Element Value
    Action
    Action Arguments

    If you set each the WindowsID, Element and Element Value to *, then this puts the plugin into monitor mode and it will capture (to log file) all the WindowsID/Element/Values as they are used.

    The Action can either be a program to run (full path and extension), a path to a directory (path can not contain a "."), this will spin up the disks, or WOL

    The Action Arguments can contain any parameters that need to be passed to the "Action" program, or the MAC address for the WOL action.

    To install, simply copy the DLL file to the Mediaportal/Plugins/Process directory.

    Chances are no one will ever need this plugin, but hey...no harm in putting it out there to be used.....

    Let me know of any issues....

    J.
     

    Attachments

    • ElementWatcher.zip
      14 KB
    Last edited:

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi all,

    A new release on the first post.

    I was finding it wasn't always spinning up my disks, so I have had to switch techniques to spin them up. Now I write a small 1K temporary file and then delete it. Obviously this means you need to have write access to the directory.

    If anyone knows of a way of spinning up the disk using a read-only method, then please let me know.

    J.
     

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi all,

    Two updates to this plugin:

    Now supports WOL
    Bug fix - Not logging the correct parameter

    To use WOL, simply put the action as the word: wol

    And set the argument to be the MAC address required.

    I have updated the DLL in the first post.

    J.
     

    Users who are viewing this thread

    Top Bottom