Juce "string" to "std::string"

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi,

I'm working with IPlug.I want to import WDF++ to IPlug.But i have trouble with strings.

Using #include <string> to use std::string but i can't change "String::empty".Getting errors.

Can you help me about it?

Thanks.

Code: Select all

template <typename T>
class OnePort
{
    public:
        OnePort (T R, String n = String::empty)
            : _name (n), Rp (R), a (0), b (0), port(this) {}
        //----------------------------------------------------------------------
        virtual String name () const { return _name.isEmpty() ? label() : _name; }
        virtual String label () const = 0;
        //----------------------------------------------------------------------
        virtual inline void incident (T wave) = 0;
        //----------------------------------------------------------------------
        virtual inline T reflected () = 0;
        //----------------------------------------------------------------------
        virtual T R () { return port->Rp; }       // Port resistance
        virtual T G () { return 1.0 / port->Rp; } // Port conductance (inv.Rp)
        //----------------------------------------------------------------------
        virtual void connect (OnePort<T>* other)
        {
            port = other;
            other->port = this;
        }
        //----------------------------------------------------------------------
        T voltage () // v
        {
            return (port->a + port->b) / 2.0;
        }
        //----------------------------------------------------------------------
        T current () // i
        {
            return (port->a - port->b) / (port->Rp + port->Rp);
        }
        //----------------------------------------------------------------------
    protected:
        //----------------------------------------------------------------------
        String _name; // Port name
        T Rp; // Port resistance
        //----------------------------------------------------------------------
        T a; // incident wave (incoming wave)
        T b; // reflected wave (outgoing wave)
        //----------------------------------------------------------------------
        OnePort<T>* port; // internal pointer (used for direct connect form)
        //----------------------------------------------------------------------
};
http://analogobsession.com/ VST, AU, AAX for WIN & MAC

Post

Changed like this.Is this ok?

Code: Select all

OnePort (T R, std::string n = " " )
http://analogobsession.com/ VST, AU, AAX for WIN & MAC

Post

tunca wrote:Changed like this.Is this ok?

Code: Select all

OnePort (T R, std::string n = " " )
I know absolute nothing about JUCE, but as far as std::string goes your default parameter value above is a non-empty string containing one space character; this is probably not what you want (ie. you should probably remove the space between the quotes).

Post

mystran wrote:
tunca wrote:Changed like this.Is this ok?

Code: Select all

OnePort (T R, std::string n = " " )
I know absolute nothing about JUCE, but as far as std::string goes your default parameter value above is a non-empty string containing one space character; this is probably not what you want (ie. you should probably remove the space between the quotes).
Thanks for answer.

I'm using WDF++.hpp and made for JUCE.So i converted it to IPlug.Now everything is ok.But i have trouble about using components and connecting them together.I have electronic knowledge.

I just want to build simple RC HPF but i can't...

Checked tones of documents but i still can't understand.

Any info about WDF?
http://analogobsession.com/ VST, AU, AAX for WIN & MAC

Post

Ok.I find the way.Now there is no issue but still can build my first simple circuit...
http://analogobsession.com/ VST, AU, AAX for WIN & MAC

Post Reply

Return to “DSP and Plugin Development”