/usr/include/rplay.h is in librplay3-dev 3.3.2-14.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | /* $Id: rplay.h,v 1.3 1999/03/10 07:57:27 boyns Exp $ */
/*
* Copyright (C) 1993-99 Mark R. Boyns <boyns@doit.org>
*
* This file is part of rplay.
*
* rplay is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* rplay is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with rplay; see the file COPYING. If not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _rplay_h
#define _rplay_h
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#undef FALSE
#define FALSE 0
#undef TRUE
#define TRUE 1
#define RPLAY_PORT 5555
#define RPTP_PORT 5556
#define OLD_RPLAY_PORT 55555
#define OLD_RPTP_PORT 55556
#define RPLAY_PACKET_ID 30 /* id sent with rplay 3.x packets */
/* Attributes: */
#define RPLAY_NULL 0
#define RPLAY_PLAY 1
#define RPLAY_STOP 2
#define RPLAY_PAUSE 3
#define RPLAY_CONTINUE 4
#define RPLAY_SOUND 5
#define RPLAY_VOLUME 6
#define RPLAY_NSOUNDS 7
#define RPLAY_COMMAND 8
#define RPLAY_APPEND 9
#define RPLAY_INSERT 10
#define RPLAY_DELETE 11
#define RPLAY_CHANGE 12
#define RPLAY_COUNT 13
#define RPLAY_LIST_COUNT 14
#define RPLAY_PRIORITY 15
#define RPLAY_RANDOM_SOUND 16
#define RPLAY_PING 17
#define RPLAY_RPTP_SERVER 18
#define RPLAY_RPTP_SERVER_PORT 19
#define RPLAY_RPTP_SEARCH 20
#define RPLAY_RPTP_FROM_SENDER 21
#define RPLAY_SAMPLE_RATE 22
#define RPLAY_RESET 23
#define RPLAY_DONE 24
#define RPLAY_CLIENT_DATA 25
#define RPLAY_LIST_NAME 26
#define RPLAY_PUT 27
#define RPLAY_ID 28
#define RPLAY_SEQUENCE 29
#define RPLAY_DATA 30
#define RPLAY_DATA_SIZE 31
/* audio formats */
#define RPLAY_FORMAT_NONE 0
#define RPLAY_FORMAT_LINEAR_8 1 /* 8-bit linear PCM */
#define RPLAY_FORMAT_ULINEAR_8 2 /* 8-bit unsigned linear PCM */
#define RPLAY_FORMAT_LINEAR_16 3 /* 16-bit linear PCM */
#define RPLAY_FORMAT_ULINEAR_16 4 /* 16-bit unsigned linear PCM */
#define RPLAY_FORMAT_ULAW 5 /* 8-bit ISDN u-law */
#define RPLAY_FORMAT_G721 6 /* CCITT G.721 4-bits ADPCM */
#define RPLAY_FORMAT_G723_3 7 /* CCITT G.723 3-bits ADPCM */
#define RPLAY_FORMAT_G723_5 8 /* CCITT G.723 5-bits ADPCM */
#define RPLAY_FORMAT_GSM 9 /* GSM 0.610 13 kbit/s RPE/LTP speech compression */
/* audio byte order */
#define RPLAY_BIG_ENDIAN 1
#define RPLAY_LITTLE_ENDIAN 2
/* Audio ports: */
#define RPLAY_AUDIO_PORT_NONE (1<<0)
#define RPLAY_AUDIO_PORT_SPEAKER (1<<1)
#define RPLAY_AUDIO_PORT_HEADPHONE (1<<2)
#define RPLAY_AUDIO_PORT_LINEOUT (1<<3)
/* Attribute restrictions: */
#define RPLAY_MIN_VOLUME 0
#define RPLAY_MAX_VOLUME 255
#define RPLAY_MIN_PRIORITY 0
#define RPLAY_MAX_PRIORITY 255
/* Attribute defaults: */
#define RPLAY_DEFAULT_VOLUME 127
#define RPLAY_DEFAULT_PRIORITY 0
#define RPLAY_DEFAULT_COUNT 1
#define RPLAY_DEFAULT_LIST_COUNT 1
#define RPLAY_DEFAULT_RANDOM_SOUND -1
#define RPLAY_DEFAULT_SAMPLE_RATE 0
#define RPLAY_DEFAULT_OFFSET 0
#define RPLAY_DEFAULT_BYTE_ORDER 0
#define RPLAY_DEFAULT_CHANNELS 0
#define RPLAY_DEFAULT_BITS 0
/* RPLAY errors used by rplay_errno: */
#define RPLAY_ERROR_NONE 0
#define RPLAY_ERROR_MEMORY 1
#define RPLAY_ERROR_HOST 2
#define RPLAY_ERROR_CONNECT 3
#define RPLAY_ERROR_SOCKET 4
#define RPLAY_ERROR_WRITE 5
#define RPLAY_ERROR_CLOSE 6
#define RPLAY_ERROR_PACKET_SIZE 7
#define RPLAY_ERROR_BROADCAST 8
#define RPLAY_ERROR_ATTRIBUTE 9
#define RPLAY_ERROR_COMMAND 10
#define RPLAY_ERROR_INDEX 11
#define RPLAY_ERROR_MODIFIER 12
/* RPTP errors used by rptp_errno: */
#define RPTP_ERROR_NONE 0
#define RPTP_ERROR_MEMORY 1
#define RPTP_ERROR_HOST 2
#define RPTP_ERROR_CONNECT 3
#define RPTP_ERROR_SOCKET 4
#define RPTP_ERROR_OPEN 5
#define RPTP_ERROR_READ 6
#define RPTP_ERROR_WRITE 7
#define RPTP_ERROR_PING 8
#define RPTP_ERROR_TIMEOUT 9
#define RPTP_ERROR_PROTOCOL 10
/* RPTP response types: */
#define RPTP_ERROR '-'
#define RPTP_OK '+'
#define RPTP_TIMEOUT '!'
#define RPTP_NOTIFY '@'
/* RPLAY 2.0 support: */
#define OLD_RPLAY_PLAY 1
#define OLD_RPLAY_STOP 2
#define OLD_RPLAY_PAUSE 3
#define OLD_RPLAY_CONTINUE 4
/* Definitions for the RPTP asynchronous I/O system: */
#define RPTP_ASYNC_READ 1
#define RPTP_ASYNC_WRITE 2
#define RPTP_ASYNC_RAW 4
#define RPTP_ASYNC_ENABLE 1
#define RPTP_ASYNC_DISABLE 2
/* These event can be used to specify a mask: */
#define RPTP_EVENT_OK (1 << 0)
#define RPTP_EVENT_ERROR (1 << 1)
#define RPTP_EVENT_TIMEOUT (1 << 2)
#define RPTP_EVENT_OTHER (1 << 3)
#define RPTP_EVENT_CONTINUE (1 << 4)
#define RPTP_EVENT_DONE (1 << 5)
#define RPTP_EVENT_PAUSE (1 << 6)
#define RPTP_EVENT_PLAY (1 << 7)
#define RPTP_EVENT_SKIP (1 << 8)
#define RPTP_EVENT_STATE (1 << 9)
#define RPTP_EVENT_STOP (1 << 10)
#define RPTP_EVENT_VOLUME (1 << 11)
#define RPTP_EVENT_CLOSE (1 << 12)
#define RPTP_EVENT_FLOW (1 << 13)
#define RPTP_EVENT_MODIFY (1 << 14)
#define RPTP_EVENT_LEVEL (1 << 15)
#define RPTP_EVENT_POSITION (1 << 16)
#define RPTP_EVENT_ALL 0x0000ffff
/* Size restrictions for RPTP: */
#define RPTP_MAX_LINE 1024
#define RPTP_MAX_ARGS 32
/* rplay object attributes: */
typedef struct _rplay_attrs
{
struct _rplay_attrs *next;
char *sound;
int volume;
int count;
char *rptp_server;
unsigned short rptp_server_port;
int rptp_search;
unsigned long sample_rate;
char *client_data;
}
RPLAY_ATTRS;
/* the rplay object */
typedef struct _rplay
{
struct _rplay_attrs *attrs;
struct _rplay_attrs **attrsp;
char *buf;
int len;
int size;
int command;
int nsounds;
int count;
int priority;
int random_sound;
char *list_name;
int id;
unsigned long sequence;
unsigned short data_size;
char *data;
}
RPLAY;
extern int rplay_errno;
extern int rptp_errno;
extern char *rplay_errlist[];
extern char *rptp_errlist[];
#ifdef __cplusplus
#ifndef __STDC__
#define __STDC__
#endif
extern "C"
{
#endif
#ifdef __STDC__
extern void * xmalloc(size_t size);
extern RPLAY *rplay_create (int rplay_command);
extern char *rplay_convert (char *buf);
extern int rplay_pack (RPLAY * rp);
extern RPLAY *rplay_unpack (char *buf);
extern void rplay_destroy (RPLAY * rp);
extern long rplay_set (RPLAY *,...);
extern long rplay_get (RPLAY *,...);
extern int rplay_open (char *host);
extern int rplay_open_port (char *host, int port);
extern int rplay_open_sockaddr_in (struct sockaddr_in *saddr);
extern int rplay (int rplay_fd, RPLAY * rp);
extern int rplay_close (int rplay_fd);
extern void rplay_perror (char *message);
extern int rplay_open_display (void);
extern int rplay_display (char *sound);
extern int rplay_local (char *sound);
extern int rplay_host (char *host, char *sound);
extern int rplay_host_volume (char *host, char *sound, int volume);
extern int rplay_sound (int rplay_fd, char *sound);
extern int rplay_ping (char *host);
extern int rplay_ping_sockaddr_in (struct sockaddr_in *saddr);
extern int rplay_ping_sockfd (int sock_fd);
extern char *rplay_default_host (void);
extern int rplay_default (char *sound);
extern int rplay_open_default (void);
extern int rptp_open (char *host, int port, char *response, int response_size);
extern int rptp_read (int rptp_fd, char *buf, int nbytes);
extern int rptp_write (int rptp_fd, char *buf, int nbytes);
extern int rptp_close (int rptp_fd);
extern void rptp_perror (char *message);
extern int rptp_putline (int rptp_fd, char *fmt,...);
extern int rptp_getline (int rptp_fd, char *buf, int nbytes);
extern int rptp_command (int rptp_fd, char *command, char *response, int response_size);
extern char *rptp_parse (char *response, char *name);
extern int rptp_async_putline (int rptp_fd, void (*callback)(), char *fmt, ...);
extern int rptp_async_write (int rptp_fd, void (*callback)(), char *ptr, int nbytes);
extern void rptp_async_register(int rptp_fd, int what, void (*callback)());
extern void rptp_async_notify (int rptp_fd, int mask, void (*callback)());
extern void rptp_async_process (int rptp_fd, int what);
extern int rptp_main_loop (void);
extern void rptp_stop_main_loop (int);
#else
extern RPLAY *rplay_create ( /* int rplay_command */ );
extern char *rplay_convert ( /* char *buf */ );
extern int rplay_pack ( /* RPLAY *rp */ );
extern RPLAY *rplay_unpack ( /* char *buf */ );
extern void rplay_destroy ( /* RPLAY *rp */ );
extern int rplay_set ( /* RPLAY *, ... */ );
extern int rplay_get ( /* RPLAY *, ... */ );
extern int rplay_open ( /* char *host */ );
extern int rplay_open_port ( /* char *host, int port */ );
extern int rplay_open_sockaddr_in ( /* struct sockaddr_in *saddr */ );
extern int rplay ( /* int rplay_fd, RPLAY *rp */ );
extern int rplay_close ( /* int rplay_fd */ );
extern void rplay_perror ( /* char *message */ );
extern int rplay_open_display ();
extern int rplay_display ( /* char *sound */ );
extern int rplay_local ( /* char *sound */ );
extern int rplay_host ( /* char *host, char *sound */ );
extern int rplay_host_volume ( /* char *host, char *sound, int volume */ );
extern int rplay_sound ( /* int rplay_fd, char *sound */ );
extern int rplay_ping ( /* char *host */ );
extern int rplay_ping_sockaddr_in ( /* struct sockaddr_in *saddr */ );
extern int rplay_ping_sockfd ( /* int sock_fd */ );
extern char *rplay_default_host ();
extern int rplay_default ( /* char *sound */ );
extern int rplay_open_default ();
extern int rptp_open ( /* char *host, int port, char *response, int response_size */ );
extern int rptp_read ( /* int rptp_fd, char *buf, int nbytes */ );
extern int rptp_write ( /* int rptp_fd, char *buf, int nbytes */ );
extern int rptp_close ( /* int rptp_fd */ );
extern void rptp_perror ( /* char *message */ );
extern int rptp_putline ( /* int rptp_fd, char *fmt, ... */ );
extern int rptp_getline ( /* int rptp_fd, char *buf, int nbytes */ );
extern int rptp_command ( /* int rptp_fd, char *command, char *response, int response_size */ );
extern char *rptp_parse ( /* char *response, char *name */ );
extern int rptp_async_putline ( /* int rptp_fd, void (callback *)(), char *fmt, ... */ );
extern int rptp_async_write ( /* int rptp_fd, void (callback *)(), char *ptr, int nbytes */ );
extern void rptp_async_register (/* int rptp_fd, int what, void (callback*)() */ );
extern void rptp_async_notify ( /* int rptp_fd, int what, void (*callback)() */ );
extern void rptp_async_process ( /* int rptp_fd, int what */ );
extern int rptp_main_loop ();
extern void rptp_stop_main_loop ();
#endif
#ifdef __cplusplus
}
#endif
#endif /* _rplay_h */
|