summaryrefslogtreecommitdiffstats
path: root/src/pulse/volume.h
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2010-10-09 22:30:20 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2010-10-15 01:10:00 +0530
commit1d2ef7923d28a74e08a4309b6fa3d36481d2df3b (patch)
tree50a611811a1408f682ff21500f3f679e429c327a /src/pulse/volume.h
parent4d84a00b495c44a9e348534bf754ace823c9abe8 (diff)
volume: Use a macro to check if a volume is valid
This adds a PA_VOLUME_IS_VALID() macro for checking if a given pa_volume_t is valid. This makes changes to the volume ranges simpler (just change PA_VOLUME_MAX, for example, without needing to modify any other code).
Diffstat (limited to 'src/pulse/volume.h')
-rw-r--r--src/pulse/volume.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pulse/volume.h b/src/pulse/volume.h
index 594cf91d..9ef26f13 100644
--- a/src/pulse/volume.h
+++ b/src/pulse/volume.h
@@ -118,6 +118,9 @@ typedef uint32_t pa_volume_t;
/** Special 'invalid' volume. \since 0.9.16 */
#define PA_VOLUME_INVALID ((pa_volume_t) UINT32_MAX)
+/** Check if volume is valid. \since 0.9.22 */
+#define PA_VOLUME_IS_VALID(v) ((v) <= PA_VOLUME_MAX)
+
/** A structure encapsulating a per-channel volume */
typedef struct pa_cvolume {
uint8_t channels; /**< Number of channels */