]> code.delx.au - pulseaudio/blobdiff - src/pulse/volume.c
add new PA_SINK_CAN_SUSPEND/PA_SOURCE_CAN_SUSPEND flag
[pulseaudio] / src / pulse / volume.c
index 530814e0fc2203b976380486f009bbd1fee3c663..8bba834d5bd833e5ae35764c9b6e16a8d6b4734a 100644 (file)
@@ -2,17 +2,19 @@
 
 /***
   This file is part of PulseAudio.
+
+  Copyright 2004-2006 Lennart Poettering
+
   PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published
   by the Free Software Foundation; either version 2 of the License,
   or (at your option) any later version.
+
   PulseAudio is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.
+
   You should have received a copy of the GNU Lesser General Public License
   along with PulseAudio; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -27,6 +29,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <pulsecore/core-util.h>
 #include "volume.h"
 
 int pa_cvolume_equal(const pa_cvolume *a, const pa_cvolume *b) {
@@ -36,7 +39,7 @@ int pa_cvolume_equal(const pa_cvolume *a, const pa_cvolume *b) {
 
     if (a->channels != b->channels)
         return 0;
-    
+
     for (i = 0; i < a->channels; i++)
         if (a->values[i] != b->values[i])
             return 0;
@@ -46,7 +49,7 @@ int pa_cvolume_equal(const pa_cvolume *a, const pa_cvolume *b) {
 
 pa_cvolume* pa_cvolume_set(pa_cvolume *a, unsigned channels, pa_volume_t v) {
     int i;
-    
+
     assert(a);
     assert(channels > 0);
     assert(channels <= PA_CHANNELS_MAX);
@@ -115,7 +118,7 @@ char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c) {
     unsigned channel;
     int first = 1;
     char *e;
-    
+
     assert(s);
     assert(l > 0);
     assert(c);
@@ -123,7 +126,7 @@ char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c) {
     *(e = s) = 0;
 
     for (channel = 0; channel < c->channels && l > 1; channel++) {
-        l -= snprintf(e, l, "%s%u: %3u%%",
+        l -= pa_snprintf(e, l, "%s%u: %3u%%",
                       first ? "" : " ",
                       channel,
                       (c->values[channel]*100)/PA_VOLUME_NORM);
@@ -149,7 +152,7 @@ int pa_cvolume_channels_equal_to(const pa_cvolume *a, pa_volume_t v) {
 
 pa_cvolume *pa_sw_cvolume_multiply(pa_cvolume *dest, const pa_cvolume *a, const pa_cvolume *b) {
     unsigned i;
-    
+
     assert(dest);
     assert(a);
     assert(b);