Header for alsa.c.
More...
#include <glib.h>
Go to the source code of this file.
Header for alsa.c.
Header for alsa.c.
Definition in file alsa.h.
◆ AlsaCard
◆ AlsaCb
typedef void(* AlsaCb) (enum alsa_event event, gpointer data) |
◆ alsa_event
Enumerator |
---|
ALSA_CARD_ERROR | |
ALSA_CARD_DISCONNECTED | |
ALSA_CARD_VALUES_CHANGED | |
Definition at line 30 of file alsa.h.
◆ alsa_card_free()
Free a card instance, therefore closing mixer and freeing any allocated ressources.
- Parameters
-
Definition at line 862 of file alsa.c.
◆ alsa_card_get_channel()
const char* alsa_card_get_channel |
( |
AlsaCard * |
card | ) |
|
Get the name of the channel. This is an internal string that shouldn't be modified.
- Parameters
-
- Returns
- the name of the channel.
Definition at line 750 of file alsa.c.
◆ alsa_card_get_name()
const char* alsa_card_get_name |
( |
AlsaCard * |
card | ) |
|
Get the name of the card. This is an internal string that shouldn't be modified.
- Parameters
-
- Returns
- the name of the card.
Definition at line 737 of file alsa.c.
◆ alsa_card_get_volume()
gdouble alsa_card_get_volume |
( |
AlsaCard * |
card | ) |
|
Get the volume in percent (value between 0 and 100).
- Parameters
-
- Returns
- the volume in percent.
Definition at line 804 of file alsa.c.
◆ alsa_card_has_mute()
gboolean alsa_card_has_mute |
( |
AlsaCard * |
card | ) |
|
Whether the card has mute capabilities.
- Parameters
-
- Returns
- TRUE if the card can be muted, FALSE otherwise.
Definition at line 762 of file alsa.c.
◆ alsa_card_install_callback()
void alsa_card_install_callback |
( |
AlsaCard * |
card, |
|
|
AlsaCb |
callback, |
|
|
gpointer |
user_data |
|
) |
| |
Set a callback invoked on volume/mute changes.
- Parameters
-
card | a Card instance. |
callback | the callback to be invoked. |
user_data | the user data passed to the callback. |
Definition at line 850 of file alsa.c.
◆ alsa_card_is_muted()
gboolean alsa_card_is_muted |
( |
AlsaCard * |
card | ) |
|
Get the mute state, either TRUE or FALSE.
- Parameters
-
- Returns
- TRUE if the card is muted, FALSE otherwise.
Definition at line 774 of file alsa.c.
◆ alsa_card_new()
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.
◆ alsa_card_set_volume()
void alsa_card_set_volume |
( |
AlsaCard * |
card, |
|
|
gdouble |
value, |
|
|
int |
dir |
|
) |
| |
Set the volume in percent (value between 0 and 100).
- Parameters
-
card | a Card instance. |
value | the volume in percent. |
dir | the direction of the volume change (-1: lowering, +1: raising, 0: setting). |
Definition at line 827 of file alsa.c.
◆ alsa_card_toggle_mute()
void alsa_card_toggle_mute |
( |
AlsaCard * |
card | ) |
|
Toggle the mute state.
- Parameters
-
Definition at line 788 of file alsa.c.
◆ alsa_list_cards()
GSList* alsa_list_cards |
( |
void |
| ) |
|
Return the list of playable cards as a GSList. Must be freed using g_slist_free_full() and g_free().
- Returns
- a list of playable cards.
Definition at line 966 of file alsa.c.
◆ alsa_list_channels()
GSList* alsa_list_channels |
( |
const char * |
card_name | ) |
|
For a given card name, return the list of playable channels as a GSList. Must be freed using g_slist_free_full() and g_free().
- Parameters
-
card_name | the name of the card for which we list the channels |
- Returns
- a list of playable channels.
Definition at line 1002 of file alsa.c.