(sorry about my english, but i'm from germany
You did good work. But Prevent Save Energy don't work correct on Win7 (Prof/64Bit). My PC go to sleep mode during streaming.
I'm not a windows or java expert, but i have a look an the code. The Sub that should do this work is in
Modul Win Utils.java (here the code)
- Code: Select all
public void disableGoToSleep() {
// Disable go to sleep (every 40s)
if (PMS.getConfiguration().isPreventsSleep()
&& System.currentTimeMillis() - lastDontSleepCall > 40000) {
logger.trace("Calling SetThreadExecutionState ES_SYSTEM_REQUIRED");
Kernel32.INSTANCE.SetThreadExecutionState(Kernel32.ES_SYSTEM_REQUIRED | Kernel32.ES_CONTINUOUS);
lastDontSleepCall = System.currentTimeMillis();
}
}
Perhaps it is an idee to change "ES_CONTINUOUS" to "ES_AWAYMODE_REQUIRED" (found at http://msdn.microsoft.com/en-us/library/windows/desktop/aa373208%28v=vs.85%29.aspx )
I dont have knowllege and enviroment to test it myself, but when you did it, i will test it for you.
Thanks for your fine job and until it doesn't work correkt i use "preventsleep"
Regards
Peter
