source: roaraudio/roard/include/roard.h @ 5740:b3aff85876f1

Last change on this file since 5740:b3aff85876f1 was 5740:b3aff85876f1, checked in by phi, 11 years ago

commit 1: Moved protocol support into new plugins protocol-esound, protocol-rplay and protocol-gopher (Closes: #311)

File size: 5.4 KB
RevLine 
[0]1//roard.h:
2
[668]3/*
[5381]4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2012
[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()
[5194]30extern int g_verbose;
[2970]31#define ROAR_DBG_INFOVAR g_verbose
32
[4299]33// configure ROAR_*()
34#define ROAR_DBG_PREFIX "roard"
35
[1482]36// need to include this first as we need the config
37#include <roaraudio.h>
[3207]38#include <roaraudio/units.h>
[1964]39#include <libroarlight/libroarlight.h>
[2283]40#include <libroareio/libroareio.h>
[1482]41
[2726]42#include <ctype.h>
[1482]43
[3056]44#ifdef ROAR_HAVE_H_SIGNAL
[0]45#include <signal.h>
[1482]46#endif
47
[1537]48#if defined(ROAR_HAVE_SELECT) && defined(ROAR_HAVE_H_SYS_SELECT)
[0]49#include <sys/select.h>
[1482]50#endif
51
52#ifdef ROAR_HAVE_WAIT
[248]53#include <sys/wait.h>
[1482]54#endif
55
56#if !defined(ROAR_TARGET_WIN32) && !defined(ROAR_TARGET_MICROCONTROLLER)
[444]57#include <pwd.h>
[1482]58#endif
59
[3202]60#ifdef ROAR_HAVE_H_SYS_TIME
[1198]61#include <sys/time.h>
[3202]62#endif
63#ifdef ROAR_HAVE_H_TIME
[1198]64#include <time.h>
[1482]65#endif
[242]66
[1993]67#ifdef ROAR_HAVE_LIBSLP
68#include <slp.h>
69#endif
70
[243]71/*
[242]72#ifdef __linux__
[243]73#include <linux/unistd.h>
[242]74#include <linux/ioprio.h>
75#endif
[243]76*/
[242]77
[1917]78#define ROAR_SUBSYS_NONE          0x00
79#define ROAR_SUBSYS_WAVEFORM      0x01
80#define ROAR_SUBSYS_MIDI          0x02
81#define ROAR_SUBSYS_CB            0x04
82#define ROAR_SUBSYS_LIGHT         0x08
[2232]83#define ROAR_SUBSYS_RAW           0x10
[2681]84#define ROAR_SUBSYS_COMPLEX       0x20
[2838]85#define ROAR_SUBSYS_RDTCS         0x40
[1917]86
[2530]87// listeing code:
[4766]88#define ROAR_MAX_LISTEN_SOCKETS   16
[2530]89
[3977]90union uniinst {
91 void * vp;
92 int    si;
93};
94
[5140]95enum output_format {
96 FORMAT_NATIVE = 1,
97 FORMAT_WIKI,
98 FORMAT_CSV,
99
100 FORMAT_DEFAULT = FORMAT_NATIVE
101};
102
[4955]103
[3763]104// MFOI = Marked For Optional Include
105
[0]106//#include "buffer.h"
[4504]107#include "caps.h"
[4231]108#include "memlock.h"
[3763]109#include "codecfilter.h" /* MFOI */
110#include "container_framework.h" /* MFOI */
[4932]111#include "rolestack.h"
[0]112#include "client.h"
[4469]113#include "auth.h"
[3763]114#include "driver.h" /* MFOI */
[0]115#include "output.h"
116#include "mixer.h"
117//#include "convert.h"
118#include "streams.h"
119#include "network.h"
120#include "commands.h"
121#include "req.h"
[3763]122#include "emul_simple.h" /* MFOI */
123#include "emul_rsound.h" /* MFOI */
[0]124#include "sources.h"
[40]125#include "sample.h"
[4359]126#include "hwmixer.h"
[89]127#include "meta.h"
[244]128#include "midi.h"
[2446]129#include "ssynth.h"
[1816]130#include "light.h"
[2236]131#include "raw.h"
[2717]132#include "rdtcs.h"
[2945]133#include "waveform.h"
[3572]134#include "beep.h"
[245]135#include "lib.h"
[3353]136#include "plugins.h"
[0]137
[242]138
[5192]139extern int alive;
[1494]140#ifdef ROAR_SUPPORT_LISTEN
[5192]141extern int g_no_listen;
[1494]142#endif
[0]143
[5414]144extern uint32_t g_pos; // current position in output stream
[246]145
[5192]146extern int g_standby;
147extern int g_autostandby;
[0]148
[3730]149#ifdef ROAR_SUPPORT_LISTEN
150struct roard_listen;
151#endif
152
[4811]153int main_loop (struct roar_audio_info * sa, int sysclocksync);
[574]154void cleanup_listen_socket (int terminate);
[0]155void clean_quit (void);
156void clean_quit_prep (void);
157
[3800]158void on_sig_int  (int signum);
[2732]159void on_sig_term (int signum);
[248]160void on_sig_chld (int signum);
[2112]161void on_sig_usr1 (int signum);
[0]162
[1494]163#ifdef ROAR_SUPPORT_LISTEN
[3731]164int get_listen(struct roard_listen ** sock, char *** sockname);
[4678]165int add_listen (char * addr, int port, int sock_type, char * user, char * group, int proto, int dir, struct roar_audio_info * info);
[3730]166#endif
167
168#ifdef ROAR_SUPPORT_LISTEN
[5192]169extern struct roard_listen {
[3802]170 int used;
171 struct roar_vio_calls sock;
[3128]172 int proto;
173 union {
174  void * vp;
175  int    si;
176  struct {
177   int                    dir;
178   struct roar_audio_info info;
179  } stpl;
180 } inst;
181} g_listen[ROAR_MAX_LISTEN_SOCKETS];
[1494]182#endif
[0]183
[5192]184extern int g_self_client;
[37]185
[5192]186extern int g_terminate;
[71]187
[5192]188extern struct roar_audio_info * g_sa, * g_max_sa;
[1609]189
[4442]190#define CONF_DEF_STRING "***default***"
191
[5194]192extern struct roard_config {
[1609]193 uint32_t flags;
194 struct {
[5624]195  uint32_t                   flags;
[1609]196  struct roar_mixer_settings mixer;
197  int                        mixer_channels;
[5624]198  int                        rpgmode;
[1609]199 } streams[ROAR_DIR_DIRIDS];
[2017]200 char * location;
[4421]201 char * description;
[5279]202 char * contact;
203 char * serial;
204 char * uiurl;
[3039]205 size_t jumbo_mtu;
[4245]206 int memlock_level;
[4851]207#ifdef ROAR_HAVE_SYSTEM
208 struct {
209  const char * post_shutdown;
210 } scripts;
211#endif
[1609]212} * g_config;
[0]213
[4101]214struct _counters {
215 size_t clients, streams,
216        samples,
217        sources, outputs,
218        mixers, bridges,
219        listens;
220};
221
[5194]222extern struct counters {
[4101]223 struct _counters cur, sum;
224} g_counters;
225
226
[5345]227#define counters_init() memset(counters_getptr(), 0, sizeof(struct counters))
[4101]228//#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)
[5345]229#define counters_inc(c,i) do { signed long int __i = (i); counters_getptr()->cur.c += __i; if ( __i > 0 ) counters_getptr()->sum.c += __i; } while (0)
[4101]230
[5345]231#define counters_get(g,c) ((counters_getptr()->g.c))
[4101]232
[5345]233struct counters * counters_getptr(void);
[4101]234void counters_print(int type, int force);
235
[0]236#endif
237
238//ll
Note: See TracBrowser for help on using the repository browser.