Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonathan Wilkes
purr-data
Commits
398b2a07
Commit
398b2a07
authored
4 years ago
by
Jonathan Wilkes
Browse files
Options
Downloads
Patches
Plain Diff
add bang methods to [scalar] and [array]
parent
41442f4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!471
port savestate (squashed)
,
!468
add bang methods to [scalar] and [array]
Pipeline
#2367
passed
4 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pd/src/x_array.c
+18
-1
18 additions, 1 deletion
pd/src/x_array.c
pd/src/x_scalar.c
+14
-0
14 additions, 0 deletions
pd/src/x_scalar.c
with
32 additions
and
1 deletion
pd/src/x_array.c
+
18
−
1
View file @
398b2a07
...
@@ -227,7 +227,23 @@ static void array_define_send(t_glist *x, t_symbol *s)
...
@@ -227,7 +227,23 @@ static void array_define_send(t_glist *x, t_symbol *s)
pd_pointer
(
s
->
s_thing
,
&
gp
);
pd_pointer
(
s
->
s_thing
,
&
gp
);
gpointer_unset
(
&
gp
);
gpointer_unset
(
&
gp
);
}
}
else
bug
(
"array_define_anything"
);
else
bug
(
"array_define_send"
);
}
static
void
array_define_bang
(
t_glist
*
x
)
{
t_glist
*
gl
=
(
x
->
gl_list
?
pd_checkglist
(
&
x
->
gl_list
->
g_pd
)
:
0
);
if
(
gl
&&
gl
->
gl_list
&&
pd_class
(
&
gl
->
gl_list
->
g_pd
)
==
garray_class
)
{
t_gpointer
gp
;
gpointer_init
(
&
gp
);
gpointer_setglist
(
&
gp
,
gl
,
//garray_getscalar((t_garray *)gl->gl_list));
(
t_gobj
*
)
gl
->
gl_list
);
outlet_pointer
(
x
->
gl_obj
.
ob_outlet
,
&
gp
);
gpointer_unset
(
&
gp
);
}
else
bug
(
"array_define_bang"
);
}
}
/* just forward any messages to the garray */
/* just forward any messages to the garray */
...
@@ -864,6 +880,7 @@ void x_array_setup(void )
...
@@ -864,6 +880,7 @@ void x_array_setup(void )
canvas_add_for_class
(
array_define_class
);
canvas_add_for_class
(
array_define_class
);
class_addmethod
(
array_define_class
,
(
t_method
)
array_define_send
,
class_addmethod
(
array_define_class
,
(
t_method
)
array_define_send
,
gensym
(
"send"
),
A_SYMBOL
,
0
);
gensym
(
"send"
),
A_SYMBOL
,
0
);
class_addbang
(
array_define_class
,
array_define_bang
);
class_addanything
(
array_define_class
,
array_define_anything
);
class_addanything
(
array_define_class
,
array_define_anything
);
class_sethelpsymbol
(
array_define_class
,
gensym
(
"array-object"
));
class_sethelpsymbol
(
array_define_class
,
gensym
(
"array-object"
));
class_setsavefn
(
array_define_class
,
array_define_save
);
class_setsavefn
(
array_define_class
,
array_define_save
);
...
...
This diff is collapsed.
Click to expand it.
pd/src/x_scalar.c
+
14
−
0
View file @
398b2a07
...
@@ -111,6 +111,19 @@ static void scalar_define_send(t_glist *x, t_symbol *s)
...
@@ -111,6 +111,19 @@ static void scalar_define_send(t_glist *x, t_symbol *s)
else
bug
(
"scalar_define_send"
);
else
bug
(
"scalar_define_send"
);
}
}
static
void
scalar_define_bang
(
t_glist
*
x
)
{
if
(
x
->
gl_list
&&
pd_class
(
&
x
->
gl_list
->
g_pd
)
==
scalar_class
)
{
t_gpointer
gp
;
gpointer_init
(
&
gp
);
gpointer_setglist
(
&
gp
,
x
,
(
t_gobj
*
)
&
x
->
gl_list
->
g_pd
);
outlet_pointer
(
x
->
gl_obj
.
ob_outlet
,
&
gp
);
gpointer_unset
(
&
gp
);
}
else
bug
(
"scalar_define_bang"
);
}
/* set to a list, used to restore from scalar_define_save()s below */
/* set to a list, used to restore from scalar_define_save()s below */
static
void
scalar_define_set
(
t_glist
*
x
,
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
static
void
scalar_define_set
(
t_glist
*
x
,
t_symbol
*
s
,
int
argc
,
t_atom
*
argv
)
{
{
...
@@ -180,6 +193,7 @@ void x_scalar_setup(void )
...
@@ -180,6 +193,7 @@ void x_scalar_setup(void )
canvas_add_for_class
(
scalar_define_class
);
canvas_add_for_class
(
scalar_define_class
);
class_addmethod
(
scalar_define_class
,
(
t_method
)
scalar_define_send
,
class_addmethod
(
scalar_define_class
,
(
t_method
)
scalar_define_send
,
gensym
(
"send"
),
A_SYMBOL
,
0
);
gensym
(
"send"
),
A_SYMBOL
,
0
);
class_addbang
(
scalar_define_class
,
(
t_method
)
scalar_define_bang
);
class_addmethod
(
scalar_define_class
,
(
t_method
)
scalar_define_set
,
class_addmethod
(
scalar_define_class
,
(
t_method
)
scalar_define_set
,
gensym
(
"set"
),
A_GIMME
,
0
);
gensym
(
"set"
),
A_GIMME
,
0
);
class_sethelpsymbol
(
scalar_define_class
,
gensym
(
"scalar-object"
));
class_sethelpsymbol
(
scalar_define_class
,
gensym
(
"scalar-object"
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment