mirror of
https://gitee.com/openharmony/third_party_alsa-lib
synced 2024-11-26 17:21:07 +00:00
initial & empty smixer-ac97.so module (only the build framework)
This commit is contained in:
parent
c9d343a0cc
commit
4c4849230c
@ -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 \
|
||||
|
@ -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>'
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
8
src/mixer/simple/Makefile.am
Normal file
8
src/mixer/simple/Makefile.am
Normal file
@ -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
|
36
src/mixer/simple/ac97.c
Normal file
36
src/mixer/simple/ac97.c
Normal file
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user