void DistortionComponent::bufferChanged (Buffer* changedBuffer)
{
    if (changedBuffer == &buffer)
    {
        refreshPath();
    }
}
void DistortionComponent::resized()
{
    const int w = getWidth();
    const int h = getHeight();

    if (! isInitialised && w > 0 && h > 0)
    {
        resetPoints();
        isInitialised = true;
    }
    
    background = Image (Image::RGB, jmax (1, w), jmax (1, h), false);
    Graphics g (background);
    g.fillAll (Colours::black);
    
    g.setColour (Colour::greyLevel (0.25f));
    const float xScale = w / 10.0f;
    const float yScale = h / 10.0f;
    for (int i = 1; i < 10; ++i)
    {
        g.drawHorizontalLine ((int) (i * yScale), 0.0f, (float) w);
        g.drawVerticalLine ((int) (i * xScale), 0.0f, (float) h);
    }
    g.drawLine (0.0f, (float) h, (float) w, 0.0f);
    
    refreshPath();
}
Example #3
0
void Notes::save()
{
    if (Settings::instance()->get("current_profile") != strNotesUserProfile)
        refreshPath();

    QFile f(strNotesFile);
    if (f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text))
    {
        QTextStream out(&f);
        out << strNotesContent;
        f.close();
    }
    else
    {
        if (Settings::instance()->get("debug") == "true")
            qWarning() << tr("Error: Cannot save notes file!");
    }
}
Example #4
0
void Notes::read()
{
    if (Settings::instance()->get("current_profile") != strNotesUserProfile)
        refreshPath();

    strNotesContent.clear(); // clear before read

    QFile f(strNotesFile);
    if (f.exists())
    {
        if (f.open(QIODevice::ReadOnly | QIODevice::Text))
        {
            // read content
            QTextStream in(&f);
            strNotesContent = in.readAll();
            f.close();
        }
        else
        {
            if (Settings::instance()->get("debug") == "true")
                qWarning() << tr("Error: Cannot read notes file!");
        }
    }
}
Example #5
0
//==============================================================================
void CallOutBox::setArrowSize (const float newSize)
{
    arrowSize = newSize;
    refreshPath();
}
Example #6
0
void CallOutBox::moved()
{
    refreshPath();
}
Example #7
0
void CallOutBox::resized()
{
    const int borderSpace = getBorderSize();
    content.setTopLeftPosition (borderSpace, borderSpace);
    refreshPath();
}
//==============================================================================
void CallOutBox::setArrowSize (const float newSize)
{
    arrowSize = newSize;
    borderSpace = jmax (20, (int) arrowSize);
    refreshPath();
}
Example #9
0
void Notes::init()
{
    refreshPath();
}