Update of /cvsroot/alsa/alsa-lib/src/conf
In directory sc8-pr-cvs1:/tmp/cvs-serv23405/src/conf

Modified Files:
        Makefile.am 
Added Files:
        sndo-mixer.alisp 
Log Message:
added snd_hctl_ctl() function
ordinary mixer:
  - revised Ordinary Mixer I/O type
  - sndo_mixer_open() take PCMs rather than strings to pass
    the real relationship
  - an initial version of toplevel alisp script
more alisp development:
  - renamed a* functions to A* functions (acall -> Acall etc.)
  - many improvements (unset*, exfun, Acall pcm_info, Asnderr, Asyserr)


--- NEW FILE: sndo-mixer.alisp ---
(defun sndo_include (hctl stream)
  (setq info (Acall "ctl_card_info" (Acall "hctl_ctl" hctl)))
  (if (= (Aerror info) 0)
    (progn
      (setq info (Aresult info))
      (setq driver (cdr (assq "driver" (unsetq info))))
      (setq file (+ (path "data") "/alsa/cards/" (snd_card_alias driver) "/sndo" 
stream "-mixer.alisp"))
      (setq r (include file))
      (when (= r -2) (Asyserr "unable to find file " file))
      (unsetq driver file r)
    )
    (setq r (Aerror info))
    (unsetq info r)
  )
)

(defun sndo_mixer_open1 (pcm stream)
  (setq info (Acall "pcm_info" pcm))
  (setq r (Aerror info))
  (when (= r 0)
    (progn
      (setq info (Aresult info))
      (setq card (cdr (assq "card" info)))
      (setq r
        (if (< card 0)
          (+ (Acall "pcm_name" pcm) stream)
          (+ "hw:" (str card))
        )
      )
      (unsetq card)
    )
  )
  (unsetq info r)
)

(defun sndo_mixer_open (ppcm cpcm)
  (setq pname (sndo_mixer_open1 ppcm "p"))
  (setq cname (sndo_mixer_open1 cpcm "c"))
  (setq phctl (Acall "hctl_open" pname nil))
  (if (= (Aerror phctl) 0)
    (progn
      (setq phctl (Aresult phctl))
      (setq chctl (Acall "hctl_open" cname nil))
      (if (= (Aerror chctl) 0)
        (progn
          (setq chctl (Aresult chctl))
          (setq hctls (cons phctl (cons chctl)))
          (setq r (sndo_include phctl "p"))
          (when (= r 0) (setq r (sndo_include chctl "c")))
          (when (= r 0) (setq r (if (exfun sndop_mixer_open) (sndop_mixer_open phctl) 
0)))
          (when (= r 0)
            (progn
              (setq r (if (exfun sndoc_mixer_open) (sndoc_mixer_open chctl) 0))
              (unless (= r 0) (sndop_close phctl))
            )
          )
          (unless (= r 0) (sndo_close))
          (unsetq phctl chctl)
          (gc)
          (unsetq r)
        )
        (progn
          (Acall "hctl_close" (Aresult phctl))
          (setq r (Aerror chctl))
          (unsetq r)
        )
      )
    )
    (setq r (Aerror phctl))
    (unsetq r)
  )
)

(defun sndo_mixer_close nil
  (cond (exfun sndop_close) (sndop_close (nth 0 hctls)))
  (cond (exfun sndoc_close) (sndoc_close (nth 1 hctls)))
  (Acall "hctl_close" (nth 0 hctls))
  (Acall "hctl_close" (nth 1 hctls))
  (unsetq hctls)
)

(include (+ (path "data") "/alsa/cards/aliases.alisp"))

Index: Makefile.am
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/conf/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Makefile.am 24 Jun 2001 23:16:17 -0000      1.4
+++ Makefile.am 9 Sep 2003 19:24:36 -0000       1.5
@@ -1,6 +1,7 @@
 SUBDIRS=cards pcm
 
-cfg_files = alsa.conf
+cfg_files = alsa.conf \
+       sndo-mixer.alisp
 
 EXTRA_DIST = $(cfg_files)
 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to