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