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