Update of /cvsroot/pure-data/externals/grill/flext/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15710/source
Modified Files: flbase.cpp flbase.h Log Message: added flext_base::GetCanvasDir to retrieve folder where patcher resides renamed flext_base::CanvasArgs to GetCanvasArgs fixed flext install routine for bcc makefile
Index: flbase.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flbase.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** flbase.cpp 23 May 2005 16:52:44 -0000 1.23 --- flbase.cpp 30 Jul 2005 12:21:41 -0000 1.24 *************** *** 150,154 ****
! void flext_obj::CanvasArgs(AtomList &args) const { #if FLEXT_SYS == FLEXT_SYS_PD --- 150,154 ----
! void flext_obj::GetCanvasArgs(AtomList &args) const { #if FLEXT_SYS == FLEXT_SYS_PD *************** *** 156,161 **** t_atom *argv; canvas_getargs(&argc,&argv); ! args(argc); ! for(int i = 0; i < argc; ++i) args[i] = argv[i]; #else #pragma message("Not implemented") --- 156,160 ---- t_atom *argv; canvas_getargs(&argc,&argv); ! args(argc,argv); #else #pragma message("Not implemented") *************** *** 163,164 **** --- 162,191 ---- #endif } + + + #if FLEXT_SYS == FLEXT_SYS_MAX + static short patcher_myvol(t_patcher *x) + { + t_box *w; + if(x->p_vol) + return x->p_vol; + else if((w = (t_box *)x->p_vnewobj) != NULL) + return patcher_myvol(w->b_patcher); + else + return 0; + } + #endif + + void flext_obj::GetCanvasDir(char *buf,size_t bufsz) const + { + #if FLEXT_SYS == FLEXT_SYS_PD + const char *c = GetString(canvas_getdir(thisCanvas())); + strncpy(buf,c,bufsz); + #elif FLEXT_SYS == FLEXT_SYS_MAX + short path = patcher_myvol(thisCanvas()); + // \TODO dangerous!! no check for path length (got to be long enough... like 1024 chars) + path_topathname(path,NULL,buf); + #else + #error Not implemented + #endif + }
Index: flbase.h =================================================================== RCS file: /cvsroot/pure-data/externals/grill/flext/source/flbase.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** flbase.h 6 Jul 2005 16:08:04 -0000 1.32 --- flbase.h 30 Jul 2005 12:21:41 -0000 1.33 *************** *** 258,262 ****
//! Get the canvas arguments ! void CanvasArgs(AtomList &args) const;
//! @} FLEXT_OBJ_INTERNAL --- 258,265 ----
//! Get the canvas arguments ! void GetCanvasArgs(AtomList &args) const; ! ! //! Get the canvas/patcher directory ! void GetCanvasDir(char *buf,size_t bufsz) const;
//! @} FLEXT_OBJ_INTERNAL