All files: The great namespace purge

nix
Owen Green 7 years ago
parent 52bafc0184
commit 6660cb53dc

@ -18,7 +18,7 @@
//static InterfaceTable *ft; //static InterfaceTable *ft;
namespace fluid { namespace fluid {
namespace sc{ namespace wrapper{
/** /**
A descendent of SndBuf that will populate itself A descendent of SndBuf that will populate itself
from the NRT mirror buffers given a world and a bufnum from the NRT mirror buffers given a world and a bufnum
@ -37,7 +37,7 @@ namespace sc{
}; };
/** /**
A combination of SndBuf and parameter::BufferAdaptor (which, in turn, exposes FluidTensorView<float,2>), for simple transfer of data A combination of SndBuf and client::BufferAdaptor (which, in turn, exposes FluidTensorView<float,2>), for simple transfer of data
Given a World* and a buffer number, this will populate its SndBuf stuff Given a World* and a buffer number, this will populate its SndBuf stuff
from the NRT mirror buffers, and create a FluidTensorView wrapper of from the NRT mirror buffers, and create a FluidTensorView wrapper of
@ -50,7 +50,7 @@ namespace sc{
nSamps = rows nSamps = rows
nChans = columns nChans = columns
**/ **/
class SCBufferView: public NRTBuf, public parameter::BufferAdaptor class SCBufferView: public NRTBuf, public client::BufferAdaptor
{ {
public: public:
SCBufferView() = delete; SCBufferView() = delete;
@ -153,7 +153,7 @@ namespace sc{
size_t mRank = 1; size_t mRank = 1;
}; };
class RTBufferView: public parameter::BufferAdaptor class RTBufferView: public client::BufferAdaptor
{ {
public: public:
RTBufferView(World* world, int bufnum): mWorld(world), mBufnum(bufnum) {} RTBufferView(World* world, int bufnum): mWorld(world), mBufnum(bufnum) {}
@ -233,7 +233,7 @@ namespace sc{
class NRTCommandBase{ class NRTCommandBase{
using param_type = fluid::parameter::Instance; using param_type = fluid::client::Instance;
public: public:
NRTCommandBase() = delete; NRTCommandBase() = delete;
NRTCommandBase(NRTCommandBase&) = delete; NRTCommandBase(NRTCommandBase&) = delete;
@ -312,7 +312,7 @@ namespace sc{
} }
cmd << ", "; cmd << ", ";
if (d.getType() == parameter::Type::kBuffer) { if (d.getType() == client::Type::kBuffer) {
if (count == 0) if (count == 0)
cmd << d.getName() << ".bufnum"; cmd << d.getName() << ".bufnum";
else else
@ -328,7 +328,7 @@ namespace sc{
ss << ";\n\n\t\tserver = server ? Server.default\n;" ; ss << ";\n\n\t\tserver = server ? Server.default\n;" ;
if (Client::getParamDescriptors()[0].getType() == if (Client::getParamDescriptors()[0].getType() ==
parameter::Type::kBuffer) { client::Type::kBuffer) {
ss << "if("<<Client::getParamDescriptors()[0].getName() ss << "if("<<Client::getParamDescriptors()[0].getName()
<< ".bufnum.isNil) {Error(\"Invalid Buffer\").format(thisMethod.name, this.class.name).throw};\n\n"; << ".bufnum.isNil) {Error(\"Invalid Buffer\").format(thisMethod.name, this.class.name).throw};\n\n";
} }
@ -347,12 +347,12 @@ namespace sc{
NRT_Plug* cmd = new NRT_Plug(inUserData); NRT_Plug* cmd = new NRT_Plug(inUserData);
//Iterate over parameter descriptions associated with this client object, fill with data from language side //Iterate over parameter descriptions associated with this client object, fill with data from language side
// std::vector<parameter::Instance> params = NRT_Plug::client_type::newParameterSet(); // std::vector<client::Instance> params = NRT_Plug::client_type::newParameterSet();
for (auto&& p: cmd->parameters()) for (auto&& p: cmd->parameters())
{ {
switch(p.getDescriptor().getType()) switch(p.getDescriptor().getType())
{ {
case parameter::Type::kBuffer: { case client::Type::kBuffer: {
long bufnum = static_cast<long>(args->geti()); long bufnum = static_cast<long>(args->geti());
if (bufnum >= 0) { if (bufnum >= 0) {
SCBufferView *buf = new SCBufferView(bufnum, inWorld); SCBufferView *buf = new SCBufferView(bufnum, inWorld);
@ -360,11 +360,11 @@ namespace sc{
} }
break; break;
} }
case parameter::Type::kLong: { case client::Type::kLong: {
p.setLong(static_cast<long>(args->geti())); p.setLong(static_cast<long>(args->geti()));
break; break;
} }
case parameter::Type::kFloat: { case client::Type::kFloat: {
p.setFloat(args->getf()); p.setFloat(args->getf());
break; break;
} }
@ -388,14 +388,14 @@ namespace sc{
cmd->runCommand(inWorld, replyAddr, completionMsgData, completionMsgSize); cmd->runCommand(inWorld, replyAddr, completionMsgData, completionMsgSize);
} }
} //namespace sc } //namespace wrapper
}//namespace fluid }//namespace fluid
template <typename NRT_Plug,typename NRT_Client> template <typename NRT_Plug,typename NRT_Client>
void registerCommand(InterfaceTable* ft, const char* name) void registerCommand(InterfaceTable* ft, const char* name)
{ {
PlugInCmdFunc cmd = fluid::sc::command<NRT_Plug>; PlugInCmdFunc cmd = fluid::wrapper::command<NRT_Plug>;
(*ft->fDefinePlugInCmd)(name,cmd,nullptr); (*ft->fDefinePlugInCmd)(name,cmd,nullptr);
} }

@ -12,12 +12,12 @@
static InterfaceTable *ft; static InterfaceTable *ft;
namespace fluid { namespace fluid {
namespace sc{ namespace wrapper{
class BufCompose: public NRTCommandBase class BufCompose: public NRTCommandBase
{ {
public: public:
using client_type = buf::BufferComposeClient; using client_type = client::BufferComposeClient;
using NRTCommandBase::NRTCommandBase; using NRTCommandBase::NRTCommandBase;
~BufCompose() {} ~BufCompose() {}
@ -55,7 +55,7 @@ namespace fluid {
return true; return true;
} }
std::vector<parameter::Instance>& parameters() std::vector<client::Instance>& parameters()
{ {
return bufferCompose.getParams(); return bufferCompose.getParams();
} }
@ -63,12 +63,12 @@ namespace fluid {
client_type bufferCompose; client_type bufferCompose;
client_type::ProcessModel mModel; client_type::ProcessModel mModel;
};//class };//class
} //namespace sc } //namespace wrapper
}//namespace fluid }//namespace fluid
PluginLoad(OfflineFluidDecompositionUGens) { PluginLoad(OfflineFluidDecompositionUGens) {
ft = inTable; ft = inTable;
registerCommand<fluid::sc::BufCompose,fluid:: buf::BufferComposeClient>(ft, "BufCompose"); registerCommand<fluid::wrapper::BufCompose,fluid:: client::BufferComposeClient>(ft, "BufCompose");
fluid::sc::printCmd<fluid::buf::BufferComposeClient>(ft,"BufCompose","FDCompose"); fluid::wrapper::printCmd<fluid::client::BufferComposeClient>(ft,"BufCompose","FDCompose");
} }

@ -17,7 +17,7 @@ using fluid::FluidTensor;
using fluid::FluidTensorView; using fluid::FluidTensorView;
namespace fluid { namespace fluid {
namespace sc{ namespace wrapper{
class BufHPSS: public NRTCommandBase class BufHPSS: public NRTCommandBase
{ {
@ -34,7 +34,7 @@ namespace fluid {
 fft size  fft size
*/ */
public: public:
using client_type = hpss::HPSSClient; using client_type = client::HPSSClient;
using NRTCommandBase::NRTCommandBase; using NRTCommandBase::NRTCommandBase;
~BufHPSS() {} ~BufHPSS() {}
@ -48,7 +48,7 @@ namespace fluid {
{ {
//sanity check the parameters //sanity check the parameters
bool parametersOk; bool parametersOk;
hpss::HPSSClient::ProcessModel processModel; client::HPSSClient::ProcessModel processModel;
std::string whatHappened;//this will give us a message to pass back if param check fails std::string whatHappened;//this will give us a message to pass back if param check fails
std::tie(parametersOk,whatHappened,processModel) = processor.sanityCheck(); std::tie(parametersOk,whatHappened,processModel) = processor.sanityCheck();
if(!parametersOk) if(!parametersOk)
@ -82,20 +82,20 @@ namespace fluid {
} }
std::vector<parameter::Instance>& parameters() std::vector<client::Instance>& parameters()
{ {
return processor.getParams(); return processor.getParams();
} }
private: private:
hpss::HPSSClient processor; client::HPSSClient processor;
hpss::HPSSClient::ProcessModel mModel; client::HPSSClient::ProcessModel mModel;
};//class };//class
} //namespace sc } //namespace wrapper
}//namespace fluid }//namespace fluid
PluginLoad(OfflineFluidDecompositionUGens) { PluginLoad(OfflineFluidDecompositionUGens) {
ft = inTable; ft = inTable;
registerCommand<fluid::sc::BufHPSS,fluid::hpss::HPSSClient>(ft, "BufHPSS"); registerCommand<fluid::wrapper::BufHPSS,fluid::client::HPSSClient>(ft, "BufHPSS");
fluid::sc::printCmd<fluid::hpss::HPSSClient>(ft,"BufHPSS","FDHPSS"); fluid::wrapper::printCmd<fluid::client::HPSSClient>(ft,"BufHPSS","FDHPSS");
} }

@ -19,10 +19,10 @@ static InterfaceTable *ft;
//Using statements for fluidtensor //Using statements for fluidtensor
using fluid::FluidTensor; using fluid::FluidTensor;
using fluid::FluidTensorView; using fluid::FluidTensorView;
using fluid::nmf::NMFClient; using fluid::client::NMFClient;
namespace fluid { namespace fluid {
namespace sc{ namespace wrapper{
class BufNMF: public NRTCommandBase class BufNMF: public NRTCommandBase
{ {
@ -81,10 +81,10 @@ namespace fluid {
nmf.process(processModel); nmf.process(processModel);
mModel = processModel; mModel = processModel;
src = static_cast<SCBufferView*>(parameter::lookupParam("src", nmf.getParams()).getBuffer()); src = static_cast<SCBufferView*>(client::lookupParam("src", nmf.getParams()).getBuffer());
resynth = static_cast<SCBufferView*>(parameter::lookupParam("resynthbuf", nmf.getParams()).getBuffer()); resynth = static_cast<SCBufferView*>(client::lookupParam("resynthbuf", nmf.getParams()).getBuffer());
dict = static_cast<SCBufferView*>(parameter::lookupParam("filterbuf", nmf.getParams()).getBuffer()); dict = static_cast<SCBufferView*>(client::lookupParam("filterbuf", nmf.getParams()).getBuffer());
act = static_cast<SCBufferView*>(parameter::lookupParam("envbuf", nmf.getParams()).getBuffer()); act = static_cast<SCBufferView*>(client::lookupParam("envbuf", nmf.getParams()).getBuffer());
return true; return true;
} }
@ -113,7 +113,7 @@ namespace fluid {
return true; return true;
} }
std::vector<parameter::Instance>& parameters() std::vector<client::Instance>& parameters()
{ {
return nmf.getParams(); return nmf.getParams();
} }
@ -125,11 +125,11 @@ namespace fluid {
SCBufferView* dict; SCBufferView* dict;
SCBufferView* act; SCBufferView* act;
};//class };//class
} //namespace sc } //namespace wrapper
}//namespace fluid }//namespace fluid
PluginLoad(OfflineFluidDecompositionUGens) { PluginLoad(OfflineFluidDecompositionUGens) {
ft = inTable; ft = inTable;
registerCommand<fluid::sc::BufNMF,fluid::nmf::NMFClient>(ft, "BufNMF"); registerCommand<fluid::wrapper::BufNMF,fluid::client::NMFClient>(ft, "BufNMF");
} }

@ -13,12 +13,12 @@
static InterfaceTable *ft; static InterfaceTable *ft;
namespace fluid { namespace fluid {
namespace sc{ namespace wrapper{
class BufNoveltySlice: public NRTCommandBase class BufNoveltySlice: public NRTCommandBase
{ {
public: public:
using client_type = segmentation::NoveltyClient; using client_type = client::NoveltyClient;
using NRTCommandBase::NRTCommandBase; using NRTCommandBase::NRTCommandBase;
~BufNoveltySlice() {} ~BufNoveltySlice() {}
@ -56,7 +56,7 @@ namespace fluid {
return true; return true;
} }
std::vector<parameter::Instance>& parameters() std::vector<client::Instance>& parameters()
{ {
return trans.getParams(); return trans.getParams();
} }
@ -64,12 +64,12 @@ namespace fluid {
client_type trans; client_type trans;
client_type::ProcessModel mModel; client_type::ProcessModel mModel;
};//class };//class
} //namespace sc } //namespace wrapper
}//namespace fluid }//namespace fluid
PluginLoad(OfflineFluidDecompositionUGens) { PluginLoad(OfflineFluidDecompositionUGens) {
ft = inTable; ft = inTable;
registerCommand<fluid::sc::BufNoveltySlice,fluid::segmentation::NoveltyClient>(ft, "BufNoveltySlice"); registerCommand<fluid::wrapper::BufNoveltySlice,fluid::client::NoveltyClient>(ft, "BufNoveltySlice");
fluid::sc::printCmd<fluid::segmentation::NoveltyClient>(ft,"BufNoveltySlice","FluidBufNoveltySlice"); fluid::wrapper::printCmd<fluid::client::NoveltyClient>(ft,"BufNoveltySlice","FluidBufNoveltySlice");
} }

@ -17,7 +17,7 @@ using fluid::FluidTensor;
using fluid::FluidTensorView; using fluid::FluidTensorView;
namespace fluid { namespace fluid {
namespace sc{ namespace wrapper{
class BufSines: public NRTCommandBase class BufSines: public NRTCommandBase
{ {
@ -39,7 +39,7 @@ namespace fluid {
 fft size  fft size
*/ */
public: public:
using client_type = stn::SinesClient; using client_type = client::SinesClient;
using NRTCommandBase::NRTCommandBase; using NRTCommandBase::NRTCommandBase;
~BufSines() {} ~BufSines() {}
@ -53,7 +53,7 @@ namespace fluid {
{ {
//sanity check the parameters //sanity check the parameters
bool parametersOk; bool parametersOk;
stn::SinesClient::ProcessModel processModel; client::SinesClient::ProcessModel processModel;
std::string whatHappened;//this will give us a message to pass back if param check fails std::string whatHappened;//this will give us a message to pass back if param check fails
std::tie(parametersOk,whatHappened,processModel) = processor.sanityCheck(); std::tie(parametersOk,whatHappened,processModel) = processor.sanityCheck();
if(!parametersOk) if(!parametersOk)
@ -80,20 +80,20 @@ namespace fluid {
return true; return true;
} }
std::vector<parameter::Instance>& parameters() std::vector<client::Instance>& parameters()
{ {
return processor.getParams(); return processor.getParams();
} }
private: private:
stn::SinesClient processor; client::SinesClient processor;
stn::SinesClient::ProcessModel mModel; client::SinesClient::ProcessModel mModel;
};//class };//class
} //namespace sc } //namespace wrapper
}//namespace fluid }//namespace fluid
PluginLoad(OfflineFluidDecompositionUGens) { PluginLoad(OfflineFluidDecompositionUGens) {
ft = inTable; ft = inTable;
registerCommand<fluid::sc::BufSines,fluid::stn::SinesClient>(ft, "BufSines"); registerCommand<fluid::wrapper::BufSines,fluid::client::SinesClient>(ft, "BufSines");
fluid::sc::printCmd<fluid::stn::SinesClient>(ft,"BufSines","FDSines"); fluid::wrapper::printCmd<fluid::client::SinesClient>(ft,"BufSines","FDSines");
} }

@ -14,12 +14,12 @@
static InterfaceTable *ft; static InterfaceTable *ft;
namespace fluid { namespace fluid {
namespace sc{ namespace wrapper{
class BufTransientsSlice: public NRTCommandBase class BufTransientsSlice: public NRTCommandBase
{ {
public: public:
using client_type = segmentation::TransientSliceNRT; using client_type = client::TransientSliceNRT;
using NRTCommandBase::NRTCommandBase; using NRTCommandBase::NRTCommandBase;
~BufTransientsSlice() {} ~BufTransientsSlice() {}
@ -58,7 +58,7 @@ namespace fluid {
return true; return true;
} }
std::vector<parameter::Instance>& parameters() std::vector<client::Instance>& parameters()
{ {
return trans.getParams(); return trans.getParams();
} }
@ -66,12 +66,12 @@ namespace fluid {
client_type trans; client_type trans;
client_type::ProcessModel mModel; client_type::ProcessModel mModel;
};//class };//class
} //namespace sc } //namespace wrapper
}//namespace fluid }//namespace fluid
PluginLoad(OfflineFluidDecompositionUGens) { PluginLoad(OfflineFluidDecompositionUGens) {
ft = inTable; ft = inTable;
registerCommand<fluid::sc::BufTransientsSlice,fluid::segmentation::TransientSliceNRT>(ft, "BufTransientSlice"); registerCommand<fluid::wrapper::BufTransientsSlice,fluid::client::TransientSliceNRT>(ft, "BufTransientSlice");
fluid::sc::printCmd<fluid::segmentation::TransientSliceNRT>(ft,"BufTransientsSlice","FluidBufTransientSlice"); fluid::wrapper::printCmd<fluid::client::TransientSliceNRT>(ft,"BufTransientsSlice","FluidBufTransientSlice");
} }

@ -12,12 +12,12 @@
static InterfaceTable *ft; static InterfaceTable *ft;
namespace fluid { namespace fluid {
namespace sc{ namespace wrapper{
class BufTransients: public NRTCommandBase class BufTransients: public NRTCommandBase
{ {
public: public:
using client_type = str::TransientNRTClient; using client_type = client::TransientNRTClient;
using NRTCommandBase::NRTCommandBase; using NRTCommandBase::NRTCommandBase;
~BufTransients() {} ~BufTransients() {}
@ -62,7 +62,7 @@ namespace fluid {
return true; return true;
} }
std::vector<parameter::Instance>& parameters() std::vector<client::Instance>& parameters()
{ {
return trans.getParams(); return trans.getParams();
} }
@ -70,12 +70,12 @@ namespace fluid {
client_type trans; client_type trans;
client_type::ProcessModel mModel; client_type::ProcessModel mModel;
};//class };//class
} //namespace sc } //namespace wrapper
}//namespace fluid }//namespace fluid
PluginLoad(OfflineFluidDecompositionUGens) { PluginLoad(OfflineFluidDecompositionUGens) {
ft = inTable; ft = inTable;
registerCommand<fluid::sc::BufTransients,fluid::str::TransientNRTClient>(ft, "BufTransients"); registerCommand<fluid::wrapper::BufTransients,fluid::client::TransientNRTClient>(ft, "BufTransients");
fluid::sc::printCmd<fluid::str::TransientNRTClient>(ft,"BufTransients","FDTransients"); fluid::wrapper::printCmd<fluid::client::TransientNRTClient>(ft,"BufTransients","FDTransients");
} }

@ -10,7 +10,7 @@ static InterfaceTable *ft;
namespace fluid { namespace fluid {
class FDGain: public SCUnit class FDGain: public SCUnit
{ {
using AudioClient = fluid::audio::GainAudioClient<double, float>; using AudioClient = fluid::client::GainAudioClient<double, float>;
using ClientPointer = std::unique_ptr<AudioClient>; using ClientPointer = std::unique_ptr<AudioClient>;
using SignalWrapper = AudioClient::Signal; using SignalWrapper = AudioClient::Signal;
using AudioSignal= AudioClient::AudioSignal; using AudioSignal= AudioClient::AudioSignal;
@ -23,10 +23,10 @@ public:
{ {
mClient = ClientPointer(new AudioClient(65536)); mClient = ClientPointer(new AudioClient(65536));
std::vector<parameter::Instance>& params = mClient->getParams(); std::vector<client::Instance>& params = mClient->getParams();
parameter::lookupParam("winsize", params).setLong(in0(1)); client::lookupParam("winsize", params).setLong(in0(1));
parameter::lookupParam("hopsize", params).setLong(in0(1)); client::lookupParam("hopsize", params).setLong(in0(1));
mClient->setHostBufferSize(bufferSize()); mClient->setHostBufferSize(bufferSize());
mClient->reset(); mClient->reset();

@ -7,13 +7,13 @@
static InterfaceTable *ft; static InterfaceTable *ft;
namespace fluid { namespace fluid {
namespace hpss{ namespace wrapper{
class FDRTHPSS: public SCUnit class FDRTHPSS: public SCUnit
{ {
using AudioSignalWrapper = hpss::HPSSClient<double, float>::AudioSignal; using AudioSignalWrapper = client::HPSSClient<double, float>::AudioSignal;
using SignalWrapper = hpss::HPSSClient<double, float>::Signal<float>; using SignalWrapper = client::HPSSClient<double, float>::Signal<float>;
using SignalPointer = std::unique_ptr<SignalWrapper>; using SignalPointer = std::unique_ptr<SignalWrapper>;
using ClientPointer = std::unique_ptr<hpss::HPSSClient<double,float>>; using ClientPointer = std::unique_ptr<client::HPSSClient<double,float>>;
template <size_t N> template <size_t N>
using SignalArray = std::array<SignalPointer,N>; using SignalArray = std::array<SignalPointer,N>;
public: public:
@ -23,7 +23,7 @@ namespace hpss{
//psize hszie pthresh hthresh Window size, Hop size, FFT Size //psize hszie pthresh hthresh Window size, Hop size, FFT Size
//Oh NO! Heap allocation! Make client object //Oh NO! Heap allocation! Make client object
mClient = ClientPointer(new hpss::HPSSClient<double,float>(65536)); mClient = ClientPointer(new client::HPSSClient<double,float>(65536));
setParams(true); setParams(true);
@ -61,16 +61,16 @@ namespace hpss{
assert(mClient); assert(mClient);
for(size_t i = 0; i < mClient->getParams().size(); ++i) for(size_t i = 0; i < mClient->getParams().size(); ++i)
{ {
parameter::Instance& p = mClient->getParams()[i]; client::Instance& p = mClient->getParams()[i];
if(!instantiation && p.getDescriptor().instantiation()) if(!instantiation && p.getDescriptor().instantiation())
continue; continue;
switch(p.getDescriptor().getType()) switch(p.getDescriptor().getType())
{ {
case parameter::Type::kLong: case client::Type::kLong:
p.setLong(in0(i + 1)); p.setLong(in0(i + 1));
p.checkRange(); p.checkRange();
break; break;
case parameter::Type::kFloat: { case client::Type::kFloat: {
// We need to constrain threshold (normalised) frequency pairs at // We need to constrain threshold (normalised) frequency pairs at
// runtime. // runtime.
@ -78,7 +78,7 @@ namespace hpss{
auto constraint = paramConstraints.find(attrname); auto constraint = paramConstraints.find(attrname);
if (constraint != paramConstraints.end()) { if (constraint != paramConstraints.end()) {
double limit = parameter::lookupParam(constraint->second.param, double limit = client::lookupParam(constraint->second.param,
mClient->getParams()) mClient->getParams())
.getFloat(); .getFloat();
@ -91,7 +91,7 @@ namespace hpss{
p.checkRange(); p.checkRange();
} }
break; break;
case parameter::Type::kBuffer: case client::Type::kBuffer:
// p.setBuffer( in0(i+1)); // p.setBuffer( in0(i+1));
break; break;
default: default:
@ -134,7 +134,7 @@ namespace hpss{
PluginLoad(FluidSTFTUGen) { PluginLoad(FluidSTFTUGen) {
ft = inTable; ft = inTable;
registerUnit<fluid::hpss::FDRTHPSS>(ft, "FluidHPSS"); registerUnit<fluid::wrapper::FDRTHPSS>(ft, "FluidHPSS");
} }

@ -13,7 +13,7 @@ namespace fluid {
namespace nmf{ namespace nmf{
class FDNMFMatch: public SCUnit class FDNMFMatch: public SCUnit
{ {
using Client = NMFMatch<double,float>; using Client = client::NMFMatch<double,float>;
using AudioSignalWrapper = Client::AudioSignal; using AudioSignalWrapper = Client::AudioSignal;
using SignalWrapper = Client::Signal<float>; using SignalWrapper = Client::Signal<float>;
using SignalPointer = std::unique_ptr<SignalWrapper>; using SignalPointer = std::unique_ptr<SignalWrapper>;
@ -45,7 +45,7 @@ namespace nmf{
return; return;
} }
mRank = parameter::lookupParam("rank", mClient->getParams()).getLong(); mRank = client::lookupParam("rank", mClient->getParams()).getLong();
mClient->setHostBufferSize(bufferSize()); mClient->setHostBufferSize(bufferSize());
@ -71,27 +71,27 @@ namespace nmf{
assert(mClient); assert(mClient);
for(size_t i = 0; i < mClient->getParams().size(); ++i) for(size_t i = 0; i < mClient->getParams().size(); ++i)
{ {
parameter::Instance& p = mClient->getParams()[i]; client::Instance& p = mClient->getParams()[i];
if(!instantiation && p.getDescriptor().instantiation()) if(!instantiation && p.getDescriptor().instantiation())
continue; continue;
switch(p.getDescriptor().getType()) switch(p.getDescriptor().getType())
{ {
case parameter::Type::kLong: case client::Type::kLong:
p.setLong(in0(i + 1)); p.setLong(in0(i + 1));
p.checkRange(); p.checkRange();
break; break;
case parameter::Type::kFloat: { case client::Type::kFloat: {
p.setFloat(in0(i + 1)); p.setFloat(in0(i + 1));
p.checkRange(); p.checkRange();
} }
break; break;
case parameter::Type::kBuffer: { case client::Type::kBuffer: {
long bufnum = static_cast<long>(in0(i+1)); long bufnum = static_cast<long>(in0(i+1));
sc::RTBufferView* currentBuf = static_cast<sc::RTBufferView*>(p.getBuffer()); wrapper::RTBufferView* currentBuf = static_cast<wrapper::RTBufferView*>(p.getBuffer());
if(bufnum >= 0 && (currentBuf? (currentBuf->bufnum() != bufnum) : true)){ if(bufnum >= 0 && (currentBuf? (currentBuf->bufnum() != bufnum) : true)){
sc::RTBufferView* buf = new sc::RTBufferView(mWorld,bufnum); wrapper::RTBufferView* buf = new wrapper::RTBufferView(mWorld,bufnum);
p.setBuffer(buf); p.setBuffer(buf);
} }
break; break;

@ -12,8 +12,8 @@ namespace fluid {
class FDSTFTPass: public SCUnit class FDSTFTPass: public SCUnit
{ {
using AudioSignalWrapper = audio::BaseSTFTClient<double, float>::AudioSignal; using AudioSignalWrapper = client::BaseSTFTClient<double, float>::AudioSignal;
using SignalWrapper = audio::BaseSTFTClient<double, float>::Signal<float>; using SignalWrapper = client::BaseSTFTClient<double, float>::Signal<float>;
// using SignalPointer = std::unique_ptr<signal_wrapper>; // using SignalPointer = std::unique_ptr<signal_wrapper>;
public: public:
@ -28,7 +28,7 @@ public:
const float fftSize = in0(3); const float fftSize = in0(3);
//Oh NO! Heap allocation! Make client object //Oh NO! Heap allocation! Make client object
mClient = new audio::BaseSTFTClient<double,float>(65536); mClient = new client::BaseSTFTClient<double,float>(65536);
mClient->getParams()[0].setLong(windowSize); mClient->getParams()[0].setLong(windowSize);
mClient->getParams()[1].setLong(hopSize); mClient->getParams()[1].setLong(hopSize);
mClient->getParams()[2].setLong(fftSize); mClient->getParams()[2].setLong(fftSize);
@ -75,7 +75,7 @@ private:
mClient->doProcess(std::begin(inputSignals),std::end(inputSignals),std::begin(outputSignals), std::end(outputSignals),numsamples,1,1); mClient->doProcess(std::begin(inputSignals),std::end(inputSignals),std::begin(outputSignals), std::end(outputSignals),numsamples,1,1);
} }
audio::BaseSTFTClient<double, float> *mClient; client::BaseSTFTClient<double, float> *mClient;
SignalWrapper *inputSignals[1]; SignalWrapper *inputSignals[1];
SignalWrapper *outputSignals[1]; SignalWrapper *outputSignals[1];
}; };

@ -7,11 +7,11 @@
static InterfaceTable *ft; static InterfaceTable *ft;
namespace fluid { namespace fluid {
namespace stn{ namespace wrapper{
class FDRTSines: public SCUnit class FDRTSines: public SCUnit
{ {
using AudioSignalWrapper = stn::SinesClient<double, float>::AudioSignal; using AudioSignalWrapper = client::SinesClient<double, float>::AudioSignal;
using SignalWrapper = stn::SinesClient<double, float>::Signal<float>; using SignalWrapper = client::SinesClient<double, float>::Signal<float>;
// using SignalPointer = std::unique_ptr<signal_wrapper>; // using SignalPointer = std::unique_ptr<signal_wrapper>;
public: public:
@ -31,7 +31,7 @@ namespace stn{
// //
//Oh NO! Heap allocation! Make client object //Oh NO! Heap allocation! Make client object
mClient = new stn::SinesClient<double,float>(65536); mClient = new client::SinesClient<double,float>(65536);
setParams(true); setParams(true);
// m_client->getParams()[0].setLong(pfilter_size); // m_client->getParams()[0].setLong(pfilter_size);
@ -81,22 +81,22 @@ namespace stn{
assert(mClient); assert(mClient);
for(size_t i = 0; i < mClient->getParams().size(); ++i) for(size_t i = 0; i < mClient->getParams().size(); ++i)
{ {
parameter::Instance& p = mClient->getParams()[i]; client::Instance& p = mClient->getParams()[i];
if(!instantiation && p.getDescriptor().instantiation()) if(!instantiation && p.getDescriptor().instantiation())
continue; continue;
switch(p.getDescriptor().getType()) switch(p.getDescriptor().getType())
{ {
case parameter::Type::kLong: case client::Type::kLong:
p.setLong(in0(i + 1)); p.setLong(in0(i + 1));
p.checkRange(); p.checkRange();
break; break;
case parameter::Type::kFloat: case client::Type::kFloat:
p.setFloat(in0(i + 1)); p.setFloat(in0(i + 1));
p.checkRange(); p.checkRange();
break; break;
case parameter::Type::kBuffer: case client::Type::kBuffer:
// p.setBuffer( in0(i+1)); // p.setBuffer( in0(i+1));
break; break;
default: default:
@ -117,7 +117,7 @@ namespace stn{
mClient->doProcess(std::begin(inputSignals),std::end(inputSignals),std::begin(outputSignals), std::end(outputSignals),numsamples,1,2); mClient->doProcess(std::begin(inputSignals),std::end(inputSignals),std::begin(outputSignals), std::end(outputSignals),numsamples,1,2);
} }
stn::SinesClient<double, float> *mClient; client::SinesClient<double, float> *mClient;
SignalWrapper *inputSignals[1]; SignalWrapper *inputSignals[1];
SignalWrapper *outputSignals[2]; SignalWrapper *outputSignals[2];
}; };
@ -126,6 +126,6 @@ namespace stn{
PluginLoad(FluidSTFTUGen) { PluginLoad(FluidSTFTUGen) {
ft = inTable; ft = inTable;
registerUnit<fluid::stn::FDRTSines>(ft, "FluidSines"); registerUnit<fluid::wrapper::FDRTSines>(ft, "FluidSines");
} }

@ -10,7 +10,7 @@ namespace fluid {
namespace segmentation{ namespace segmentation{
class FluidSliceTransients: public SCUnit class FluidSliceTransients: public SCUnit
{ {
using audio_client = TransientsSlice<double, float>; using audio_client = client::TransientsSlice<double, float>;
using AudioSignalWrapper = audio_client::AudioSignal; using AudioSignalWrapper = audio_client::AudioSignal;
using SignalWrapper = audio_client::Signal<float>; using SignalWrapper = audio_client::Signal<float>;
@ -59,22 +59,22 @@ namespace segmentation{
assert(mClient); assert(mClient);
for(size_t i = 0; i < mClient->getParams().size(); ++i) for(size_t i = 0; i < mClient->getParams().size(); ++i)
{ {
parameter::Instance& p = mClient->getParams()[i]; client::Instance& p = mClient->getParams()[i];
if(!instantiation && p.getDescriptor().instantiation()) if(!instantiation && p.getDescriptor().instantiation())
continue; continue;
switch(p.getDescriptor().getType()) switch(p.getDescriptor().getType())
{ {
case parameter::Type::kLong: case client::Type::kLong:
p.setLong(in0(i + 1)); p.setLong(in0(i + 1));
p.checkRange(); p.checkRange();
break; break;
case parameter::Type::kFloat: case client::Type::kFloat:
p.setFloat(in0(i + 1)); p.setFloat(in0(i + 1));
p.checkRange(); p.checkRange();
break; break;
case parameter::Type::kBuffer: case client::Type::kBuffer:
// p.setBuffer( in0(i+1)); // p.setBuffer( in0(i+1));
break; break;
default: default:

@ -7,11 +7,11 @@
static InterfaceTable *ft; static InterfaceTable *ft;
namespace fluid { namespace fluid {
namespace stn{ namespace wrapper{
class FluidTransients: public SCUnit class FluidTransients: public SCUnit
{ {
using AudioSignalWrapper = stn::TransientsClient<double, float>::AudioSignal; using AudioSignalWrapper = client::TransientsClient<double, float>::AudioSignal;
using SignalWrapper = stn::TransientsClient<double, float>::Signal<float>; using SignalWrapper = client::TransientsClient<double, float>::Signal<float>;
// using SignalPointer = std::unique_ptr<signal_wrapper>; // using SignalPointer = std::unique_ptr<signal_wrapper>;
public: public:
@ -31,7 +31,7 @@ namespace stn{
// //
//Oh NO! Heap allocation! Make client object //Oh NO! Heap allocation! Make client object
mClient = new stn::TransientsClient<double,float>(65536); mClient = new client::TransientsClient<double,float>(65536);
setParams(true); setParams(true);
// mClient->geParams()[0].setLong(pfilter_size); // mClient->geParams()[0].setLong(pfilter_size);
@ -80,22 +80,22 @@ namespace stn{
assert(mClient); assert(mClient);
for(size_t i = 0; i < mClient->getParams().size(); ++i) for(size_t i = 0; i < mClient->getParams().size(); ++i)
{ {
parameter::Instance& p = mClient->getParams()[i]; client::Instance& p = mClient->getParams()[i];
if(!instantiation && p.getDescriptor().instantiation()) if(!instantiation && p.getDescriptor().instantiation())
continue; continue;
switch(p.getDescriptor().getType()) switch(p.getDescriptor().getType())
{ {
case parameter::Type::kLong: case client::Type::kLong:
p.setLong(in0(i + 1)); p.setLong(in0(i + 1));
p.checkRange(); p.checkRange();
break; break;
case parameter::Type::kFloat: case client::Type::kFloat:
p.setFloat(in0(i + 1)); p.setFloat(in0(i + 1));
p.checkRange(); p.checkRange();
break; break;
case parameter::Type::kBuffer: case client::Type::kBuffer:
// p.setBuffer( in0(i+1)); // p.setBuffer( in0(i+1));
break; break;
default: default:
@ -116,7 +116,7 @@ namespace stn{
mClient->doProcess(std::begin(inputSignals),std::end(inputSignals),std::begin(outputSignals), std::end(outputSignals),numsamples,1,2); mClient->doProcess(std::begin(inputSignals),std::end(inputSignals),std::begin(outputSignals), std::end(outputSignals),numsamples,1,2);
} }
stn::TransientsClient<double, float> *mClient; client::TransientsClient<double, float> *mClient;
SignalWrapper *inputSignals[1]; SignalWrapper *inputSignals[1];
SignalWrapper *outputSignals[2]; SignalWrapper *outputSignals[2];
}; };
@ -125,5 +125,5 @@ namespace stn{
PluginLoad(FluidSTFTUGen) { PluginLoad(FluidSTFTUGen) {
ft = inTable; ft = inTable;
registerUnit<fluid::stn::FluidTransients>(ft, "FluidTransients"); registerUnit<fluid::wrapper::FluidTransients>(ft, "FluidTransients");
} }

Loading…
Cancel
Save