[other] PowerScheduler: Ability to call programm with the next wakeup time as argument (1 Viewer)

myscha

Portal Pro
May 6, 2008
71
15
Home Country
Germany Germany
Hello,

i'd like to use PowerScheduler to wake my HTPC, but from S5 instead of S3 or S4. To manage this I have built a small piece of DIY hardware and wrote a simple PC software to interface it. Now it would be great if PowerScheduler could call my interface progam (e.g. before going to standby/shutdown) and pass the next wakeup time as argument.

The format of the argument is not very important as I can adjust my program accordingly.

Although it's not a big problem for me to write embedded software or small standalone PC programs, I'm absolutely not familiar with very big software projects like MePo and have no clue where to start and/or how to write a modification for it.

It would be great if this could be implemented.

Michael
 

myscha

Portal Pro
May 6, 2008
71
15
Home Country
Germany Germany
Thanks for the link.

What I did up to now:
- I installed VC# 2010 Express and MePo 1.7.1
- I created a new class library and added referencs as desribed here
- I created a skeleton as a starting point that looks like
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using MediaPortal;
using TvControl;
using TvDatabase;
using TvEngine;
using TvEngine.Events;
using TvLibrary;
using SetupControls;
using SetupTv;

namespace TvEngine
{
    /// <summary>
    /// base class for tv-server plugins
    /// </summary>
    public class test_plugin : ITvServerPlugin
    {
//        ITvServerEvent events = null;

        #region ITvServerPlugin implementation

        /// <summary>
        /// returns the name of the plugin
        /// </summary>
        public string Name
        {
            get { return "test-plugin"; }
        }

        /// <summary>
        /// returns the version of the plugin
        /// </summary>
        public string Version
        {
            get { return "0.1"; }
        }

        /// <summary>
        /// returns the author of the plugin
        /// </summary>
        public string Author
        {
            get { return "myscha"; }
        }

        /// <summary>
        /// returns if the plugin should only run on the master server
        /// or also on slave servers
        /// </summary>
        public bool MasterOnly
        {
            get { return true; }
        }
       
        /// <summary>
        /// Starts the plugin
        /// </summary>
        public void Start(IController controller)
        {
//            events = GlobalServiceProvider.Instance.Get<ITvServerEvent>();
//            events.OnTvServerEvent += new TvServerEventHandler(events_OnTvServerEvent);
        }

        /// <summary>
        /// Stops the plugin
        /// </summary>
        public void Stop()
        {
//            events.OnTvServerEvent -= new TvServerEventHandler(events_OnTvServerEvent);
        }

        /// <summary>
        /// returns the setup sections for display in SetupTv
        /// </summary>
        public SetupTv.SectionSettings Setup
        {
            get
            {
                return new SetupTv.SectionSettings();
            }
        }

//        void events_OnTvServerEvent(object sender, EventArgs eventArgs)
//        {
//        }

        #endregion
    }
}

After building this I copy the resulting dll to the plugin folder of the TV server and it shows up in the TV server configuration dialog, but it is listed as "incompatible plugin" and therefore cannot be activated. The plugin name shows up correct, but the author shows "Unknown" and the version "1.0.0.0". Why does that happen and how do I fix it?

I only created a file with the above content and didn't touch all other project files and settings.
 

Users who are viewing this thread

Top Bottom