[3325] | 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, 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
| 22 | * |
---|
| 23 | * NOTE for everyone want's to change something and send patches: |
---|
| 24 | * read README and HACKING! There a addition information on |
---|
| 25 | * the license of this document you need to read before you send |
---|
| 26 | * any patches. |
---|
| 27 | * |
---|
| 28 | * NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc |
---|
| 29 | * or libpulse*: |
---|
| 30 | * The libs libroaresd, libroararts and libroarpulse link this lib |
---|
| 31 | * and are therefore GPL. Because of this it may be illigal to use |
---|
| 32 | * them with any software that uses libesd, libartsc or libpulse*. |
---|
| 33 | */ |
---|
| 34 | |
---|
| 35 | #ifndef _LIBROARDSP_CHANNELS_H_ |
---|
| 36 | #define _LIBROARDSP_CHANNELS_H_ |
---|
| 37 | |
---|
| 38 | #include "libroardsp.h" |
---|
| 39 | |
---|
[3332] | 40 | /* Channel map: |
---|
| 41 | * Standard marix: |
---|
| 42 | * |
---|
| 43 | * # Left | Center | Right # |
---|
| 44 | * ======#============#==============#=============# |
---|
| 45 | * Front # FRONT_LEFT | FRONT_CENTER | FRONT_RIGHT # |
---|
| 46 | * # LEFT | CENTER/MONO | RIGHT # |
---|
| 47 | * ------#------------+--------------+-------------# |
---|
[3333] | 48 | * Side # SIDE_LEFT | SIDE_CENTER$ | SIDE_RIGH # |
---|
[3332] | 49 | * ------#------------+--------------+-------------# |
---|
| 50 | * Back # BACK_LEFT | BACK_CENTER | BACK_RIGHT # |
---|
| 51 | * ======#============#==============#=============# |
---|
[3333] | 52 | * $ = Side Center has null-vector possion and because of this |
---|
| 53 | * arg(Pos) is undefined. This means that the channel does |
---|
| 54 | * not have a defined phase and therefor does can not exist. |
---|
| 55 | * we include it just to have the matrix complet. |
---|
| 56 | * |
---|
[3332] | 57 | * |
---|
| 58 | * Low Frequency Effects: |
---|
| 59 | * |
---|
| 60 | * LFE is location independ. |
---|
| 61 | * |
---|
| 62 | * |
---|
| 63 | * Mid-Side (MS): |
---|
| 64 | * |
---|
| 65 | * Mid = Left + Right |
---|
| 66 | * Side = Left - Right |
---|
| 67 | * Left = (Mid + Side) / 2 |
---|
| 68 | * Right = (Mid - Side) / 2 |
---|
| 69 | * |
---|
| 70 | */ |
---|
| 71 | |
---|
[3328] | 72 | #define ROARDSP_CHAN_EOL -1 |
---|
[3326] | 73 | #define ROARDSP_CHAN_NONE 0 |
---|
| 74 | #define ROARDSP_CHAN_FRONT_LEFT 1 |
---|
| 75 | #define ROARDSP_CHAN_FRONT_RIGHT 2 |
---|
| 76 | #define ROARDSP_CHAN_SIDE_LEFT 3 |
---|
| 77 | #define ROARDSP_CHAN_SIDE_RIGHT 4 |
---|
| 78 | #define ROARDSP_CHAN_BACK_LEFT 5 |
---|
| 79 | #define ROARDSP_CHAN_BACK_RIGHT 6 |
---|
| 80 | #define ROARDSP_CHAN_FRONT_CENTER 7 |
---|
| 81 | #define ROARDSP_CHAN_SIDE_CENTER 8 |
---|
| 82 | #define ROARDSP_CHAN_BACK_CENTER 9 |
---|
| 83 | |
---|
| 84 | #define ROARDSP_CHAN_LEFT ROARDSP_CHAN_FRONT_LEFT |
---|
| 85 | #define ROARDSP_CHAN_RIGHT ROARDSP_CHAN_FRONT_RIGHT |
---|
| 86 | #define ROARDSP_CHAN_CENTER ROARDSP_CHAN_FRONT_CENTER |
---|
| 87 | #define ROARDSP_CHAN_MONO ROARDSP_CHAN_CENTER |
---|
| 88 | |
---|
| 89 | #define ROARDSP_CHAN_MS_MID 10 |
---|
| 90 | #define ROARDSP_CHAN_MS_SIDE 11 |
---|
| 91 | |
---|
| 92 | #define ROARDSP_CHAN_LFE 12 |
---|
| 93 | |
---|
[3329] | 94 | #define ROARDSP_CHANMAP_IN 0 |
---|
| 95 | #define ROARDSP_CHANMAP_OUT 1 |
---|
| 96 | #define ROARDSP_CHANMAP_MAP 2 |
---|
| 97 | |
---|
| 98 | struct roardsp_chanmap { |
---|
| 99 | char in [ROAR_MAX_CHANNELS]; |
---|
| 100 | char out[ROAR_MAX_CHANNELS]; |
---|
| 101 | char map[ROAR_MAX_CHANNELS]; |
---|
| 102 | }; |
---|
[3328] | 103 | |
---|
| 104 | char * roardsp_chan2str (int chan); |
---|
| 105 | int roardsp_str2chan(char * str); |
---|
| 106 | |
---|
[3331] | 107 | int roardsp_chanlist2str(char * list, size_t len, char * str, size_t strlen); |
---|
[3330] | 108 | |
---|
[3329] | 109 | int roardsp_chanmap_calc(struct roardsp_chanmap * map, int what, int err_on_none); |
---|
| 110 | |
---|
[3325] | 111 | #endif |
---|
| 112 | |
---|
| 113 | //ll |
---|