Blame src/mixer/mixer_local.h

Packit 4a16fb
/*
Packit 4a16fb
 *  Mixer Interface - local header file
Packit 4a16fb
 *  Copyright (c) 2000 by Jaroslav Kysela <perex@perex.cz>
Packit 4a16fb
 *  Copyright (c) 2001 by Abramo Bagnara <abramo@alsa-project.org>
Packit 4a16fb
 *
Packit 4a16fb
 *
Packit 4a16fb
 *   This library is free software; you can redistribute it and/or modify
Packit 4a16fb
 *   it under the terms of the GNU Lesser General Public License as
Packit 4a16fb
 *   published by the Free Software Foundation; either version 2.1 of
Packit 4a16fb
 *   the License, or (at your option) any later version.
Packit 4a16fb
 *
Packit 4a16fb
 *   This program is distributed in the hope that it will be useful,
Packit 4a16fb
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 4a16fb
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 4a16fb
 *   GNU Lesser General Public License for more details.
Packit 4a16fb
 *
Packit 4a16fb
 *   You should have received a copy of the GNU Lesser General Public
Packit 4a16fb
 *   License along with this library; if not, write to the Free Software
Packit 4a16fb
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit 4a16fb
 *
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
#include "local.h"
Packit 4a16fb
Packit 4a16fb
typedef struct _bag1 {
Packit 4a16fb
	void *ptr;
Packit 4a16fb
	struct list_head list;
Packit 4a16fb
} bag1_t;
Packit 4a16fb
Packit 4a16fb
typedef struct list_head bag_t;
Packit 4a16fb
Packit 4a16fb
int bag_new(bag_t **bag);
Packit 4a16fb
void bag_free(bag_t *bag);
Packit 4a16fb
int bag_add(bag_t *bag, void *ptr);
Packit 4a16fb
int bag_del(bag_t *bag, void *ptr);
Packit 4a16fb
int bag_empty(bag_t *bag);
Packit 4a16fb
void bag_del_all(bag_t *bag);
Packit 4a16fb
Packit 4a16fb
typedef struct list_head *bag_iterator_t;
Packit 4a16fb
Packit 4a16fb
#define bag_iterator_entry(i) (list_entry((i), bag1_t, list)->ptr)
Packit 4a16fb
#define bag_for_each(pos, bag) list_for_each(pos, bag)
Packit 4a16fb
#define bag_for_each_safe(pos, next, bag) list_for_each_safe(pos, next, bag)
Packit 4a16fb
Packit 4a16fb
struct _snd_mixer_class {
Packit 4a16fb
	struct list_head list;
Packit 4a16fb
	snd_mixer_t *mixer;
Packit 4a16fb
	snd_mixer_event_t event;
Packit 4a16fb
	void *private_data;		
Packit 4a16fb
	void (*private_free)(snd_mixer_class_t *class);
Packit 4a16fb
	snd_mixer_compare_t compare;
Packit 4a16fb
};
Packit 4a16fb
Packit 4a16fb
struct _snd_mixer_elem {
Packit 4a16fb
	snd_mixer_elem_type_t type;
Packit 4a16fb
	struct list_head list;		/* links for list of all elems */
Packit 4a16fb
	snd_mixer_class_t *class;
Packit 4a16fb
	void *private_data;
Packit 4a16fb
	void (*private_free)(snd_mixer_elem_t *elem);
Packit 4a16fb
	snd_mixer_elem_callback_t callback;
Packit 4a16fb
	void *callback_private;
Packit 4a16fb
	bag_t helems;
Packit 4a16fb
	int compare_weight;		/* compare weight (reversed) */
Packit 4a16fb
};
Packit 4a16fb
Packit 4a16fb
struct _snd_mixer {
Packit 4a16fb
	struct list_head slaves;	/* list of all slaves */
Packit 4a16fb
	struct list_head classes;	/* list of all elem classes */
Packit 4a16fb
	struct list_head elems;		/* list of all elems */
Packit 4a16fb
	snd_mixer_elem_t **pelems;	/* array of all elems */
Packit 4a16fb
	unsigned int count;
Packit 4a16fb
	unsigned int alloc;
Packit 4a16fb
	unsigned int events;
Packit 4a16fb
	snd_mixer_callback_t callback;
Packit 4a16fb
	void *callback_private;
Packit 4a16fb
	snd_mixer_compare_t compare;
Packit 4a16fb
};
Packit 4a16fb
Packit 4a16fb
struct _snd_mixer_selem_id {
Packit 4a16fb
	char name[60];
Packit 4a16fb
	unsigned int index;
Packit 4a16fb
};