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 \
}
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>'
usb {
searchl "USB"
- lib smixer_usb.so
+ lib smixer-usb.so
}
ac97 {
searchl "AC97a:"
- lib smixer_ac97.so
+ lib smixer-ac97.so
}
+SUBDIRS=simple
+
EXTRA_LTLIBRARIES=libmixer.la
libmixer_la_SOURCES = bag.c mixer.c simple.c simple_none.c simple_abst.c
--- /dev/null
+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
--- /dev/null
+/*
+ * 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
#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);
}
free(xlib);
snd_mixer_class_set_event(class, event_func);
+ priv->dlhandle = h;
return 0;
}
{
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)