]> git.alsa-project.org Git - alsa-lib.git/commitdiff
initial & empty smixer-ac97.so module (only the build framework)
authorJaroslav Kysela <perex@perex.cz>
Tue, 7 Jun 2005 11:44:25 +0000 (11:44 +0000)
committerJaroslav Kysela <perex@perex.cz>
Tue, 7 Jun 2005 11:44:25 +0000 (11:44 +0000)
configure.in
doc/asoundrc.txt
src/conf/smixer.conf
src/mixer/Makefile.am
src/mixer/simple/Makefile.am [new file with mode: 0644]
src/mixer/simple/ac97.c [new file with mode: 0644]
src/mixer/simple_abst.c

index b8a182b2e732f8d14f40a1ad9eb942213480d428..83dee128cf523939f759cd81d5728df61b45dc53 100644 (file)
@@ -202,7 +202,7 @@ fi
 
 AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile include/Makefile
          include/sound/Makefile src/Makefile \
-          src/control/Makefile src/mixer/Makefile \
+          src/control/Makefile src/mixer/Makefile src/mixer/simple/Makefile \
          src/pcm/Makefile src/pcm/scopes/Makefile \
          src/rawmidi/Makefile src/timer/Makefile \
           src/hwdep/Makefile src/seq/Makefile src/instr/Makefile \
index 7a98f84b20b9c2caf0e02234ddccd6dd5bff966e..f79d528e2d1d97a3998ce0f5d6436cdeb4da7364 100644 (file)
@@ -452,7 +452,7 @@ pcm.m {
 }
 
 pcm_scope_type.level {
-       lib /home/abramo/scopes/liblevel.so
+       lib /home/abramo/scopes/scope-level.so
 } 
 
 # an example command is 'aplay -D plug:ladspa <filename>'
index 908de4a4462abbadc43bc26b4d38ffabfe51ea64..000e8f02419cdb42045e61fe500277f507c99cbb 100644 (file)
@@ -1,8 +1,8 @@
 usb {
        searchl "USB"
-       lib smixer_usb.so
+       lib smixer-usb.so
 }
 ac97 {
        searchl "AC97a:"
-       lib smixer_ac97.so
+       lib smixer-ac97.so
 }
index 10c03850dcbf843596e1eb2080e37c0e213f543f..99ca4e1438f8dc096f9785597c0ddc95974b2e0e 100644 (file)
@@ -1,3 +1,5 @@
+SUBDIRS=simple
+
 EXTRA_LTLIBRARIES=libmixer.la
 
 libmixer_la_SOURCES = bag.c mixer.c simple.c simple_none.c simple_abst.c
diff --git a/src/mixer/simple/Makefile.am b/src/mixer/simple/Makefile.am
new file mode 100644 (file)
index 0000000..c4fee41
--- /dev/null
@@ -0,0 +1,8 @@
+pkglibdir = $(libdir)/@PACKAGE@/smixer
+
+AM_CFLAGS = -g -O2 -W -Wall
+
+pkglib_LTLIBRARIES = smixer-ac97.la
+
+smixer_ac97_la_SOURCES = ac97.c
+smixer_ac97_la_LDFLAGS = -module
diff --git a/src/mixer/simple/ac97.c b/src/mixer/simple/ac97.c
new file mode 100644 (file)
index 0000000..e10da33
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  Mixer Interface - AC97 simple abstact module
+ *  Copyright (c) 2005 by Jaroslav Kysela <perex@suse.cz>
+ *
+ *
+ *   This library is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Lesser General Public License as
+ *   published by the Free Software Foundation; either version 2.1 of
+ *   the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU Lesser General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Lesser General Public
+ *   License along with this library; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <math.h>
+#include <alsa/asoundlib.h>
+
+int alsa_mixer_simple_event(snd_mixer_class_t *class, unsigned int mask,
+                           snd_hctl_elem_t *helem, snd_mixer_elem_t *melem)
+{
+       return -EIO;
+}
+                                 
\ No newline at end of file
index 29f421f29a5f8f6669a3f84326bad947ae818cac..13a5958594920e17b76bc9ee287f7c3d315b06a3 100644 (file)
 #include "asoundlib.h"
 #include "mixer_simple.h"
 
-#define SO_PATH PKGLIBDIR "/smixer/"
+#define SO_PATH PKGLIBDIR "/smixer"
 
 typedef struct _class_priv {
        char *device;
        snd_ctl_t *ctl;
        snd_hctl_t *hctl;
        snd_ctl_card_info_t *info;
-} class_priv_t;   
+       void *dlhandle;
+} class_priv_t;
 
 static int try_open(snd_mixer_class_t *class, const char *lib)
 {
+       class_priv_t *priv = snd_mixer_class_get_private(class);
        snd_mixer_event_t event_func;
-       char *xlib;
+       char *xlib, *path;
        void *h;
 
-       xlib = malloc(strlen(lib) + strlen(SO_PATH) + 1);
+       path = getenv("ALSA_MIXER_SIMPLE_MODULES");
+       if (!path)
+               path = SO_PATH;
+       xlib = malloc(strlen(lib) + strlen(path) + 1 + 1);
        if (xlib == NULL)
                return -ENOMEM;
-       strcpy(xlib, SO_PATH);
+       strcpy(xlib, path);
+       strcat(xlib, "/");
        strcat(xlib, lib);
-       h = snd_dlopen(lib, RTLD_NOW);
+       h = snd_dlopen(xlib, RTLD_NOW);
        if (h == NULL) {
                SNDERR("Unable to open library '%s'", xlib);
                free(xlib);
@@ -74,6 +80,7 @@ static int try_open(snd_mixer_class_t *class, const char *lib)
        }
        free(xlib);
        snd_mixer_class_set_event(class, event_func);
+       priv->dlhandle = h;
        return 0;
 }
 
@@ -140,6 +147,8 @@ static void private_free(snd_mixer_class_t *class)
 {
        class_priv_t *priv = snd_mixer_class_get_private(class);
        
+       if (priv->dlhandle)
+               snd_dlclose(priv->dlhandle);
        if (priv->info)
                snd_ctl_card_info_free(priv->info);
        if (priv->hctl)