Hi, I've been trying to do the migration to TypedControls and we've some problems.<br>
Since the *ControlRegistry now is defined as
std::list<BaseTyped*Control*> the functions Get() and GetByNumber
now return a BaseTyped*Control instead of a *Control.<br>
The same is happening with Get*Controls() which now returns a list<Base..> instead of a list<*Control *><br>So, every single code line using Get*Controls as well as Get() and GetByNumber() has to be replaced.<br>
As Pau proposed i wrote the function that connected a In to a temporary out and sends the value, but that was just one of the <span onclick="dr4sdgryt2(event)" style="cursor: pointer;">appearances </span> of the problem.<br>
Those functiones were used in other <span style="cursor: pointer;" onclick="dr4sdgryt(event,"Ox")"><span class="q">circumstances</span></span>:<br>  - Assignations: MIDIIO/MIDIKeyboard.cxx:        OutControl& outVelocity = mNoteIn.GetOutControls().GetByNumber(2); <br>
  - To access in controls defined in parent classes: SpectralSpread.hxx:                     GetInControl("Amount").DoControl(100);<br>  - also (don't know why) in the Initialization function of some processings (where the controls were accesible by its own variable name, but anyways they were referenced with Get*Controls: FrameTransformation.hxx:                                GetInControl("Amount").DoControl(0.);<br>
<br>I tried to solve every one of these problems with the better solution i thought, now i present these solutions:<br> - For the already known problem (the one of this thread) i wrote the following function <br>
(i made also a version where an int is passed instead of the name, but is essentially the same, for those places where GetByNumber was used):<br>    void SendFloatToInControl(Processing & receiver, const std::string & inControlName, float value){<br>
        TypedOutControl<float> controlSender;<br>        controlSender.AddLink(receiver.GetInControls().Get(inControlName));<br>        controlSender.SendControl(value);<br>    }<br>The first i had to do a static cast, i don't like this solution, but the code needs to be rewritten to avoid it, this happends also in NetworkEditor and Annotator. <br>
The second was solved with this function also, but passed *this as argument.<br>The third was solved replacing the lines using the variable name.<br>Another of these problems was that GetInControl was used to ask for GetLastValue of an InControl, for this i wrote: <br>
float GetFloatFromInControl(Processing & proc, const std::string & inControlName){<br>        InControl& in = (InControl&)(proc.GetInControl(inControlName));<br>        return in.GetLastValue();<br>    }<br>
This needed a typecast, but static. I'm not so sure about this solution. This was needed in the SMSDeesser lines 44-47.<br><br>Also there were some places that used GetOutControl to do a SendControl, with these i used this function:<br>
<br>    void SendFloatToOutControl(Processing & sender, int inControlIndex, float value){<br>        OutControl& out = (OutControl&)(sender.GetOutControls().GetByNumber(inControlIndex));<br>        out.SendControl(value);<br>
    }<br>Again, a cast was needed, used in MIDIInControl.hxx.<br>Hope you can help me with this and tell me how to best solve the migration problem.<br>bye!<br>