[Clam-devel] Problem with CascadingTypedControls & SVN Down

David García Garzón dgarcia at iua.upf.edu
Sun Dec 14 17:08:21 PST 2008


I guess that the DoControl should be declared virtual in the TypedInControl so 
that the overwritten method in the Cascaded is called. Maybe i removed it 
while doing the refactor. This also needs a virtual destructor. And the whole 
thing asks for a unit test.


On Diumenge 14 Desembre 2008 23:36:20 Francisco Tufró wrote:
> I'm trying to use CascadingTypedInControl to implement a callbacked version
> of the MIDISink processing and something is not working ok.
> I do the following:
> 1) create a MIDISource and a MIDISink and connect them.
> 2) Send some data to the midi source, but the callback function is never
> called.
>
> I think that the problem comes from TypedOutControl::DoControl().
>
> template<class TypedControlData>
> void TypedOutControl<TypedControlData>::SendControl(const TypedControlData&
> val)
> {
> typename std::list< InControlBase * >::iterator it;
> for (it=mLinks.begin(); it!=mLinks.end(); it++) {
> ((dynamic_cast<TypedInControl<TypedControlData>*>(*it)))->DoControl(val);
> }
> }
>
> It's casting the OutControlBase from the mLinks to
> TypedInControl<TypedControlData>, and then using the DoControl from
> TypedInControl<TypedControlData>, but never uses the one from the
> CascadingTypedInControl.
> Is this the problem?, or i'm doing something wrong in the code?. If this is
> the problem, what do we do to solve it?
> I've attached the MIDISink code.
>
> PS: Is the svn down? I can't connect to it.
> That's all by now.
> Francisco

-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia





More information about the clam-devel mailing list