2009-01-15 18:29:16 +01:00
|
|
|
#ifndef foopulsecardhfoo
|
|
|
|
|
#define foopulsecardhfoo
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
This file is part of PulseAudio.
|
|
|
|
|
|
|
|
|
|
Copyright 2009 Lennart Poettering
|
|
|
|
|
|
|
|
|
|
PulseAudio is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Lesser General Public License as published
|
2009-03-03 20:23:02 +00:00
|
|
|
by the Free Software Foundation; either version 2.1 of the License,
|
2009-01-15 18:29:16 +01:00
|
|
|
or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
PulseAudio 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
|
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
|
along with PulseAudio; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
|
USA.
|
|
|
|
|
***/
|
|
|
|
|
|
|
|
|
|
typedef struct pa_card pa_card;
|
|
|
|
|
|
|
|
|
|
#include <pulse/proplist.h>
|
|
|
|
|
#include <pulsecore/core.h>
|
|
|
|
|
#include <pulsecore/module.h>
|
|
|
|
|
#include <pulsecore/idxset.h>
|
|
|
|
|
|
2009-01-15 23:44:46 +01:00
|
|
|
typedef struct pa_card_profile {
|
2009-01-15 18:29:16 +01:00
|
|
|
char *name;
|
2009-01-17 02:03:35 +01:00
|
|
|
char *description;
|
2009-01-15 18:29:16 +01:00
|
|
|
|
2009-01-20 20:35:18 +01:00
|
|
|
unsigned priority;
|
|
|
|
|
|
2009-01-17 02:03:35 +01:00
|
|
|
/* We probably want to have different properties later on here */
|
2009-01-15 18:29:16 +01:00
|
|
|
unsigned n_sinks;
|
|
|
|
|
unsigned n_sources;
|
|
|
|
|
|
|
|
|
|
unsigned max_sink_channels;
|
|
|
|
|
unsigned max_source_channels;
|
2009-01-17 02:03:35 +01:00
|
|
|
|
|
|
|
|
/* .. followed by some implementation specific data */
|
2009-01-15 23:44:46 +01:00
|
|
|
} pa_card_profile;
|
2009-01-15 18:29:16 +01:00
|
|
|
|
2009-01-17 02:03:35 +01:00
|
|
|
#define PA_CARD_PROFILE_DATA(d) ((void*) ((uint8_t*) d + PA_ALIGN(sizeof(pa_card_profile))))
|
|
|
|
|
|
2009-01-15 18:29:16 +01:00
|
|
|
struct pa_card {
|
|
|
|
|
uint32_t index;
|
|
|
|
|
pa_core *core;
|
|
|
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
|
|
pa_proplist *proplist;
|
|
|
|
|
pa_module *module;
|
|
|
|
|
char *driver;
|
|
|
|
|
|
|
|
|
|
pa_idxset *sinks;
|
|
|
|
|
pa_idxset *sources;
|
|
|
|
|
|
2009-01-15 23:44:46 +01:00
|
|
|
pa_hashmap *profiles;
|
|
|
|
|
pa_card_profile *active_profile;
|
2009-01-15 18:29:16 +01:00
|
|
|
|
|
|
|
|
void *userdata;
|
|
|
|
|
|
2009-01-15 23:44:46 +01:00
|
|
|
int (*set_profile)(pa_card *c, pa_card_profile *profile);
|
2009-01-15 18:29:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef struct pa_card_new_data {
|
|
|
|
|
char *name;
|
2009-01-17 02:03:35 +01:00
|
|
|
char *description;
|
2009-01-15 18:29:16 +01:00
|
|
|
|
|
|
|
|
pa_proplist *proplist;
|
|
|
|
|
const char *driver;
|
|
|
|
|
pa_module *module;
|
|
|
|
|
|
2009-01-15 23:44:46 +01:00
|
|
|
pa_hashmap *profiles;
|
2009-01-21 02:46:36 +01:00
|
|
|
char *active_profile;
|
2009-01-15 18:29:16 +01:00
|
|
|
|
|
|
|
|
pa_bool_t namereg_fail:1;
|
|
|
|
|
} pa_card_new_data;
|
|
|
|
|
|
2009-01-17 02:03:35 +01:00
|
|
|
pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra);
|
2009-01-15 23:44:46 +01:00
|
|
|
void pa_card_profile_free(pa_card_profile *c);
|
2009-01-15 18:29:16 +01:00
|
|
|
|
|
|
|
|
pa_card_new_data *pa_card_new_data_init(pa_card_new_data *data);
|
|
|
|
|
void pa_card_new_data_set_name(pa_card_new_data *data, const char *name);
|
2009-01-21 02:46:36 +01:00
|
|
|
void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile);
|
2009-01-15 18:29:16 +01:00
|
|
|
void pa_card_new_data_done(pa_card_new_data *data);
|
|
|
|
|
|
|
|
|
|
pa_card *pa_card_new(pa_core *c, pa_card_new_data *data);
|
|
|
|
|
void pa_card_free(pa_card *c);
|
|
|
|
|
|
2009-01-15 23:44:46 +01:00
|
|
|
int pa_card_set_profile(pa_card *c, const char *name);
|
2009-01-15 18:29:16 +01:00
|
|
|
|
2009-01-22 00:17:11 +01:00
|
|
|
int pa_card_suspend(pa_card *c, pa_bool_t suspend);
|
|
|
|
|
|
2009-01-15 18:29:16 +01:00
|
|
|
#endif
|