The documentation on SndSetDefaultVolume that I looked at didn't say anything about it being a System use only function or Palm OS 5.
The docs on SndGetDefaultVolume did say not to call it in Palm OS Garnet.  However, I tried it and it seemed to work fine, not that I needed to.

Anyway, SndSetDefaultVolume works like a charm.  Thanks for the tip.

-Benjamin Bloomfield

On 1/2/06, Douglas Handy <[EMAIL PROTECTED]> wrote:
Benjamin,

>Anyway, someone _must_ be doing this, right?

The problem is that the volume preferences are read after a soft reset and then
cached internally by the sound manager for quick access during execution.
Programatic changes to the volume preference are not recognized until the next
soft reset.

The reason the prefs applet seems to display your changes correctly is that it
is reading the value from the preference DB, not the cached value.

>How does the prefs app do it?

By changing not only the preference DB but also the internal cached value.

See the SndSetDefaultVolume() api, but note that is is both listed in Appendix A
as a "System Use Only" function, and also contains the caveat in the API's
compatability section as "Never call this function in Palm OS 5".

Doug

--
For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

-- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to