source: roaraudio/include/libroardsp/channels.h @ 3538:a5ca10905545

Last change on this file since 3538:a5ca10905545 was 3538:a5ca10905545, checked in by phi, 14 years ago

added function to init channel map list

File size: 4.2 KB
Line 
1//channels.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010
5 *
6 *  This file is part of libroar a part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  libroar is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22 *  Boston, MA 02110-1301, USA.
23 *
24 *  NOTE for everyone want's to change something and send patches:
25 *  read README and HACKING! There a addition information on
26 *  the license of this document you need to read before you send
27 *  any patches.
28 *
29 *  NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
30 *  or libpulse*:
31 *  The libs libroaresd, libroararts and libroarpulse link this lib
32 *  and are therefore GPL. Because of this it may be illigal to use
33 *  them with any software that uses libesd, libartsc or libpulse*.
34 */
35
36#ifndef _LIBROARDSP_CHANNELS_H_
37#define _LIBROARDSP_CHANNELS_H_
38
39#include "libroardsp.h"
40
41/* Channel map:
42 * Standard marix:
43 *
44 *       # Left       | Center       | Right       #
45 * ======#============#==============#=============#
46 * Front # FRONT_LEFT | FRONT_CENTER | FRONT_RIGHT #
47 *       # LEFT       | CENTER/MONO  | RIGHT       #
48 * ------#------------+--------------+-------------#
49 * Side  # SIDE_LEFT  | SIDE_CENTER$ | SIDE_RIGH   #
50 * ------#------------+--------------+-------------#
51 * Back  # BACK_LEFT  | BACK_CENTER  | BACK_RIGHT  #
52 * ======#============#==============#=============#
53 * $ = Side Center has null-vector possion and because of this
54 *     arg(Pos) is undefined. This means that the channel does
55 *     not have a defined phase and therefor does can not exist.
56 *     we include it just to have the matrix complet.
57 *
58 *
59 * Low Frequency Effects:
60 *
61 *  LFE is location independ.
62 *
63 *
64 * Mid-Side (MS):
65 *
66 * Mid   = Left + Right
67 * Side  = Left - Right
68 * Left  = (Mid + Side) / 2
69 * Right = (Mid - Side) / 2
70 *
71 */
72
73#define ROARDSP_CHAN_EOL                 -1
74#define ROARDSP_CHAN_NONE                 0
75#define ROARDSP_CHAN_FRONT_LEFT           1
76#define ROARDSP_CHAN_FRONT_RIGHT          2
77#define ROARDSP_CHAN_SIDE_LEFT            3
78#define ROARDSP_CHAN_SIDE_RIGHT           4
79#define ROARDSP_CHAN_BACK_LEFT            5
80#define ROARDSP_CHAN_BACK_RIGHT           6
81#define ROARDSP_CHAN_FRONT_CENTER         7
82#define ROARDSP_CHAN_SIDE_CENTER          8
83#define ROARDSP_CHAN_BACK_CENTER          9
84
85#define ROARDSP_CHAN_LEFT                 ROARDSP_CHAN_FRONT_LEFT
86#define ROARDSP_CHAN_RIGHT                ROARDSP_CHAN_FRONT_RIGHT
87#define ROARDSP_CHAN_CENTER               ROARDSP_CHAN_FRONT_CENTER
88#define ROARDSP_CHAN_MONO                 ROARDSP_CHAN_CENTER
89
90#define ROARDSP_CHAN_MS_MID               10
91#define ROARDSP_CHAN_MS_SIDE              11
92
93#define ROARDSP_CHAN_LFE                  12
94
95#define ROARDSP_CHANLIST_MAP_ROARAUDIO    0
96#define ROARDSP_CHANLIST_MAP_VORBIS       1
97#define ROARDSP_CHANLIST_MAP_FLAC         2
98#define ROARDSP_CHANLIST_MAP_RIFF_WAVE    3
99#define ROARDSP_CHANLIST_MAP_OSS          4
100#define ROARDSP_CHANLIST_MAP_ALSA         5
101#define ROARDSP_CHANLIST_MAP_ESD          6
102
103#define ROARDSP_CHANMAP_IN                0
104#define ROARDSP_CHANMAP_OUT               1
105#define ROARDSP_CHANMAP_MAP               2
106
107struct roardsp_chanmap {
108 char in [ROAR_MAX_CHANNELS];
109 char out[ROAR_MAX_CHANNELS];
110 char map[ROAR_MAX_CHANNELS];
111};
112
113char * roardsp_chan2str (int chan);
114int    roardsp_str2chan(char * str);
115
116int    roardsp_chanlist2str(char * list, size_t len, char * str, size_t strlen);
117
118int    roardsp_chanlist_init(char * list, int channels, int map);
119
120int roardsp_chanmap_calc(struct roardsp_chanmap * map, int what, int err_on_none);
121
122#endif
123
124//ll
Note: See TracBrowser for help on using the repository browser.