mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-06 07:15:35 -04:00
spa: alsa: Add a mechanism for external volume control
Currently enabled at device creation and delegated to an external entity via a varlink protocol.
This commit is contained in:
parent
c1031bef1b
commit
283c091b71
9 changed files with 758 additions and 88 deletions
47
spa/plugins/alsa/acp/ext-volume.h
Normal file
47
spa/plugins/alsa/acp/ext-volume.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/* External Volume Control */
|
||||
/* SPDX-FileCopyrightText: Copyright © 2026 Arun Raghavan */
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#ifndef ACP_EXT_VOLUME_H
|
||||
#define ACP_EXT_VOLUME_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <spa/param/audio/volume.h>
|
||||
#include <spa/support/varlink.h>
|
||||
|
||||
typedef struct pa_cvolume pa_cvolume;
|
||||
|
||||
struct acp_card;
|
||||
|
||||
struct spa_acp_ext_volume {
|
||||
struct spa_varlink_client *client;
|
||||
struct spa_hook listener;
|
||||
|
||||
enum spa_audio_volume_control_flags flags;
|
||||
};
|
||||
|
||||
int spa_acp_ext_volume_init(struct spa_acp_ext_volume *ext_volume, struct spa_varlink *varlink,
|
||||
const char *path, const char *device, const char *route);
|
||||
|
||||
void spa_acp_ext_volume_destroy(struct spa_acp_ext_volume *ext_volume);
|
||||
|
||||
int spa_acp_ext_volume_read_volume(struct spa_acp_ext_volume *ext_volume,
|
||||
const char *device, const char *route, pa_cvolume *cvol);
|
||||
|
||||
int spa_acp_ext_volume_write_volume_absolute(struct spa_acp_ext_volume *ext_volume,
|
||||
const char *device, const char *route, pa_cvolume *cvol);
|
||||
|
||||
int spa_acp_ext_volume_write_volume_relative(struct spa_acp_ext_volume *ext_volume,
|
||||
const char *device, const char *route, float step);
|
||||
|
||||
int spa_acp_ext_volume_read_mute(struct spa_acp_ext_volume *ext_volume,
|
||||
const char *device, const char *route, bool *mute);
|
||||
|
||||
int spa_acp_ext_volume_write_mute_value(struct spa_acp_ext_volume *ext_volume,
|
||||
const char *device, const char *route, bool mute);
|
||||
|
||||
int spa_acp_ext_volume_write_mute_toggle(struct spa_acp_ext_volume *ext_volume,
|
||||
const char *device, const char *route);
|
||||
|
||||
#endif /* ACP_EXT_VOLUME_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue