Hi,
i noticed that everytime i wake up my Pc (windows) from sleep mode XBMC re-scan my library. This means that exist an event that catch this situation: i need to write a very simple addon that everytime my PC wake up launches an external application (.exe).
Can someone helps me?
Suspend and Wake
kersal
Junior Member Posts: 4 Joined: Oct 2012 Reputation: 0 |
2013-03-21 14:28
Post: #1
|
| find quote |
artrafael
Team-XBMC Forum Moderator Posts: 4,424 Joined: Jul 2010 Reputation: 78 Location: USA |
2013-03-21 19:52
Post: #2
Isn't that a function of your operating system rather than of an application such as XBMC? It may be more fruitful to Google for a generic Windows solution. This is not an uncommon requirement (do something upon resume from sleep), so you should find plenty of hits.
|
| find quote |
leechguy
Member Posts: 95 Joined: Aug 2009 Reputation: 3 Location: The Netherlands |
2013-03-30 15:09
Post: #3
For an example check the code of my addon. Below are the interesting bits:
PHP Code: RESUME_TIMEOUT = 5 // in seconds if I recall correctlyBasically what I do is keep track of time in a loop. If this loop takes longer than RESUME_TIMEOUT then I assume that the computer has been suspended for a while and just resumed. Not 100% safe (if the computer suspends again between the "if (time.time() - resume_watchdog_time) > RESUME_TIMEOUT:" and "resume_watchdog_time = time.time()" lines then you won't notice the suspended state), but good enough for me. |
| find quote |

Search
Help