2004-06-08 23:54:24 +00:00
|
|
|
#ifndef foosourcehfoo
|
|
|
|
|
#define foosourcehfoo
|
|
|
|
|
|
2004-07-16 19:56:36 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
This file is part of polypaudio.
|
|
|
|
|
|
|
|
|
|
polypaudio 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.
|
|
|
|
|
|
|
|
|
|
polypaudio 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.
|
|
|
|
|
|
2004-11-14 14:58:54 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2004-07-16 19:56:36 +00:00
|
|
|
along with polypaudio; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
|
USA.
|
|
|
|
|
***/
|
|
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
struct pa_source;
|
2004-06-08 23:54:24 +00:00
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
#include "core.h"
|
|
|
|
|
#include "sample.h"
|
|
|
|
|
#include "idxset.h"
|
|
|
|
|
#include "memblock.h"
|
2004-07-03 00:19:17 +00:00
|
|
|
#include "memchunk.h"
|
2004-07-04 17:40:15 +00:00
|
|
|
#include "sink.h"
|
2005-09-15 23:42:56 +00:00
|
|
|
#include "channelmap.h"
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-09-01 15:00:44 +00:00
|
|
|
#define PA_MAX_OUTPUTS_PER_SOURCE 16
|
|
|
|
|
|
2005-09-15 23:42:56 +00:00
|
|
|
typedef enum {
|
2004-09-14 20:53:25 +00:00
|
|
|
PA_SOURCE_RUNNING,
|
2004-09-16 23:34:25 +00:00
|
|
|
PA_SOURCE_DISCONNECTED
|
2005-09-15 23:42:56 +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;
|
2004-07-03 23:35:12 +00:00
|
|
|
struct pa_core *core;
|
2005-09-15 23:42:56 +00:00
|
|
|
pa_source_state_t state;
|
|
|
|
|
|
|
|
|
|
char *name, *description, *driver;
|
2004-06-23 23:17:30 +00:00
|
|
|
struct pa_sample_spec sample_spec;
|
2005-09-15 23:42:56 +00:00
|
|
|
struct pa_channel_map channel_map;
|
2004-07-03 23:35:12 +00:00
|
|
|
struct pa_idxset *outputs;
|
2004-07-04 17:40:15 +00:00
|
|
|
struct pa_sink *monitor_of;
|
2005-09-15 23:42:56 +00:00
|
|
|
struct pa_module *owner;
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
void (*notify)(struct pa_source*source);
|
2004-09-16 00:05:56 +00:00
|
|
|
pa_usec_t (*get_latency)(struct pa_source *s);
|
2005-09-15 23:42:56 +00:00
|
|
|
|
2004-06-08 23:54:24 +00:00
|
|
|
void *userdata;
|
|
|
|
|
};
|
|
|
|
|
|
2005-09-15 23:42:56 +00:00
|
|
|
struct pa_source* pa_source_new(
|
|
|
|
|
struct pa_core *core,
|
|
|
|
|
const char *name,
|
|
|
|
|
const char *driver,
|
|
|
|
|
int fail,
|
|
|
|
|
const struct pa_sample_spec *spec,
|
|
|
|
|
const struct pa_channel_map *map);
|
|
|
|
|
|
2004-09-14 20:53:25 +00:00
|
|
|
void pa_source_disconnect(struct pa_source *s);
|
|
|
|
|
void pa_source_unref(struct pa_source *s);
|
|
|
|
|
struct pa_source* pa_source_ref(struct pa_source *c);
|
2004-06-08 23:54:24 +00:00
|
|
|
|
|
|
|
|
/* Pass a new memory block to all output streams */
|
2004-09-29 17:38:45 +00:00
|
|
|
void pa_source_post(struct pa_source*s, const struct pa_memchunk *b);
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
void pa_source_notify(struct pa_source *s);
|
2004-06-15 17:05:03 +00:00
|
|
|
|
2004-07-10 20:56:38 +00:00
|
|
|
void pa_source_set_owner(struct pa_source *s, struct pa_module *m);
|
|
|
|
|
|
2004-09-16 00:05:56 +00:00
|
|
|
pa_usec_t pa_source_get_latency(struct pa_source *s);
|
|
|
|
|
|
2004-06-08 23:54:24 +00:00
|
|
|
#endif
|