diff --git a/spa/include/spa/param/audio/volume.h b/spa/include/spa/param/audio/volume.h new file mode 100644 index 000000000..56df18064 --- /dev/null +++ b/spa/include/spa/param/audio/volume.h @@ -0,0 +1,29 @@ +/* Simple Plugin API */ +/* SPDX-FileCopyrightText: Copyright © 2026 Arun Raghavan */ +/* SPDX-License-Identifier: MIT */ + +#ifndef SPA_AUDIO_VOLUME_H +#define SPA_AUDIO_VOLUME_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** Flags for volume control capabilities */ +enum spa_audio_volume_control_flags { + SPA_AUDIO_VOLUME_CONTROL_NONE = 0, /**<< No flags */ + SPA_AUDIO_VOLUME_CONTROL_READ_VOLUME = (1 << 0), /**<< Volume value can be read */ + SPA_AUDIO_VOLUME_CONTROL_WRITE_VOLUME_VALUE = (1 << 1), /**<< Volume value can be set */ + SPA_AUDIO_VOLUME_CONTROL_WRITE_VOLUME_UPDOWN = (1 << 2), /**<< Volume value can incremented/decremented */ + SPA_AUDIO_VOLUME_CONTROL_READ_MUTE = (1 << 3), /**<< Mute state can be read */ + SPA_AUDIO_VOLUME_CONTROL_WRITE_MUTE_VALUE = (1 << 4), /**<< Mute state can be set */ + SPA_AUDIO_VOLUME_CONTROL_WRITE_MUTE_TOGGLE = (1 << 5), /**<< Mute state can be toggled */ + SPA_AUDIO_VOLUME_CONTROL_READ_BALANCE = (1 << 6), /**<< Per-channel volumes can be read */ + SPA_AUDIO_VOLUME_CONTROL_WRITE_BALANCE = (1 << 7), /**<< Per-channel volumes can be set */ +}; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* SPA_AUDIO_VOLUME_H */ diff --git a/spa/include/spa/param/props-types.h b/spa/include/spa/param/props-types.h index 15423a082..af8be1cc3 100644 --- a/spa/include/spa/param/props-types.h +++ b/spa/include/spa/param/props-types.h @@ -69,6 +69,7 @@ static const struct spa_type_info spa_type_props[] = { { SPA_PROP_volumeRampScale, SPA_TYPE_Id, SPA_TYPE_INFO_PROPS_BASE "volumeRampScale", spa_type_audio_volume_ramp_scale }, { SPA_PROP_volumeMin, SPA_TYPE_Float, SPA_TYPE_INFO_PROPS_BASE "volumeMin", NULL }, { SPA_PROP_volumeMax, SPA_TYPE_Float, SPA_TYPE_INFO_PROPS_BASE "volumeMax", NULL }, + { SPA_PROP_volumeControlFlags, SPA_TYPE_Int, SPA_TYPE_INFO_PROPS_BASE "volumeControlFlags", NULL }, { SPA_PROP_brightness, SPA_TYPE_Float, SPA_TYPE_INFO_PROPS_BASE "brightness", NULL }, { SPA_PROP_contrast, SPA_TYPE_Float, SPA_TYPE_INFO_PROPS_BASE "contrast", NULL }, diff --git a/spa/include/spa/param/props.h b/spa/include/spa/param/props.h index b78d6de17..cf373a1fe 100644 --- a/spa/include/spa/param/props.h +++ b/spa/include/spa/param/props.h @@ -102,6 +102,8 @@ enum spa_prop { * volume */ SPA_PROP_volumeMin, /**< the minimum volume */ SPA_PROP_volumeMax, /**< the maximum volume */ + SPA_PROP_volumeControlFlags, /**< Available volume control features + * (Id enum spa_audio_volume_control_flags) */ SPA_PROP_START_Video = 0x20000, /**< video related properties */ SPA_PROP_brightness,