|
|
@@ -43,7 +43,7 @@ static const rtosc::Ports local_ports = { |
|
|
rSelf(EffectMgr), |
|
|
rSelf(EffectMgr), |
|
|
rPaste, |
|
|
rPaste, |
|
|
rRecurp(filterpars, "Filter Parameter for Dynamic Filter"), |
|
|
rRecurp(filterpars, "Filter Parameter for Dynamic Filter"), |
|
|
{"parameter#64::i", rProp(alias) rDoc("Parameter Accessor"), NULL, |
|
|
|
|
|
|
|
|
{"parameter#128::i", rProp(alias) rDoc("Parameter Accessor"), NULL, |
|
|
[](const char *msg, rtosc::RtData &d) |
|
|
[](const char *msg, rtosc::RtData &d) |
|
|
{ |
|
|
{ |
|
|
EffectMgr *eff = (EffectMgr*)d.obj; |
|
|
EffectMgr *eff = (EffectMgr*)d.obj; |
|
|
@@ -52,8 +52,10 @@ static const rtosc::Ports local_ports = { |
|
|
|
|
|
|
|
|
if(!rtosc_narguments(msg)) |
|
|
if(!rtosc_narguments(msg)) |
|
|
d.reply(d.loc, "i", eff->geteffectparrt(atoi(mm))); |
|
|
d.reply(d.loc, "i", eff->geteffectparrt(atoi(mm))); |
|
|
else |
|
|
|
|
|
|
|
|
else { |
|
|
eff->seteffectparrt(atoi(mm), rtosc_argument(msg, 0).i); |
|
|
eff->seteffectparrt(atoi(mm), rtosc_argument(msg, 0).i); |
|
|
|
|
|
d.broadcast(d.loc, "i", eff->geteffectparrt(atoi(mm))); |
|
|
|
|
|
} |
|
|
}}, |
|
|
}}, |
|
|
{"preset::i", rProp(alias) rDoc("Effect Preset Selector"), NULL, |
|
|
{"preset::i", rProp(alias) rDoc("Effect Preset Selector"), NULL, |
|
|
[](const char *msg, rtosc::RtData &d) |
|
|
[](const char *msg, rtosc::RtData &d) |
|
|
@@ -61,8 +63,10 @@ static const rtosc::Ports local_ports = { |
|
|
EffectMgr *eff = (EffectMgr*)d.obj; |
|
|
EffectMgr *eff = (EffectMgr*)d.obj; |
|
|
if(!rtosc_narguments(msg)) |
|
|
if(!rtosc_narguments(msg)) |
|
|
d.reply(d.loc, "i", eff->getpreset()); |
|
|
d.reply(d.loc, "i", eff->getpreset()); |
|
|
else |
|
|
|
|
|
|
|
|
else { |
|
|
eff->changepresetrt(rtosc_argument(msg, 0).i); |
|
|
eff->changepresetrt(rtosc_argument(msg, 0).i); |
|
|
|
|
|
d.broadcast(d.loc, "i", eff->getpreset()); |
|
|
|
|
|
} |
|
|
}}, |
|
|
}}, |
|
|
{"eq-coeffs:", rProp(internal) rDoc("Get equalizer Coefficients"), NULL, |
|
|
{"eq-coeffs:", rProp(internal) rDoc("Get equalizer Coefficients"), NULL, |
|
|
[](const char *, rtosc::RtData &d) |
|
|
[](const char *, rtosc::RtData &d) |
|
|
@@ -81,9 +85,10 @@ static const rtosc::Ports local_ports = { |
|
|
{"efftype::i", rDoc("Get Effect Type"), NULL, [](const char *m, rtosc::RtData &d) |
|
|
{"efftype::i", rDoc("Get Effect Type"), NULL, [](const char *m, rtosc::RtData &d) |
|
|
{ |
|
|
{ |
|
|
EffectMgr *eff = (EffectMgr*)d.obj; |
|
|
EffectMgr *eff = (EffectMgr*)d.obj; |
|
|
if(rtosc_narguments(m)) |
|
|
|
|
|
|
|
|
if(rtosc_narguments(m)) { |
|
|
eff->changeeffectrt(rtosc_argument(m,0).i); |
|
|
eff->changeeffectrt(rtosc_argument(m,0).i); |
|
|
else |
|
|
|
|
|
|
|
|
d.broadcast(d.loc, "i", eff->nefx); |
|
|
|
|
|
} else |
|
|
d.reply(d.loc, "i", eff->nefx); |
|
|
d.reply(d.loc, "i", eff->nefx); |
|
|
}}, |
|
|
}}, |
|
|
{"efftype:b", rProp(internal) rDoc("Pointer swap EffectMgr"), NULL, |
|
|
{"efftype:b", rProp(internal) rDoc("Pointer swap EffectMgr"), NULL, |
|
|
@@ -141,7 +146,7 @@ void EffectMgr::defaults(void) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//Change the effect |
|
|
//Change the effect |
|
|
void EffectMgr::changeeffectrt(int _nefx) |
|
|
|
|
|
|
|
|
void EffectMgr::changeeffectrt(int _nefx, bool avoidSmash) |
|
|
{ |
|
|
{ |
|
|
cleanup(); |
|
|
cleanup(); |
|
|
if(nefx == _nefx && efx != NULL) |
|
|
if(nefx == _nefx && efx != NULL) |
|
|
@@ -185,6 +190,10 @@ void EffectMgr::changeeffectrt(int _nefx) |
|
|
|
|
|
|
|
|
if(efx) |
|
|
if(efx) |
|
|
filterpars = efx->filterpars; |
|
|
filterpars = efx->filterpars; |
|
|
|
|
|
|
|
|
|
|
|
if(!avoidSmash) |
|
|
|
|
|
for(int i=0; i<128; ++i) |
|
|
|
|
|
settings[i] = geteffectparrt(i); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void EffectMgr::changeeffect(int _nefx) |
|
|
void EffectMgr::changeeffect(int _nefx) |
|
|
@@ -203,8 +212,8 @@ int EffectMgr::geteffect(void) |
|
|
// Initialize An Effect in RT context |
|
|
// Initialize An Effect in RT context |
|
|
void EffectMgr::init(void) |
|
|
void EffectMgr::init(void) |
|
|
{ |
|
|
{ |
|
|
changeeffectrt(nefx); |
|
|
|
|
|
changepresetrt(preset); |
|
|
|
|
|
|
|
|
changeeffectrt(nefx, true); |
|
|
|
|
|
changepresetrt(preset, true); |
|
|
for(int i=0; i<128; ++i) |
|
|
for(int i=0; i<128; ++i) |
|
|
seteffectparrt(i, settings[i]); |
|
|
seteffectparrt(i, settings[i]); |
|
|
} |
|
|
} |
|
|
@@ -240,11 +249,14 @@ void EffectMgr::changepreset(unsigned char npreset) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Change the preset of the current effect |
|
|
// Change the preset of the current effect |
|
|
void EffectMgr::changepresetrt(unsigned char npreset) |
|
|
|
|
|
|
|
|
void EffectMgr::changepresetrt(unsigned char npreset, bool avoidSmash) |
|
|
{ |
|
|
{ |
|
|
preset = npreset; |
|
|
preset = npreset; |
|
|
if(efx) |
|
|
if(efx) |
|
|
efx->setpreset(npreset); |
|
|
efx->setpreset(npreset); |
|
|
|
|
|
if(!avoidSmash) |
|
|
|
|
|
for(int i=0; i<128; ++i) |
|
|
|
|
|
settings[i] = geteffectparrt(i); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//Change a parameter of the current effect |
|
|
//Change a parameter of the current effect |
|
|
@@ -368,11 +380,10 @@ void EffectMgr::setdryonly(bool value) |
|
|
|
|
|
|
|
|
void EffectMgr::paste(EffectMgr &e) |
|
|
void EffectMgr::paste(EffectMgr &e) |
|
|
{ |
|
|
{ |
|
|
changeeffectrt(e.nefx); |
|
|
|
|
|
changepresetrt(e.preset); |
|
|
|
|
|
for(int i=0;i<128;++i){ |
|
|
|
|
|
|
|
|
changeeffectrt(e.nefx, true); |
|
|
|
|
|
changepresetrt(e.preset, true); |
|
|
|
|
|
for(int i=0;i<128;++i) |
|
|
seteffectparrt(e.settings[i], i); |
|
|
seteffectparrt(e.settings[i], i); |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void EffectMgr::add2XML(XMLwrapper *xml) |
|
|
void EffectMgr::add2XML(XMLwrapper *xml) |
|
|
|