[0] | 1 | //roard.h: |
---|
| 2 | |
---|
[668] | 3 | /* |
---|
[3812] | 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2010 |
---|
[668] | 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 |
---|
[3517] | 21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
---|
| 22 | * Boston, MA 02110-1301, USA. |
---|
[668] | 23 | * |
---|
| 24 | */ |
---|
| 25 | |
---|
[0] | 26 | #ifndef _ROARD_H_ |
---|
| 27 | #define _ROARD_H_ |
---|
| 28 | |
---|
[2970] | 29 | // configure ROAR_INFO() |
---|
| 30 | int g_verbose; |
---|
| 31 | #define ROAR_DBG_INFOVAR g_verbose |
---|
| 32 | |
---|
[1482] | 33 | // need to include this first as we need the config |
---|
| 34 | #include <roaraudio.h> |
---|
[3207] | 35 | #include <roaraudio/units.h> |
---|
[1964] | 36 | #include <libroarlight/libroarlight.h> |
---|
[2283] | 37 | #include <libroareio/libroareio.h> |
---|
[1482] | 38 | |
---|
[2726] | 39 | #include <ctype.h> |
---|
[1482] | 40 | |
---|
[3056] | 41 | #ifdef ROAR_HAVE_H_SIGNAL |
---|
[0] | 42 | #include <signal.h> |
---|
[1482] | 43 | #endif |
---|
| 44 | |
---|
[1537] | 45 | #if defined(ROAR_HAVE_SELECT) && defined(ROAR_HAVE_H_SYS_SELECT) |
---|
[0] | 46 | #include <sys/select.h> |
---|
[1482] | 47 | #endif |
---|
| 48 | |
---|
| 49 | #ifdef ROAR_HAVE_WAIT |
---|
[248] | 50 | #include <sys/wait.h> |
---|
[1482] | 51 | #endif |
---|
| 52 | |
---|
| 53 | #if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER) |
---|
[444] | 54 | #include <pwd.h> |
---|
[1482] | 55 | #endif |
---|
| 56 | |
---|
[3202] | 57 | #ifdef ROAR_HAVE_H_SYS_TIME |
---|
[1198] | 58 | #include <sys/time.h> |
---|
[3202] | 59 | #endif |
---|
| 60 | #ifdef ROAR_HAVE_H_TIME |
---|
[1198] | 61 | #include <time.h> |
---|
[1482] | 62 | #endif |
---|
[242] | 63 | |
---|
[1993] | 64 | #ifdef ROAR_HAVE_LIBSLP |
---|
| 65 | #include <slp.h> |
---|
| 66 | #endif |
---|
| 67 | |
---|
[243] | 68 | /* |
---|
[242] | 69 | #ifdef __linux__ |
---|
[243] | 70 | #include <linux/unistd.h> |
---|
[242] | 71 | #include <linux/ioprio.h> |
---|
| 72 | #endif |
---|
[243] | 73 | */ |
---|
[242] | 74 | |
---|
[1917] | 75 | #define ROAR_SUBSYS_NONE 0x00 |
---|
| 76 | #define ROAR_SUBSYS_WAVEFORM 0x01 |
---|
| 77 | #define ROAR_SUBSYS_MIDI 0x02 |
---|
| 78 | #define ROAR_SUBSYS_CB 0x04 |
---|
| 79 | #define ROAR_SUBSYS_LIGHT 0x08 |
---|
[2232] | 80 | #define ROAR_SUBSYS_RAW 0x10 |
---|
[2681] | 81 | #define ROAR_SUBSYS_COMPLEX 0x20 |
---|
[2838] | 82 | #define ROAR_SUBSYS_RDTCS 0x40 |
---|
[1917] | 83 | |
---|
[2530] | 84 | // listeing code: |
---|
| 85 | #define ROAR_MAX_LISTEN_SOCKETS 8 |
---|
| 86 | |
---|
[3763] | 87 | // MFOI = Marked For Optional Include |
---|
| 88 | |
---|
[0] | 89 | //#include "buffer.h" |
---|
[3763] | 90 | #include "codecfilter.h" /* MFOI */ |
---|
| 91 | #include "container_framework.h" /* MFOI */ |
---|
[0] | 92 | #include "client.h" |
---|
[3763] | 93 | #include "driver.h" /* MFOI */ |
---|
[0] | 94 | #include "output.h" |
---|
| 95 | #include "mixer.h" |
---|
| 96 | //#include "convert.h" |
---|
| 97 | #include "streams.h" |
---|
| 98 | #include "network.h" |
---|
| 99 | #include "commands.h" |
---|
| 100 | #include "req.h" |
---|
[3763] | 101 | #include "emul_esd.h" /* MFOI */ |
---|
| 102 | #include "emul_simple.h" /* MFOI */ |
---|
| 103 | #include "emul_rsound.h" /* MFOI */ |
---|
[0] | 104 | #include "sources.h" |
---|
[40] | 105 | #include "sample.h" |
---|
[89] | 106 | #include "meta.h" |
---|
[244] | 107 | #include "midi.h" |
---|
[2446] | 108 | #include "ssynth.h" |
---|
[1816] | 109 | #include "light.h" |
---|
[2236] | 110 | #include "raw.h" |
---|
[2717] | 111 | #include "rdtcs.h" |
---|
[2945] | 112 | #include "waveform.h" |
---|
[3572] | 113 | #include "beep.h" |
---|
[245] | 114 | #include "lib.h" |
---|
[3353] | 115 | #include "plugins.h" |
---|
[0] | 116 | |
---|
[242] | 117 | |
---|
[0] | 118 | int alive; |
---|
[1494] | 119 | #ifdef ROAR_SUPPORT_LISTEN |
---|
[1155] | 120 | int g_no_listen; |
---|
[1494] | 121 | #endif |
---|
[0] | 122 | |
---|
[246] | 123 | uint32_t g_pos; // current possition in output stream |
---|
| 124 | |
---|
[0] | 125 | int g_standby; |
---|
[920] | 126 | int g_autostandby; |
---|
[0] | 127 | |
---|
[3730] | 128 | #ifdef ROAR_SUPPORT_LISTEN |
---|
| 129 | struct roard_listen; |
---|
| 130 | #endif |
---|
| 131 | |
---|
[905] | 132 | int main_loop (int driver, DRIVER_USERDATA_T driver_inst, struct roar_audio_info * sa, int sysclocksync); |
---|
[574] | 133 | void cleanup_listen_socket (int terminate); |
---|
[0] | 134 | void clean_quit (void); |
---|
| 135 | void clean_quit_prep (void); |
---|
| 136 | |
---|
[3800] | 137 | void on_sig_int (int signum); |
---|
[2732] | 138 | void on_sig_term (int signum); |
---|
[248] | 139 | void on_sig_chld (int signum); |
---|
[2112] | 140 | void on_sig_usr1 (int signum); |
---|
[0] | 141 | |
---|
[1494] | 142 | #ifdef ROAR_SUPPORT_LISTEN |
---|
[3731] | 143 | int get_listen(struct roard_listen ** sock, char *** sockname); |
---|
[3730] | 144 | #endif |
---|
| 145 | |
---|
| 146 | #ifdef ROAR_SUPPORT_LISTEN |
---|
[3253] | 147 | struct roard_listen { |
---|
[3802] | 148 | int used; |
---|
| 149 | struct roar_vio_calls sock; |
---|
[3128] | 150 | int proto; |
---|
| 151 | union { |
---|
| 152 | void * vp; |
---|
| 153 | int si; |
---|
| 154 | struct { |
---|
| 155 | int dir; |
---|
| 156 | struct roar_audio_info info; |
---|
| 157 | } stpl; |
---|
| 158 | } inst; |
---|
| 159 | } g_listen[ROAR_MAX_LISTEN_SOCKETS]; |
---|
[1494] | 160 | #endif |
---|
[0] | 161 | |
---|
[37] | 162 | int g_self_client; |
---|
| 163 | |
---|
[71] | 164 | int g_terminate; |
---|
| 165 | |
---|
[1609] | 166 | struct roar_audio_info * g_sa, * g_max_sa; |
---|
| 167 | |
---|
| 168 | struct roard_config { |
---|
| 169 | uint32_t flags; |
---|
| 170 | struct { |
---|
| 171 | uint32_t flags; |
---|
| 172 | struct roar_mixer_settings mixer; |
---|
| 173 | int mixer_channels; |
---|
| 174 | } streams[ROAR_DIR_DIRIDS]; |
---|
[2017] | 175 | char * location; |
---|
[3039] | 176 | size_t jumbo_mtu; |
---|
[1609] | 177 | } * g_config; |
---|
[0] | 178 | |
---|
| 179 | #endif |
---|
| 180 | |
---|
| 181 | //ll |
---|