aboutsummaryrefslogtreecommitdiff
path: root/cyclone/hammer/hammer.c
diff options
context:
space:
mode:
authorN.N. <krzyszcz@users.sourceforge.net>2003-09-11 09:04:32 +0000
committerN.N. <krzyszcz@users.sourceforge.net>2003-09-11 09:04:32 +0000
commit49cc44f855c16ae11988e9ff3739fdc01ac8aebe (patch)
tree4a47d1b56d0cda8f8f34965c881c0bba1e4f46fd /cyclone/hammer/hammer.c
parent53f05d96ff8e49c87977fa91a06ebade8893606e (diff)
*** empty log message ***
svn path=/trunk/externals/miXed/; revision=947
Diffstat (limited to 'cyclone/hammer/hammer.c')
-rw-r--r--cyclone/hammer/hammer.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/cyclone/hammer/hammer.c b/cyclone/hammer/hammer.c
index a4d7efe..3c4f3c2 100644
--- a/cyclone/hammer/hammer.c
+++ b/cyclone/hammer/hammer.c
@@ -27,21 +27,24 @@ static void hammer_readhook(t_pd *z, t_symbol *fn, int ac, t_atom *av)
import_max(fn->s_name, "");
}
-static void hammer_import(t_hammer *x, t_symbol *fn, t_symbol *dir)
+static void hammer_doimport(t_hammer *x, t_symbol *fn, t_symbol *dir)
{
+ if (!dir || dir == &s_) dir = x->x_dir;
if (fn && fn != &s_)
- {
- if (!dir || dir == &s_) dir = x->x_dir;
import_max(fn->s_name, (dir && dir != &s_) ? dir->s_name : "");
- }
else
- hammerpanel_open(x->x_filehandle);
+ hammerpanel_open(x->x_filehandle, dir);
}
static void hammer_click(t_hammer *x, t_floatarg xpos, t_floatarg ypos,
- t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
+ t_floatarg shift, t_floatarg ctrl, t_floatarg alt)
+{
+ hammer_doimport(x, 0, 0);
+}
+
+static void hammer_import(t_hammer *x, t_symbol *fn)
{
- hammer_import(x, 0, 0);
+ hammer_doimport(x, fn, 0);
}
static void hammer_bang(t_hammer *x)
@@ -82,7 +85,7 @@ void hammer_setup(void)
sizeof(t_hammer), 0, A_DEFSYM, 0);
class_addbang(hammer_class, hammer_bang);
class_addmethod(hammer_class, (t_method)hammer_import,
- gensym("import"), A_DEFSYM, A_DEFSYM, 0);
+ gensym("import"), A_DEFSYM, 0);
class_addmethod(hammer_class, (t_method)hammer_click,
gensym("click"),
A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);