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

Modified Files:
        ordinary_mixer.c 
Log Message:
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)


Index: ordinary_mixer.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/ordinary_mixer/ordinary_mixer.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ordinary_mixer.c    21 Dec 2003 18:25:57 -0000      1.5
+++ ordinary_mixer.c    23 Dec 2003 16:43:04 -0000      1.6
@@ -67,18 +67,12 @@
        int _free_cfg;
 };
 
-/**
- * \brief Opens a ordinary mixer instance
- * \param pmixer Returned ordinary mixer handle
- * \param playback_pcm handle of the playback PCM
- * \param capture_pcm handle of the capture PCM
- * \param lconf Local configuration (might be NULL - use global configuration)
- * \return 0 on success otherwise a negative error code
- */
-int sndo_mixer_open(sndo_mixer_t **pmixer,
-                   snd_pcm_t *playback_pcm,
-                   snd_pcm_t *capture_pcm,
-                   struct alisp_cfg *lconf)
+int sndo_mixer_open1(sndo_mixer_t **pmixer,
+                    const char *lisp_fcn,
+                    const char *lisp_fmt,
+                    const void *parg,
+                    const void *carg,
+                    struct alisp_cfg *lconf)
 {
        struct alisp_cfg *cfg = lconf;
        struct alisp_instance *alisp;
@@ -101,16 +95,16 @@
                cfg = alsa_lisp_default_cfg(input);
                if (cfg == NULL)
                        return -ENOMEM;
+               cfg->warning = 1;
 #if 0
                cfg->debug = 1;
                cfg->verbose = 1;
-               cfg->warning = 1;
 #endif
        }
        err = alsa_lisp(cfg, &alisp);
        if (err < 0)
                goto __error;
-       err = alsa_lisp_function(alisp, &iterator, "sndo_mixer_open", "%ppcm%ppcm", 
playback_pcm, capture_pcm);
+       err = alsa_lisp_function(alisp, &iterator, lisp_fcn, lisp_fmt, parg, carg);
        if (err < 0) {
                alsa_lisp_free(alisp);
                goto __error;
@@ -118,6 +112,7 @@
        err = alsa_lisp_seq_integer(iterator, &val);
        if (err == 0 && val < 0)
                err = val;
+       alsa_lisp_result_free(alisp, iterator);
        if (err < 0) {
                alsa_lisp_free(alisp);
                goto __error;
@@ -155,6 +150,39 @@
        if (cfg != lconf)
                alsa_lisp_default_cfg_free(cfg);
        return err;
+}
+
+/**
+ * \brief Opens a ordinary mixer instance
+ * \param pmixer Returned ordinary mixer handle
+ * \param playback_name name for playback HCTL communication
+ * \param capture_name name for capture HCTL communication
+ * \param lconf Local configuration (might be NULL - use global configuration)
+ * \return 0 on success otherwise a negative error code
+ */
+int sndo_mixer_open(sndo_mixer_t **pmixer,
+                   const char *playback_name,
+                   const char *capture_name,
+                   struct alisp_cfg *lconf)
+{
+       return sndo_mixer_open1(pmixer, "sndo_mixer_open", "%s%s", playback_name, 
capture_name, lconf);
+}
+
+
+/**
+ * \brief Opens a ordinary mixer instance
+ * \param pmixer Returned ordinary mixer handle
+ * \param playback_pcm handle of the playback PCM
+ * \param capture_pcm handle of the capture PCM
+ * \param lconf Local configuration (might be NULL - use global configuration)
+ * \return 0 on success otherwise a negative error code
+ */
+int sndo_mixer_open_pcm(sndo_mixer_t **pmixer,
+                       snd_pcm_t *playback_pcm,
+                       snd_pcm_t *capture_pcm,
+                       struct alisp_cfg *lconf)
+{
+       return sndo_mixer_open1(pmixer, "sndo_mixer_open_pcm", "%ppcm%ppcm", 
playback_pcm, capture_pcm, lconf);
 }
 
 /**



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to