1 | //roard.h: |
---|
2 | |
---|
3 | /* |
---|
4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008, 2009 |
---|
5 | * |
---|
6 | * This file is part of roard 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 | * 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 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 | */ |
---|
24 | |
---|
25 | #ifndef _ROARD_H_ |
---|
26 | #define _ROARD_H_ |
---|
27 | |
---|
28 | // need to include this first as we need the config |
---|
29 | #include <roaraudio.h> |
---|
30 | #include <libroarlight/libroarlight.h> |
---|
31 | #include <libroareio/libroareio.h> |
---|
32 | |
---|
33 | #include <ctype.h> |
---|
34 | |
---|
35 | #ifndef ROAR_TARGET_MICROCONTROLLER |
---|
36 | #include <signal.h> |
---|
37 | #endif |
---|
38 | |
---|
39 | #if defined(ROAR_HAVE_SELECT) && defined(ROAR_HAVE_H_SYS_SELECT) |
---|
40 | #include <sys/select.h> |
---|
41 | #endif |
---|
42 | |
---|
43 | #ifdef ROAR_HAVE_WAIT |
---|
44 | #include <sys/wait.h> |
---|
45 | #endif |
---|
46 | |
---|
47 | #if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) |
---|
48 | #include <pwd.h> |
---|
49 | #endif |
---|
50 | |
---|
51 | #ifndef ROAR_TARGET_MICROCONTROLLER |
---|
52 | #include <sys/time.h> |
---|
53 | #include <time.h> |
---|
54 | #endif |
---|
55 | |
---|
56 | #ifdef ROAR_HAVE_LIBSLP |
---|
57 | #include <slp.h> |
---|
58 | #endif |
---|
59 | |
---|
60 | /* |
---|
61 | #ifdef __linux__ |
---|
62 | #include <linux/unistd.h> |
---|
63 | #include <linux/ioprio.h> |
---|
64 | #endif |
---|
65 | */ |
---|
66 | |
---|
67 | #define ROAR_SUBSYS_NONE 0x00 |
---|
68 | #define ROAR_SUBSYS_WAVEFORM 0x01 |
---|
69 | #define ROAR_SUBSYS_MIDI 0x02 |
---|
70 | #define ROAR_SUBSYS_CB 0x04 |
---|
71 | #define ROAR_SUBSYS_LIGHT 0x08 |
---|
72 | #define ROAR_SUBSYS_RAW 0x10 |
---|
73 | #define ROAR_SUBSYS_COMPLEX 0x20 |
---|
74 | #define ROAR_SUBSYS_RDTCS 0x40 |
---|
75 | |
---|
76 | // some usefull macros: |
---|
77 | #define _8BIT 1 |
---|
78 | #define _16BIT 2 |
---|
79 | #define _24BIT 3 |
---|
80 | #define _32BIT 4 |
---|
81 | #define _64BIT 8 |
---|
82 | |
---|
83 | // listeing code: |
---|
84 | #define ROAR_MAX_LISTEN_SOCKETS 8 |
---|
85 | |
---|
86 | //#include "buffer.h" |
---|
87 | #include "codecfilter.h" |
---|
88 | #include "container_framework.h" |
---|
89 | #include "client.h" |
---|
90 | #include "driver.h" |
---|
91 | #include "output.h" |
---|
92 | #include "mixer.h" |
---|
93 | //#include "convert.h" |
---|
94 | #include "streams.h" |
---|
95 | #include "network.h" |
---|
96 | #include "commands.h" |
---|
97 | #include "req.h" |
---|
98 | #include "emul_esd.h" |
---|
99 | #include "sources.h" |
---|
100 | #include "sample.h" |
---|
101 | #include "meta.h" |
---|
102 | #include "midi.h" |
---|
103 | #include "ssynth.h" |
---|
104 | #include "light.h" |
---|
105 | #include "raw.h" |
---|
106 | #include "rdtcs.h" |
---|
107 | #include "lib.h" |
---|
108 | |
---|
109 | |
---|
110 | int alive; |
---|
111 | #ifdef ROAR_SUPPORT_LISTEN |
---|
112 | int g_no_listen; |
---|
113 | #endif |
---|
114 | |
---|
115 | uint32_t g_pos; // current possition in output stream |
---|
116 | |
---|
117 | int g_standby; |
---|
118 | int g_autostandby; |
---|
119 | |
---|
120 | int main_loop (int driver, DRIVER_USERDATA_T driver_inst, struct roar_audio_info * sa, int sysclocksync); |
---|
121 | void cleanup_listen_socket (int terminate); |
---|
122 | void clean_quit (void); |
---|
123 | void clean_quit_prep (void); |
---|
124 | |
---|
125 | void on_sig_int (int signum); |
---|
126 | void on_sig_term (int signum); |
---|
127 | void on_sig_chld (int signum); |
---|
128 | void on_sig_usr1 (int signum); |
---|
129 | |
---|
130 | #ifdef ROAR_SUPPORT_LISTEN |
---|
131 | int g_listen_socket[ROAR_MAX_LISTEN_SOCKETS]; |
---|
132 | int g_listen_proto[ROAR_MAX_LISTEN_SOCKETS]; |
---|
133 | #endif |
---|
134 | |
---|
135 | int g_self_client; |
---|
136 | |
---|
137 | int g_terminate; |
---|
138 | |
---|
139 | struct roar_audio_info * g_sa, * g_max_sa; |
---|
140 | |
---|
141 | struct roard_config { |
---|
142 | uint32_t flags; |
---|
143 | struct { |
---|
144 | uint32_t flags; |
---|
145 | struct roar_mixer_settings mixer; |
---|
146 | int mixer_channels; |
---|
147 | } streams[ROAR_DIR_DIRIDS]; |
---|
148 | char * location; |
---|
149 | } * g_config; |
---|
150 | |
---|
151 | #endif |
---|
152 | |
---|
153 | //ll |
---|