aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-07-30 12:21:41 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-07-30 12:21:41 +0000
commit5f9f3ed9b7c2ff07d8745c81d1a085c8eaa08737 (patch)
tree597a0e46cb60010efc1f4702dc445034ea100ac5
parentdd82923d4e8ef537e2e63956d0ec1138046fb996 (diff)
added flext_base::GetCanvasDir to retrieve folder where patcher resides
renamed flext_base::CanvasArgs to GetCanvasArgs fixed flext install routine for bcc makefile svn path=/trunk/; revision=3388
-rw-r--r--externals/grill/flext/buildsys/win/bmake-bcc-flext.inc6
-rw-r--r--externals/grill/flext/changes.txt1
-rw-r--r--externals/grill/flext/source/flbase.cpp33
-rw-r--r--externals/grill/flext/source/flbase.h5
4 files changed, 38 insertions, 7 deletions
diff --git a/externals/grill/flext/buildsys/win/bmake-bcc-flext.inc b/externals/grill/flext/buildsys/win/bmake-bcc-flext.inc
index 8dfb224e..0d82065e 100644
--- a/externals/grill/flext/buildsys/win/bmake-bcc-flext.inc
+++ b/externals/grill/flext/buildsys/win/bmake-bcc-flext.inc
@@ -55,9 +55,9 @@ FLEXTLIBINST=$(FLEXTLIB)
!endif
_install_:
- @if not exist $@ mkdir $(FLEXTINC) > nul
- @if not exist $@ mkdir $(FLEXTLIB) > nul
- @if not exist $@ mkdir $(FLEXTLIBINST) > nul
+ @if not exist $(FLEXTINC) mkdir $(FLEXTINC) > nul
+ @if not exist $(FLEXTLIB) mkdir $(FLEXTLIB) > nul
+ @if not exist $(FLEXTLIBINST) mkdir $(FLEXTLIBINST) > nul
copy $(TARGET) $(FLEXTLIBINST) > nul
!ifdef SHARED
diff --git a/externals/grill/flext/changes.txt b/externals/grill/flext/changes.txt
index 8c2cbb15..16e2c793 100644
--- a/externals/grill/flext/changes.txt
+++ b/externals/grill/flext/changes.txt
@@ -11,6 +11,7 @@ Version history:
0.5.1:
- optimizations for message handling and memory footprint
- enhanced build system for cygwin
+- added GetCanvasDir to retrieve folder in which the patcher resides
0.5.0:
- fixes for 64 bit builds (size_t is integer type of pointer size)
diff --git a/externals/grill/flext/source/flbase.cpp b/externals/grill/flext/source/flbase.cpp
index 2fd3fc97..63017d47 100644
--- a/externals/grill/flext/source/flbase.cpp
+++ b/externals/grill/flext/source/flbase.cpp
@@ -149,16 +149,43 @@ void canvas_getargs(int *argcp, t_atom **argvp);
#endif
-void flext_obj::CanvasArgs(AtomList &args) const
+void flext_obj::GetCanvasArgs(AtomList &args) const
{
#if FLEXT_SYS == FLEXT_SYS_PD
int argc;
t_atom *argv;
canvas_getargs(&argc,&argv);
- args(argc);
- for(int i = 0; i < argc; ++i) args[i] = argv[i];
+ args(argc,argv);
#else
#pragma message("Not implemented")
args(0);
#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
+}
diff --git a/externals/grill/flext/source/flbase.h b/externals/grill/flext/source/flbase.h
index d20f1866..664dc15b 100644
--- a/externals/grill/flext/source/flbase.h
+++ b/externals/grill/flext/source/flbase.h
@@ -257,7 +257,10 @@ class FLEXT_SHARE FLEXT_CLASSDEF(flext_obj):
static bool GetParamSym(t_atom &dst,const t_symbol *s,t_canvas *c);
//! Get the canvas arguments
- void CanvasArgs(AtomList &args) const;
+ void GetCanvasArgs(AtomList &args) const;
+
+ //! Get the canvas/patcher directory
+ void GetCanvasDir(char *buf,size_t bufsz) const;
//! @} FLEXT_OBJ_INTERNAL
};