aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source
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 /externals/grill/flext/source
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
Diffstat (limited to 'externals/grill/flext/source')
-rw-r--r--externals/grill/flext/source/flbase.cpp33
-rw-r--r--externals/grill/flext/source/flbase.h5
2 files changed, 34 insertions, 4 deletions
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
};