2011-11-25 15:17:12 +01:00
|
|
|
#ifndef foopulsedeviceporthfoo
|
|
|
|
|
#define foopulsedeviceporthfoo
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
This file is part of PulseAudio.
|
|
|
|
|
|
|
|
|
|
Copyright 2004-2006 Lennart Poettering
|
|
|
|
|
Copyright 2006 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
|
|
|
|
Copyright 2011 David Henningsson, Canonical Ltd.
|
|
|
|
|
|
|
|
|
|
PulseAudio is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Lesser General Public License as published
|
|
|
|
|
by the Free Software Foundation; either version 2.1 of the License,
|
|
|
|
|
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.
|
|
|
|
|
***/
|
|
|
|
|
|
2011-11-27 17:16:53 +02:00
|
|
|
typedef struct pa_device_port pa_device_port;
|
2011-11-25 15:17:12 +01:00
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
|
|
#include <pulse/def.h>
|
|
|
|
|
#include <pulsecore/object.h>
|
|
|
|
|
#include <pulsecore/hashmap.h>
|
2011-11-27 17:16:53 +02:00
|
|
|
#include <pulsecore/core.h>
|
2013-01-17 20:55:14 +01:00
|
|
|
#include <pulsecore/card.h>
|
2011-11-25 15:17:12 +01:00
|
|
|
|
|
|
|
|
struct pa_device_port {
|
|
|
|
|
pa_object parent; /* Needed for reference counting */
|
2011-11-27 17:16:53 +02:00
|
|
|
pa_core *core;
|
2013-01-17 20:55:14 +01:00
|
|
|
pa_card *card;
|
2011-11-25 15:17:12 +01:00
|
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
char *description;
|
|
|
|
|
|
|
|
|
|
unsigned priority;
|
2013-02-18 16:13:24 +01:00
|
|
|
pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */
|
2011-11-25 15:17:12 +01:00
|
|
|
|
2011-12-02 13:34:54 +01:00
|
|
|
pa_proplist *proplist;
|
2012-06-08 19:00:14 +03:00
|
|
|
pa_hashmap *profiles; /* Does not own the profiles */
|
2012-06-29 18:04:59 +03:00
|
|
|
pa_direction_t direction;
|
2012-06-27 17:38:42 +02:00
|
|
|
int64_t latency_offset;
|
2011-11-25 15:17:13 +01:00
|
|
|
|
2011-11-25 15:17:12 +01:00
|
|
|
/* .. followed by some implementation specific data */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
PA_DECLARE_PUBLIC_CLASS(pa_device_port);
|
|
|
|
|
#define PA_DEVICE_PORT(s) (pa_device_port_cast(s))
|
|
|
|
|
|
|
|
|
|
#define PA_DEVICE_PORT_DATA(d) ((void*) ((uint8_t*) d + PA_ALIGN(sizeof(pa_device_port))))
|
|
|
|
|
|
2013-03-28 12:05:11 +01:00
|
|
|
typedef struct pa_device_port_new_data {
|
|
|
|
|
char *name;
|
|
|
|
|
char *description;
|
|
|
|
|
pa_available_t available;
|
|
|
|
|
pa_direction_t direction;
|
|
|
|
|
} pa_device_port_new_data;
|
|
|
|
|
|
|
|
|
|
pa_device_port_new_data *pa_device_port_new_data_init(pa_device_port_new_data *data);
|
|
|
|
|
void pa_device_port_new_data_set_name(pa_device_port_new_data *data, const char *name);
|
|
|
|
|
void pa_device_port_new_data_set_description(pa_device_port_new_data *data, const char *description);
|
|
|
|
|
void pa_device_port_new_data_set_available(pa_device_port_new_data *data, pa_available_t available);
|
|
|
|
|
void pa_device_port_new_data_set_direction(pa_device_port_new_data *data, pa_direction_t direction);
|
|
|
|
|
void pa_device_port_new_data_done(pa_device_port_new_data *data);
|
|
|
|
|
|
|
|
|
|
pa_device_port *pa_device_port_new(pa_core *c, pa_device_port_new_data *data, size_t extra);
|
2011-11-25 15:17:12 +01:00
|
|
|
|
2011-11-25 15:17:14 +01:00
|
|
|
/* The port's available status has changed */
|
2013-02-18 16:13:24 +01:00
|
|
|
void pa_device_port_set_available(pa_device_port *p, pa_available_t available);
|
2011-11-25 15:17:14 +01:00
|
|
|
|
2012-06-27 17:38:42 +02:00
|
|
|
void pa_device_port_set_latency_offset(pa_device_port *p, int64_t offset);
|
2012-06-22 20:55:53 +02:00
|
|
|
|
2014-03-21 10:19:19 +01:00
|
|
|
pa_device_port *pa_device_port_find_best(pa_hashmap *ports);
|
|
|
|
|
|
2011-11-25 15:17:12 +01:00
|
|
|
#endif
|