pulseaudio  14.2
About: PulseAudio is a networked sound server (for POSIX OSes), a proxy for your sound applications.
  Fossies Dox: pulseaudio-14.2.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

module-card-restore.c File Reference
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <pulse/gccmacro.h>
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
#include <pulse/rtclock.h>
#include <pulsecore/core-error.h>
#include <pulsecore/module.h>
#include <pulsecore/core-util.h>
#include <pulsecore/modargs.h>
#include <pulsecore/log.h>
#include <pulsecore/core-subscribe.h>
#include <pulsecore/card.h>
#include <pulsecore/namereg.h>
#include <pulsecore/database.h>
#include <pulsecore/tagstruct.h>
Include dependency graph for module-card-restore.c:

Go to the source code of this file.

Data Structures

struct  userdata
 
struct  port_info
 
struct  entry
 

Macros

#define SAVE_INTERVAL   (10 * PA_USEC_PER_SEC)
 
#define ENTRY_VERSION   4
 

Functions

 PA_MODULE_AUTHOR ("Lennart Poettering")
 This file is part of PulseAudio. More...
 
 PA_MODULE_DESCRIPTION ("Automatically restore profile of cards")
 
 PA_MODULE_VERSION (PACKAGE_VERSION)
 
 PA_MODULE_LOAD_ONCE (true)
 
 PA_MODULE_USAGE ("restore_bluetooth_profile=<boolean>")
 
static void save_time_callback (pa_mainloop_api *a, pa_time_event *e, const struct timeval *t, void *userdata)
 
static void trigger_save (struct userdata *u)
 
static void port_info_free (struct port_info *p_info)
 
static struct entryentry_new (void)
 
static struct port_infoport_info_new (pa_device_port *port)
 
static void entry_free (struct entry *e)
 
static struct entryentry_from_card (pa_card *card)
 
static bool entrys_equal (struct entry *a, struct entry *b)
 
static bool entry_write (struct userdata *u, const char *name, const struct entry *e)
 
static struct entryentry_read (struct userdata *u, const char *name)
 
static void show_full_info (pa_card *card)
 
static pa_hook_result_t card_put_hook_callback (pa_core *c, pa_card *card, struct userdata *u)
 
static void update_profile_for_port (struct entry *entry, pa_card *card, pa_device_port *p)
 
static pa_hook_result_t card_profile_changed_callback (pa_core *c, pa_card *card, struct userdata *u)
 
static pa_hook_result_t card_profile_added_callback (pa_core *c, pa_card_profile *profile, struct userdata *u)
 
static pa_hook_result_t port_offset_change_callback (pa_core *c, pa_device_port *port, struct userdata *u)
 
static pa_hook_result_t card_new_hook_callback (pa_core *c, pa_card_new_data *new_data, struct userdata *u)
 
static pa_hook_result_t card_choose_initial_profile_callback (pa_core *core, pa_card *card, struct userdata *u)
 
static pa_hook_result_t card_preferred_port_changed_callback (pa_core *core, pa_card_preferred_port_changed_hook_data *data, struct userdata *u)
 
int pa__init (pa_module *m)
 
void pa__done (pa_module *m)
 

Variables

static const char *const valid_modargs []
 

Macro Definition Documentation

◆ ENTRY_VERSION

#define ENTRY_VERSION   4

Definition at line 70 of file module-card-restore.c.

◆ SAVE_INTERVAL

#define SAVE_INTERVAL   (10 * PA_USEC_PER_SEC)

Definition at line 55 of file module-card-restore.c.

Function Documentation

◆ card_choose_initial_profile_callback()

◆ card_new_hook_callback()

◆ card_preferred_port_changed_callback()

◆ card_profile_added_callback()

static pa_hook_result_t card_profile_added_callback ( pa_core c,
pa_card_profile profile,
struct userdata u 
)
static

◆ card_profile_changed_callback()

◆ card_put_hook_callback()

static pa_hook_result_t card_put_hook_callback ( pa_core c,
pa_card card,
struct userdata u 
)
static

◆ entry_free()

◆ entry_from_card()

◆ entry_new()

static struct entry* entry_new ( void  )
static

◆ entry_read()

◆ entry_write()

◆ entrys_equal()

◆ pa__done()

◆ pa__init()

◆ PA_MODULE_AUTHOR()

PA_MODULE_AUTHOR ( "Lennart Poettering"  )

This file is part of PulseAudio.

Copyright 2006-2008 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 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, see http://www.gnu.org/licenses/.

◆ PA_MODULE_DESCRIPTION()

PA_MODULE_DESCRIPTION ( "Automatically restore profile of cards"  )

◆ PA_MODULE_LOAD_ONCE()

PA_MODULE_LOAD_ONCE ( true  )

◆ PA_MODULE_USAGE()

PA_MODULE_USAGE ( )

◆ PA_MODULE_VERSION()

PA_MODULE_VERSION ( PACKAGE_VERSION  )

◆ port_info_free()

static void port_info_free ( struct port_info p_info)
static

Definition at line 107 of file module-card-restore.c.

References port_info::name, pa_assert, pa_xfree(), and port_info::profile.

Referenced by entry_new().

◆ port_info_new()

◆ port_offset_change_callback()

◆ save_time_callback()

static void save_time_callback ( pa_mainloop_api a,
pa_time_event e,
const struct timeval *  t,
void *  userdata 
)
static

◆ show_full_info()

static void show_full_info ( pa_card card)
static

◆ trigger_save()

◆ update_profile_for_port()

Variable Documentation

◆ valid_modargs

const char* const valid_modargs[]
static
Initial value:
= {
"restore_bluetooth_profile",
NULL
}

Definition at line 57 of file module-card-restore.c.

Referenced by pa__init().