Commit fffd9372 authored by thomas's avatar thomas
Browse files

no message


git-svn-id: https://svn.grrrr.org/ext/trunk@186 4d9ac71a-51e6-0310-8455-cad1006bcd31
parent 803c0bd9
No preview for this file type
......@@ -75,7 +75,7 @@ Version history:
- added threaded methods along with a message queue for ToOut* functions
- check/update function for buffer change (resize etc.)
- description text for inlets/outlets (e.g. for MaxMSPs assist function)
- added buffer resize (to be implemented for MaxMSP!)
- added buffer resize functions flext_base::buffer::Frames(int,bool)
- added some utility functions: Sleep, CopyAtom, CopyList
- added List manipulation classes: AtomList, AtomAnything
- Alias object names (simply specify with FLEXT_NEW*, separated by whitespace)
......@@ -175,12 +175,14 @@ general:
bugs:
- PD: problems with timed buffer redrawing (takes a lot of cpu time)
- hard thread termination upon object destruction doesn't seem to work properly
- hard thread termination upon object destruction doesn't seem to work properly -> crash
- Max rounding bug (at least version 4.0.5) ... buffer resize could be one sample less!
tests:
- PD: figure out what "pointer" messages do and where they occur
- some more mutexes needed for thread safety?
- test alias names with MaxMSP
- buffer resize: flext_base::buffer::Frames(): should we use buffer or system sample rate?
features:
- abstraction for parsing argument lists
......
......@@ -149,9 +149,38 @@ bool flext_base::buffer::Update()
void flext_base::buffer::Frames(int fr,bool keep)
{
#ifdef PD
garray_resize(arr,(float)fr);
::garray_resize(arr,(float)fr);
Update();
#else
#pragma message ("flext - Buffer resize not implemented!")
t_sample *tmp = NULL;
int sz = frames;
if(fr < sz) sz = fr;
if(keep) {
// copy buffer data to tmp storage
tmp = new t_sample[sz];
if(tmp)
BlockMoveData(data,tmp,sizeof(t_sample)*sz);
else
error("flext::buffer - not enough memory for keeping buffer~ contents");
}
t_atom msg;
_buffer *buf = (_buffer *)sym->s_thing;
// b_msr reflects buffer sample rate... is this what we want?
// Max bug: adding 0.small value 0.001 to get right sample count
float ms = fr/buf->b_msr+0.001;
SetFloat(msg,ms);
::typedmess((object *)buf,gensym("size"),1,&msg);
Update();
if(tmp) {
// copy data back
BlockMoveData(tmp,data,sizeof(t_sample)*sz);
delete[] tmp;
}
#endif
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment