#include <pulsecore/module.h>
#include <pulsecore/idxset.h>
+/* This enum replaces pa_port_available_t (defined in pulse/def.h) for
+ * internal use, so make sure both enum types stay in sync. */
+typedef enum pa_available {
+ PA_AVAILABLE_UNKNOWN = 0,
+ PA_AVAILABLE_NO = 1,
+ PA_AVAILABLE_YES = 2,
+} pa_available_t;
+
typedef struct pa_card_profile {
+ pa_card *card;
char *name;
char *description;
unsigned priority;
+ pa_available_t available; /* PA_AVAILABLE_UNKNOWN, PA_AVAILABLE_NO or PA_AVAILABLE_YES */
/* We probably want to have different properties later on here */
unsigned n_sinks;
pa_hashmap *profiles;
pa_card_profile *active_profile;
+ pa_hashmap *ports;
+
+ bool save_profile:1;
+
void *userdata;
int (*set_profile)(pa_card *c, pa_card_profile *profile);
typedef struct pa_card_new_data {
char *name;
- char *description;
-
pa_proplist *proplist;
+
const char *driver;
pa_module *module;
pa_hashmap *profiles;
char *active_profile;
- pa_bool_t namereg_fail:1;
+ pa_hashmap *ports;
+
+ bool namereg_fail:1;
+
+ bool save_profile:1;
} pa_card_new_data;
pa_card_profile *pa_card_profile_new(const char *name, const char *description, size_t extra);
void pa_card_profile_free(pa_card_profile *c);
+/* The profile's available status has changed */
+void pa_card_profile_set_available(pa_card_profile *c, pa_available_t available);
+
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);
void pa_card_new_data_set_profile(pa_card_new_data *data, const char *profile);
pa_card *pa_card_new(pa_core *c, pa_card_new_data *data);
void pa_card_free(pa_card *c);
-int pa_card_set_profile(pa_card *c, const char *name);
+void pa_card_add_profile(pa_card *c, pa_card_profile *profile);
+
+int pa_card_set_profile(pa_card *c, pa_card_profile *profile, bool save);
-int pa_card_suspend(pa_card *c, pa_bool_t suspend);
+int pa_card_suspend(pa_card *c, bool suspend, pa_suspend_cause_t cause);
#endif