mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-14 06:59:54 -05:00
ALISP update
- function names are more emacs-like - implemented (format) function - fixed numerous memory-leaks (valgrind is now happy) Ordinary mixer - added the global view (using hdsp names only)
This commit is contained in:
parent
beb837bcf7
commit
d0facfde2b
10 changed files with 628 additions and 250 deletions
|
|
@ -1,4 +1,11 @@
|
|||
(defun sndoc_mixer_open (hctl)
|
||||
(princ "sndoc_mixer_open\n")
|
||||
;
|
||||
; SiS SI7018 mixer abstract layer
|
||||
;
|
||||
; Copyright (c) 2003 Jaroslav Kysela <perex@suse.cz>
|
||||
; License: GPL v2 (http://www.gnu.org/licenses/gpl.html)
|
||||
;
|
||||
|
||||
(defun sndoc_mixer_open (hctl pcm)
|
||||
(princ "sndoc_mixer_open: hctl=" hctl " pcm=" pcm "\n")
|
||||
0
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
(defun sndop_mixer_open (hctl)
|
||||
(princ "sndop_mixer_open\n")
|
||||
;
|
||||
; SiS SI7018 mixer abstract layer
|
||||
;
|
||||
; Copyright (c) 2003 Jaroslav Kysela <perex@suse.cz>
|
||||
; License: GPL v2 (http://www.gnu.org/licenses/gpl.html)
|
||||
;
|
||||
|
||||
(defun sndop_mixer_open (hctl pcm)
|
||||
(princ "sndop_mixer_open: hctl=" hctl " pcm=" pcm "\n")
|
||||
0
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
(setq snd_card_aliases_array
|
||||
(
|
||||
("YMF724" . "YMF744")
|
||||
("YMF724F" . "YMF744")
|
||||
("YMF740" . "YMF744")
|
||||
("YMF740C" . "YMF744")
|
||||
("YMF754" . "YMF744")
|
||||
("CMIPCI" . "CMI8338")
|
||||
("CMI8738" . "CMI8338")
|
||||
("CMI8738-MC4" . "CMI8738-MC6")
|
||||
("E-mu APS" . "EMU10K1")
|
||||
("GUS Max" . "GUS")
|
||||
("GUS ACE" . "GUS")
|
||||
("GUS Extreme" . "GUS")
|
||||
("AMD InterWave" . "GUS")
|
||||
("Dynasonic 3-D" . "GUS")
|
||||
("InterWave STB" . "GUS")
|
||||
("YMF724" . "YMF744")
|
||||
("YMF724F" . "YMF744")
|
||||
("YMF740" . "YMF744")
|
||||
("YMF740C" . "YMF744")
|
||||
("YMF754" . "YMF744")
|
||||
("CMIPCI" . "CMI8338")
|
||||
("CMI8738" . "CMI8338")
|
||||
("CMI8738-MC4" . "CMI8738-MC6")
|
||||
("E-mu APS" . "EMU10K1")
|
||||
("GUS Max" . "GUS")
|
||||
("GUS ACE" . "GUS")
|
||||
("GUS Extreme" . "GUS")
|
||||
("AMD InterWave" . "GUS")
|
||||
("Dynasonic 3-D" . "GUS")
|
||||
("InterWave STB" . "GUS")
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
;
|
||||
; Toplevel configuration for the ALSA Ordinary Mixer Interface
|
||||
;
|
||||
; Copyright (c) 2003 Jaroslav Kysela <perex@suse.cz>
|
||||
; License: GPL v2 (http://www.gnu.org/licenses/gpl.html)
|
||||
;
|
||||
|
||||
(defun sndo_include (hctl stream)
|
||||
(setq info (Acall "ctl_card_info" (Acall "hctl_ctl" hctl)))
|
||||
|
|
@ -8,7 +11,7 @@
|
|||
(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 file (concat (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))
|
||||
)
|
||||
|
|
@ -17,36 +20,55 @@
|
|||
(unsetq info driver file r)
|
||||
)
|
||||
|
||||
(defun sndo_mixer_open_fcn (stream)
|
||||
(setq fcn (+ "sndo" stream "_mixer_open"))
|
||||
(setq r (if (exfun fcn) (call fcn hctl) 0))
|
||||
(defun sndo_mixer_open_fcn (hctl stream pcm)
|
||||
(setq fcn (concat "sndo" stream "_mixer_open"))
|
||||
(setq r (if (exfun fcn) (funcall fcn hctl pcm) 0))
|
||||
(when (= r 0)
|
||||
(setq hctls (if hctls (cons hctls (cons hctl)) hctl))
|
||||
)
|
||||
(unsetq fcn r)
|
||||
)
|
||||
|
||||
(defun sndo_mixer_open_hctl (card stream)
|
||||
(setq hctl (Acall "hctl_open" (+ "hw:" (str card)) nil))
|
||||
(defun sndo_mixer_open_hctl (name stream pcm)
|
||||
(setq hctl (Acall "hctl_open" name nil))
|
||||
(setq r (Aerror hctl))
|
||||
(when (= r 0)
|
||||
(setq hctl (Aresult hctl))
|
||||
(setq r (sndo_include hctl stream))
|
||||
(when (= r 0) (setq r (sndo_mixer_open_fcn stream)))
|
||||
(if (= r 0)
|
||||
(setq r (sndo_mixer_open_fcn hctl stream pcm))
|
||||
(Acall "hctl_close" hctl)
|
||||
)
|
||||
)
|
||||
(unsetq hctl r)
|
||||
)
|
||||
|
||||
(defun sndo_mixer_open_virtual (pcm stream)
|
||||
(setq name (Acall "pcm_name" pcm))
|
||||
(setq file (+ (path "data") "/alsa/virtual/" name "/sndo" stream "-mixer.alisp"))
|
||||
(defun sndo_mixer_open_virtual (name stream pcm)
|
||||
(setq file (concat (path "data") "/alsa/virtual/" name "/sndo" stream "-mixer.alisp"))
|
||||
(setq r (include file))
|
||||
(when (= r -2) (Asyserr "unable to find file " file))
|
||||
(when (= r 0) (setq r (sndo_mixer_open_fcn stream)))
|
||||
(unsetq name file r)
|
||||
(when (= r 0) (setq r (sndo_mixer_open_fcn nil stream pcm)))
|
||||
(unsetq file r)
|
||||
)
|
||||
|
||||
(defun sndo_mixer_open1 (pcm stream)
|
||||
(defun sndo_mixer_open1 (name stream)
|
||||
(if (compare-strings name 0 2 "hw:" 0 2)
|
||||
(sndo_mixer_open_hctl name stream nil)
|
||||
(sndo_mixer_open_virtual name stream nil)
|
||||
)
|
||||
)
|
||||
|
||||
(defun sndo_mixer_open (pname cname)
|
||||
(setq r (sndo_mixer_open1 pname "p"))
|
||||
(when (= r 0) (setq r (sndo_mixer_open1 cname "c")))
|
||||
(when (!= r 0) (sndo_mixer_close))
|
||||
(unsetq sndo_mixer_open
|
||||
sndo_mixer_open_pcm sndo_mixer_open_pcm1
|
||||
sndo_mixer_open_virtual sndo_mixer_open_fcn
|
||||
sndo_include r)
|
||||
)
|
||||
|
||||
(defun sndo_mixer_open_pcm1 (pcm stream)
|
||||
(setq info (Acall "pcm_info" pcm))
|
||||
(setq r (Aerror info))
|
||||
(when (= r 0)
|
||||
|
|
@ -54,19 +76,20 @@
|
|||
(setq card (cdr (assq "card" info)))
|
||||
(setq r
|
||||
(if (< card 0)
|
||||
(sndo_mixer_open_virtual pcm stream)
|
||||
(sndo_mixer_open_hctl card stream)
|
||||
(sndo_mixer_open_virtual (Acall "pcm_name" pcm) stream pcm)
|
||||
(sndo_mixer_open_hctl (format "hw:%i" card) stream pcm)
|
||||
)
|
||||
)
|
||||
)
|
||||
(unsetq info card r)
|
||||
)
|
||||
|
||||
(defun sndo_mixer_open (ppcm cpcm)
|
||||
(setq r (sndo_mixer_open1 ppcm "p"))
|
||||
(when (= r 0) (setq r (sndo_mixer_open1 cpcm "c")))
|
||||
(defun sndo_mixer_open_pcm (ppcm cpcm)
|
||||
(setq r (sndo_mixer_open_pcm1 ppcm "p"))
|
||||
(when (= r 0) (setq r (sndo_mixer_open_pcm1 cpcm "c")))
|
||||
(when (!= r 0) (sndo_mixer_close))
|
||||
(unsetq sndo_mixer_open sndo_mixer_open1
|
||||
(unsetq sndo_mixer_open
|
||||
sndo_mixer_open_pcm sndo_mixer_open_pcm1
|
||||
sndo_mixer_open_virtual sndo_mixer_open_fcn
|
||||
sndo_include r)
|
||||
)
|
||||
|
|
@ -74,8 +97,8 @@
|
|||
(defun sndo_mixer_close1 (hctl stream)
|
||||
(when hctl
|
||||
(progn
|
||||
(setq fcn (+ "sndo" stream "_mixer_close"))
|
||||
(when (exfun fcn) (call fcn hctl))
|
||||
(setq fcn (concat "sndo" stream "_mixer_close"))
|
||||
(when (exfun fcn) (funcall fcn hctl))
|
||||
(unsetq fcn)
|
||||
(Acall "hctl_close" hctl)
|
||||
)
|
||||
|
|
@ -88,4 +111,4 @@
|
|||
(unsetq hctls)
|
||||
)
|
||||
|
||||
(include (+ (path "data") "/alsa/cards/aliases.alisp"))
|
||||
(include (concat (path "data") "/alsa/cards/aliases.alisp"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue