|
Packit Service |
db8eaa |
/*
|
|
Packit Service |
db8eaa |
* Mixer Interface - simple abstact module - base library
|
|
Packit Service |
db8eaa |
* Copyright (c) 2005 by Jaroslav Kysela <perex@perex.cz>
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
* This library is free software; you can redistribute it and/or modify
|
|
Packit Service |
db8eaa |
* it under the terms of the GNU Lesser General Public License as
|
|
Packit Service |
db8eaa |
* published by the Free Software Foundation; either version 2.1 of
|
|
Packit Service |
db8eaa |
* the License, or (at your option) any later version.
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
* This program is distributed in the hope that it will be useful,
|
|
Packit Service |
db8eaa |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
db8eaa |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
db8eaa |
* GNU Lesser General Public License for more details.
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
db8eaa |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
db8eaa |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit Service |
db8eaa |
*
|
|
Packit Service |
db8eaa |
*/
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#ifndef __SMIXER_BASE_H
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#include "list.h"
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define MAX_CHANNEL 6
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define SID_MASTER 0
|
|
Packit Service |
db8eaa |
#define SID_HEADPHONE 1
|
|
Packit Service |
db8eaa |
#define SID_FRONT 2
|
|
Packit Service |
db8eaa |
#define SID_PCM 3
|
|
Packit Service |
db8eaa |
#define SID_CD 4
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct melem_sids {
|
|
Packit Service |
db8eaa |
unsigned short sid;
|
|
Packit Service |
db8eaa |
const char *sname;
|
|
Packit Service |
db8eaa |
unsigned short sindex;
|
|
Packit Service |
db8eaa |
unsigned short weight;
|
|
Packit Service |
db8eaa |
unsigned int chanmap[2];
|
|
Packit Service |
db8eaa |
struct sm_elem_ops *sops;
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#define PURPOSE_VOLUME 0
|
|
Packit Service |
db8eaa |
#define PURPOSE_SWITCH 1
|
|
Packit Service |
db8eaa |
#define PURPOSE_ENUMLIST 2
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct helem_selector {
|
|
Packit Service |
db8eaa |
snd_ctl_elem_iface_t iface;
|
|
Packit Service |
db8eaa |
const char *name;
|
|
Packit Service |
db8eaa |
unsigned short index;
|
|
Packit Service |
db8eaa |
unsigned short sid;
|
|
Packit Service |
db8eaa |
unsigned short purpose;
|
|
Packit Service |
db8eaa |
unsigned short caps;
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct helem_base {
|
|
Packit Service |
db8eaa |
struct list_head list;
|
|
Packit Service |
db8eaa |
snd_hctl_elem_t *helem;
|
|
Packit Service |
db8eaa |
unsigned short purpose;
|
|
Packit Service |
db8eaa |
unsigned int caps;
|
|
Packit Service |
db8eaa |
unsigned int inactive: 1;
|
|
Packit Service |
db8eaa |
long min, max;
|
|
Packit Service |
db8eaa |
unsigned int count;
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct selem_base {
|
|
Packit Service |
db8eaa |
sm_selem_t selem;
|
|
Packit Service |
db8eaa |
struct list_head helems;
|
|
Packit Service |
db8eaa |
unsigned short sid;
|
|
Packit Service |
db8eaa |
struct {
|
|
Packit Service |
db8eaa |
unsigned int chanmap;
|
|
Packit Service |
db8eaa |
unsigned int forced_range: 1;
|
|
Packit Service |
db8eaa |
long min, max;
|
|
Packit Service |
db8eaa |
long vol[MAX_CHANNEL];
|
|
Packit Service |
db8eaa |
} dir[2];
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct bclass_selector {
|
|
Packit Service |
db8eaa |
struct list_head list;
|
|
Packit Service |
db8eaa |
struct helem_selector *selectors;
|
|
Packit Service |
db8eaa |
unsigned int count;
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct bclass_sid {
|
|
Packit Service |
db8eaa |
struct list_head list;
|
|
Packit Service |
db8eaa |
struct melem_sids *sids;
|
|
Packit Service |
db8eaa |
unsigned int count;
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
typedef struct bclass_base_ops {
|
|
Packit Service |
db8eaa |
int (*event)(snd_mixer_class_t *class, unsigned int mask,
|
|
Packit Service |
db8eaa |
snd_hctl_elem_t *helem, snd_mixer_elem_t *melem);
|
|
Packit Service |
db8eaa |
int (*selreg)(snd_mixer_class_t *class,
|
|
Packit Service |
db8eaa |
struct helem_selector *selectors,
|
|
Packit Service |
db8eaa |
unsigned int count);
|
|
Packit Service |
db8eaa |
int (*sidreg)(snd_mixer_class_t *class,
|
|
Packit Service |
db8eaa |
struct melem_sids *sids,
|
|
Packit Service |
db8eaa |
unsigned int count);
|
|
Packit Service |
db8eaa |
} bclass_base_ops_t;
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
struct bclass_private {
|
|
Packit Service |
db8eaa |
struct list_head selectors;
|
|
Packit Service |
db8eaa |
struct list_head sids;
|
|
Packit Service |
db8eaa |
void *dl_sbase;
|
|
Packit Service |
db8eaa |
bclass_base_ops_t ops;
|
|
Packit Service |
db8eaa |
};
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
int mixer_simple_basic_dlopen(snd_mixer_class_t *class,
|
|
Packit Service |
db8eaa |
bclass_base_ops_t **ops);
|
|
Packit Service |
db8eaa |
|
|
Packit Service |
db8eaa |
#endif /* __SMIXER_BASE_H */
|