pipewire/spa/plugins/alsa/acp/ext-volume.h

48 lines
1.5 KiB
C
Raw Normal View History

/* 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 */