Skip to content

Commit

Permalink
merge conflict resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
vlazzarini committed Sep 27, 2018
2 parents dc84e0e + b74aa7a commit 65aba4d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Opcodes/emugens/scugens.c
Expand Up @@ -281,7 +281,7 @@ static int32_t lagud_init(CSOUND *csound, LagUD *p) {

/* ------------------ Trig -------------------------
Returns 1 for a given duration whenever signal crosses from
Returns 1 for a given duration whenever signal crosses from
non-positive to positive
kout trig kin, kduration
Expand Down
2 changes: 1 addition & 1 deletion Opcodes/faustgen.cpp
Expand Up @@ -969,7 +969,7 @@ int32_t init_faustgen(CSOUND *csound, faustgen *p) {
pthread_create((pthread_t *)&thread, &attr, init_faustgen_thread, data);
csound->RegisterDeinitCallback(csound, p, delete_faustgen);
pthread_join((pthread_t)thread, (void **)&ret);

if (ret == NULL)
return OK;
else
Expand Down
38 changes: 27 additions & 11 deletions Opcodes/socksend.c
Expand Up @@ -2,6 +2,7 @@
socksend.c:
Copyright (C) 2006 by John ffitch
2018 by Victor Lazzarini
This file is part of Csound.
Expand Down Expand Up @@ -792,8 +793,11 @@ typedef struct {
ARRAYDAT *dest;
ARRAYDAT *type;
ARRAYDAT *arg;
<<<<<<< HEAD
MYFLT *imtu;
int mtu;
=======
>>>>>>> b74aa7aadf06c548fa17ed27844ca5b8c1682d14
AUXCH aux; /* MTU bytes */
int32_t sock, iargs;
MYFLT last;
Expand All @@ -812,17 +816,29 @@ static int oscbundle_init(CSOUND *csound, OSCBUNDLE *p) {
return csound->InitError(csound, "arg array needs to be two dimensional\n");
if(p->type->dimensions > 1 ||
p->dest->dimensions > 1)
<<<<<<< HEAD
return csound->InitError(csound, "type and dest arrays need to be unidimensional\n");
=======
return csound->InitError(csound, "%s",
Str("type and dest arrays need to be unidimensionsal\n"));
>>>>>>> b74aa7aadf06c548fa17ed27844ca5b8c1682d14
if((p->type->sizes[0] !=
p->dest->sizes[0]))
return csound->InitError(csound, "type and dest arrays need to have the same size\n");
return csound->InitError(csound, "%s",
Str("type and dest arrays need to have the same size\n"));
p->no_msgs = p->type->sizes[0];
if(p->no_msgs < p->arg->sizes[0])
<<<<<<< HEAD
return csound->InitError(csound, "arg array not big enough\n");

if(*p->imtu) p->mtu = (int) *p->imtu;
else p->mtu = MAX_PACKET_SIZE;

=======
return csound->InitError(csound, "%s",
Str("arg array not big enough\n"));

>>>>>>> b74aa7aadf06c548fa17ed27844ca5b8c1682d14
#if defined(WIN32) && !defined(__CYGWIN__)
WSADATA wsaData = {0};
int32_t err;
Expand Down Expand Up @@ -857,7 +873,7 @@ static int oscbundle_init(CSOUND *csound, OSCBUNDLE *p) {

#define INCR_AND_CHECK(S) buffsize += S; \
if(buffsize >= p->mtu) { \
csound->Warning(csound, "Bundle msg exceeded MTU, not sent\n"); \
csound->Warning(csound, "Bundle msg exceeded max packet size, not sent\n"); \
return OK; }

static int oscbundle_perf(CSOUND *csound, OSCBUNDLE *p){
Expand All @@ -882,7 +898,7 @@ static int oscbundle_perf(CSOUND *csound, OSCBUNDLE *p){
cols = p->arg->sizes[1];
for(i = 0; i < p->no_msgs; i++, size = 0) {
int32_t siz;
dstr = dest[i].data;
dstr = dest[i].data;
dstrs = strlen(dstr)+1;
size += ceil((dstrs)/4.)*4;
tstr[0] = ',';
Expand All @@ -903,20 +919,20 @@ static int oscbundle_perf(CSOUND *csound, OSCBUNDLE *p){
tmp = ceil((tstrs)/4.)*4;
INCR_AND_CHECK(tmp)
strcpy(buff,tstr);
buff += tmp;
buff += tmp;
for(n = 0; n < msize; n++) {
switch(type[i].data[n]) {
case 'f':
if(n < cols)
if(n < cols)
fdata = (float) p->arg->data[cols*i+n];
else fdata = 0.f;
else fdata = 0.f;
byteswap((char *) &fdata, 4);
INCR_AND_CHECK(4)
memcpy(buff, &fdata, 4);
buff += 4;
break;
case 'i':
if(n < cols)
if(n < cols)
idata = (int32_t) p->arg->data[cols*i+n];
else idata = 0;
byteswap((char *) &idata, 4);
Expand All @@ -926,15 +942,15 @@ static int oscbundle_perf(CSOUND *csound, OSCBUNDLE *p){
break;
default:
csound->Message(csound,
"only bundles with i and f types are supported \n");
}
Str("only bundles with i and f types are supported \n"));
}
}
}

if (UNLIKELY(sendto(p->sock, (void*) p->aux.auxp, buffsize, 0, to,
sizeof(p->server_addr)) < 0))
sizeof(p->server_addr)) < 0))
return csound->PerfError(csound, &(p->h), Str("OSCbundle failed"));
p->last = *p->kwhen;
p->last = *p->kwhen;
}
return OK;
}
Expand Down
5 changes: 4 additions & 1 deletion Release_Notes/Version_6.12.md
Expand Up @@ -54,7 +54,10 @@ scores and many bug fixes.
- OSCcount returns the number of OSC incoming messages pending

- faustplay and faustdsp are new opcodes splitting the faust DSP
instantiation and performance.
instantiation and performance.

- OSCbundle sends a collection of similr OSC essages as a single packet
for efficieny.

### New Gen and Macros

Expand Down

0 comments on commit 65aba4d

Please sign in to comment.