Adjust volume and prevent computer from standby in Java... (Mac and Windows XP, Vista)
Asked Answered
C

1

0

I am writing a Java program that wants to do 3 things, and I don't know how to do them or if it's even possible with Java.

1 - I want to ensure that the computer whether running mac OS or windows xp/vista, doesn't go to sleep whilst running my app.

2 - I want my app to be able to turn the volume to full on all of the above OS's before playing a sound.

3 - Finally, when a sound is played I want to make sure that the screen, if turned off for 'power saving', is switched on.

Is any of this possible? I saw this post which suggested javax.sound.* as an answer to (2), but does that work on OS X and Windows XP, Windows Vista?

If anyone knows I would be very grateful.

EDIT: The app is a wi-fi LAN communications program that allows a user using the "client" software to pop up a message on any computer on the network running the "server" software. The software must notify the user even if they are not at the computer, hence the requirements for it to be always on (no support for WOL over wi-fi) and for it to make alot of noise & wake the screen to display any messages.

Chivaree answered 25/8, 2009 at 19:52 Comment(2)
Unless you're writing a virus, it's probably bad for any application to stop the computer from entering sleep mode, or start playing sounds at maximum volume.Accusatory
This sounds more like an alarm clock.Koralle
K
0

For part 1, you might want to look at the OnNow/ACPI Support for Windows and the likes of ES_DISPLAY_REQUIRED. Not Java, but you're probably going to have to go native or find a 3rd party wrapper library for this type of control.

Koralle answered 25/8, 2009 at 20:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.