diff options
author | Miller Puckette <millerpuckette@users.sourceforge.net> | 2005-10-15 23:14:28 +0000 |
---|---|---|
committer | Miller Puckette <millerpuckette@users.sourceforge.net> | 2005-10-15 23:14:28 +0000 |
commit | 9ac980fd47d057cccd89eb52909bd2afec79569a (patch) | |
tree | 84594bdc9f730e873c051d3085317827610b00fc /pd/src/t_tkcmd.c | |
parent | c23dc858c7362d6f72b797e5d06f3f81280d67b9 (diff) |
Bug fixes, notably for mac if no audio input device is available; also
worked around a problem in ASIO support on MSW (but need to fix it better.)
svn path=/trunk/; revision=3717
Diffstat (limited to 'pd/src/t_tkcmd.c')
-rw-r--r-- | pd/src/t_tkcmd.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/pd/src/t_tkcmd.c b/pd/src/t_tkcmd.c index def4a328..755aa1a0 100644 --- a/pd/src/t_tkcmd.c +++ b/pd/src/t_tkcmd.c @@ -479,13 +479,6 @@ static void pd_startfromgui( void) static void pdgui_setupsocket(void) { -#ifdef DEBUGCONNECT - debugfd = fopen("/Users/msp/bratwurst", "w"); - fprintf(debugfd, "turning stderr back on\n"); - fflush(debugfd); - dup2(fileno(debugfd), 2); - fprintf(stderr, "duped to stderr?\n"); -#endif #ifdef MSW pdgui_connecttosocket(); #else @@ -624,8 +617,26 @@ int Pdtcl_Init(Tcl_Interp *interp) { const char *argv = Tcl_GetVar(interp, "argv", 0); int portno, argno = 0; + /* argument passing seems to be different in MSW as opposed to + unix-likes. Here we check if we got sent a "port number" as an + argument. If so. we're to connect to a previously running pd (i.e., + pd got started first). If not, we start Pd from here. */ +#ifdef MSW if (argv && (portno = atoi(argv)) > 1) +#else + char *firstspace; + if (argv && (firstspace = strchr(argv, ' ')) && (portno = atoi(firstspace)) > 1) +#endif pdgui_setsock(portno); +#ifdef DEBUGCONNECT + debugfd = fopen("/Users/msp/bratwurst", "w"); + fprintf(debugfd, "turning stderr back on\n"); + fflush(debugfd); + dup2(fileno(debugfd), 2); + fprintf(stderr, "duped to stderr?\n"); + fprintf(stderr, "portno %d\n", pd_portno); + fprintf(stderr, "argv %s\n", argv); +#endif tk_pdinterp = interp; pdgui_startup(interp); interp->result = "loaded pdtcl_init"; |