Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
flext
Commits
df5bc9ad
Commit
df5bc9ad
authored
Feb 10, 2002
by
thomas
Browse files
no message
git-svn-id:
https://svn.grrrr.org/ext/trunk@14
4d9ac71a-51e6-0310-8455-cad1006bcd31
parent
7c747e0d
Changes
3
Hide whitespace changes
Inline
Side-by-side
source/flbuf.cpp
View file @
df5bc9ad
...
...
@@ -35,32 +35,43 @@ buffer::~buffer()
#endif
}
BL
buffer
::
Set
(
t_symbol
*
s
)
I
buffer
::
Set
(
t_symbol
*
s
)
{
I
ret
=
0
;
if
(
sym
!=
s
)
{
ret
=
-
1
;
data
=
NULL
;
frames
=
0
;
chns
=
0
;
}
if
(
s
&&
*
s
->
s_name
)
sym
=
s
;
data
=
NULL
;
frames
=
0
;
chns
=
0
;
if
(
sym
)
{
#ifdef PD
t_garray
*
a
;
I
frames1
;
F
*
data1
;
if
(
!
(
a
=
(
t_garray
*
)
pd_findbyclass
(
sym
,
garray_class
)))
{
if
(
*
sym
->
s_name
)
error
(
"%s: no such array '%s'"
,
thisName
(),
sym
->
s_name
);
sym
=
0
;
sym
=
NULL
;
ret
=
-
1
;
}
else
if
(
!
garray_getfloatarray
(
a
,
&
frames
,
&
data
))
else
if
(
!
garray_getfloatarray
(
a
,
&
frames
1
,
&
data
1
))
{
error
(
"%s: bad template '%s'"
,
thisName
(),
sym
->
s_name
);
data
=
NULL
;
frames
=
0
;
ret
=
-
1
;
}
else
{
garray_usedindsp
(
a
);
if
(
frames
!=
frames1
)
{
frames
=
frames1
;
ret
=
1
;
}
if
(
data
!=
data1
)
{
data
=
data1
;
ret
=
1
;
}
chns
=
1
;
}
#elif defined(MAXMSP)
...
...
@@ -69,23 +80,26 @@ BL buffer::Set(t_symbol *s)
if
(
NOGOOD
(
p
))
{
post
(
"%s: buffer object '%s' no good"
,
thisName
(),
sym
->
s_name
);
ret
=
-
1
;
}
else
{
#ifdef DEBUG
post
(
"%s: buffer object '%s' -
???
:%i samples:%i channels:%i buflen:%i"
,
thisName
(),
bufname
->
s_name
,
p
->
b_valid
,
p
->
b_frames
,
p
->
b_nchans
,
p
->
b_size
);
post
(
"%s: buffer object '%s' -
valid
:%i samples:%i channels:%i buflen:%i"
,
thisName
(),
bufname
->
s_name
,
p
->
b_valid
,
p
->
b_frames
,
p
->
b_nchans
,
p
->
b_size
);
#endif
data
=
p
->
b_samples
;
chns
=
p
->
b_nchans
;
frames
=
p
->
b_size
;
if
(
data
!=
p
->
b_samples
)
{
data
=
p
->
b_samples
;
ret
=
1
;
}
if
(
chns
!=
p
->
b_nchans
)
{
chns
=
p
->
b_nchans
;
ret
=
1
;
}
if
(
frames
!=
p
->
b_size
)
{
frames
=
p
->
b_size
;
ret
=
1
;
}
}
}
else
{
error
(
"%s: symbol '%s' not defined"
,
thisName
(),
sym
->
s_name
);
ret
=
-
1
;
}
#endif
}
else
ret
=
-
1
;
return
false
;
return
ret
;
}
V
buffer
::
Dirty
()
...
...
source/flext.cpp
View file @
df5bc9ad
...
...
@@ -10,6 +10,8 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <_cppext.h>
// -- ext_obj --------------------------
V
ext_obj
::
cb_setup
(
t_class
*
c
)
{
add_method0
(
c
,
cb_help
,
"help"
);
...
...
@@ -32,7 +34,7 @@ V ext_obj::m_help()
post
(
"Loaded object '%s' - compiled on %s %s"
,
thisName
(),
__DATE__
,
__TIME__
);
}
// ----------------------------
// --
dsp_obj
--------------------------
V
dsp_obj
::
cb_setup
(
t_class
*
c
)
{
...
...
source/flext.h
View file @
df5bc9ad
...
...
@@ -52,7 +52,7 @@ public:
buffer
(
t_symbol
*
s
=
NULL
);
~
buffer
();
BL
Set
(
t_symbol
*
s
=
NULL
);
I
Set
(
t_symbol
*
s
=
NULL
);
V
Dirty
();
t_symbol
*
Symbol
()
{
return
sym
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment