[4668] | 1 | //proto.h: |
---|
[0] | 2 | |
---|
[704] | 3 | /* |
---|
[5823] | 4 | * Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008-2013 |
---|
[704] | 5 | * |
---|
| 6 | * This file is 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 Lesser 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 Lesser General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU Lesser 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. |
---|
[704] | 23 | * |
---|
| 24 | * NOTE: Even though this file is LGPLed it (may) include GPLed files |
---|
| 25 | * so the license of this file is/may therefore downgraded to GPL. |
---|
| 26 | * See HACKING for details. |
---|
| 27 | */ |
---|
| 28 | |
---|
[0] | 29 | #ifndef _ROARAUDIO_PORTO_H_ |
---|
| 30 | #define _ROARAUDIO_PORTO_H_ |
---|
| 31 | |
---|
| 32 | #define ROAR_CMD_EOL -1 /* end of list */ |
---|
| 33 | #define ROAR_CMD_NOOP 0 /* do nothing */ |
---|
| 34 | #define ROAR_CMD_IDENTIFY 1 /* after connect we have to identify ourself */ |
---|
| 35 | #define ROAR_CMD_AUTH 2 /* send an auth cookie */ |
---|
| 36 | #define ROAR_CMD_NEW_STREAM 3 /* request a new stream id */ |
---|
| 37 | #define ROAR_CMD_SET_META 4 /* update meta data of streamed data */ |
---|
| 38 | #define ROAR_CMD_EXEC_STREAM 5 /* close all data channels and make the controll socket a raw data socket */ |
---|
| 39 | #define ROAR_CMD_QUIT 6 /* quits the connection */ |
---|
| 40 | |
---|
| 41 | #define ROAR_CMD_GET_STANDBY 7 |
---|
| 42 | #define ROAR_CMD_SET_STANDBY 8 |
---|
| 43 | |
---|
| 44 | #define ROAR_CMD_SERVER_INFO 9 /* Server version ... */ |
---|
| 45 | #define ROAR_CMD_SERVER_STATS 10 /* Server stats: number of clients, streams,.. */ |
---|
| 46 | #define ROAR_CMD_SERVER_OINFO 11 /* Output info, roar_audio_info sa */ |
---|
| 47 | |
---|
| 48 | #define ROAR_CMD_ADD_DATA 12 /* add some data to the input buffer */ |
---|
| 49 | |
---|
| 50 | //#define ROAR_CMD_ |
---|
| 51 | |
---|
[20] | 52 | #define ROAR_CMD_EXIT 13 /* make the server quit */ |
---|
| 53 | #define ROAR_CMD_LIST_STREAMS 14 /* list all streams (not only playback streams like esd does) */ |
---|
| 54 | #define ROAR_CMD_LIST_CLIENTS 15 /* list all clients */ |
---|
[0] | 55 | |
---|
[20] | 56 | #define ROAR_CMD_GET_CLIENT 16 /* get infos about a client */ |
---|
| 57 | #define ROAR_CMD_GET_STREAM 17 /* get infos about a stream */ |
---|
[0] | 58 | |
---|
[20] | 59 | #define ROAR_CMD_KICK 18 /* kick a client, stream, sample or source */ |
---|
[0] | 60 | |
---|
[20] | 61 | #define ROAR_CMD_SET_VOL 19 /* change volume */ |
---|
| 62 | #define ROAR_CMD_GET_VOL 20 /* get volume */ |
---|
[0] | 63 | |
---|
[76] | 64 | #define ROAR_CMD_CON_STREAM 21 /* let the server connect to something to get data for a new stream */ |
---|
| 65 | |
---|
[100] | 66 | #define ROAR_CMD_GET_META 22 /* get meta data of streamed data */ |
---|
[114] | 67 | #define ROAR_CMD_LIST_META 23 /* get list of meta data of streamed data */ |
---|
[100] | 68 | |
---|
[238] | 69 | #define ROAR_CMD_BEEP 24 /* send an beep */ |
---|
[100] | 70 | |
---|
[4620] | 71 | #define ROAR_AUTHCTL 25 |
---|
| 72 | #define ROAR_ACLCTL 26 |
---|
[352] | 73 | |
---|
[465] | 74 | #define ROAR_CMD_GET_STREAM_PARA 27 /* Get addition stream parameters like blocksizes */ |
---|
[5809] | 75 | #define ROAR_CMD_SET_STREAM_PARA 28 /* set special stream parameter */ |
---|
[352] | 76 | |
---|
[641] | 77 | #define ROAR_CMD_ATTACH 29 /* attach a OUTPUT or source */ |
---|
| 78 | #define ROAR_CMD_DETACH ROAR_CMD_KICK /* just to have an alias */ |
---|
[352] | 79 | |
---|
[756] | 80 | #define ROAR_CMD_PASSFH 30 /* send an fh via UNIX Domain Socket to the roard */ |
---|
| 81 | |
---|
[5091] | 82 | #define ROAR_CMD_GETTIMEOFDAY 31 /* get time of day from server */ |
---|
[986] | 83 | |
---|
[5091] | 84 | #define ROAR_CMD_WHOAMI 32 /* returns the ID of the current client */ |
---|
[1162] | 85 | |
---|
[4340] | 86 | #define ROAR_CMD_DEVCTL 33 /* send control messages to devices */ |
---|
| 87 | #define ROAR_CMD_CAPS 34 /* send caps */ |
---|
| 88 | #define ROAR_CMD_WAIT 35 /* wait for an event */ |
---|
| 89 | #define ROAR_CMD_NOTIFY 36 /* asyncronus notify of events */ |
---|
| 90 | #define ROAR_CMD_SEEK 37 /* seek in stream */ |
---|
| 91 | #define ROAR_CMD_CLIENTCTL 38 /* like stream ctl, just for client connections */ |
---|
| 92 | #define ROAR_CMD_LOOKUP 39 /* lookup??? */ |
---|
| 93 | #define ROAR_CMD_CONCTL 40 /* change parameter for current connection */ |
---|
[756] | 94 | |
---|
[5091] | 95 | #define ROAR_CMD_SHIFT_DATA 41 /* get some data from the stream */ |
---|
| 96 | |
---|
[2325] | 97 | // Reserved for RAUM project: |
---|
[5091] | 98 | #define ROAR_CMD_RAUM_SEEKTABLE 201 /* contains a seektable */ |
---|
| 99 | #define ROAR_CMD_RAUM_PICTURE 202 /* contains a picture block */ |
---|
| 100 | #define ROAR_CMD_RAUM_SYNC 203 /* used for raw-seeking, contains a magic pattern */ |
---|
[2325] | 101 | // End of reserved block |
---|
| 102 | |
---|
[641] | 103 | #define ROAR_CMD_EPERM 252 /* error: permition denided */ |
---|
| 104 | #define ROAR_CMD_OK_STOP 253 /* used internaly in the serveer: */ |
---|
| 105 | // ROAR_CMD_OK but do not queue the client again within the block |
---|
[20] | 106 | #define ROAR_CMD_OK 254 /* return value OK */ |
---|
| 107 | #define ROAR_CMD_ERROR 255 /* return value ERROR */ |
---|
[0] | 108 | |
---|
| 109 | |
---|
| 110 | #define ROAR_STANDBY_ACTIVE 1 |
---|
| 111 | #define ROAR_STANDBY_INACTIVE 0 |
---|
| 112 | |
---|
| 113 | // object types... |
---|
[4327] | 114 | #define ROAR_OT_CLIENT 1 |
---|
| 115 | #define ROAR_OT_STREAM 2 |
---|
| 116 | #define ROAR_OT_SOURCE 3 |
---|
| 117 | #define ROAR_OT_SAMPLE 4 |
---|
| 118 | #define ROAR_OT_OUTPUT 5 |
---|
| 119 | #define ROAR_OT_MIXER 6 |
---|
| 120 | #define ROAR_OT_BRIDGE 7 |
---|
| 121 | #define ROAR_OT_LISTEN 8 |
---|
| 122 | #define ROAR_OT_ACTION 9 |
---|
| 123 | #define ROAR_OT_MSGQUEUE 10 |
---|
| 124 | #define ROAR_OT_MSGBUS 11 |
---|
[0] | 125 | |
---|
[4331] | 126 | // filter: |
---|
| 127 | #define ROAR_CTL_FILTER_ANY 0 |
---|
| 128 | #define ROAR_CTL_FILTER_DIR 1 |
---|
| 129 | |
---|
| 130 | #define ROAR_CTL_CMP_ANY ROAR_CTL_FILTER_ANY |
---|
| 131 | #define ROAR_CTL_CMP_EQ 1 |
---|
[4333] | 132 | #define ROAR_CTL_CMP_NE 2 |
---|
[4331] | 133 | |
---|
[642] | 134 | // auth types... |
---|
[3915] | 135 | #define ROAR_AUTH_T_AUTO -1 |
---|
| 136 | #define ROAR_AUTH_T_NONE 0 /* do not auth */ |
---|
| 137 | #define ROAR_AUTH_T_COOKIE 1 /* use cookie */ |
---|
| 138 | #define ROAR_AUTH_T_TRUST 2 /* trust: used for UNIX Domain sockets, */ |
---|
| 139 | /* same uid = trusted, diffrent uid = public */ |
---|
| 140 | #define ROAR_AUTH_T_PASSWORD 3 /* use password */ |
---|
| 141 | #define ROAR_AUTH_T_SYSUSER 4 /* use local/NIS/PAM userdatabase */ |
---|
| 142 | #define ROAR_AUTH_T_OPENPGP_SIGN 5 |
---|
| 143 | #define ROAR_AUTH_T_OPENPGP_ENCRYPT 6 |
---|
| 144 | #define ROAR_AUTH_T_OPENPGP_AUTH 7 |
---|
| 145 | #define ROAR_AUTH_T_KERBEROS 8 |
---|
| 146 | #define ROAR_AUTH_T_RHOST 9 |
---|
| 147 | #define ROAR_AUTH_T_XAUTH 10 |
---|
| 148 | #define ROAR_AUTH_T_IDENT 11 |
---|
| 149 | |
---|
[642] | 150 | |
---|
[772] | 151 | // attach types... |
---|
[5029] | 152 | #define ROAR_ATTACH_SIMPLE 1 /* move a stream from one to another client (attach the stream to it) */ |
---|
| 153 | #define ROAR_ATTACH_SOURCE 2 /* attach a new source to the server */ |
---|
| 154 | #define ROAR_ATTACH_OUTPUT 3 /* attach a new output stream to the server */ |
---|
| 155 | #define ROAR_ATTACH_MIXER 4 /* attach a new hwmixer stream to the server */ |
---|
| 156 | #define ROAR_ATTACH_BRIDGE 5 /* attach a new bridge stream to the server */ |
---|
[772] | 157 | |
---|
[1842] | 158 | // modes for ROAR_CMD_?ET_STREAM_PARA... |
---|
| 159 | #define ROAR_STREAM_PARA_INFO 1 |
---|
| 160 | #define ROAR_STREAM_PARA_FLAGS 2 |
---|
| 161 | #define ROAR_STREAM_PARA_NAME 3 |
---|
[3538] | 162 | #define ROAR_STREAM_PARA_CHANMAP 4 |
---|
[3696] | 163 | #define ROAR_STREAM_PARA_ROLE 5 |
---|
[4267] | 164 | #define ROAR_STREAM_PARA_HASHTABLE 6 |
---|
| 165 | #define ROAR_STREAM_PARA_WININFO 7 |
---|
| 166 | #define ROAR_STREAM_PARA_PROPTABLE 8 |
---|
| 167 | #define ROAR_STREAM_PARA_LTM 9 |
---|
[5029] | 168 | #define ROAR_STREAM_PARA_USAGE 10 /* used by RAUM */ |
---|
[5092] | 169 | #define ROAR_STREAM_PARA_RADIO 11 /* used by RDTCS */ |
---|
[5624] | 170 | #define ROAR_STREAM_PARA_RPG 12 |
---|
| 171 | |
---|
| 172 | // modes for ROAR_STREAM_PARA_RPG: |
---|
| 173 | #define ROAR_RPGMODE_DEFAULT -1 |
---|
| 174 | #define ROAR_RPGMODE_NONE 0 |
---|
| 175 | #define ROAR_RPGMODE_USER 1 |
---|
| 176 | #define ROAR_RPGMODE_ALBUM 2 |
---|
| 177 | #define ROAR_RPGMODE_TRACK 3 |
---|
| 178 | #define ROAR_RPGMODE_ALBUMTRACK 4 |
---|
| 179 | #define ROAR_RPGMODE_TRACKALBUM 5 |
---|
[986] | 180 | |
---|
[3876] | 181 | // Message flags: |
---|
[3884] | 182 | #define ROAR_MF_NONE 0x00000000 /* No flags set | Versions: *ALL* */ |
---|
| 183 | #define ROAR_MF_SID 0x00000001 /* Stream ID | Versions: 1 */ |
---|
| 184 | #define ROAR_MF_SPOS 0x00000002 /* Stream Possition | Versions: 1 */ |
---|
| 185 | #define ROAR_MF_DL 0x00000004 /* Data Length | Versions: 1 */ |
---|
| 186 | #define ROAR_MF_LSID 0x00000008 /* Long Stream ID | Versions: 1 */ |
---|
| 187 | #define ROAR_MF_LSPOS 0x00000010 /* Long Stream Possition | Versions: 1,2 */ |
---|
| 188 | #define ROAR_MF_LDL 0x00000020 /* Long Data Length | Versions: 1 */ |
---|
| 189 | #define ROAR_MF_ED 0x00000040 /* Error Detection | Versions: 1,2 */ |
---|
| 190 | #define ROAR_MF_MF 0x00000080 /* Meta Framing | Versions: 1 */ |
---|
| 191 | #define ROAR_MF_UNIID 0x00000100 /* Stream ID is Universal ID | Versions: 2 */ |
---|
[5464] | 192 | #define ROAR_MF_ANNOUNCE 0x00000200 /* This is an announcement | Versions: 2 */ |
---|
| 193 | #define ROAR_MF_CLOUD 0x00000400 /* To cloud | Versions: 2 */ |
---|
[3876] | 194 | |
---|
[4425] | 195 | // Types for SERVER_INFO: |
---|
| 196 | #define ROAR_IT_SERVER 1 |
---|
| 197 | #define ROAR_IT_COUNTERS 2 |
---|
| 198 | //#define ROAR_IT_LISTEN 3 |
---|
| 199 | |
---|
| 200 | // Types for ROAR_IT_SERVER (Information Type Server Type = ITST) |
---|
| 201 | #define ROAR_ITST_VERSION 0 |
---|
| 202 | #define ROAR_ITST_LOCATION 1 |
---|
| 203 | #define ROAR_ITST_DESCRIPTION 2 |
---|
| 204 | #define ROAR_ITST_CONTACT 3 |
---|
| 205 | #define ROAR_ITST_UN_SYSNAME 4 |
---|
| 206 | #define ROAR_ITST_UN_NODENAME 5 |
---|
| 207 | #define ROAR_ITST_UN_RELEASE 6 |
---|
| 208 | #define ROAR_ITST_UN_MACHINE 7 |
---|
| 209 | #define ROAR_ITST_SERIAL 8 |
---|
| 210 | #define ROAR_ITST_ADDRESS 9 |
---|
| 211 | #define ROAR_ITST_UIURL 10 |
---|
[5093] | 212 | #define ROAR_ITST_HOSTID 11 |
---|
[5279] | 213 | #define ROAR_ITST_LICENSE 12 |
---|
[5372] | 214 | #define ROAR_ITST_BUILD 13 |
---|
[4425] | 215 | |
---|
[5065] | 216 | // IDs for diffrent clocks: |
---|
| 217 | #define ROAR_CLOCK_DEFAULT -2 |
---|
| 218 | #define ROAR_CLOCK_UNKNOWN -1 |
---|
| 219 | #define ROAR_CLOCK_REALTIME 1 |
---|
| 220 | #define ROAR_CLOCK_MONOTONIC 2 |
---|
| 221 | #define ROAR_CLOCK_UPTIME 3 |
---|
| 222 | |
---|
[5031] | 223 | // old: do not use. |
---|
[986] | 224 | struct roar_timeofday { |
---|
| 225 | int64_t t_sec; // secund part of system time |
---|
| 226 | uint64_t t_nsec; // nano-secund part of system time // we use a int64 here so all types are int64... |
---|
| 227 | uint64_t c_nhz; // system hi res timer freq in nHz |
---|
| 228 | uint64_t d_nsps; // clock drift in nano secs per sec |
---|
| 229 | }; |
---|
| 230 | |
---|
[0] | 231 | #endif |
---|
| 232 | |
---|
| 233 | //ll |
---|