source: roaraudio/roard/include/roard.h @ 4231:ef708f3f861a

Last change on this file since 4231:ef708f3f861a was 4231:ef708f3f861a, checked in by phi, 14 years ago

added dummy memlock.h

File size: 4.7 KB
Line 
1//roard.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2010
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, 51 Franklin Street, Fifth Floor,
22 *  Boston, MA 02110-1301, USA.
23 *
24 */
25
26#ifndef _ROARD_H_
27#define _ROARD_H_
28
29// configure ROAR_INFO()
30int g_verbose;
31#define ROAR_DBG_INFOVAR g_verbose
32
33// need to include this first as we need the config
34#include <roaraudio.h>
35#include <roaraudio/units.h>
36#include <libroarlight/libroarlight.h>
37#include <libroareio/libroareio.h>
38
39#include <ctype.h>
40
41#ifdef ROAR_HAVE_H_SIGNAL
42#include <signal.h>
43#endif
44
45#if defined(ROAR_HAVE_SELECT) && defined(ROAR_HAVE_H_SYS_SELECT)
46#include <sys/select.h>
47#endif
48
49#ifdef ROAR_HAVE_WAIT
50#include <sys/wait.h>
51#endif
52
53#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER)
54#include <pwd.h>
55#endif
56
57#ifdef ROAR_HAVE_H_SYS_TIME
58#include <sys/time.h>
59#endif
60#ifdef ROAR_HAVE_H_TIME
61#include <time.h>
62#endif
63
64#ifdef ROAR_HAVE_LIBSLP
65#include <slp.h>
66#endif
67
68/*
69#ifdef __linux__
70#include <linux/unistd.h>
71#include <linux/ioprio.h>
72#endif
73*/
74
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
80#define ROAR_SUBSYS_RAW           0x10
81#define ROAR_SUBSYS_COMPLEX       0x20
82#define ROAR_SUBSYS_RDTCS         0x40
83
84// listeing code:
85#define ROAR_MAX_LISTEN_SOCKETS  8
86
87union uniinst {
88 void * vp;
89 int    si;
90};
91
92// MFOI = Marked For Optional Include
93
94//#include "buffer.h"
95#include "memlock.h"
96#include "codecfilter.h" /* MFOI */
97#include "container_framework.h" /* MFOI */
98#include "client.h"
99#include "driver.h" /* MFOI */
100#include "output.h"
101#include "mixer.h"
102//#include "convert.h"
103#include "streams.h"
104#include "network.h"
105#include "commands.h"
106#include "req.h"
107#include "emul_esd.h" /* MFOI */
108#include "emul_simple.h" /* MFOI */
109#include "emul_rsound.h" /* MFOI */
110#include "emul_rplay.h" /* MFOI */
111#include "sources.h"
112#include "sample.h"
113#include "meta.h"
114#include "midi.h"
115#include "ssynth.h"
116#include "light.h"
117#include "raw.h"
118#include "rdtcs.h"
119#include "waveform.h"
120#include "beep.h"
121#include "lib.h"
122#include "plugins.h"
123
124
125int alive;
126#ifdef ROAR_SUPPORT_LISTEN
127int g_no_listen;
128#endif
129
130uint32_t g_pos; // current possition in output stream
131
132int g_standby;
133int g_autostandby;
134
135#ifdef ROAR_SUPPORT_LISTEN
136struct roard_listen;
137#endif
138
139int main_loop (int driver, DRIVER_USERDATA_T driver_inst, struct roar_audio_info * sa, int sysclocksync);
140void cleanup_listen_socket (int terminate);
141void clean_quit (void);
142void clean_quit_prep (void);
143
144void on_sig_int  (int signum);
145void on_sig_term (int signum);
146void on_sig_chld (int signum);
147void on_sig_usr1 (int signum);
148
149#ifdef ROAR_SUPPORT_LISTEN
150int get_listen(struct roard_listen ** sock, char *** sockname);
151#endif
152
153#ifdef ROAR_SUPPORT_LISTEN
154struct roard_listen {
155 int used;
156 struct roar_vio_calls sock;
157 int proto;
158 union {
159  void * vp;
160  int    si;
161  struct {
162   int                    dir;
163   struct roar_audio_info info;
164  } stpl;
165 } inst;
166} g_listen[ROAR_MAX_LISTEN_SOCKETS];
167#endif
168
169int g_self_client;
170
171int g_terminate;
172
173struct roar_audio_info * g_sa, * g_max_sa;
174
175struct roard_config {
176 uint32_t flags;
177 struct {
178  uint32_t flags;
179  struct roar_mixer_settings mixer;
180  int                        mixer_channels;
181 } streams[ROAR_DIR_DIRIDS];
182 char * location;
183 size_t jumbo_mtu;
184} * g_config;
185
186struct _counters {
187 size_t clients, streams,
188        samples,
189        sources, outputs,
190        mixers, bridges,
191        listens;
192};
193
194struct {
195 struct _counters cur, sum;
196} g_counters;
197
198
199#define counters_init() memset(&g_counters, 0, sizeof(g_counters))
200//#define counters_inc(c,i) do { signed long int __i = (i); if ( __i < 0 && __i > (g_counters.cur.c) ) { ROAR_WARN("counters_inc(c=%s, i=%li): Decrement request bigger than current counter value. Counter out of syn!", )  } while (0)
201#define counters_inc(c,i) do { signed long int __i = (i); g_counters.cur.c += __i; if ( __i > 0 ) g_counters.sum.c += __i; } while (0)
202
203#define counters_get(g,c) ((g_counters.g.c))
204
205void counters_print(int type, int force);
206
207#endif
208
209//ll
Note: See TracBrowser for help on using the repository browser.