mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
control: Add UMP Endpoint and Block info query support
Add functions to query the UMP Endpoint and Block info via control interface. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
8bc10c83b1
commit
81b0cf46d1
6 changed files with 51 additions and 0 deletions
|
|
@ -418,6 +418,8 @@ int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device);
|
||||||
int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info);
|
int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info);
|
||||||
int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev);
|
int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev);
|
||||||
int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device);
|
int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device);
|
||||||
|
int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info);
|
||||||
|
int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info);
|
||||||
#endif
|
#endif
|
||||||
int snd_ctl_set_power_state(snd_ctl_t *ctl, unsigned int state);
|
int snd_ctl_set_power_state(snd_ctl_t *ctl, unsigned int state);
|
||||||
int snd_ctl_get_power_state(snd_ctl_t *ctl, unsigned int *state);
|
int snd_ctl_get_power_state(snd_ctl_t *ctl, unsigned int *state);
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,7 @@
|
||||||
#include "pcm.h"
|
#include "pcm.h"
|
||||||
#include "pcm_plugin.h"
|
#include "pcm_plugin.h"
|
||||||
#include "rawmidi.h"
|
#include "rawmidi.h"
|
||||||
|
#include "ump.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "hwdep.h"
|
#include "hwdep.h"
|
||||||
#include "control.h"
|
#include "control.h"
|
||||||
|
|
|
||||||
|
|
@ -154,4 +154,6 @@ ALSA_1.2.10 {
|
||||||
|
|
||||||
@SYMBOL_PREFIX@snd_ump_*;
|
@SYMBOL_PREFIX@snd_ump_*;
|
||||||
@SYMBOL_PREFIX@snd_ctl_ump_next_device;
|
@SYMBOL_PREFIX@snd_ctl_ump_next_device;
|
||||||
|
@SYMBOL_PREFIX@snd_ctl_ump_endpoint_info;
|
||||||
|
@SYMBOL_PREFIX@snd_ctl_ump_block_info;
|
||||||
} ALSA_1.2.9;
|
} ALSA_1.2.9;
|
||||||
|
|
|
||||||
|
|
@ -1281,6 +1281,30 @@ int snd_ctl_ump_next_device(snd_ctl_t *ctl, int *device)
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get UMP Endpoint info about a UMP RawMidi device
|
||||||
|
* \param ctl CTL handle
|
||||||
|
* \param info UMP Endpoint info pointer
|
||||||
|
* \return 0 on success otherwise a negative error code
|
||||||
|
*/
|
||||||
|
int snd_ctl_ump_endpoint_info(snd_ctl_t *ctl, snd_ump_endpoint_info_t *info)
|
||||||
|
{
|
||||||
|
assert(ctl && info);
|
||||||
|
return ctl->ops->ump_endpoint_info(ctl, info);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Get UMP Block info about a UMP RawMidi device
|
||||||
|
* \param ctl CTL handle
|
||||||
|
* \param info UMP Block info pointer
|
||||||
|
* \return 0 on success otherwise a negative error code
|
||||||
|
*/
|
||||||
|
int snd_ctl_ump_block_info(snd_ctl_t *ctl, snd_ump_block_info_t *info)
|
||||||
|
{
|
||||||
|
assert(ctl && info);
|
||||||
|
return ctl->ops->ump_block_info(ctl, info);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set Power State to given SND_CTL_POWER_* value and do the power management
|
* \brief Set Power State to given SND_CTL_POWER_* value and do the power management
|
||||||
* \param ctl CTL handle
|
* \param ctl CTL handle
|
||||||
|
|
|
||||||
|
|
@ -333,6 +333,24 @@ static int snd_ctl_hw_ump_next_device(snd_ctl_t *handle, int *device)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int snd_ctl_hw_ump_endpoint_info(snd_ctl_t *handle,
|
||||||
|
snd_ump_endpoint_info_t *info)
|
||||||
|
{
|
||||||
|
snd_ctl_hw_t *hw = handle->private_data;
|
||||||
|
if (ioctl(hw->fd, SNDRV_CTL_IOCTL_UMP_ENDPOINT_INFO, info) < 0)
|
||||||
|
return -errno;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int snd_ctl_hw_ump_block_info(snd_ctl_t *handle,
|
||||||
|
snd_ump_block_info_t *info)
|
||||||
|
{
|
||||||
|
snd_ctl_hw_t *hw = handle->private_data;
|
||||||
|
if (ioctl(hw->fd, SNDRV_CTL_IOCTL_UMP_BLOCK_INFO, info) < 0)
|
||||||
|
return -errno;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int snd_ctl_hw_set_power_state(snd_ctl_t *handle, unsigned int state)
|
static int snd_ctl_hw_set_power_state(snd_ctl_t *handle, unsigned int state)
|
||||||
{
|
{
|
||||||
snd_ctl_hw_t *hw = handle->private_data;
|
snd_ctl_hw_t *hw = handle->private_data;
|
||||||
|
|
@ -388,6 +406,8 @@ static const snd_ctl_ops_t snd_ctl_hw_ops = {
|
||||||
.rawmidi_info = snd_ctl_hw_rawmidi_info,
|
.rawmidi_info = snd_ctl_hw_rawmidi_info,
|
||||||
.rawmidi_prefer_subdevice = snd_ctl_hw_rawmidi_prefer_subdevice,
|
.rawmidi_prefer_subdevice = snd_ctl_hw_rawmidi_prefer_subdevice,
|
||||||
.ump_next_device = snd_ctl_hw_ump_next_device,
|
.ump_next_device = snd_ctl_hw_ump_next_device,
|
||||||
|
.ump_endpoint_info = snd_ctl_hw_ump_endpoint_info,
|
||||||
|
.ump_block_info = snd_ctl_hw_ump_block_info,
|
||||||
.set_power_state = snd_ctl_hw_set_power_state,
|
.set_power_state = snd_ctl_hw_set_power_state,
|
||||||
.get_power_state = snd_ctl_hw_get_power_state,
|
.get_power_state = snd_ctl_hw_get_power_state,
|
||||||
.read = snd_ctl_hw_read,
|
.read = snd_ctl_hw_read,
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,8 @@ typedef struct _snd_ctl_ops {
|
||||||
int (*rawmidi_info)(snd_ctl_t *handle, snd_rawmidi_info_t * info);
|
int (*rawmidi_info)(snd_ctl_t *handle, snd_rawmidi_info_t * info);
|
||||||
int (*rawmidi_prefer_subdevice)(snd_ctl_t *handle, int subdev);
|
int (*rawmidi_prefer_subdevice)(snd_ctl_t *handle, int subdev);
|
||||||
int (*ump_next_device)(snd_ctl_t *handle, int *device);
|
int (*ump_next_device)(snd_ctl_t *handle, int *device);
|
||||||
|
int (*ump_endpoint_info)(snd_ctl_t *handle, snd_ump_endpoint_info_t *info);
|
||||||
|
int (*ump_block_info)(snd_ctl_t *handle, snd_ump_block_info_t *info);
|
||||||
int (*set_power_state)(snd_ctl_t *handle, unsigned int state);
|
int (*set_power_state)(snd_ctl_t *handle, unsigned int state);
|
||||||
int (*get_power_state)(snd_ctl_t *handle, unsigned int *state);
|
int (*get_power_state)(snd_ctl_t *handle, unsigned int *state);
|
||||||
int (*read)(snd_ctl_t *handle, snd_ctl_event_t *event);
|
int (*read)(snd_ctl_t *handle, snd_ctl_event_t *event);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue