[clfswm-devel] [pull-request] Add volume mode

Desmond O. Chang dochang at gmail.com
Tue Feb 22 02:01:46 UTC 2011


Hi,

The following changes since commit 014f413770096568320199de7d13ac10d2f34ec1:

  src/clfswm.lisp (main-unprotected): Add a close hook. And close the
notify window, the virtual keyboard and the clfswm terminal by
default. (2011-02-16 11:47:09 +0100)

are available in the git repository at:
  git://repo.or.cz/clfswm/dochang.git volume-mode

Desmond O. Chang (2):
      Use ASDF:SYSTEM-SOURCE-DIRECTORY instead of *LOAD-TRUENAME*.
      Add volume mode.

 clfswm.asd                    |    6 +-
 contrib/amixer.lisp           |   43 +++++++++++
 contrib/server/server.lisp    |    2 +-
 src/bindings-second-mode.lisp |    7 ++
 src/bindings.lisp             |    4 +
 src/clfswm-keys.lisp          |    2 +
 src/clfswm-util.lisp          |    2 +-
 src/clfswm-volume-mode.lisp   |  154 +++++++++++++++++++++++++++++++++++++++++
 src/clfswm.lisp               |    6 +-
 src/config.lisp               |   17 +++++
 src/package.lisp              |    3 +
 src/tools.lisp                |    7 ++
 12 files changed, 246 insertions(+), 7 deletions(-)
 create mode 100644 contrib/amixer.lisp
 create mode 100644 src/clfswm-volume-mode.lisp


This pull-request adds volume mode.

This mode is inspired by the emms volume package.  When you change the
volume in main mode or second mode, clfswm will enter volume mode and
set a timer to leave this mode.  Changing volume in volume mode will
reset the timer.  You can also leave volume mode manually by return,
escape or control-g.

Special variable *VOLUME-MODE-TIMEOUT* controls the timeout in
seconds.  If it's positive, volume mode will exit when timeout occurs;
if it's 0, volume mode will exit right now; if it's negative, volume
will not exit even if timeout occurs.  Default timeout is 3 seconds.

Volume mode uses three special variables to control the mixer:
*VOLUME-MUTE-FUNCTION*, *VOLUME-LOWER-FUNCTION* and
*VOLUME-RAISE-FUNCTION*.  Their values are functions which must accept
no arguments and return two values indicating the mixer state.  The
first value is the volume ratio whose type must be (real 0 1).  If the
mixer is mute, the second value should be true, otherwise it should be
false.  If volume controller cannot get the mixer state, it must
return NIL.

Volume mode shows a mute sign, a percentage and a ratio bar on the
screen.  A plus sign '+' means it's unmute and a minus sign '-' means
it's mute now.  If volume mode doesn't know the mixer state, a message
"unknown" will be shown.

contrib/amixer.lisp shows how to use volume mode with alsa.


Thanks,
Des




More information about the clfswm-devel mailing list