~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/pulse/volume.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-05-05 14:18:20 UTC
  • mfrom: (1.2.4 upstream) (1.1.8 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090505141820-rrr2mtdd1jkllvr8
Tags: 1:0.9.15-1ubuntu1
* Merge from unreleased Debian pulseaudio git, remaining changes:
  - epoch (my stupid fault :S)
  - Don't build against, and create jack package. Jack is not in main
  - use linear resampler to work better with lack of PREEMPT in jaunty's
    -generic kernel config, also change buffer size
  - Add alsa configuration files to route alsa applications via pulseaudio
  - Move libasound2-plugins from Recommends to Depends
  - Add pm-utils sleep hook to suspend (and resume) users' pulseaudio
    daemons
  - patch to fix source/sink and suspend-on-idle race
  - Make initscript more informative in the default case of per-user
    sessions
  - create /var/run/pulse, and make restart more robust
  - add status check for system wide pulseaudio instance
  - LSB {Required-*,Should-*} should specify hal instead of dbus,
    since hal is required (and already requires dbus)
  - indicate that the system pulseaudio instance is being started from the init
    script
  - Install more upstream man pages
  - Link to pacat for parec man page
  - check whether pulseaudio is running before preloading the padsp library
  - Add DEB_OPT_FLAG = -O3 as per recommendation from
    pulseaudio-discuss/2007-December/001017.html
  - cache /usr/share/sounds/ubuntu/stereo/ wav files on pulseaudio load
  - disable glitch free (use tsched=0)
  - Generate a PO template on build
  - add special case to disable pulseaudio loading if accessibility/speech
    is being used
  - the sd wrapper script should not load pulseaudio if pulseaudio is being
    used as a system service
  - add a pulseaudio apport hook
  - fix some typos in README.Debian
  - demote paprefs to suggests
  - drop padevchooser(Recommends) and pavucontrol (Suggests)
  - drop libasyncns-dev build dependency, its in universe
* add libudev-dev as a build-dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
  PulseAudio is free software; you can redistribute it and/or modify
11
11
  it under the terms of the GNU Lesser General Public License as published
12
 
  by the Free Software Foundation; either version 2 of the License,
 
12
  by the Free Software Foundation; either version 2.1 of the License,
13
13
  or (at your option) any later version.
14
14
 
15
15
  PulseAudio is distributed in the hope that it will be useful, but
24
24
***/
25
25
 
26
26
#include <inttypes.h>
 
27
#include <limits.h>
27
28
 
28
29
#include <pulse/cdecl.h>
29
30
#include <pulse/gccmacro.h>
30
31
#include <pulse/sample.h>
31
32
#include <pulse/channelmap.h>
 
33
#include <pulse/version.h>
32
34
 
33
35
/** \page volume Volume Control
34
36
 *
101
103
 * > PA_VOLUME_NORM: increased volume */
102
104
typedef uint32_t pa_volume_t;
103
105
 
104
 
/** Normal volume (100%) */
 
106
/** Normal volume (100%, 0 dB) */
105
107
#define PA_VOLUME_NORM ((pa_volume_t) 0x10000U)
106
108
 
107
 
/** Muted volume (0%) */
 
109
/** Muted volume (0%, -inf dB) */
108
110
#define PA_VOLUME_MUTED ((pa_volume_t) 0U)
109
111
 
 
112
/** Maximum volume we can store. \since 0.9.15 */
 
113
#define PA_VOLUME_MAX ((pa_volume_t) UINT32_MAX)
 
114
 
110
115
/** A structure encapsulating a per-channel volume */
111
116
typedef struct pa_cvolume {
112
117
    uint8_t channels;                     /**< Number of channels */
150
155
/** Pretty print a volume structure but show dB values. \since 0.9.13 */
151
156
char *pa_sw_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c);
152
157
 
 
158
/** Maximum length of the strings returned by
 
159
 * pa_volume_snprint(). Please note that this value can change with
 
160
 * any release without warning and without being considered API or ABI
 
161
 * breakage. You should not use this definition anywhere where it
 
162
 * might become part of an ABI. \since 0.9.15 */
 
163
#define PA_VOLUME_SNPRINT_MAX 10
 
164
 
 
165
/** Pretty print a volume \since 0.9.15 */
 
166
char *pa_volume_snprint(char *s, size_t l, pa_volume_t v);
 
167
 
 
168
/** Maximum length of the strings returned by
 
169
 * pa_volume_snprint_dB(). Please note that this value can change with
 
170
 * any release without warning and without being considered API or ABI
 
171
 * breakage. You should not use this definition anywhere where it
 
172
 * might become part of an ABI. \since 0.9.15 */
 
173
#define PA_SW_VOLUME_SNPRINT_DB_MAX 10
 
174
 
 
175
/** Pretty print a volume but show dB values. \since 0.9.15 */
 
176
char *pa_sw_volume_snprint_dB(char *s, size_t l, pa_volume_t v);
 
177
 
153
178
/** Return the average volume of all channels */
154
179
pa_volume_t pa_cvolume_avg(const pa_cvolume *a) PA_GCC_PURE;
155
180
 
207
232
#endif
208
233
 
209
234
/** Remap a volume from one channel mapping to a different channel mapping. \since 0.9.12 */
210
 
pa_cvolume *pa_cvolume_remap(pa_cvolume *v, pa_channel_map *from, pa_channel_map *to);
 
235
pa_cvolume *pa_cvolume_remap(pa_cvolume *v, const pa_channel_map *from, const pa_channel_map *to);
211
236
 
212
 
/** Return non-zero if the specified volume is compatible with
213
 
 * the specified sample spec. \since 0.9.13 */
 
237
/** Return non-zero if the specified volume is compatible with the
 
238
 * specified sample spec. \since 0.9.13 */
214
239
int pa_cvolume_compatible(const pa_cvolume *v, const pa_sample_spec *ss) PA_GCC_PURE;
215
240
 
 
241
/** Return non-zero if the specified volume is compatible with the
 
242
 * specified sample spec. \since 0.9.15 */
 
243
int pa_cvolume_compatible_with_channel_map(const pa_cvolume *v, const pa_channel_map *cm) PA_GCC_PURE;
 
244
 
 
245
/** Calculate a 'balance' value for the specified volume with the
 
246
 * specified channel map. The return value will range from -1.0f
 
247
 * (left) to +1.0f (right). If no balance value is applicable to this
 
248
 * channel map the return value will always be 0.0f. See
 
249
 * pa_channel_map_can_balance(). \since 0.9.15 */
 
250
float pa_cvolume_get_balance(const pa_cvolume *v, const pa_channel_map *map) PA_GCC_PURE;
 
251
 
 
252
/** Adjust the 'balance' value for the specified volume with the
 
253
 * specified channel map. v will be modified in place and
 
254
 * returned. The balance is a value between -1.0f and +1.0f. This
 
255
 * operation might not be reversible! Also, after this call
 
256
 * pa_cvolume_get_balance() is not guaranteed to actually return the
 
257
 * requested balance value (e.g. when the input volume was zero anyway for
 
258
 * all channels). If no balance value is applicable to
 
259
 * this channel map the volume will not be modified. See
 
260
 * pa_channel_map_can_balance(). \since 0.9.15 */
 
261
pa_cvolume* pa_cvolume_set_balance(pa_cvolume *v, const pa_channel_map *map, float new_balance);
 
262
 
 
263
/** Calculate a 'fade' value (i.e. 'balance' between front and rear)
 
264
 * for the specified volume with the specified channel map. The return
 
265
 * value will range from -1.0f (rear) to +1.0f (left). If no fade
 
266
 * value is applicable to this channel map the return value will
 
267
 * always be 0.0f. See pa_channel_map_can_fade(). \since 0.9.15 */
 
268
float pa_cvolume_get_fade(const pa_cvolume *v, const pa_channel_map *map) PA_GCC_PURE;
 
269
 
 
270
/** Adjust the 'fade' value (i.e. 'balance' between front and rear)
 
271
 * for the specified volume with the specified channel map. v will be
 
272
 * modified in place and returned. The balance is a value between
 
273
 * -1.0f and +1.0f. This operation might not be reversible! Also,
 
274
 * after this call pa_cvolume_get_fade() is not guaranteed to actually
 
275
 * return the requested fade value (e.g. when the input volume was
 
276
 * zero anyway for all channels). If no fade value is applicable to
 
277
 * this channel map the volume will not be modified. See
 
278
 * pa_channel_map_can_fade(). \since 0.9.15 */
 
279
pa_cvolume* pa_cvolume_set_fade(pa_cvolume *v, const pa_channel_map *map, float new_fade);
 
280
 
 
281
/** Scale the passed pa_cvolume structure so that the maximum volume
 
282
 * of all channels equals max. The proportions between the channel
 
283
 * volumes are kept. \since 0.9.15 */
 
284
pa_cvolume* pa_cvolume_scale(pa_cvolume *v, pa_volume_t max);
 
285
 
216
286
PA_C_DECL_END
217
287
 
218
288
#endif