2004-06-08 23:54:24 +00:00
|
|
|
#ifndef foosourcehfoo
|
|
|
|
|
#define foosourcehfoo
|
|
|
|
|
|
2004-07-16 19:56:36 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
|
|
/***
|
2006-06-19 21:53:48 +00:00
|
|
|
This file is part of PulseAudio.
|
2004-07-16 19:56:36 +00:00
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is free software; you can redistribute it and/or modify
|
2004-11-14 14:58:54 +00:00
|
|
|
it under the terms of the GNU Lesser General Public License as published
|
2004-07-16 19:56:36 +00:00
|
|
|
by the Free Software Foundation; either version 2 of the License,
|
|
|
|
|
or (at your option) any later version.
|
|
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
PulseAudio is distributed in the hope that it will be useful, but
|
2004-07-16 19:56:36 +00:00
|
|
|
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.
|
|
|
|
|
|
2004-11-14 14:58:54 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2006-06-19 21:53:48 +00:00
|
|
|
along with PulseAudio; if not, write to the Free Software
|
2004-07-16 19:56:36 +00:00
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
|
USA.
|
|
|
|
|
***/
|
|
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
typedef struct pa_source pa_source;
|
2004-06-08 23:54:24 +00:00
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
2006-02-17 12:10:58 +00:00
|
|
|
|
2006-06-19 21:53:48 +00:00
|
|
|
#include <pulse/sample.h>
|
|
|
|
|
#include <pulse/channelmap.h>
|
|
|
|
|
#include <pulse/volume.h>
|
|
|
|
|
#include <pulsecore/core-def.h>
|
|
|
|
|
#include <pulsecore/core.h>
|
|
|
|
|
#include <pulsecore/idxset.h>
|
|
|
|
|
#include <pulsecore/memblock.h>
|
|
|
|
|
#include <pulsecore/memchunk.h>
|
|
|
|
|
#include <pulsecore/sink.h>
|
|
|
|
|
#include <pulsecore/module.h>
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-09-01 15:00:44 +00:00
|
|
|
#define PA_MAX_OUTPUTS_PER_SOURCE 16
|
|
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
typedef enum pa_source_state {
|
2004-09-14 20:53:25 +00:00
|
|
|
PA_SOURCE_RUNNING,
|
2004-09-16 23:34:25 +00:00
|
|
|
PA_SOURCE_DISCONNECTED
|
2006-01-27 16:25:31 +00:00
|
|
|
} pa_source_state_t;
|
2004-09-14 20:53:25 +00:00
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
struct pa_source {
|
2004-09-14 20:53:25 +00:00
|
|
|
int ref;
|
2004-06-08 23:54:24 +00:00
|
|
|
uint32_t index;
|
2006-01-27 16:25:31 +00:00
|
|
|
pa_core *core;
|
|
|
|
|
pa_source_state_t state;
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2006-08-11 23:31:59 +00:00
|
|
|
char *name;
|
|
|
|
|
char *description, *driver; /* may be NULL */
|
|
|
|
|
|
|
|
|
|
pa_module *owner; /* may be NULL */
|
2006-01-27 16:25:31 +00:00
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
pa_sample_spec sample_spec;
|
2006-01-27 16:25:31 +00:00
|
|
|
pa_channel_map channel_map;
|
|
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
pa_idxset *outputs;
|
2006-08-11 23:31:59 +00:00
|
|
|
pa_sink *monitor_of; /* may be NULL */
|
2006-02-22 14:11:23 +00:00
|
|
|
|
|
|
|
|
pa_cvolume hw_volume, sw_volume;
|
2006-02-23 12:04:31 +00:00
|
|
|
int hw_muted, sw_muted;
|
2006-07-16 17:26:55 +00:00
|
|
|
|
|
|
|
|
int is_hardware;
|
2006-01-27 16:25:31 +00:00
|
|
|
|
2006-08-11 23:31:59 +00:00
|
|
|
void (*notify)(pa_source*source); /* may be NULL */
|
|
|
|
|
pa_usec_t (*get_latency)(pa_source *s); /* dito */
|
|
|
|
|
int (*set_hw_volume)(pa_source *s); /* dito */
|
|
|
|
|
int (*get_hw_volume)(pa_source *s); /* dito */
|
|
|
|
|
int (*set_hw_mute)(pa_source *s); /* dito */
|
|
|
|
|
int (*get_hw_mute)(pa_source *s); /* dito */
|
2006-01-27 16:25:31 +00:00
|
|
|
|
2004-06-08 23:54:24 +00:00
|
|
|
void *userdata;
|
|
|
|
|
};
|
|
|
|
|
|
2006-01-27 16:25:31 +00:00
|
|
|
pa_source* pa_source_new(
|
|
|
|
|
pa_core *core,
|
|
|
|
|
const char *driver,
|
|
|
|
|
const char *name,
|
|
|
|
|
int namereg_fail,
|
|
|
|
|
const pa_sample_spec *spec,
|
|
|
|
|
const pa_channel_map *map);
|
|
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
void pa_source_disconnect(pa_source *s);
|
|
|
|
|
void pa_source_unref(pa_source *s);
|
|
|
|
|
pa_source* pa_source_ref(pa_source *c);
|
2004-06-08 23:54:24 +00:00
|
|
|
|
|
|
|
|
/* Pass a new memory block to all output streams */
|
2006-01-11 01:17:39 +00:00
|
|
|
void pa_source_post(pa_source*s, const pa_memchunk *b);
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
void pa_source_notify(pa_source *s);
|
2004-06-15 17:05:03 +00:00
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
void pa_source_set_owner(pa_source *s, pa_module *m);
|
2004-07-10 20:56:38 +00:00
|
|
|
|
2006-01-11 01:17:39 +00:00
|
|
|
pa_usec_t pa_source_get_latency(pa_source *s);
|
2004-09-16 00:05:56 +00:00
|
|
|
|
2006-02-22 14:11:23 +00:00
|
|
|
void pa_source_set_volume(pa_source *source, pa_mixer_t m, const pa_cvolume *volume);
|
|
|
|
|
const pa_cvolume *pa_source_get_volume(pa_source *source, pa_mixer_t m);
|
2006-02-23 12:04:31 +00:00
|
|
|
void pa_source_set_mute(pa_source *source, pa_mixer_t m, int mute);
|
|
|
|
|
int pa_source_get_mute(pa_source *source, pa_mixer_t m);
|
2006-02-22 14:11:23 +00:00
|
|
|
|
2006-08-11 17:53:34 +00:00
|
|
|
void pa_source_set_description(pa_source *s, const char *description);
|
|
|
|
|
|
2006-08-12 16:50:58 +00:00
|
|
|
unsigned pa_source_used_by(pa_source *s);
|
2004-06-08 23:54:24 +00:00
|
|
|
#endif
|