[PD-cvs] externals/OSCx/src dumpOSC.c, 1.4, 1.5 htmsocket.c, 1.4, 1.5 OSC.c, 1.5, 1.6 OSC-common.h, 1.3, 1.4 OSC.dsp, 1.2, 1.3 OSCroute.c, 1.5, 1.6 OSC-system-dependent.c, 1.1, 1.2 sendOSC.c, 1.4, 1.5 VERSION, 1.2, 1.3
Georg Holzmann
grholzi at users.sourceforge.net
Tue Aug 30 22:54:07 CEST 2005
Update of /cvsroot/pure-data/externals/OSCx/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21615
Modified Files:
dumpOSC.c htmsocket.c OSC.c OSC-common.h OSC.dsp OSCroute.c
OSC-system-dependent.c sendOSC.c VERSION
Log Message:
changes by piotr majdak
Index: OSC.dsp
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/OSC.dsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** OSC.dsp 10 Mar 2004 00:01:56 -0000 1.2
--- OSC.dsp 30 Aug 2005 20:54:05 -0000 1.3
***************
*** 44,48 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAFOSC_EXPORTS" /YX /FD /c
! # ADD CPP /nologo /MT /W3 /GX /O2 /I "../../../pd/src" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OSC_EXPORTS" /D "NT" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
--- 44,48 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAFOSC_EXPORTS" /YX /FD /c
! # ADD CPP /nologo /MT /W3 /GX /O2 /I "c:\pd\src" /I "LIBOSC" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OSC_EXPORTS" /D "NT" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
***************
*** 54,58 ****
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
! # ADD LINK32 pd.lib libc.lib kernel32.lib wsock32.lib LIBOSC.lib /nologo /dll /machine:I386 /nodefaultlib /out:"../../../pd/extra/OSC.dll" /libpath:"../../../pd/lib" /libpath:"../../../pd/bin"
# SUBTRACT LINK32 /pdb:none
--- 54,58 ----
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
! # ADD LINK32 c:\pd\bin\pd.lib libc.lib kernel32.lib wsock32.lib LIBOSC/Release/LIBOSC.lib /nologo /dll /machine:I386 /nodefaultlib /libpath:"../../../pd/lib" /libpath:"../../../pd/bin"
# SUBTRACT LINK32 /pdb:none
***************
*** 71,75 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAFOSC_EXPORTS" /YX /FD /GZ /c
! # ADD CPP /nologo /MTd /W3 /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OSC_EXPORTS" /D "NT" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
--- 71,75 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RAFOSC_EXPORTS" /YX /FD /GZ /c
! # ADD CPP /nologo /MTd /W3 /GX /ZI /Od /I "c:\pd\src" /I "LIBOSC" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OSC_EXPORTS" /D "NT" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
***************
*** 81,85 ****
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 pd.lib libc.lib kernel32.lib wsock32.lib LIBOSC.lib /nologo /dll /debug /machine:I386 /nodefaultlib /pdbtype:sept
!ENDIF
--- 81,85 ----
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 c:\pd\bin\pd.lib libc.lib kernel32.lib wsock32.lib LIBOSC/Release/LIBOSC.lib /nologo /dll /debug /machine:I386 /nodefaultlib /pdbtype:sept /libpath:"c:\pd\src"
!ENDIF
***************
*** 106,114 ****
# Begin Source File
SOURCE=.\OSC.c
# End Source File
# Begin Source File
! SOURCE=.\routeOSC.c
# End Source File
# Begin Source File
--- 106,118 ----
# Begin Source File
+ SOURCE=".\OSC-system-dependent.c"
+ # End Source File
+ # Begin Source File
+
SOURCE=.\OSC.c
# End Source File
# Begin Source File
! SOURCE=.\OSCroute.c
# End Source File
# Begin Source File
Index: OSC.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/OSC.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** OSC.c 19 Aug 2004 22:01:38 -0000 1.5
--- OSC.c 30 Aug 2005 20:54:05 -0000 1.6
***************
*** 6,9 ****
--- 6,10 ----
-- smoothed out build, clean up for Darwin <hans at at.or.at> 2004.04.04
-- shoutz: miller and the others
+ -- Windows-ification by Piotr Majdak <piotr at majdak.com> 30.08.2005
*/
***************
*** 15,19 ****
#include "OSC-common.h"
! #define VERSION "0.2"
#ifndef OSC_API
--- 16,20 ----
#include "OSC-common.h"
! #define VERSION "0.3"
#ifndef OSC_API
***************
*** 29,37 ****
OSC_API void OSC_setup(void);
OSC_API void OSC_version(t_OSC*);
! /*
OSC_API void sendOSC_setup(void);
OSC_API void dumpOSC_setup(void);
OSC_API void OSCroute_setup(void);
! */
static t_class* OSC_class;
--- 30,38 ----
OSC_API void OSC_setup(void);
OSC_API void OSC_version(t_OSC*);
!
OSC_API void sendOSC_setup(void);
OSC_API void dumpOSC_setup(void);
OSC_API void OSCroute_setup(void);
!
static t_class* OSC_class;
***************
*** 46,55 ****
OSC_API void OSC_version (t_OSC *x) {
! // EnterCallback();
! post("OSC4PD Version " VERSION
! "\n ¯\\ original code by matt wright. pd-fication jdl at xdv.org\n"
! " · Win32-port raf at interaccess.com unified versions hans at at.or.at\n"
! " \\_ Compiled " __TIME__ " " __DATE__);
! // ExitCallback();
}
--- 47,55 ----
OSC_API void OSC_version (t_OSC *x) {
! post("OSC4PD Version " VERSION "\n"
! " Original code by matt wright. pd-fication jdl at xdv.org\n"
! " Win32-port raf at interaccess.com unified versions hans at at.or.at\n"
! " Adaptations for Windows: piotr at majdak.com\n"
! " Compiled: "__DATE__);
}
***************
*** 65,68 ****
post("O : Open Sound Control 4 PD, http://www.cnmat.berkeley.edu/OSC");
post(" S : original code by matt wright, pd hakcs cxc, Win32-port raf at interaccess.com");
! post(" C: ver: "VERSION ", compiled: "__DATE__);
}
--- 65,68 ----
post("O : Open Sound Control 4 PD, http://www.cnmat.berkeley.edu/OSC");
post(" S : original code by matt wright, pd hakcs cxc, Win32-port raf at interaccess.com");
! post(" C: ver: "VERSION ", compiled: "__DATE__ " -- adapted by piotr at majdak.com");
}
Index: OSC-common.h
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/OSC-common.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** OSC-common.h 7 Apr 2004 04:15:06 -0000 1.3
--- OSC-common.h 30 Aug 2005 20:54:05 -0000 1.4
***************
*** 42,46 ****
#define FALSE 0
#endif
!
/* Fixed byte width types */
--- 42,60 ----
#define FALSE 0
#endif
!
!
! #ifdef WIN32
! #include <stdio.h>
! #ifdef OSC_EXPORTS
! #define OSC_API __declspec(dllexport)
! #else
! #define OSC_API __declspec(dllimport)
! #endif
! #ifdef _DEBUG
! #define DEBUG
! #endif
! #endif
!
! //#define int32_t t_int
/* Fixed byte width types */
***************
*** 58,60 ****
void OSCWarning(char *s, ...);
-
--- 72,73 ----
Index: VERSION
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/VERSION,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** VERSION 10 Mar 2004 00:01:56 -0000 1.2
--- VERSION 30 Aug 2005 20:54:05 -0000 1.3
***************
*** 1 ****
! 0.2
--- 1 ----
! 0.3
Index: htmsocket.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/htmsocket.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** htmsocket.c 19 Aug 2004 22:01:38 -0000 1.4
--- htmsocket.c 30 Aug 2005 20:54:05 -0000 1.5
***************
*** 55,58 ****
--- 55,59 ----
#include <stdlib.h>
#include "OSC-common.h"
+ #include <stdio.h>
#else
#include <stdio.h>
***************
*** 114,122 ****
#endif
desc *o;
o = malloc(sizeof(*o));
if(!o)
return 0;
- int oval = 1;
#ifndef WIN32
--- 115,124 ----
#endif
+ char oval = 1;
+
desc *o;
o = malloc(sizeof(*o));
if(!o)
return 0;
#ifndef WIN32
Index: dumpOSC.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/dumpOSC.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** dumpOSC.c 19 Aug 2004 22:01:38 -0000 1.4
--- dumpOSC.c 30 Aug 2005 20:54:05 -0000 1.5
***************
*** 78,82 ****
// typedef void (*t_fdpollfn)(void *ptr, int fd);
! void sys_addpollfn(int fd, t_fdpollfn fn, void *ptr);
--- 78,82 ----
// typedef void (*t_fdpollfn)(void *ptr, int fd);
! //void sys_addpollfn(int fd, t_fdpollfn fn, void *ptr);
***************
*** 93,96 ****
--- 93,97 ----
#include <ctype.h>
#include <signal.h>
+ #include <stdio.h>
#else
#include <stdio.h>
***************
*** 135,139 ****
} *ClientAddr;
! typedef unsigned long long osc_time_t;
Boolean ShowBytes = FALSE;
--- 136,140 ----
} *ClientAddr;
!
Boolean ShowBytes = FALSE;
***************
*** 145,148 ****
--- 146,157 ----
#endif
+ #ifdef WIN32
+ typedef unsigned __int64 osc_time_t;
+ #else
+ typedef unsigned long long osc_time_t;
+ #endif
+
+
+
static int initudp(int chan);
static void closeudp(int sockfd);
***************
*** 157,160 ****
--- 166,170 ----
Boolean IsNiceString(char *string, char *boundary) ;
void complain(char *s, ...);
+ osc_time_t ReadTime(const char* src);
#define MAXMESG 32768
***************
*** 226,230 ****
#endif
! if(!dumpOSC_SendReply(mbuf, n, &x->x_server, clilen, sockfd))
{
dumpOSC_ParsePacket(x, mbuf, n, ra);
--- 236,240 ----
#endif
! //if(!dumpOSC_SendReply(mbuf, n, &x->x_server, clilen, sockfd))
{
dumpOSC_ParsePacket(x, mbuf, n, ra);
***************
*** 507,511 ****
//*******************
! void WriteTime(char* dst, osc_time_t osctime)
{
*(int32_t*)dst = htonl((int32_t)(osctime >> 32));
--- 517,521 ----
//*******************
! /*void WriteTime(char* dst, osc_time_t osctime)
{
*(int32_t*)dst = htonl((int32_t)(osctime >> 32));
***************
*** 526,530 ****
double TimeToSeconds(osc_time_t osctime)
{
! return (double)osctime * 2.3283064365386962890625e-10 /* 1/2^32 */;
}
--- 536,541 ----
double TimeToSeconds(osc_time_t osctime)
{
! return (double)osctime * 2.3283064365386962890625e-10 // 1/2^32 ;
! // ^^^^^^^^^^^^^^^ isn't working on WIN32 (and on other machines: doesn't make sense!)
}
***************
*** 533,536 ****
--- 544,548 ----
return x >= 0.0 ? x+0.5 : x-0.5;
}
+ */
/*
void WriteLogicalTime(char* dst)
***************
*** 552,559 ****
*/
! void WriteLogicalTime(char* dst)
{
double sTime = clock_gettimesince(19230720) / 1000.0;
! double tau = sTime - timeRound(sTime);
//fprintf(stderr, "sSec = %f tau = %f\n", sTime, tau);
--- 564,571 ----
*/
! /*void WriteLogicalTime(char* dst)
{
double sTime = clock_gettimesince(19230720) / 1000.0;
! double tau = sTime - (double)timeRound(sTime);
//fprintf(stderr, "sSec = %f tau = %f\n", sTime, tau);
***************
*** 563,567 ****
}
! Boolean dumpOSC_SendReply(char *buf, int n, void *clientDesc, int clientDescLenght, int fd)
{
if((n == 24) && (strcmp(buf, "#time") == 0))
--- 575,579 ----
}
! int dumpOSC_SendReply(char *buf, int n, void *clientDesc, int clientDescLenght, int fd)
{
if((n == 24) && (strcmp(buf, "#time") == 0))
***************
*** 588,592 ****
return FALSE;
}
! }
//**********************
--- 600,604 ----
return FALSE;
}
! }*/
//**********************
Index: OSC-system-dependent.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/OSC-system-dependent.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** OSC-system-dependent.c 7 Apr 2004 04:15:06 -0000 1.1
--- OSC-system-dependent.c 30 Aug 2005 20:54:05 -0000 1.2
***************
*** 51,55 ****
#include <stdarg.h>
! #include <stdio.h>
void fatal_error(char *s, ...) {
--- 51,58 ----
#include <stdarg.h>
! #include <stdio.h>
! #ifdef WIN32
! #include <stdlib.h>
! #endif
void fatal_error(char *s, ...) {
Index: OSCroute.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/OSCroute.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** OSCroute.c 28 Jun 2005 18:37:59 -0000 1.5
--- OSCroute.c 30 Aug 2005 20:54:05 -0000 1.6
***************
*** 57,60 ****
--- 57,61 ----
#include <stdlib.h>
#include <string.h>
+ #include <stdio.h>
#endif
#ifdef __APPLE__
***************
*** 66,70 ****
/* structure definition of your object */
! #define MAX_NUM 20
#define OSC_ROUTE_VERSION "1.05"
/* Version 1.04: Allows #1 thru #9 as typed-in arguments
--- 67,71 ----
/* structure definition of your object */
! #define MAX_NUM 128
#define OSC_ROUTE_VERSION "1.05"
/* Version 1.04: Allows #1 thru #9 as typed-in arguments
***************
*** 126,130 ****
// setup
#ifdef WIN32
! OSC_API void OSCroute_setup(void) {
#else
void OSCroute_setup(void) {
--- 127,131 ----
// setup
#ifdef WIN32
! OSC_API void OSCroute_setup(void) {
#else
void OSCroute_setup(void) {
***************
*** 150,154 ****
post("OSCroute object version " OSC_ROUTE_VERSION " by Matt Wright. pd: jdl Win32 raf.");
! post("OSCroute Copyright © 1999 Regents of the University of California. All Rights Reserved.");
}
--- 151,155 ----
post("OSCroute object version " OSC_ROUTE_VERSION " by Matt Wright. pd: jdl Win32 raf.");
! post("OSCroute Copyright © 1999 Regents of the Univ. of California. All Rights Reserved.");
}
Index: sendOSC.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/sendOSC.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sendOSC.c 19 Aug 2004 22:01:38 -0000 1.4
--- sendOSC.c 30 Aug 2005 20:54:05 -0000 1.5
***************
*** 219,223 ****
}
! void sendOSC_senduntyped(t_sendOSC *x, t_symbol *s, int argc, t_atom *argv)
{
char* targv[MAXPDARG];
--- 219,223 ----
}
! /*void sendOSC_senduntyped(t_sendOSC *x, t_symbol *s, int argc, t_atom *argv)
{
char* targv[MAXPDARG];
***************
*** 248,252 ****
// exit(3);
}
! }
//////////////////////////////////////////////////////////////////////
--- 248,252 ----
// exit(3);
}
! }*/
//////////////////////////////////////////////////////////////////////
***************
*** 268,282 ****
messageName = "";
- #ifdef DEBUG
- post ("sendOSC: messageName: %s", messageName);
- #endif
-
for (c=0;c<argc;c++) {
! atom_string(argv+c,tmp, 80);
#ifdef DEBUG
! // post ("sendOSC: %d, %s",c, tmp);
#endif
--- 268,280 ----
messageName = "";
+ if(argc>MAX_ARGS)
+ { post ("sendOSC: too many arguments! (max: %d)", MAX_ARGS); return; }
for (c=0;c<argc;c++) {
! atom_string(argv+c,tmp, MAXPDSTRING);
#ifdef DEBUG
! post ("sendOSC: %d, %s",c, tmp);
#endif
***************
*** 285,289 ****
#ifdef DEBUG
! // post ("sendOSC: %d, %s",c, targv[c]);
#endif
}
--- 283,287 ----
#ifdef DEBUG
! post ("sendOSC: %d, %s",c, targv[c]);
#endif
}
***************
*** 299,331 ****
j = 1;
for (i = j; i < argc; i++) {
! token = strtok(targv[i],",");
! args[i-j] = ParseToken(token);
#ifdef DEBUG
! printf("cell-cont: %s\n", targv[i]);
! printf(" type-id: %d\n", args[i-j]);
#endif
! numArgs = i;
}
if(WriteMessage(x->x_oscbuf, messageName, numArgs, args)) {
! post("sendOSC: usage error, write-msg failed: %s", OSC_errorMessage);
! return;
}
if(!x->x_bundle) {
! /* // post("sendOSC: accumulating bundle, not sending things ..."); */
! /* } else { */
! // post("sendOSC: yeah and OUT!");
! SendBuffer(x->x_htmsocket, x->x_oscbuf);
! OSC_initBuffer(x->x_oscbuf, SC_BUFFER_SIZE, bufferForOSCbuf);
}
- //CommandLineMode(argc, targv, x->x_htmsocket);
- //useTypeTags = 0;
}
else {
post("sendOSC: not connected");
- // exit(3);
}
}
--- 297,323 ----
j = 1;
for (i = j; i < argc; i++) {
! token = strtok(targv[i],",");
! args[i-j] = ParseToken(token);
#ifdef DEBUG
! printf("cell-cont: %s\n", targv[i]);
! printf(" type-id: %d\n", args[i-j]);
#endif
! numArgs = i;
}
if(WriteMessage(x->x_oscbuf, messageName, numArgs, args)) {
! post("sendOSC: usage error, write-msg failed: %s", OSC_errorMessage);
! return;
}
if(!x->x_bundle) {
! SendBuffer(x->x_htmsocket, x->x_oscbuf);
! OSC_initBuffer(x->x_oscbuf, SC_BUFFER_SIZE, bufferForOSCbuf);
}
}
else {
post("sendOSC: not connected");
}
}
***************
*** 352,356 ****
#ifdef WIN32
! OSC_API void sendOSC_setup(void) {
#else
void sendOSC_setup(void) {
--- 344,348 ----
#ifdef WIN32
! void sendOSC_setup(void) {
#else
void sendOSC_setup(void) {
More information about the Pd-cvs
mailing list