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
34818426
Commit
34818426
authored
8 years ago
by
Jonathan Wilkes
Browse files
Options
Downloads
Patches
Plain Diff
Vanilla 0.47 backport 6: g_readwrite.c
parent
6cae5856
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pd/src/g_readwrite.c
+41
-12
41 additions, 12 deletions
pd/src/g_readwrite.c
with
41 additions
and
12 deletions
pd/src/g_readwrite.c
+
41
−
12
View file @
34818426
...
@@ -95,14 +95,21 @@ static void glist_readatoms(t_glist *x, int natoms, t_atom *vec,
...
@@ -95,14 +95,21 @@ static void glist_readatoms(t_glist *x, int natoms, t_atom *vec,
}
}
else
if
(
template
->
t_vec
[
i
].
ds_type
==
DT_LIST
)
else
if
(
template
->
t_vec
[
i
].
ds_type
==
DT_LIST
)
{
{
/* If we want to keep the canvas field API, this needs to be
/* nothing needs to happen here */
revisited */
}
//while (1)
else
if
(
template
->
t_vec
[
i
].
ds_type
==
DT_TEXT
)
//{
{
// if (!glist_readscalar(w->w_list, natoms, vec,
// Miller's addition for the [text] object
// p_nextmsg, 0))
t_binbuf
*
z
=
binbuf_new
();
// break;
int
first
=
*
p_nextmsg
,
last
;
//}
for
(
last
=
first
;
last
<
natoms
&&
vec
[
last
].
a_type
!=
A_SEMI
;
last
++
);
binbuf_restore
(
z
,
last
-
first
,
vec
+
first
);
binbuf_add
(
w
[
i
].
w_binbuf
,
binbuf_getnatom
(
z
),
binbuf_getvec
(
z
));
binbuf_free
(
z
);
last
++
;
if
(
last
>
natoms
)
last
=
natoms
;
*
p_nextmsg
=
last
;
}
}
}
}
}
}
...
@@ -437,6 +444,11 @@ void canvas_writescalar(t_symbol *templatesym, t_word *w, t_binbuf *b,
...
@@ -437,6 +444,11 @@ void canvas_writescalar(t_symbol *templatesym, t_word *w, t_binbuf *b,
//glist_writelist(w->w_list->gl_list, b);
//glist_writelist(w->w_list->gl_list, b);
binbuf_addsemi
(
b
);
binbuf_addsemi
(
b
);
}
}
else
if
(
template
->
t_vec
[
i
].
ds_type
==
DT_TEXT
)
{
// Miller's addition for the implementation of the [text] object
binbuf_savetext
(
w
[
i
].
w_binbuf
,
b
);
}
}
}
}
}
...
@@ -487,6 +499,11 @@ static void canvas_addtemplatesforscalar(t_symbol *templatesym,
...
@@ -487,6 +499,11 @@ static void canvas_addtemplatesforscalar(t_symbol *templatesym,
//canvas_addtemplatesforlist(w->w_list->gl_list,
//canvas_addtemplatesforlist(w->w_list->gl_list,
// p_ntemplates, p_templatevec);
// p_ntemplates, p_templatevec);
}
}
else
if
(
ds
->
ds_type
==
DT_TEXT
)
{
canvas_addtemplatesforlist
(
w
->
w_list
->
gl_list
,
p_ntemplates
,
p_templatevec
);
}
}
}
}
}
...
@@ -567,10 +584,12 @@ t_binbuf *glist_writetobinbuf(t_glist *x, int wholething)
...
@@ -567,10 +584,12 @@ t_binbuf *glist_writetobinbuf(t_glist *x, int wholething)
case
DT_FLOAT
:
type
=
&
s_float
;
break
;
case
DT_FLOAT
:
type
=
&
s_float
;
break
;
case
DT_SYMBOL
:
type
=
&
s_symbol
;
break
;
case
DT_SYMBOL
:
type
=
&
s_symbol
;
break
;
case
DT_ARRAY
:
type
=
gensym
(
"array"
);
break
;
case
DT_ARRAY
:
type
=
gensym
(
"array"
);
break
;
case
DT_LIST
:
type
=
&
s_list
;
break
;
case
DT_LIST
:
type
=
gensym
(
"canvas"
);
break
;
case
DT_TEXT
:
type
=
&
s_list
;
break
;
default:
type
=
&
s_float
;
bug
(
"canvas_write"
);
default:
type
=
&
s_float
;
bug
(
"canvas_write"
);
}
}
if
(
template
->
t_vec
[
j
].
ds_type
==
DT_ARRAY
)
if
(
template
->
t_vec
[
j
].
ds_type
==
DT_ARRAY
||
template
->
t_vec
[
j
].
ds_type
==
DT_LIST
)
binbuf_addv
(
b
,
"sss;"
,
type
,
template
->
t_vec
[
j
].
ds_name
,
binbuf_addv
(
b
,
"sss;"
,
type
,
template
->
t_vec
[
j
].
ds_name
,
gensym
(
template
->
t_vec
[
j
].
ds_fieldtemplate
->
s_name
+
3
));
gensym
(
template
->
t_vec
[
j
].
ds_fieldtemplate
->
s_name
+
3
));
else
binbuf_addv
(
b
,
"ss;"
,
type
,
template
->
t_vec
[
j
].
ds_name
);
else
binbuf_addv
(
b
,
"ss;"
,
type
,
template
->
t_vec
[
j
].
ds_name
);
...
@@ -751,10 +770,12 @@ static void canvas_savetemplatesto(t_canvas *x, t_binbuf *b, int wholething)
...
@@ -751,10 +770,12 @@ static void canvas_savetemplatesto(t_canvas *x, t_binbuf *b, int wholething)
case
DT_FLOAT
:
type
=
&
s_float
;
break
;
case
DT_FLOAT
:
type
=
&
s_float
;
break
;
case
DT_SYMBOL
:
type
=
&
s_symbol
;
break
;
case
DT_SYMBOL
:
type
=
&
s_symbol
;
break
;
case
DT_ARRAY
:
type
=
gensym
(
"array"
);
break
;
case
DT_ARRAY
:
type
=
gensym
(
"array"
);
break
;
case
DT_LIST
:
type
=
&
s_list
;
break
;
case
DT_LIST
:
type
=
gensym
(
"canvas"
);
break
;
case
DT_TEXT
:
type
=
gensym
(
"text"
);
break
;
//&s_list; break;
default:
type
=
&
s_float
;
bug
(
"canvas_write"
);
default:
type
=
&
s_float
;
bug
(
"canvas_write"
);
}
}
if
(
template
->
t_vec
[
j
].
ds_type
==
DT_ARRAY
)
if
(
template
->
t_vec
[
j
].
ds_type
==
DT_ARRAY
||
template
->
t_vec
[
j
].
ds_type
==
DT_LIST
)
binbuf_addv
(
b
,
"sss"
,
type
,
template
->
t_vec
[
j
].
ds_name
,
binbuf_addv
(
b
,
"sss"
,
type
,
template
->
t_vec
[
j
].
ds_name
,
gensym
(
template
->
t_vec
[
j
].
ds_fieldtemplate
->
s_name
+
3
));
gensym
(
template
->
t_vec
[
j
].
ds_fieldtemplate
->
s_name
+
3
));
else
binbuf_addv
(
b
,
"ss"
,
type
,
template
->
t_vec
[
j
].
ds_name
);
else
binbuf_addv
(
b
,
"ss"
,
type
,
template
->
t_vec
[
j
].
ds_name
);
...
@@ -830,3 +851,11 @@ void g_readwrite_setup(void)
...
@@ -830,3 +851,11 @@ void g_readwrite_setup(void)
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_menusaveas
,
class_addmethod
(
canvas_class
,
(
t_method
)
canvas_menusaveas
,
gensym
(
"menusaveas"
),
A_DEFFLOAT
,
0
);
gensym
(
"menusaveas"
),
A_DEFFLOAT
,
0
);
}
}
void
canvas_readwrite_for_class
(
t_class
*
c
)
{
class_addmethod
(
c
,
(
t_method
)
canvas_menusave
,
gensym
(
"menusave"
),
0
);
class_addmethod
(
c
,
(
t_method
)
canvas_menusaveas
,
gensym
(
"menusaveas"
),
0
);
}
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