Or simpler: do a read() from /dev/empeg_state to retrieve the state. Still gotta get the current power mode (AC/DC) from /proc/empeg_power, and then pull the correct volume setting from the corresponding offset within the savearea.

To figure out the volume location in the savearea, use the Hijack menu item for "Show Flash Savearea" to scroll around while you adjust the volume to see which part of it changes (it gets hilighted). Repeat for the "other" power mode to cover both AC/DC.

This could be a useful app.. go for it!

-ml