For my personal use only !!!
I am trying to find where I can change the system volume inside an app. I just want to make something that when I press a button it turns down the brightness and lowers the volume (ringtone) and when I am in a meeting I can set a different “profile”.
I would use this a lot since I am in classes and meetings during the day.
Any help? I have heard about the celestial framework, but I can’t find it anywhere. Is that what i need.
Again, this is not for apple’s approval:-) Thanks in advance.
For the brightness you can use following code (and it’s even public)
where
brightnessis some float from 0.0 to 1.0.For the volume. Try following (these are private APIs in SpringboardService framework)
In the case, if it won’t work. You can try to use
GSEventwith codekGSEventVolumeDownButtonDown,kGSEventVolumeDownButtonUp,kGSEventVolumeUpButtonDown,kGSEventVolumeUpButtonUpThe reference implementation is here:
http://code.google.com/p/hid-support/source/browse/trunk/hidspringboard/Tweak.xm?spec=svn82&r=82
It’s jailbreak tweak. However, you can extract the code and it should work on non jailbroken phone.