From: Jaroslav Kysela Date: Tue, 7 Jun 2005 11:44:25 +0000 (+0000) Subject: initial & empty smixer-ac97.so module (only the build framework) X-Git-Tag: v1.0.10rc1~35 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=4c4849230c739ab5f412160f0a7b9c98a204b8aa;p=alsa-lib.git initial & empty smixer-ac97.so module (only the build framework) --- diff --git a/configure.in b/configure.in index b8a182b2..83dee128 100644 --- a/configure.in +++ b/configure.in @@ -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 \ diff --git a/doc/asoundrc.txt b/doc/asoundrc.txt index 7a98f84b..f79d528e 100644 --- a/doc/asoundrc.txt +++ b/doc/asoundrc.txt @@ -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 ' diff --git a/src/conf/smixer.conf b/src/conf/smixer.conf index 908de4a4..000e8f02 100644 --- a/src/conf/smixer.conf +++ b/src/conf/smixer.conf @@ -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 } diff --git a/src/mixer/Makefile.am b/src/mixer/Makefile.am index 10c03850..99ca4e14 100644 --- a/src/mixer/Makefile.am +++ b/src/mixer/Makefile.am @@ -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 index 00000000..c4fee410 --- /dev/null +++ b/src/mixer/simple/Makefile.am @@ -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 index 00000000..e10da33b --- /dev/null +++ b/src/mixer/simple/ac97.c @@ -0,0 +1,36 @@ +/* + * Mixer Interface - AC97 simple abstact module + * Copyright (c) 2005 by Jaroslav Kysela + * + * + * 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 +#include +#include +#include +#include +#include +#include +#include + +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 diff --git a/src/mixer/simple_abst.c b/src/mixer/simple_abst.c index 29f421f2..13a59585 100644 --- a/src/mixer/simple_abst.c +++ b/src/mixer/simple_abst.c @@ -39,27 +39,33 @@ #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)