Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
flext
Commits
f079045d
Commit
f079045d
authored
May 10, 2017
by
Thomas Grill
Browse files
Fixed buffer-sample conversion
parent
b3a01bca
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/flsupport.h
View file @
f079045d
...
...
@@ -217,28 +217,36 @@ public:
# define FLEXT_PD_ARRAYGRAB garray_getfloatwords
# define FLEXT_ARRAYTYPE t_word
# define FLEXT_GETSAMPLE(x) ((x).w_float)
# define _FLEXT_NEED_SAMPLE_CONV 1
# else
/* use old garray support, not 64-bit safe */
# define FLEXT_PD_ARRAYGRAB garray_getfloatarray
# define FLEXT_ARRAYTYPE t_sample
# define FLEXT_GETSAMPLE(x) (x)
# define _FLEXT_NEED_SAMPLE_CONV 0
# endif
#elif FLEXT_SYS == FLEXT_SYS_MAX
# define FLEXT_ARRAYTYPE float
# define FLEXT_GETSAMPLE(x) (x)
# define _FLEXT_NEED_SAMPLE_CONV 0
#endif
class
Element
{
public:
Element
()
{}
Element
(
FLEXT_ARRAYTYPE
s
)
{
FLEXT_GETSAMPLE
(
el
)
=
s
;
}
operator
FLEXT_ARRAYTYPE
&
()
{
return
FLEXT_GETSAMPLE
(
el
);
}
operator
FLEXT_ARRAYTYPE
()
const
{
return
FLEXT_GETSAMPLE
(
el
);
}
protected:
FLEXT_ARRAYTYPE
el
;
};
class
Element
{
public:
Element
()
{}
Element
(
FLEXT_ARRAYTYPE
s
)
:
el
(
s
)
{}
operator
FLEXT_ARRAYTYPE
&
()
{
return
el
;
}
operator
FLEXT_ARRAYTYPE
()
const
{
return
el
;
}
#if _FLEXT_NEED_SAMPLE_CONV
Element
(
t_sample
s
)
{
FLEXT_GETSAMPLE
(
el
)
=
s
;
}
operator
t_sample
&
()
{
return
FLEXT_GETSAMPLE
(
el
);
}
operator
t_sample
()
const
{
return
FLEXT_GETSAMPLE
(
el
);
}
#endif
protected:
FLEXT_ARRAYTYPE
el
;
};
/*! \brief Construct buffer.
\param s: symbol name, can be NULL
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment