[other] - PowerScheduler: Ability to call programm with the next wakeup time as argument

Discussion in 'Improvement Suggestions' started by myscha, May 21, 2014.

  1. myscha

    myscha Portal Pro

    Joined:
    May 6, 2008
    Messages:
    71
    Likes Received:
    11
    Ratings:
    +15 / 1
    Home Country:
    Germany Germany
    Show System Specs
    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
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,522
    Likes Received:
    2,566
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,251 / 13
    Home Country:
    France France
    Show System Specs
  4. myscha

    myscha Portal Pro

    Joined:
    May 6, 2008
    Messages:
    71
    Likes Received:
    11
    Ratings:
    +15 / 1
    Home Country:
    Germany Germany
    Show System Specs
    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 (C):
    1. using System;
    2. using System.Collections.Generic;
    3. using System.Linq;
    4. using System.Text;
    5.  
    6. using MediaPortal;
    7. using TvControl;
    8. using TvDatabase;
    9. using TvEngine;
    10. using TvEngine.Events;
    11. using TvLibrary;
    12. using SetupControls;
    13. using SetupTv;
    14.  
    15. namespace TvEngine
    16. {
    17.     /// <summary>
    18.     /// base class for tv-server plugins
    19.     /// </summary>
    20.     public class test_plugin : ITvServerPlugin
    21.     {
    22. //        ITvServerEvent events = null;
    23.  
    24.         #region ITvServerPlugin implementation
    25.  
    26.         /// <summary>
    27.         /// returns the name of the plugin
    28.         /// </summary>
    29.         public string Name
    30.         {
    31.             get { return "test-plugin"; }
    32.         }
    33.  
    34.         /// <summary>
    35.         /// returns the version of the plugin
    36.         /// </summary>
    37.         public string Version
    38.         {
    39.             get { return "0.1"; }
    40.         }
    41.  
    42.         /// <summary>
    43.         /// returns the author of the plugin
    44.         /// </summary>
    45.         public string Author
    46.         {
    47.             get { return "myscha"; }
    48.         }
    49.  
    50.         /// <summary>
    51.         /// returns if the plugin should only run on the master server
    52.         /// or also on slave servers
    53.         /// </summary>
    54.         public bool MasterOnly
    55.         {
    56.             get { return true; }
    57.         }
    58.        
    59.         /// <summary>
    60.         /// Starts the plugin
    61.         /// </summary>
    62.         public void Start(IController controller)
    63.         {
    64. //            events = GlobalServiceProvider.Instance.Get<ITvServerEvent>();
    65. //            events.OnTvServerEvent += new TvServerEventHandler(events_OnTvServerEvent);
    66.         }
    67.  
    68.         /// <summary>
    69.         /// Stops the plugin
    70.         /// </summary>
    71.         public void Stop()
    72.         {
    73. //            events.OnTvServerEvent -= new TvServerEventHandler(events_OnTvServerEvent);
    74.         }
    75.  
    76.         /// <summary>
    77.         /// returns the setup sections for display in SetupTv
    78.         /// </summary>
    79.         public SetupTv.SectionSettings Setup
    80.         {
    81.             get
    82.             {
    83.                 return new SetupTv.SectionSettings();
    84.             }
    85.         }
    86.  
    87. //        void events_OnTvServerEvent(object sender, EventArgs eventArgs)
    88. //        {
    89. //        }
    90.  
    91.         #endregion
    92.     }
    93. }
    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.
     
  5. azzuro
    • Team MediaPortal

    azzuro Test Group

    Joined:
    May 10, 2007
    Messages:
    8,522
    Likes Received:
    2,566
    Occupation:
    technician HVAC
    Location:
    France - IDF
    Ratings:
    +4,251 / 13
    Home Country:
    France France
    Show System Specs
    'im not expert, but should be assembly version issue.
    should be compatible with MP 1.7.1
     
    • Thank You! Thank You! x 1
  6. myscha

    myscha Portal Pro

    Joined:
    May 6, 2008
    Messages:
    71
    Likes Received:
    11
    Ratings:
    +15 / 1
    Home Country:
    Germany Germany
    Show System Specs
    Thanks again! I did some more research and solved the problem with help from this page. The plugin seems to be loaded and I can proceed.
     
    • Like Like x 2
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!