aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/dynext/src
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-01-19 04:59:59 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-01-19 04:59:59 +0000
commitb71e257899abcb9a8bee4e7d967bb653c03890d4 (patch)
treee22c56d88132394a06dff4f9de8e86e57a54c6c6 /externals/grill/dynext/src
parent8e23697a6e3f993805d7bd90114a4dac1bbc8498 (diff)
- strip .pd from abstraction filenames
- open debug patcher on alt-click svn path=/trunk/; revision=2525
Diffstat (limited to 'externals/grill/dynext/src')
-rw-r--r--externals/grill/dynext/src/main.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/externals/grill/dynext/src/main.cpp b/externals/grill/dynext/src/main.cpp
index a9aee6b7..07b3b5e4 100644
--- a/externals/grill/dynext/src/main.cpp
+++ b/externals/grill/dynext/src/main.cpp
@@ -2,7 +2,7 @@
dyn~ - dynamical object management for PD
-Copyright (c)2003-2004 Thomas Grill (xovo@gmx.net)
+Copyright (c)2003-2005 Thomas Grill (gr@grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
@@ -13,8 +13,8 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <flext.h>
-#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 406)
-#error You need at least flext version 0.4.6
+#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 500)
+#error You need at least flext version 0.5.0
#endif
#define DYN_VERSION "0.1.1pre"
@@ -55,6 +55,8 @@ public:
protected:
+ virtual void m_click() { m_vis(true); }
+
static const t_symbol *k_obj,*k_msg,*k_text;
class obj {
@@ -196,7 +198,7 @@ const t_symbol *dyn::sym_dsp = NULL;
void dyn::setup(t_classid c)
{
post("");
- post("dyn~ %s - dynamic object management, (C)2003-04 Thomas Grill",DYN_VERSION);
+ post("dyn~ %s - dynamic object management, (C)2003-2005 Thomas Grill",DYN_VERSION);
post("");
sym_dynsin = MakeSymbol("dyn_in~");
@@ -455,6 +457,21 @@ t_gobj *dyn::New(const t_symbol *kind,int _argc_,const t_atom *_argv_,bool add)
else if(!canv || !(glist = FindCanvas(canv)))
err = "Canvas could not be found";
else {
+ // convert abstraction filenames
+ if(kind == k_obj && argc >= 3 && IsSymbol(argv[2])) {
+ const char *c = GetString(argv[2]);
+ int l = strlen(c);
+ // check end of string for .pd file extension
+ if(l >= 4 && !memcmp(c+l-3,".pd",4)) {
+ // found -> get rid of it
+ char tmp[64],*t = tmp;
+ if(l > sizeof tmp-1) t = new char[l+1];
+ memcpy(tmp,c,l-3); tmp[l-3] = 0;
+ SetString(argv[2],tmp);
+ if(tmp != t) delete[] t;
+ }
+ }
+
// set selected canvas as current
canvas_setcurrent(glist);