[Clam-devel] Demo today report
Alex Norman
alex at neisis.net
Tue Jun 5 16:09:00 PDT 2007
So the same thing happened to me, I ended up replacing:
CLAM::InPort<Audio>
CLAM::OutPort<Audio>
and
Do(const CLAM::Audio& ...
With
CLAM::AudioInPort
..
and
Do(const CLAM::TData&..
and connections work, though I haven't actually tried passing any data through
yet..
InPort<Audio> etc. are more descriptive.. shouldn't they work?.. I noticed that
-Alex
On 0, Xavier Amatriain <xavier at create.ucsb.edu> wrote:
> I have unsuccessfully tried to figure out what the problem is but I
> can't find any reason. I am attaching the "offending" processing class.
> Apart from that all I did was add it to the ProcessingTree and tried to
> r'n'r ;)
>
>
> On Tue, 2007-06-05 at 15:53 +0200, Pau Arumi wrote:
> > En/na Xavier Amatriain ha escrit:
> >
> > > 2) When I added the new processing in the NetworkEditor I could not
> > > connect the ports! This
> > > is new to me, I have done this many times before and never experienced
> > > that behavior. Maybe
> > > it was a silly coding mistake but everything was pretty straightforward
> > > (Audio ports). I will look
> > > into the code on Monday but maybe somebody has some idea what might have
> > > gone wrong.
> >
> > did you find the reason? send a patch if not. i'm curious about it.
>
> --
> /*********************************
> * Xavier Amatriain *
> * Associate Director - MATi *
> * Research Director - CREATE *
> * UCSB, Santa Barbara CA *
> * 1-(805)- 893 83 52 *
> ********************************/
> #include "EmptyProcessing.hxx"
> #include <CLAM/Factory.hxx>
>
> namespace CLAM{
>
> static CLAM::Factory<CLAM::Processing>::Registrator<RingModulator>
> RingModulatorRegistrator("RingModulator");
>
> RingModulator::RingModulator(const Config& config = Config())
> : mIn("Audio Input1", this)
> ,mIn2("Audio Input2", this)
> , mOut("Empty Output", this)
> , mInControl("In Control", this)
> {
> Configure( config );
> }
>
> bool RingModulator::Do()
> {
> bool result = Do(mIn.GetData(), mIn2.GetData(), mOut.GetData());
> // Tell the ports this is done
> mIn.Consume();
> mIn2.Consume();
> mOut.Produce();
> return result;
> }
>
> bool RingModulator::Do(const Audio& in, const Audio& in2, Audio& out)
> {
> // Your implementation
> }
>
> };
> #ifndef RingModulator_hxx
> #define RingModulator_hxx
>
> #include <CLAM/InPort.hxx>
> #include <CLAM/OutPort.hxx>
> #include <CLAM/Processing.hxx>
>
> // Those two configuration types could be the ones you choose.
> // Your own ones or any type already in CLAM.
> #include "Audio.hxx"
> #include "Spectrum.hxx"
> #include "InControl.hxx"
> #include "OutControl.hxx"
>
> namespace CLAM {
>
> class RingModulator : public CLAM::Processing
> {
> CLAM::InPort<Audio> mIn;
> CLAM::InPort<Audio> mIn2;
>
> CLAM::OutPort<Audio> mOut;
>
> CLAM::InControl mInControl;
> public:
> const char* GetClassName() const { return "RingModulator"; }
> RingModulator(const Config& config );
>
> bool Do();
>
> bool Do(const Audio& in,const Audio& in2, Audio& out);
> };
>
> };
>
> #endif // RingModulator_hxx
> _______________________________________________
> Clam-devel mailing list
> Clam-devel at llistes.projectes.lafarga.org
> https://llistes.projectes.lafarga.org/cgi-bin/mailman/listinfo/clam-devel
More information about the clam-devel
mailing list