cwFlowTypes.h : Changes to account for changed dsp::types.
Added is_connected_to_source_proc(), var_is_source() and is_source_var().
This commit is contained in:
parent
a0b4e9c120
commit
bdcb26ac72
@ -24,7 +24,6 @@ namespace cw
|
|||||||
{ kUIntTFl, "uint" },
|
{ kUIntTFl, "uint" },
|
||||||
{ kIntTFl, "int", },
|
{ kIntTFl, "int", },
|
||||||
{ kFloatTFl, "float"},
|
{ kFloatTFl, "float"},
|
||||||
{ kRealTFl, "real"},
|
|
||||||
{ kDoubleTFl,"double"},
|
{ kDoubleTFl,"double"},
|
||||||
|
|
||||||
{ kBoolMtxTFl, "bool_mtx" },
|
{ kBoolMtxTFl, "bool_mtx" },
|
||||||
@ -38,6 +37,14 @@ namespace cw
|
|||||||
{ kMBufTFl, "midi" },
|
{ kMBufTFl, "midi" },
|
||||||
{ kStringTFl, "string" },
|
{ kStringTFl, "string" },
|
||||||
{ kTimeTFl, "time" },
|
{ kTimeTFl, "time" },
|
||||||
|
{ kCfgTFl, "cfg" },
|
||||||
|
|
||||||
|
// alias types to map to cwDspTypes.h
|
||||||
|
{ kFloatTFl, "srate"},
|
||||||
|
{ kFloatTFl, "sample"},
|
||||||
|
{ kFloatTFl, "coeff"},
|
||||||
|
{ kDoubleTFl, "ftime" },
|
||||||
|
|
||||||
{ kInvalidTFl, nullptr }
|
{ kInvalidTFl, nullptr }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -461,12 +468,18 @@ namespace cw
|
|||||||
rc_t _var_broadcast_new_value( variable_t* var )
|
rc_t _var_broadcast_new_value( variable_t* var )
|
||||||
{
|
{
|
||||||
rc_t rc = kOkRC;
|
rc_t rc = kOkRC;
|
||||||
/*
|
|
||||||
// notify each connected var that the value has changed
|
// notify each connected var that the value has changed
|
||||||
for(variable_t* con_var = var->connect_link; con_var!=nullptr; con_var=con_var->connect_link)
|
for(variable_t* con_var = var->connect_link; con_var!=nullptr; con_var=con_var->connect_link)
|
||||||
if((rc = con_var->inst->class_desc->members->value( con_var->inst, con_var )) != kOkRC )
|
{
|
||||||
break;
|
// the var->local_value[] slot used by the source variable may have changed - update the destination variable
|
||||||
*/
|
// so that it points to the correct value.
|
||||||
|
con_var->value = var->value;
|
||||||
|
|
||||||
|
//if((rc = con_var->inst->class_desc->members->value( con_var->inst, con_var )) != kOkRC )
|
||||||
|
// break;
|
||||||
|
|
||||||
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,7 +617,7 @@ namespace cw
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool is_connected_to_external_proc( const variable_t* var )
|
bool is_connected_to_source_proc( const variable_t* var )
|
||||||
{
|
{
|
||||||
// if this var does not have a 'src_ptr' then it can't be connected to an external proc
|
// if this var does not have a 'src_ptr' then it can't be connected to an external proc
|
||||||
if( var->src_var == nullptr || var->value == nullptr )
|
if( var->src_var == nullptr || var->value == nullptr )
|
||||||
@ -618,13 +631,16 @@ namespace cw
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_a_source_var( const variable_t* var )
|
||||||
|
{ return var->connect_link != nullptr; }
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
rc_t _var_set_driver( variable_t* var, unsigned typeFlag, T value )
|
rc_t _var_set_driver( variable_t* var, unsigned typeFlag, T value )
|
||||||
{
|
{
|
||||||
rc_t rc;
|
rc_t rc;
|
||||||
|
|
||||||
// if this variable is fed from the output of an external proc - then it's local value cannot be set
|
// if this variable is fed from the output of an external proc - then it's local value cannot be set
|
||||||
if(is_connected_to_external_proc(var) )
|
if(is_connected_to_source_proc(var) )
|
||||||
return kOkRC;
|
return kOkRC;
|
||||||
|
|
||||||
|
|
||||||
@ -687,6 +703,7 @@ namespace cw
|
|||||||
{
|
{
|
||||||
rc_t rc = kOkRC;
|
rc_t rc = kOkRC;
|
||||||
|
|
||||||
|
// get the variable type - note that the value type (value->flags) may be differnt
|
||||||
unsigned typeFlag = var->varDesc->type & kTypeMask;
|
unsigned typeFlag = var->varDesc->type & kTypeMask;
|
||||||
|
|
||||||
switch( typeFlag )
|
switch( typeFlag )
|
||||||
@ -882,7 +899,7 @@ namespace cw
|
|||||||
|
|
||||||
void _var_print( const variable_t* var )
|
void _var_print( const variable_t* var )
|
||||||
{
|
{
|
||||||
const char* conn_label = is_connected_to_external_proc(var) ? "extern" : " ";
|
const char* conn_label = is_connected_to_source_proc(var) ? "extern" : " ";
|
||||||
|
|
||||||
printf(" %20s:%5i id:%4i ch:%3i : %s : ", var->label, var->label_sfx_id, var->vid, var->chIdx, conn_label );
|
printf(" %20s:%5i id:%4i ch:%3i : %s : ", var->label, var->label_sfx_id, var->vid, var->chIdx, conn_label );
|
||||||
|
|
||||||
@ -969,7 +986,7 @@ const cw::flow::sample_t* cw::flow::abuf_get_channel( abuf_t* abuf, unsigned c
|
|||||||
return abuf->buf + (chIdx*abuf->frameN);
|
return abuf->buf + (chIdx*abuf->frameN);
|
||||||
}
|
}
|
||||||
|
|
||||||
cw::flow::fbuf_t* cw::flow::fbuf_create( srate_t srate, unsigned chN, const unsigned* maxBinN_V, const unsigned* binN_V, const unsigned* hopSmpN_V, const fd_real_t** magV, const fd_real_t** phsV, const fd_real_t** hzV )
|
cw::flow::fbuf_t* cw::flow::fbuf_create( srate_t srate, unsigned chN, const unsigned* maxBinN_V, const unsigned* binN_V, const unsigned* hopSmpN_V, const fd_sample_t** magV, const fd_sample_t** phsV, const fd_sample_t** hzV )
|
||||||
{
|
{
|
||||||
for(unsigned i=0; i<chN; ++i)
|
for(unsigned i=0; i<chN; ++i)
|
||||||
if( binN_V[i] > maxBinN_V[i] )
|
if( binN_V[i] > maxBinN_V[i] )
|
||||||
@ -985,9 +1002,9 @@ cw::flow::fbuf_t* cw::flow::fbuf_create( srate_t srate, unsigned chN, const unsi
|
|||||||
f->maxBinN_V = mem::allocZ<unsigned>(chN);
|
f->maxBinN_V = mem::allocZ<unsigned>(chN);
|
||||||
f->binN_V = mem::allocZ<unsigned>(chN);
|
f->binN_V = mem::allocZ<unsigned>(chN);
|
||||||
f->hopSmpN_V = mem::allocZ<unsigned>(chN);
|
f->hopSmpN_V = mem::allocZ<unsigned>(chN);
|
||||||
f->magV = mem::allocZ<fd_real_t*>(chN);
|
f->magV = mem::allocZ<fd_sample_t*>(chN);
|
||||||
f->phsV = mem::allocZ<fd_real_t*>(chN);
|
f->phsV = mem::allocZ<fd_sample_t*>(chN);
|
||||||
f->hzV = mem::allocZ<fd_real_t*>(chN);
|
f->hzV = mem::allocZ<fd_sample_t*>(chN);
|
||||||
f->readyFlV = mem::allocZ<bool>(chN);
|
f->readyFlV = mem::allocZ<bool>(chN);
|
||||||
|
|
||||||
vop::copy( f->binN_V, binN_V, chN );
|
vop::copy( f->binN_V, binN_V, chN );
|
||||||
@ -998,17 +1015,17 @@ cw::flow::fbuf_t* cw::flow::fbuf_create( srate_t srate, unsigned chN, const unsi
|
|||||||
{
|
{
|
||||||
for(unsigned chIdx=0; chIdx<chN; ++chIdx)
|
for(unsigned chIdx=0; chIdx<chN; ++chIdx)
|
||||||
{
|
{
|
||||||
f->magV[ chIdx ] = (fd_real_t*)magV[chIdx];
|
f->magV[ chIdx ] = (fd_sample_t*)magV[chIdx];
|
||||||
f->phsV[ chIdx ] = (fd_real_t*)phsV[chIdx];
|
f->phsV[ chIdx ] = (fd_sample_t*)phsV[chIdx];
|
||||||
f->hzV[ chIdx ] = (fd_real_t*)hzV[chIdx];
|
f->hzV[ chIdx ] = (fd_sample_t*)hzV[chIdx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned maxTotalBinsN = vop::sum( maxBinN_V, chN );
|
unsigned maxTotalBinsN = vop::sum( maxBinN_V, chN );
|
||||||
|
|
||||||
fd_real_t* buf = mem::allocZ<fd_real_t>( kFbufVectN * maxTotalBinsN );
|
fd_sample_t* buf = mem::allocZ<fd_sample_t>( kFbufVectN * maxTotalBinsN );
|
||||||
fd_real_t* m = buf;
|
fd_sample_t* m = buf;
|
||||||
for(unsigned chIdx=0; chIdx<chN; ++chIdx)
|
for(unsigned chIdx=0; chIdx<chN; ++chIdx)
|
||||||
{
|
{
|
||||||
f->magV[chIdx] = m + 0 * f->binN_V[chIdx];
|
f->magV[chIdx] = m + 0 * f->binN_V[chIdx];
|
||||||
@ -1026,7 +1043,7 @@ cw::flow::fbuf_t* cw::flow::fbuf_create( srate_t srate, unsigned chN, const unsi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cw::flow::fbuf_t* cw::flow::fbuf_create( srate_t srate, unsigned chN, unsigned maxBinN, unsigned binN, unsigned hopSmpN, const fd_real_t** magV, const fd_real_t** phsV, const fd_real_t** hzV )
|
cw::flow::fbuf_t* cw::flow::fbuf_create( srate_t srate, unsigned chN, unsigned maxBinN, unsigned binN, unsigned hopSmpN, const fd_sample_t** magV, const fd_sample_t** phsV, const fd_sample_t** hzV )
|
||||||
{
|
{
|
||||||
unsigned maxBinN_V[ chN ];
|
unsigned maxBinN_V[ chN ];
|
||||||
unsigned binN_V[ chN ];
|
unsigned binN_V[ chN ];
|
||||||
@ -1250,11 +1267,9 @@ cw::rc_t cw::flow::var_channelize( instance_t* inst, const char* var_label, uns
|
|||||||
goto errLabel;
|
goto errLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// locate the variable with the stated chIdx
|
// locate the variable with the stated chIdx
|
||||||
var = _var_find_on_label_and_ch( inst, var_label, sfx_id, chIdx );
|
var = _var_find_on_label_and_ch( inst, var_label, sfx_id, chIdx );
|
||||||
|
|
||||||
|
|
||||||
// 'src' variables cannot be channelized
|
// 'src' variables cannot be channelized
|
||||||
if( cwIsFlag(base_var->varDesc->flags,kSrcVarFl) )
|
if( cwIsFlag(base_var->varDesc->flags,kSrcVarFl) )
|
||||||
{
|
{
|
||||||
@ -1287,6 +1302,7 @@ cw::rc_t cw::flow::var_channelize( instance_t* inst, const char* var_label, uns
|
|||||||
// a correctly channelized var was found - but we still may need to set the value
|
// a correctly channelized var was found - but we still may need to set the value
|
||||||
if( value_cfg != nullptr )
|
if( value_cfg != nullptr )
|
||||||
{
|
{
|
||||||
|
//cwLogInfo("%s ch:%i",var_label,chIdx);
|
||||||
rc = _set_var_value_from_cfg( var, value_cfg );
|
rc = _set_var_value_from_cfg( var, value_cfg );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1300,7 +1316,7 @@ cw::rc_t cw::flow::var_channelize( instance_t* inst, const char* var_label, uns
|
|||||||
|
|
||||||
errLabel:
|
errLabel:
|
||||||
if( rc != kOkRC )
|
if( rc != kOkRC )
|
||||||
rc = cwLogError(rc,"Channelize failed for variable '%s:%i' on instance '%s:i' ch:%i.", var_label, sfx_id, inst->label, inst->label_sfx_id, chIdx );
|
rc = cwLogError(rc,"Channelize failed for variable '%s:%i' on instance '%s:%i' ch:%i.", var_label, sfx_id, inst->label, inst->label_sfx_id, chIdx );
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -1319,6 +1335,31 @@ bool cw::flow::var_has_value( instance_t* inst, const char* label, unsigned sfx_
|
|||||||
return varPtr->value != nullptr;
|
return varPtr->value != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cw::flow::var_is_a_source( instance_t* inst, const char* label, unsigned sfx_id, unsigned chIdx )
|
||||||
|
{
|
||||||
|
rc_t rc;
|
||||||
|
variable_t* varPtr = nullptr;
|
||||||
|
if((rc = var_find( inst, label, sfx_id, chIdx, varPtr)) != kOkRC )
|
||||||
|
{
|
||||||
|
cwLogError(kEleNotFoundRC,"The variable '%s:%i' was not found on proc:'%s:%i'. 'source' state query is invalid.",cwStringNullGuard(label),sfx_id,cwStringNullGuard(inst->label),inst->label_sfx_id);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return is_a_source_var(varPtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cw::flow::var_is_a_source( instance_t* inst, unsigned vid, unsigned chIdx )
|
||||||
|
{
|
||||||
|
rc_t rc;
|
||||||
|
variable_t* varPtr = nullptr;
|
||||||
|
if((rc = var_find( inst, vid, chIdx, varPtr)) != kOkRC )
|
||||||
|
{
|
||||||
|
cwLogError(kEleNotFoundRC,"The variable with vid '%i' was not found on proc:'%s:%i'. 'source' state query is invalid.",vid,cwStringNullGuard(inst->label),inst->label_sfx_id);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return is_a_source_var(varPtr);
|
||||||
|
}
|
||||||
|
|
||||||
cw::rc_t cw::flow::var_find( instance_t* inst, unsigned vid, unsigned chIdx, variable_t*& varRef )
|
cw::rc_t cw::flow::var_find( instance_t* inst, unsigned vid, unsigned chIdx, variable_t*& varRef )
|
||||||
{
|
{
|
||||||
@ -1471,7 +1512,7 @@ cw::rc_t cw::flow::var_register_and_set( instance_t* inst, const char* va
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
cw::rc_t cw::flow::var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, const unsigned* maxBinN_V, const unsigned* binN_V, const unsigned* hopSmpN_V, const fd_real_t** magV, const fd_real_t** phsV, const fd_real_t** hzV )
|
cw::rc_t cw::flow::var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, const unsigned* maxBinN_V, const unsigned* binN_V, const unsigned* hopSmpN_V, const fd_sample_t** magV, const fd_sample_t** phsV, const fd_sample_t** hzV )
|
||||||
{
|
{
|
||||||
rc_t rc = kOkRC;
|
rc_t rc = kOkRC;
|
||||||
fbuf_t* fbuf;
|
fbuf_t* fbuf;
|
||||||
@ -1499,7 +1540,7 @@ cw::rc_t cw::flow::var_register_and_set( instance_t* inst, const char* va
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cw::rc_t cw::flow::var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, unsigned maxBinN, unsigned binN, unsigned hopSmpN, const fd_real_t** magV, const fd_real_t** phsV, const fd_real_t** hzV )
|
cw::rc_t cw::flow::var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, unsigned maxBinN, unsigned binN, unsigned hopSmpN, const fd_sample_t** magV, const fd_sample_t** phsV, const fd_sample_t** hzV )
|
||||||
{
|
{
|
||||||
unsigned maxBinN_V[ chN ];
|
unsigned maxBinN_V[ chN ];
|
||||||
unsigned binN_V[ chN ];
|
unsigned binN_V[ chN ];
|
||||||
|
@ -3,11 +3,11 @@ namespace cw
|
|||||||
namespace flow
|
namespace flow
|
||||||
{
|
{
|
||||||
|
|
||||||
#define kRealTFl kFloatTFl
|
typedef dsp::coeff_t coeff_t;
|
||||||
typedef dsp::real_t real_t;
|
|
||||||
typedef dsp::sample_t sample_t;
|
typedef dsp::sample_t sample_t;
|
||||||
typedef dsp::fd_real_t fd_real_t;
|
typedef dsp::fd_sample_t fd_sample_t;
|
||||||
typedef dsp::srate_t srate_t;
|
typedef dsp::srate_t srate_t;
|
||||||
|
typedef dsp::ftime_t ftime_t;
|
||||||
typedef unsigned uint_t;
|
typedef unsigned uint_t;
|
||||||
typedef int int_t;
|
typedef int int_t;
|
||||||
|
|
||||||
@ -40,11 +40,11 @@ namespace cw
|
|||||||
unsigned* maxBinN_V; // max value that binN_V[i] is allowed to take
|
unsigned* maxBinN_V; // max value that binN_V[i] is allowed to take
|
||||||
unsigned* binN_V; // binN_V[ chN ] count of sample frames per channel
|
unsigned* binN_V; // binN_V[ chN ] count of sample frames per channel
|
||||||
unsigned* hopSmpN_V; // hopSmpN_V[ chN ] hop sample count
|
unsigned* hopSmpN_V; // hopSmpN_V[ chN ] hop sample count
|
||||||
fd_real_t** magV; // magV[ chN ][ binN ]
|
fd_sample_t** magV; // magV[ chN ][ binN ]
|
||||||
fd_real_t** phsV; // phsV[ chN ][ binN ]
|
fd_sample_t** phsV; // phsV[ chN ][ binN ]
|
||||||
fd_real_t** hzV; // hzV[ chN ][ binN ]
|
fd_sample_t** hzV; // hzV[ chN ][ binN ]
|
||||||
bool* readyFlV; // readyFlV[chN] true if this channel is ready to be processed (used to sync. fbuf rate to abuf rate)
|
bool* readyFlV; // readyFlV[chN] true if this channel is ready to be processed (used to sync. fbuf rate to abuf rate)
|
||||||
fd_real_t* buf; // memory used by this buffer (or NULL if magV,phsV,hzV point are proxied to another buffer)
|
fd_sample_t* buf; // memory used by this buffer (or NULL if magV,phsV,hzV point are proxied to another buffer)
|
||||||
} fbuf_t;
|
} fbuf_t;
|
||||||
|
|
||||||
typedef struct mbuf_str
|
typedef struct mbuf_str
|
||||||
@ -66,15 +66,15 @@ namespace cw
|
|||||||
kBoolMtxTFl = 0x00000020,
|
kBoolMtxTFl = 0x00000020,
|
||||||
kUIntMtxTFl = 0x00000040,
|
kUIntMtxTFl = 0x00000040,
|
||||||
kIntMtxTFl = 0x00000080,
|
kIntMtxTFl = 0x00000080,
|
||||||
kRealMtxTFl = 0x00000100,
|
kFloatMtxTFl = 0x00000100,
|
||||||
kFloatMtxTFl = 0x00000200,
|
kDoubleMtxTFl= 0x00000200,
|
||||||
kDoubleMtxTFl= 0x00000400,
|
|
||||||
|
|
||||||
kABufTFl = 0x00000800,
|
kABufTFl = 0x00000400,
|
||||||
kFBufTFl = 0x00001000,
|
kFBufTFl = 0x00000800,
|
||||||
kMBufTFl = 0x00002000,
|
kMBufTFl = 0x00001000,
|
||||||
kStringTFl = 0x00004000,
|
kStringTFl = 0x00002000,
|
||||||
kTimeTFl = 0x00008000,
|
kTimeTFl = 0x00004000,
|
||||||
|
kCfgTFl = 0x00008000,
|
||||||
|
|
||||||
kTypeMask = 0x0000ffff,
|
kTypeMask = 0x0000ffff,
|
||||||
|
|
||||||
@ -85,7 +85,6 @@ namespace cw
|
|||||||
union {
|
union {
|
||||||
struct mtx::mtx_str< unsigned >* u;
|
struct mtx::mtx_str< unsigned >* u;
|
||||||
struct mtx::mtx_str< int >* i;
|
struct mtx::mtx_str< int >* i;
|
||||||
struct mtx::mtx_str< real_t >* r;
|
|
||||||
struct mtx::mtx_str< float >* f;
|
struct mtx::mtx_str< float >* f;
|
||||||
struct mtx::mtx_str< double >* d;
|
struct mtx::mtx_str< double >* d;
|
||||||
} u;
|
} u;
|
||||||
@ -102,13 +101,13 @@ namespace cw
|
|||||||
double d;
|
double d;
|
||||||
|
|
||||||
mtx_t* mtx;
|
mtx_t* mtx;
|
||||||
|
|
||||||
abuf_t* abuf;
|
abuf_t* abuf;
|
||||||
fbuf_t* fbuf;
|
fbuf_t* fbuf;
|
||||||
mbuf_t* mbuf;
|
mbuf_t* mbuf;
|
||||||
|
|
||||||
char* s;
|
char* s;
|
||||||
char* fname;
|
|
||||||
|
const object_t* cfg;
|
||||||
|
|
||||||
} u;
|
} u;
|
||||||
|
|
||||||
@ -269,8 +268,8 @@ namespace cw
|
|||||||
rc_t abuf_set_channel( abuf_t* buf, unsigned chIdx, const sample_t* v, unsigned vN );
|
rc_t abuf_set_channel( abuf_t* buf, unsigned chIdx, const sample_t* v, unsigned vN );
|
||||||
const sample_t* abuf_get_channel( abuf_t* buf, unsigned chIdx );
|
const sample_t* abuf_get_channel( abuf_t* buf, unsigned chIdx );
|
||||||
|
|
||||||
fbuf_t* fbuf_create( srate_t srate, unsigned chN, const unsigned* maxBinN_V, const unsigned* binN_V, const unsigned* hopSmpN_V, const fd_real_t** magV=nullptr, const fd_real_t** phsV=nullptr, const fd_real_t** hzV=nullptr );
|
fbuf_t* fbuf_create( srate_t srate, unsigned chN, const unsigned* maxBinN_V, const unsigned* binN_V, const unsigned* hopSmpN_V, const fd_sample_t** magV=nullptr, const fd_sample_t** phsV=nullptr, const fd_sample_t** hzV=nullptr );
|
||||||
fbuf_t* fbuf_create( srate_t srate, unsigned chN, unsigned maxBinN, unsigned binN, unsigned hopSmpN, const fd_real_t** magV=nullptr, const fd_real_t** phsV=nullptr, const fd_real_t** hzV=nullptr );
|
fbuf_t* fbuf_create( srate_t srate, unsigned chN, unsigned maxBinN, unsigned binN, unsigned hopSmpN, const fd_sample_t** magV=nullptr, const fd_sample_t** phsV=nullptr, const fd_sample_t** hzV=nullptr );
|
||||||
void fbuf_destroy( fbuf_t*& buf );
|
void fbuf_destroy( fbuf_t*& buf );
|
||||||
fbuf_t* fbuf_duplicate( const fbuf_t* src );
|
fbuf_t* fbuf_duplicate( const fbuf_t* src );
|
||||||
|
|
||||||
@ -332,8 +331,12 @@ namespace cw
|
|||||||
// `value_cfg` is optional. Set it to NULL to ignore
|
// `value_cfg` is optional. Set it to NULL to ignore
|
||||||
rc_t var_register( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, const object_t* value_cfg, variable_t*& varRef );
|
rc_t var_register( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, const object_t* value_cfg, variable_t*& varRef );
|
||||||
|
|
||||||
// Returns true if this var is connected to an external proc variable
|
// Returns true if this var is connected to an source proc variable
|
||||||
bool is_connected_to_external_proc( const variable_t* var );
|
bool is_connected_to_source_proc( const variable_t* var );
|
||||||
|
|
||||||
|
// Return true if this var is acting as a source for another var.
|
||||||
|
bool is_a_source_var( const variable_t* var );
|
||||||
|
|
||||||
|
|
||||||
//-----------------
|
//-----------------
|
||||||
//
|
//
|
||||||
@ -411,8 +414,8 @@ namespace cw
|
|||||||
|
|
||||||
rc_t var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, unsigned frameN );
|
rc_t var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, unsigned frameN );
|
||||||
rc_t var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, midi::ch_msg_t* midiA, unsigned midiN );
|
rc_t var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, midi::ch_msg_t* midiA, unsigned midiN );
|
||||||
rc_t var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, const unsigned* maxBinN_V, const unsigned* binN_V, const unsigned* hopSmpN_V, const fd_real_t** magV=nullptr, const fd_real_t** phsV=nullptr, const fd_real_t** hzV=nullptr );
|
rc_t var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, const unsigned* maxBinN_V, const unsigned* binN_V, const unsigned* hopSmpN_V, const fd_sample_t** magV=nullptr, const fd_sample_t** phsV=nullptr, const fd_sample_t** hzV=nullptr );
|
||||||
rc_t var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, unsigned maxBinN, unsigned binN, unsigned hopSmpN, const fd_real_t** magV=nullptr, const fd_real_t** phsV=nullptr, const fd_real_t** hzV=nullptr );
|
rc_t var_register_and_set( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned vid, unsigned chIdx, srate_t srate, unsigned chN, unsigned maxBinN, unsigned binN, unsigned hopSmpN, const fd_sample_t** magV=nullptr, const fd_sample_t** phsV=nullptr, const fd_sample_t** hzV=nullptr );
|
||||||
|
|
||||||
inline rc_t _var_register_and_set(cw::flow::instance_t*, unsigned int ) { return kOkRC; }
|
inline rc_t _var_register_and_set(cw::flow::instance_t*, unsigned int ) { return kOkRC; }
|
||||||
|
|
||||||
@ -424,7 +427,8 @@ namespace cw
|
|||||||
variable_t* var = nullptr;
|
variable_t* var = nullptr;
|
||||||
if((rc = var_register_and_set( inst, var_label, sfx_id, vid, chIdx, var)) == kOkRC )
|
if((rc = var_register_and_set( inst, var_label, sfx_id, vid, chIdx, var)) == kOkRC )
|
||||||
{
|
{
|
||||||
var_set( inst, vid, chIdx, val );
|
if((rc = var_set( inst, vid, chIdx, val )) != kOkRC )
|
||||||
|
return rc;
|
||||||
|
|
||||||
if((rc = _var_register_and_set( inst, chIdx, std::forward<ARGS>(args)...)) != kOkRC )
|
if((rc = _var_register_and_set( inst, chIdx, std::forward<ARGS>(args)...)) != kOkRC )
|
||||||
return rc;
|
return rc;
|
||||||
@ -444,6 +448,8 @@ namespace cw
|
|||||||
|
|
||||||
bool var_exists( instance_t* inst, const char* label, unsigned sfx_id, unsigned chIdx );
|
bool var_exists( instance_t* inst, const char* label, unsigned sfx_id, unsigned chIdx );
|
||||||
bool var_has_value( instance_t* inst, const char* label, unsigned sfx_id, unsigned chIdx );
|
bool var_has_value( instance_t* inst, const char* label, unsigned sfx_id, unsigned chIdx );
|
||||||
|
bool var_is_a_source( instance_t* inst, const char* label, unsigned sfx_id, unsigned chIdx );
|
||||||
|
bool var_is_a_source( instance_t* inst, unsigned vid, unsigned chIdx );
|
||||||
|
|
||||||
rc_t var_find( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned chIdx, const variable_t*& varRef );
|
rc_t var_find( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned chIdx, const variable_t*& varRef );
|
||||||
rc_t var_find( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned chIdx, variable_t*& varRef );
|
rc_t var_find( instance_t* inst, const char* var_label, unsigned sfx_id, unsigned chIdx, variable_t*& varRef );
|
||||||
|
Loading…
Reference in New Issue
Block a user