mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-16 08:56:42 -05:00
Mixer enhancements..
This commit is contained in:
parent
05498059c3
commit
0a512c7d25
2 changed files with 27 additions and 2 deletions
|
|
@ -30,6 +30,8 @@ int snd_mixer_group(snd_mixer_t *handle, snd_mixer_group_t * group);
|
||||||
int snd_mixer_element_info(snd_mixer_t *handle, snd_mixer_element_info_t * info);
|
int snd_mixer_element_info(snd_mixer_t *handle, snd_mixer_element_info_t * info);
|
||||||
int snd_mixer_element_read(snd_mixer_t *handle, snd_mixer_element_t * element);
|
int snd_mixer_element_read(snd_mixer_t *handle, snd_mixer_element_t * element);
|
||||||
int snd_mixer_element_write(snd_mixer_t *handle, snd_mixer_element_t * element);
|
int snd_mixer_element_write(snd_mixer_t *handle, snd_mixer_element_t * element);
|
||||||
|
int snd_mixer_channel_read(snd_mixer_t *handle, snd_mixer_channels_t * channels);
|
||||||
|
int snd_mixer_channel_write(snd_mixer_t *handle, snd_mixer_channels_t * channels);
|
||||||
int snd_mixer_read(snd_mixer_t *handle, snd_mixer_callbacks_t * callbacks);
|
int snd_mixer_read(snd_mixer_t *handle, snd_mixer_callbacks_t * callbacks);
|
||||||
|
|
||||||
void snd_mixer_set_bit(unsigned int *bitmap, int bit, int val);
|
void snd_mixer_set_bit(unsigned int *bitmap, int bit, int val);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
#include "asoundlib.h"
|
#include "asoundlib.h"
|
||||||
|
|
||||||
#define SND_FILE_MIXER "/dev/snd/mixerC%iD%i"
|
#define SND_FILE_MIXER "/dev/snd/mixerC%iD%i"
|
||||||
#define SND_MIXER_VERSION_MAX SND_PROTOCOL_VERSION(2, 0, 0)
|
#define SND_MIXER_VERSION_MAX SND_PROTOCOL_VERSION(2, 1, 0)
|
||||||
|
|
||||||
struct snd_mixer {
|
struct snd_mixer {
|
||||||
int card;
|
int card;
|
||||||
|
|
@ -168,7 +168,6 @@ int snd_mixer_element_info(snd_mixer_t *handle, snd_mixer_element_info_t * info)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int snd_mixer_element_read(snd_mixer_t *handle, snd_mixer_element_t * element)
|
int snd_mixer_element_read(snd_mixer_t *handle, snd_mixer_element_t * element)
|
||||||
{
|
{
|
||||||
snd_mixer_t *mixer;
|
snd_mixer_t *mixer;
|
||||||
|
|
@ -193,6 +192,30 @@ int snd_mixer_element_write(snd_mixer_t *handle, snd_mixer_element_t * element)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int snd_mixer_channel_read(snd_mixer_t *handle, snd_mixer_channels_t * channels)
|
||||||
|
{
|
||||||
|
snd_mixer_t *mixer;
|
||||||
|
|
||||||
|
mixer = handle;
|
||||||
|
if (!mixer)
|
||||||
|
return -EINVAL;
|
||||||
|
if (ioctl(mixer->fd, SND_MIXER_IOCTL_CHANNEL_READ, channels) < 0)
|
||||||
|
return -errno;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int snd_mixer_channel_write(snd_mixer_t *handle, snd_mixer_channels_t * channels)
|
||||||
|
{
|
||||||
|
snd_mixer_t *mixer;
|
||||||
|
|
||||||
|
mixer = handle;
|
||||||
|
if (!mixer)
|
||||||
|
return -EINVAL;
|
||||||
|
if (ioctl(mixer->fd, SND_MIXER_IOCTL_CHANNEL_WRITE, channels) < 0)
|
||||||
|
return -errno;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int snd_mixer_read(snd_mixer_t *handle, snd_mixer_callbacks_t * callbacks)
|
int snd_mixer_read(snd_mixer_t *handle, snd_mixer_callbacks_t * callbacks)
|
||||||
{
|
{
|
||||||
snd_mixer_t *mixer;
|
snd_mixer_t *mixer;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue