1 | //stream.h: |
---|
2 | |
---|
3 | /* |
---|
4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2010 |
---|
5 | * |
---|
6 | * This file is 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 Lesser General Public License version 3 |
---|
12 | * as published by the Free Software Foundation. |
---|
13 | * |
---|
14 | * RoarAudio 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 Lesser General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU Lesser 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: Even though this file is LGPLed it (may) include GPLed files |
---|
25 | * so the license of this file is/may therefore downgraded to GPL. |
---|
26 | * See HACKING for details. |
---|
27 | */ |
---|
28 | |
---|
29 | #ifndef _ROARAUDIO_STREAM_H_ |
---|
30 | #define _ROARAUDIO_STREAM_H_ |
---|
31 | |
---|
32 | #define ROAR_DIR_DEFAULT ROAR_DIR_PLAY |
---|
33 | |
---|
34 | #define ROAR_DIR_PLAY 1 |
---|
35 | #define ROAR_DIR_RECORD 2 |
---|
36 | #define ROAR_DIR_MONITOR 3 |
---|
37 | #define ROAR_DIR_FILTER 4 |
---|
38 | |
---|
39 | #define ROAR_DIR_OUTPUT 5 |
---|
40 | |
---|
41 | #define ROAR_DIR_MIXING 6 |
---|
42 | //#define ROAR_DIR_INTERNAL 7 |
---|
43 | |
---|
44 | #define ROAR_DIR_META 8 |
---|
45 | #define ROAR_DIR_BIDIR 9 |
---|
46 | |
---|
47 | #define ROAR_DIR_THRU 10 |
---|
48 | |
---|
49 | #define ROAR_DIR_BRIDGE 11 |
---|
50 | |
---|
51 | // MIDI: |
---|
52 | #define ROAR_DIR_MIDI_IN 12 |
---|
53 | #define ROAR_DIR_MIDI_OUT 13 |
---|
54 | |
---|
55 | // Light Control: |
---|
56 | #define ROAR_DIR_LIGHT_IN 14 |
---|
57 | #define ROAR_DIR_LIGHT_OUT 15 |
---|
58 | |
---|
59 | // Raw Data: |
---|
60 | #define ROAR_DIR_RAW_IN 16 |
---|
61 | #define ROAR_DIR_RAW_OUT 17 |
---|
62 | |
---|
63 | // Complex (multi-content container): |
---|
64 | #define ROAR_DIR_COMPLEX_IN 18 |
---|
65 | #define ROAR_DIR_COMPLEX_OUT 19 |
---|
66 | |
---|
67 | // Radio Data and Transmitter Control System: |
---|
68 | #define ROAR_DIR_RDTCS_IN 20 |
---|
69 | #define ROAR_DIR_RDTCS_OUT 21 |
---|
70 | |
---|
71 | // Max DIR +1: |
---|
72 | #define ROAR_DIR_DIRIDS 22 |
---|
73 | |
---|
74 | // Stream flags: |
---|
75 | #define ROAR_FLAG_NONE 0x0000 |
---|
76 | #define ROAR_FLAG_PRIMARY 0x0001 |
---|
77 | #define ROAR_FLAG_OUTPUT 0x0002 |
---|
78 | #define ROAR_FLAG_DRIVER ROAR_FLAG_OUTPUT |
---|
79 | #define ROAR_FLAG_SOURCE 0x0004 |
---|
80 | #define ROAR_FLAG_SYNC 0x0008 |
---|
81 | #define ROAR_FLAG_META 0x0010 |
---|
82 | #define ROAR_FLAG_AUTOCONF 0x0020 |
---|
83 | #define ROAR_FLAG_CLEANMETA 0x0040 |
---|
84 | #define ROAR_FLAG_HWMIXER 0x0080 |
---|
85 | #define ROAR_FLAG_PAUSE 0x0100 |
---|
86 | #define ROAR_FLAG_MUTE 0x0200 |
---|
87 | #define ROAR_FLAG_MMAP 0x0400 |
---|
88 | #define ROAR_FLAG_ANTIECHO 0x0800 |
---|
89 | #define ROAR_FLAG_VIRTUAL 0x1000 |
---|
90 | #define ROAR_FLAG_RECSOURCE 0x2000 |
---|
91 | #define ROAR_FLAG_PASSMIXER 0x4000 |
---|
92 | #define ROAR_FLAG_PRETHRU 0x8000 |
---|
93 | // next are the exteded flags (> 16 bits) |
---|
94 | //#define ROAR_FLAG_SYNC 0x08 |
---|
95 | #define ROAR_FLAG_IMMUTABLE 0x00010000 |
---|
96 | #define ROAR_FLAG_ENHANCE 0x00020000 |
---|
97 | #define ROAR_FLAG_SINGLESINK 0x00040000 |
---|
98 | |
---|
99 | #define ROAR_SET_FLAG 0 |
---|
100 | #define ROAR_RESET_FLAG 1 |
---|
101 | #define ROAR_TOGGLE_FLAG 2 |
---|
102 | #define ROAR_NOOP_FLAG 3 |
---|
103 | #define ROAR_PROTECT_FLAG 0x8000 |
---|
104 | #define ROAR_SET_FLAG_PROTECT (ROAR_SET_FLAG|ROAR_PROTECT_FLAG) |
---|
105 | #define ROAR_RESET_FLAG_PROTECT (ROAR_RESET_FLAG|ROAR_PROTECT_FLAG) |
---|
106 | |
---|
107 | // Stream states: |
---|
108 | #define ROAR_STREAMSTATE_UNKNOWN -1 |
---|
109 | #define ROAR_STREAMSTATE_NULL 0 |
---|
110 | #define ROAR_STREAMSTATE_UNUSED ROAR_STREAMSTATE_NULL |
---|
111 | #define ROAR_STREAMSTATE_INITING 1 |
---|
112 | #define ROAR_STREAMSTATE_NEW 2 |
---|
113 | #define ROAR_STREAMSTATE_OLD 3 |
---|
114 | #define ROAR_STREAMSTATE_CLOSING 4 |
---|
115 | |
---|
116 | // Stream roles: |
---|
117 | // PA currently defines: video, music, game, event, phone, animation, production, a11y |
---|
118 | // RA includes : YES YES YES YES YES NO NO NO |
---|
119 | |
---|
120 | #define ROAR_ROLE_UNKNOWN -1 |
---|
121 | #define ROAR_ROLE_NONE 0 |
---|
122 | #define ROAR_ROLE_MUSIC 1 |
---|
123 | #define ROAR_ROLE_VIDEO 2 |
---|
124 | #define ROAR_ROLE_GAME 3 |
---|
125 | #define ROAR_ROLE_EVENT 4 |
---|
126 | #define ROAR_ROLE_BEEP 5 |
---|
127 | #define ROAR_ROLE_PHONE 6 |
---|
128 | #define ROAR_ROLE_BACKGROUND_MUSIC 7 |
---|
129 | #define ROAR_ROLE_VOICE 8 |
---|
130 | #define ROAR_ROLE_INSTRUMENT 9 |
---|
131 | #define ROAR_ROLE_RHYTHM 10 |
---|
132 | #define ROAR_ROLE_CLICK 11 |
---|
133 | #define ROAR_ROLE_MIXED 12 |
---|
134 | |
---|
135 | |
---|
136 | #define ROAR_CARE_NOPOS 0 |
---|
137 | #define ROAR_CARE_POS 1 |
---|
138 | |
---|
139 | #define ROAR_STREAM(a) ((struct roar_stream*)(a)) |
---|
140 | |
---|
141 | #define ROAR_STREAMS_MAX 64 |
---|
142 | |
---|
143 | |
---|
144 | struct roar_stream { |
---|
145 | int id; |
---|
146 | |
---|
147 | int fh; |
---|
148 | int dir; |
---|
149 | int care_pos; |
---|
150 | |
---|
151 | uint32_t pos; |
---|
152 | uint32_t pos_rel_id; // TODO: why is this not int? |
---|
153 | |
---|
154 | struct roar_audio_info info; |
---|
155 | |
---|
156 | /* |
---|
157 | int datalen; |
---|
158 | char * database; |
---|
159 | int offset; |
---|
160 | char * dataoff; |
---|
161 | */ |
---|
162 | }; |
---|
163 | |
---|
164 | #endif |
---|
165 | |
---|
166 | //ll |
---|