remote.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef CSOUND_REMOTE_H
00025 #define CSOUND_REMOTE_H
00026
00027 #ifdef HAVE_SOCKETS
00028 #ifdef WIN32
00029 #include <winsock.h>
00030 #else
00031 #include <sys/socket.h>
00032 #include <netinet/in.h>
00033 #include <arpa/inet.h>
00034 #ifdef HAVE_UNISTD_H
00035 # include <unistd.h>
00036 #endif
00037 #endif
00038 #endif
00039
00040 #include <stdlib.h>
00041 #include <stdio.h>
00042 #ifdef HAVE_SYS_TYPES_H
00043 # include <sys/types.h>
00044 #endif
00045 #include <string.h>
00046 #include <errno.h>
00047
00048
00049 void m_chanmsg(CSOUND *csound, MEVENT *mep);
00050 char remoteID(CSOUND *csound);
00051
00052 #define REMOT_PORT 40002
00053
00054 #define SCOR_EVT 1
00055 #define MIDI_EVT 2
00056 #define MIDI_MSG 3
00057 #define MAXSEND (sizeof(EVTBLK) + 2*sizeof(int))
00058 #define GLOBAL_REMOT -99
00059
00060 typedef struct {
00061 int len;
00062 int type;
00063 char data[MAXSEND];
00064 } REMOT_BUF;
00065
00066 #ifdef HAVE_SOCKETS
00067
00068
00069 typedef struct {
00070 char *adr;
00071 int rfd;
00072 } SOCK;
00073
00074 typedef struct {
00075 SOCK *socksout;
00076 int *socksin;
00077 int *insrfd_list;
00078 int *chnrfd_list;
00079 int insrfd_count;
00080 int chnrfd_count;
00081 int *insrfd;
00082 int *chnrfd;
00083 char *ipadrs;
00084 struct sockaddr_in to_addr;
00085 struct sockaddr_in local_addr;
00086 REMOT_BUF CLsendbuf;
00087 int remote_port;
00088 } REMOTE_GLOBALS;
00089
00090 #endif
00091
00092 typedef struct {
00093 OPDS h;
00094 MYFLT *port;
00095 } REMOTEPORT;
00096
00097 typedef struct {
00098 OPDS h;
00099 MYFLT *str1, *str2, *insno[64];
00100 } INSREMOT;
00101
00102 typedef struct {
00103 OPDS h;
00104 MYFLT *str1, *insno[64];
00105 } INSGLOBAL;
00106
00107 typedef struct {
00108 OPDS h;
00109 MYFLT *str1, *str2, *chnum[16];
00110 } MIDREMOT;
00111
00112 typedef struct {
00113 OPDS h;
00114 MYFLT *str1, *chnum[16];
00115 } MIDGLOBAL;
00116
00117 int CLsend(CSOUND *csound, int conn, void *data, int length);
00118 int SVrecv(CSOUND *csound, int conn, void *data, int length);
00119
00120
00121 int insSendevt(CSOUND *p, EVTBLK *evt, int rfd);
00122
00123
00124 int insGlobevt(CSOUND *p, EVTBLK *evt);
00125
00126
00127 int MIDIsendevt(CSOUND *p, MEVENT *evt, int rfd);
00128
00129
00130
00131 int MIDIGlobevt(CSOUND *p, MEVENT *evt);
00132
00133
00134 int MIDIsend_msg(CSOUND *p, MEVENT *evt, int rfd);
00135
00136
00137
00138 int MIDIGlob_msg(CSOUND *p, MEVENT *evt);
00139
00140
00141 int* getRemoteSocksIn(CSOUND *csound);
00142
00143
00144 int getRemoteInsRfd(CSOUND *csound, int insno);
00145
00146
00147 int getRemoteInsRfdCount(CSOUND *csound);
00148
00149
00150 int getRemoteChnRfd(CSOUND *csound, int chan);
00151
00152 #endif