Hey all,

As you know (or don't know) the state files in /usr/share/shr/scenarii/ are
not used by default anymore, since fsodeviced moved to a special file
structure to represent audio scenarios, and thus, does not support the alsa
state files format anymore.
Many of you complained that you can't easily modify the sound state (with
alsamixer), dump the state to file and then use it by default like you have
in the past. And even without your complaints, lacking this feature just
means we can't "play" with alsamixer and make our changes default.

This is not much, but I compiled a oneliner that takes the active alsa state
and dumps it to stdout in fsodeviced's format.
Here's the oneliner:
amixer contents | sed -n -e
"s/^numid=\([0-9]\+\).*name=\('[^']*'\).*$/#\1:\2/p" -e
"s/^[^;]*;.*values=\([0-9]\+\).*$/:\1:/p" -e
"s/^[^;]*:.*values=\(.*\)$/\1/p" | sed -e "s/^[ofn,]*off[ofn,]*$/0/g" -e
"s/^[ofn,]*on[ofn,]*$/1/g" | tr -d '\n' | tr '#' '\n' | sort -n

Or you can alternatively just use the script I attached that:
1. accepts a state file as a parameter
2. backs up active state
3. loads the state
4. dumps the fsodeviced format to stdout
5. restores old state

or alternatively, if no parameter is passed it just behaves like the
onliner.

It's very hackish and will only work when running from the moko because it's
a lot easier this way.
I hope you have fun, and please if you have a good scenario that you'd like
us to use and you think the current shr scenarios don't work well, please
let us know by replying to this mail and attaching your scenario.

-- 
Tom.

Attachment: convert_state.sh
Description: Bourne shell script

_______________________________________________
Shr-devel mailing list
Shr-devel@lists.shr-project.org
http://lists.shr-project.org/mailman/listinfo/shr-devel

Reply via email to