mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
moved simple mixer abstraction modules to modules/mixer/simple directory
Compile dynamic modules outside the alsa-lib tree to allow linking them against libasound.so - proper versions of dynamic symbols.
This commit is contained in:
parent
19ac270f1e
commit
a33c78ddd8
12 changed files with 10 additions and 4 deletions
90
modules/mixer/simple/hda.c
Normal file
90
modules/mixer/simple/hda.c
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* Mixer Interface - HDA 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 "asoundlib.h"
|
||||
#include "mixer_abst.h"
|
||||
#include "sbase.h"
|
||||
|
||||
static struct sm_elem_ops simple_hda_ops;
|
||||
|
||||
struct melem_sids sids[] = {
|
||||
{
|
||||
.sid = SID_FRONT,
|
||||
.sname = "Front",
|
||||
.sindex = 0,
|
||||
.weight = 1,
|
||||
.chanmap = { 3, 0 },
|
||||
.sops = &simple_hda_ops,
|
||||
}
|
||||
};
|
||||
|
||||
#define SELECTORS (sizeof(selectors)/sizeof(selectors[0]))
|
||||
|
||||
struct helem_selector selectors[] = {
|
||||
{
|
||||
.iface = SND_CTL_ELEM_IFACE_MIXER,
|
||||
.name = "Front Playback Volume",
|
||||
.index = 0,
|
||||
.sid = SID_FRONT,
|
||||
.purpose = PURPOSE_VOLUME,
|
||||
.caps = SM_CAP_PVOLUME,
|
||||
},
|
||||
{
|
||||
.iface = SND_CTL_ELEM_IFACE_MIXER,
|
||||
.name = "Front Playback Switch",
|
||||
.index = 0,
|
||||
.sid = SID_FRONT,
|
||||
.purpose = PURPOSE_SWITCH,
|
||||
.caps = SM_CAP_PSWITCH,
|
||||
}
|
||||
};
|
||||
|
||||
int alsa_mixer_simple_event(snd_mixer_class_t *class, unsigned int mask,
|
||||
snd_hctl_elem_t *helem, snd_mixer_elem_t *melem)
|
||||
{
|
||||
struct bclass_private *priv = snd_mixer_sbasic_get_private(class);
|
||||
return priv->ops.event(class, mask, helem, melem);
|
||||
}
|
||||
|
||||
int alsa_mixer_simple_init(snd_mixer_class_t *class)
|
||||
{
|
||||
struct bclass_base_ops *ops;
|
||||
int err;
|
||||
|
||||
err = mixer_simple_basic_dlopen(class, &ops);
|
||||
if (err < 0)
|
||||
return 0;
|
||||
err = ops->selreg(class, selectors, SELECTORS);
|
||||
if (err < 0)
|
||||
return err;
|
||||
err = ops->sidreg(class, sids, SELECTORS);
|
||||
if (err < 0)
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue