Statistics
| Branch: | Revision:

root / audio / mixeng.h @ ea785922

History | View | Annotate | Download (2.1 kB)

1 85571bc7 bellard
/*
2 85571bc7 bellard
 * QEMU Mixing engine header
3 1d14ffa9 bellard
 *
4 1d14ffa9 bellard
 * Copyright (c) 2004-2005 Vassili Karpov (malc)
5 1d14ffa9 bellard
 *
6 85571bc7 bellard
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 85571bc7 bellard
 * of this software and associated documentation files (the "Software"), to deal
8 85571bc7 bellard
 * in the Software without restriction, including without limitation the rights
9 85571bc7 bellard
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 85571bc7 bellard
 * copies of the Software, and to permit persons to whom the Software is
11 85571bc7 bellard
 * furnished to do so, subject to the following conditions:
12 85571bc7 bellard
 *
13 85571bc7 bellard
 * The above copyright notice and this permission notice shall be included in
14 85571bc7 bellard
 * all copies or substantial portions of the Software.
15 85571bc7 bellard
 *
16 85571bc7 bellard
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 85571bc7 bellard
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 85571bc7 bellard
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 85571bc7 bellard
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 85571bc7 bellard
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 85571bc7 bellard
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 85571bc7 bellard
 * THE SOFTWARE.
23 85571bc7 bellard
 */
24 85571bc7 bellard
#ifndef QEMU_MIXENG_H
25 85571bc7 bellard
#define QEMU_MIXENG_H
26 85571bc7 bellard
27 1d14ffa9 bellard
#ifdef FLOAT_MIXENG
28 1d14ffa9 bellard
typedef float real_t;
29 1d14ffa9 bellard
typedef struct { int mute; real_t r; real_t l; } volume_t;
30 1d14ffa9 bellard
typedef struct { real_t l; real_t r; } st_sample_t;
31 1d14ffa9 bellard
#else
32 1d14ffa9 bellard
typedef struct { int mute; int64_t r; int64_t l; } volume_t;
33 85571bc7 bellard
typedef struct { int64_t l; int64_t r; } st_sample_t;
34 1d14ffa9 bellard
#endif
35 1d14ffa9 bellard
36 1d14ffa9 bellard
typedef void (t_sample) (st_sample_t *dst, const void *src,
37 1d14ffa9 bellard
                         int samples, volume_t *vol);
38 1d14ffa9 bellard
typedef void (f_sample) (void *dst, const st_sample_t *src, int samples);
39 85571bc7 bellard
40 1d14ffa9 bellard
extern t_sample *mixeng_conv[2][2][2][2];
41 1d14ffa9 bellard
extern f_sample *mixeng_clip[2][2][2][2];
42 85571bc7 bellard
43 85571bc7 bellard
void *st_rate_start (int inrate, int outrate);
44 85571bc7 bellard
void st_rate_flow (void *opaque, st_sample_t *ibuf, st_sample_t *obuf,
45 85571bc7 bellard
                   int *isamp, int *osamp);
46 1d14ffa9 bellard
void st_rate_flow_mix (void *opaque, st_sample_t *ibuf, st_sample_t *obuf,
47 1d14ffa9 bellard
                       int *isamp, int *osamp);
48 85571bc7 bellard
void st_rate_stop (void *opaque);
49 1d14ffa9 bellard
void mixeng_clear (st_sample_t *buf, int len);
50 85571bc7 bellard
51 85571bc7 bellard
#endif  /* mixeng.h */