|
#define | _GNU_SOURCE /* exp10() */ |
|
#define | ALSA_DEFAULT_CARD "(default)" |
|
#define | ALSA_DEFAULT_HCTL "default" |
|
#define | ALSA_ERR(err, ...) alsa_log_msg(LOG_ERROR, NULL, snd_strerror(err), __VA_ARGS__) |
|
#define | ALSA_CARD_DEBUG(card, ...) alsa_log_msg(LOG_DEBUG, card, NULL, __VA_ARGS__) |
|
#define | ALSA_CARD_WARN(card, ...) alsa_log_msg(LOG_WARN, card, NULL, __VA_ARGS__) |
|
#define | ALSA_CARD_ERR(card, err, ...) alsa_log_msg(LOG_ERROR, card, snd_strerror(err), __VA_ARGS__) |
|
#define | MAX_LINEAR_DB_SCALE 24 |
|
|
static void | alsa_log_msg (enum log_level level, const char *card, const char *strerr, const char *format,...) |
|
static gboolean | use_linear_dB_scale (long db_min, long db_max) |
|
static long | lrint_dir (double x, int dir) |
|
static const char * | elem_get_name (snd_mixer_elem_t *elem) |
|
static double | elem_get_volume (const char *hctl, snd_mixer_elem_t *elem, double *volume) |
|
static gboolean | elem_set_volume (const char *hctl, snd_mixer_elem_t *elem, double volume, int dir) |
|
static gboolean | elem_get_volume_normalized (const char *hctl, snd_mixer_elem_t *elem, double *volume) |
|
static gboolean | elem_set_volume_normalized (const char *hctl, snd_mixer_elem_t *elem, double volume, int dir) |
|
static gboolean | elem_has_mute (G_GNUC_UNUSED const char *hctl, snd_mixer_elem_t *elem) |
|
static gboolean | elem_get_mute (const char *hctl, snd_mixer_elem_t *elem, gboolean *muted) |
|
static gboolean | elem_set_mute (const char *hctl, snd_mixer_elem_t *elem, gboolean mute) |
|
static struct pollfd * | mixer_get_poll_descriptors (const char *hctl, snd_mixer_t *mixer) |
|
static GSList * | mixer_list_playable (G_GNUC_UNUSED const char *hctl, snd_mixer_t *mixer) |
|
static gboolean | mixer_is_playable (const char *hctl, snd_mixer_t *mixer) |
|
static snd_mixer_elem_t * | mixer_get_playable_elem (const char *hctl, snd_mixer_t *mixer, const char *channel) |
|
static snd_mixer_elem_t * | mixer_get_first_playable_elem (const char *hctl, snd_mixer_t *mixer) |
|
static void | mixer_close (const char *hctl, snd_mixer_t *mixer) |
|
static snd_mixer_t * | mixer_open (const char *hctl) |
|
static void | alsa_card_iter_free (AlsaCardIter *iter) |
|
static AlsaCardIter * | alsa_card_iter_new (void) |
|
static gboolean | alsa_card_iter_loop (AlsaCardIter *iter) |
|
static guint * | watch_poll_descriptors (const char *hctl, struct pollfd *pollfds, GIOFunc func, gpointer data) |
|
static void | unwatch_poll_descriptors (guint *watch_ids) |
|
static gboolean | poll_watch_cb (GIOChannel *source, GIOCondition condition, AlsaCard *card) |
|
const char * | alsa_card_get_name (AlsaCard *card) |
|
const char * | alsa_card_get_channel (AlsaCard *card) |
|
gboolean | alsa_card_has_mute (AlsaCard *card) |
|
gboolean | alsa_card_is_muted (AlsaCard *card) |
|
void | alsa_card_toggle_mute (AlsaCard *card) |
|
gdouble | alsa_card_get_volume (AlsaCard *card) |
|
void | alsa_card_set_volume (AlsaCard *card, gdouble value, int dir) |
|
void | alsa_card_install_callback (AlsaCard *card, AlsaCb callback, gpointer user_data) |
|
void | alsa_card_free (AlsaCard *card) |
|
AlsaCard * | alsa_card_new (const char *card_name, const char *channel, gboolean normalize) |
|
GSList * | alsa_list_cards (void) |
|
GSList * | alsa_list_channels (const char *card_name) |
|
Alsa audio subsystem.
Alsa audio subsystem. All the alsa-related code is enclosed in here, and this is the only file that uses the alsa library. This is the lowest-level part of PNMixer, that's why it doesn't include any other local headers. If you do so, it probably means that you're starting messing up the code, so think twice.
Definition in file alsa.c.
AlsaCard* alsa_card_new |
( |
const char * |
card_name, |
|
|
const char * |
channel, |
|
|
gboolean |
normalize |
|
) |
| |
Create a new Card instance. Look for the selected card among the available cards. If found, open it, and look for the selected channel. If found, all is well, the card is ready to be used. Otherwise, NULL is returned.
- Parameters
-
card_name | the name of the card, or NULL to use the default card. |
channel | the name of the channel, or NULL to use the first playable channel. |
normalize | whether we use normalized volume or not. |
- Returns
- a newly allocated Card instance, or NULL on failure.
Definition at line 891 of file alsa.c.