Exemple #1
0
GenericEditor::GenericEditor (GenericProcessor* owner) 
	: AudioProcessorEditor (owner), isSelected(false),
	  desiredWidth(150), tNum(-1), isEnabled(true),
	  accumulator(0.0), isFading(false), drawerButton(0),
	  channelSelector(0)

{
	name = getAudioProcessor()->getName();

	nodeId = owner->getNodeId();

	MemoryInputStream mis(BinaryData::silkscreenserialized, BinaryData::silkscreenserializedSize, false);
    Typeface::Ptr typeface = new CustomTypeface(mis);
    titleFont = Font(typeface);

    if (!owner->isMerger() && !owner->isSplitter())
    {
    	drawerButton = new DrawerButton("name");
    	drawerButton->addListener(this);
    	addAndMakeVisible(drawerButton);

    	if (!owner->isSink())
    	{
    		channelSelector = new ChannelSelector(true, titleFont);
    	} else {
    		channelSelector = new ChannelSelector(false, titleFont);
    	}

    	addChildComponent(channelSelector);
    	channelSelector->setVisible(false);


	}

	backgroundGradient = ColourGradient(Colour(190, 190, 190), 0.0f, 0.0f, 
										 Colour(185, 185, 185), 0.0f, 120.0f, false);
	backgroundGradient.addColour(0.2f, Colour(155, 155, 155));

	addParameterEditors();

	backgroundColor = Colour(10,10,10);

	//fadeIn();
}
Exemple #2
0
//==============================================================================
void Ambix_binauralAudioProcessorEditor::paint (Graphics& g)
{
    
    g.fillAll (Colours::white);

    g.setGradientFill (ColourGradient (Colour (0xff4e4e4e),
                                       (float) (proportionOfWidth (0.6400f)), (float) (proportionOfHeight (0.6933f)),
                                       Colours::black,
                                       (float) (proportionOfWidth (0.1143f)), (float) (proportionOfHeight (0.0800f)),
                                       true));
    g.fillRect (0, 0, 350 + _width, 300);

    g.setColour (Colours::black);
    g.drawRect (0, 0, 350, 300, 1);

    g.setColour (Colour (0x410000ff));
    g.fillRoundedRectangle (18.0f, 100.0f, 222.0f, 76.0f, 10.0000f);

    g.setColour (Colours::white);
    g.setFont (Font (17.2000f, Font::bold));
#if BINAURAL_DECODER
    g.drawText ("AMBIX-BINAURAL-DECODER",
                1, 4, 343, 30,
                Justification::centred, true);
  
  g.setFont (Font (12.4000f, Font::plain));
  g.drawText ("listening to Ambisonics with headphones",
              1, 28, 343, 30,
              Justification::centred, true);
  
#else
  g.drawText ("AMBIX-DECODER",
              1, 4, 343, 30,
              Justification::centred, true);
  g.setFont (Font (12.4000f, Font::plain));
  g.drawText ("playback Ambisonics with loudspeakers",
              1, 28, 343, 30,
              Justification::centred, true);
#endif


    
    
}
void preenfmLookAndFeel::drawLinearSliderBackground (Graphics& g, int x, int y, int width, int height,
		float /*sliderPos*/,
		float /*minSliderPos*/,
		float /*maxSliderPos*/,
		const Slider::SliderStyle /*style*/, Slider& slider)
{
	const float sliderRadius = 2.0f; // (float) (getSliderThumbRadius (slider) - 2);

	const Colour trackColour (slider.findColour (Slider::trackColourId));
	const Colour gradCol1 (trackColour.overlaidWith (Colours::black.withAlpha (slider.isEnabled() ? 0.25f : 0.13f)));
	const Colour gradCol2 (trackColour.overlaidWith (Colour (0x14000000)));
	Path indent;

	if (slider.isHorizontal())
	{
		const float iy = y + height * 0.5f - sliderRadius * 0.5f;
		const float ih = sliderRadius;

		indent.addRoundedRectangle (x - sliderRadius * 0.5f, iy,
				width + sliderRadius, ih,
				5.0f);
	}
	else
	{
		const float ix = x + width * 0.5f - sliderRadius * 0.5f;
		const float iw = sliderRadius;

		g.setGradientFill (ColourGradient (gradCol1, ix, 0.0f,
				gradCol2, ix + iw, 0.0f, false));

		indent.addRoundedRectangle (ix, y - sliderRadius * 0.5f,
				iw, height + sliderRadius,
				5.0f);
	}

	//	    g.fillPath (indent);
	if (slider.isEnabled()) {
        g.setColour (Colours::darkgrey);
	} else {
        g.setColour (Colour (0x80808080));
	}
	g.strokePath (indent, PathStrokeType (0.5f));
}
Exemple #4
0
void UtilityButton::setEnabledState(bool state)
{

	isEnabled = state;

	if (state)
	{
		selectedGrad = ColourGradient(Colour(240,179,12),0.0,0.0,
											 Colour(207,160,33),0.0, 20.0f,
											 false);
		selectedOverGrad = ColourGradient(Colour(209,162,33),0.0, 5.0f,
											 Colour(190,150,25),0.0, 0.0f,
											 false);
		neutralGrad = ColourGradient(Colour(220,220,220),0.0,0.0,
											 Colour(170,170,170),0.0, 20.0f,
											 false);
		neutralOverGrad = ColourGradient(Colour(180,180,180),0.0,5.0f,
											 Colour(150,150,150),0.0, 0.0,
											 false);
		fontColor = Colours::darkgrey;

	} else {

		selectedGrad = ColourGradient(Colour(240,240,240),0.0,0.0,
											 Colour(200,200,200),0.0, 20.0f,
											 false);
		selectedOverGrad = ColourGradient(Colour(240,240,240),0.0,0.0,
											 Colour(200,200,200),0.0, 20.0f,
											 false);
		neutralGrad = ColourGradient(Colour(240,240,240),0.0,0.0,
											 Colour(200,200,200),0.0, 20.0f,
											 false);
		neutralOverGrad = ColourGradient(Colour(240,240,240),0.0,0.0,
											 Colour(200,200,200),0.0, 20.0f,
											 false);
		fontColor = Colours::white;
	}

	repaint();
}
    void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown)
    {
        float alpha = isMouseOverButton ? (isButtonDown ? 1.0f : 0.8f) : 0.55f;

        if (! isEnabled())
            alpha *= 0.5f;

        float x = 0, y = 0, diam;

        if (getWidth() < getHeight())
        {
            diam = (float) getWidth();
            y = (getHeight() - getWidth()) * 0.5f;
        }
        else
        {
            diam = (float) getHeight();
            y = (getWidth() - getHeight()) * 0.5f;
        }

        x += diam * 0.05f;
        y += diam * 0.05f;
        diam *= 0.9f;

        g.setGradientFill (ColourGradient(Colour::greyLevel (0.9f).withAlpha (alpha), 0, y + diam,
                                          Colour::greyLevel (0.6f).withAlpha (alpha), 0, y, false));
        g.fillEllipse (x, y, diam, diam);

        x += 2.0f;
        y += 2.0f;
        diam -= 4.0f;

        LookAndFeel::drawGlassSphere (g, x, y, diam, colour.withAlpha (alpha), 1.0f);

        Path& p = getToggleState() ? toggledShape : normalShape;

        const AffineTransform t (p.getTransformToScaleToFit (x + diam * 0.3f, y + diam * 0.3f,
                                                             diam * 0.4f, diam * 0.4f, true));

        g.setColour (Colours::black.withAlpha (alpha * 0.6f));
        g.fillPath (p, t);
    }
void IntrojucerLookAndFeel::drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)
{
    const Rectangle<int> activeArea (button.getActiveArea());

    const Colour bkg (getTabBackgroundColour (button));

    g.setGradientFill (ColourGradient (bkg.brighter (0.1f), 0, (float) activeArea.getY(),
                                       bkg.darker (0.1f), 0, (float) activeArea.getBottom(), false));
    g.fillRect (activeArea);

    g.setColour (button.findColour (mainBackgroundColourId).darker (0.3f));
    g.drawRect (activeArea);

    GlyphArrangement textLayout;
    createTabTextLayout (button, button.getTextArea(), textLayout);

    const float alpha = button.isEnabled() ? ((isMouseOver || isMouseDown) ? 1.0f : 0.8f) : 0.3f;
    g.setColour (bkg.contrasting().withMultipliedAlpha (alpha));
    textLayout.draw (g);
}
Exemple #7
0
void ParameterSlider::paint(Graphics& g)
{

	ColourGradient grad = ColourGradient(Colour(40, 40, 40), 0.0f, 0.0f,
	
							  Colour(80, 80, 80), 0.0, 40.0f, false);

	Path p;
	p.addPieSegment(3, 3, getWidth()-6, getHeight()-6, 5*double_Pi/4-0.2, 5*double_Pi/4+3*double_Pi/2+0.2, 0.5);

	g.setGradientFill(grad);
	g.fillPath(p);
	//g.fillEllipse(3, 3, getWidth()-6, getHeight()-6);

	//g.setColour(Colours::lightgrey);
	//g.fillEllipse(12, 12, getWidth()-24, getHeight()-24);

	p = makeRotaryPath(getMinimum(), getMaximum(), getValue());

	if (isEnabled)
		g.setColour(Colour(240,179,12));
	else
		g.setColour(Colour(75,75,75));

	g.fillPath(p);
	
	//g.setColour(Colours::darkgrey);
	font.setHeight(9.0);
	g.setFont(font);


	String valueString = String( (int) getValue());

	int stringWidth = font.getStringWidth(valueString);

	g.setFont(font);

	g.setColour(Colours::darkgrey);
	g.drawSingleLineText(valueString, getWidth()/2 - stringWidth/2, getHeight()/2+3);

}
Exemple #8
0
//==============================================================================
void NewComponent::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    g.fillAll (Colour (0xff222222));

    g.setGradientFill (ColourGradient (Colours::darkgrey,
                                       128.0f, static_cast<float> (-56),
                                       Colours::black,
                                       128.0f, 80.0f,
                                       false));
    g.fillRect (0, 0, 350, 30);

    g.setColour (Colour (0xffcfcfcf));
    g.setFont (Font (14.00f, Font::plain));
    g.drawText (TRANS("Amarras"),
                27, 0, 152, 30,
                Justification::centredLeft, true);

    g.setColour (Colour (0xff666666));
    g.setFont (Font (10.00f, Font::plain));
    g.drawText (TRANS("1"),
                3, 3, 13, 30,
                Justification::centred, true);

    g.setColour (Colour (0xff858585));
    g.setFont (Font (14.00f, Font::plain));
    g.drawText (CharPointer_UTF8 ("D\'Arienzo - Maur\xc3\xa9"),
                185, 0, 125, 30,
                Justification::centredLeft, true);

    g.setColour (Colour (0xff858585));
    g.setFont (Font (12.00f, Font::plain));
    g.drawText (TRANS("1941"),
                315, 0, 28, 30,
                Justification::centredRight, true);

    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}
Exemple #9
0
    void drawButtonBackground (Graphics& g, Button& button, const Colour& backgroundColour,
                               bool isMouseOverButton, bool isButtonDown) override
    {
        Colour baseColour (backgroundColour.withMultipliedSaturation (button.hasKeyboardFocus (true) ? 1.3f : 0.9f)
                           .withMultipliedAlpha (button.isEnabled() ? 0.9f : 0.5f));

        if (isButtonDown || isMouseOverButton)
            baseColour = baseColour.contrasting (isButtonDown ? 0.2f : 0.1f);

        const float width  = button.getWidth() - 1.0f;
        const float height = button.getHeight() - 1.0f;

        if (width > 0 && height > 0)
        {
            g.setGradientFill (ColourGradient (baseColour, 0.0f, 0.0f,
                                               baseColour.darker (0.1f), 0.0f, height,
                                               false));

            g.fillRect (button.getLocalBounds());
        }
    }
Exemple #10
0
void SynthSection::paintBackground(Graphics& g) {
  static const DropShadow button_shadow(Colour(0xff000000), 3, Point<int>(0, 0));
  static Font title_font(Typeface::createSystemTypefaceFor(BinaryData::RobotoLight_ttf,
                                                          BinaryData::RobotoLight_ttfSize));
  paintContainer(g);
  // Draw shadow divider.
  float shadow_top = TITLE_WIDTH - SHADOW_WIDTH;
  float shadow_bottom = TITLE_WIDTH;
  g.setGradientFill(ColourGradient(Colour(0x22000000), 0.0f, shadow_top,
                                   Colour(0x66000000), 0.0f, shadow_bottom,
                                   false));
  g.fillRoundedRectangle(0, 0, getWidth(), TITLE_WIDTH, 1.0f);

  // Draw text title.
  g.setColour(Colour(0xff999999));
  g.setFont(title_font.withPointHeight(14.0f));
  g.drawText(TRANS(getName()), 0, 0, getWidth(), TITLE_WIDTH,
             Justification::centred, true);

  paintKnobShadows(g);
}
Exemple #11
0
//==============================================================================
void NonShinyLookAndFeel::drawGlassSphere (Graphics& g,
                                   const float x, const float y,
                                   const float diameter,
                                   const Colour& colour,
                                   const float outlineThickness) throw()
{
    if (diameter <= outlineThickness)
        return;

    Path p;
    p.addEllipse (x, y, diameter, diameter);

    {
        ColourGradient cg (Colours::white.overlaidWith (colour.withMultipliedAlpha (0.3f)), 0, y,
                           Colours::white.overlaidWith (colour.withMultipliedAlpha (0.3f)), 0, y + diameter, false);

        cg.addColour (0.4, Colours::white.overlaidWith (colour));

        g.setGradientFill (cg);
        g.fillPath (p);
    }

    g.setGradientFill (ColourGradient (Colours::white, 0, y + diameter * 0.06f,
                                       Colours::transparentWhite, 0, y + diameter * 0.3f, false));
    //g.fillEllipse (x + diameter * 0.2f, y + diameter * 0.05f, diameter * 0.6f, diameter * 0.4f);

    ColourGradient cg (Colours::transparentBlack,
                       x + diameter * 0.5f, y + diameter * 0.5f,
                       Colours::black.withAlpha (0.5f * outlineThickness * colour.getFloatAlpha()),
                       x, y + diameter * 0.5f, true);

    cg.addColour (0.7, Colours::transparentBlack);
    cg.addColour (0.8, Colours::black.withAlpha (0.1f * outlineThickness));

    g.setGradientFill (cg);
    g.fillPath (p);

    g.setColour (colour.darker(10.f).withAlpha (0.5f * colour.getFloatAlpha()));
    g.drawEllipse (x, y, diameter, diameter, outlineThickness);
}
Exemple #12
0
    void drawRotarySlider (Graphics& g, int x, int y, int width, int height, float sliderPos,
                           float rotaryStartAngle, float rotaryEndAngle, Slider& slider) override
    {
        const float diameter = jmin (width, height) - 4.0f;
        const float radius = (diameter / 2.0f) * std::cos (float_Pi / 4.0f);
        const float centreX = x + width * 0.5f;
        const float centreY = y + height * 0.5f;
        const float rx = centreX - radius;
        const float ry = centreY - radius;
        const float rw = radius * 2.0f;
        const float angle = rotaryStartAngle + sliderPos * (rotaryEndAngle - rotaryStartAngle);
        const bool isMouseOver = slider.isMouseOverOrDragging() && slider.isEnabled();

        const Colour baseColour (slider.isEnabled() ? slider.findColour (Slider::rotarySliderFillColourId).withAlpha (isMouseOver ? 0.8f : 1.0f)
                                                    : Colour (0x80808080));

        Rectangle<float> r (rx, ry, rw, rw);
        AffineTransform t (AffineTransform::rotation (angle, r.getCentreX(), r.getCentreY()));

        float x1 = r.getTopLeft().getX(), y1 = r.getTopLeft().getY(), x2 = r.getBottomLeft().getX(), y2 = r.getBottomLeft().getY();
        t.transformPoints (x1, y1, x2, y2);

        g.setGradientFill (ColourGradient (baseColour, x1, y1,
                                           baseColour.darker (0.1f), x2, y2,
                                           false));

        Path knob;
        knob.addRectangle (r);
        g.fillPath (knob, t);

        Path needle;
        Rectangle<float> r2 (r * 0.1f);
        needle.addRectangle (r2.withPosition (Point<float> (r.getCentreX() - (r2.getWidth() / 2.0f), r.getY())));

        g.setColour (slider.findColour (Slider::rotarySliderOutlineColourId));
        g.fillPath (needle, AffineTransform::rotation (angle, r.getCentreX(), r.getCentreY()));
    }
void CtrlrMenuBarLookAndFeel::drawPopupMenuUpDownArrow (Graphics &g, int width, int height, bool isScrollUpArrow)
{
	const Colour background (getColour (Ids::ctrlrMenuItemBackgroundColour));

    g.setGradientFill (ColourGradient (background, 0.0f, height * 0.5f,
                                       background.withAlpha (0.0f),
                                       0.0f, isScrollUpArrow ? ((float) height) : 0.0f,
                                       false));

    g.fillRect (1, 1, width - 2, height - 2);

    const float hw = width * 0.5f;
    const float arrowW = height * 0.3f;
    const float y1 = height * (isScrollUpArrow ? 0.6f : 0.3f);
    const float y2 = height * (isScrollUpArrow ? 0.3f : 0.6f);

    Path p;
    p.addTriangle (hw - arrowW, y1,
                   hw + arrowW, y1,
                   hw, y2);

    g.setColour (findColour (PopupMenu::textColourId).withAlpha (0.5f));
    g.fillPath (p);
}
void MidiKeyboardComponent::paint (Graphics& g)
{
    g.fillAll (Colours::white.overlaidWith (findColour (whiteNoteColourId)));

    const Colour lineColour (findColour (keySeparatorLineColourId));
    const Colour textColour (findColour (textLabelColourId));

    int x, w, octave;

    for (octave = 0; octave < 128; octave += 12)
    {
        for (int white = 0; white < 7; ++white)
        {
            const int noteNum = octave + whiteNotes [white];

            if (noteNum >= rangeStart && noteNum <= rangeEnd)
            {
                getKeyPos (noteNum, x, w);

                if (orientation == horizontalKeyboard)
                    drawWhiteNote (noteNum, g, x, 0, w, getHeight(),
                                   state.isNoteOnForChannels (midiInChannelMask, noteNum),
                                   noteUnderMouse == noteNum,
                                   lineColour, textColour);
                else if (orientation == verticalKeyboardFacingLeft)
                    drawWhiteNote (noteNum, g, 0, x, getWidth(), w,
                                   state.isNoteOnForChannels (midiInChannelMask, noteNum),
                                   noteUnderMouse == noteNum,
                                   lineColour, textColour);
                else if (orientation == verticalKeyboardFacingRight)
                    drawWhiteNote (noteNum, g, 0, getHeight() - x - w, getWidth(), w,
                                   state.isNoteOnForChannels (midiInChannelMask, noteNum),
                                   noteUnderMouse == noteNum,
                                   lineColour, textColour);
            }
        }
    }

    float x1 = 0.0f, y1 = 0.0f, x2 = 0.0f, y2 = 0.0f;

    if (orientation == verticalKeyboardFacingLeft)
    {
        x1 = getWidth() - 1.0f;
        x2 = getWidth() - 5.0f;
    }
    else if (orientation == verticalKeyboardFacingRight)
        x2 = 5.0f;
    else
        y2 = 5.0f;

    g.setGradientFill (ColourGradient (Colours::black.withAlpha (0.3f), x1, y1,
                                       Colours::transparentBlack, x2, y2, false));

    getKeyPos (rangeEnd, x, w);
    x += w;

    if (orientation == verticalKeyboardFacingLeft)
        g.fillRect (getWidth() - 5, 0, 5, x);
    else if (orientation == verticalKeyboardFacingRight)
        g.fillRect (0, 0, 5, x);
    else
        g.fillRect (0, 0, x, 5);

    g.setColour (lineColour);

    if (orientation == verticalKeyboardFacingLeft)
        g.fillRect (0, 0, 1, x);
    else if (orientation == verticalKeyboardFacingRight)
        g.fillRect (getWidth() - 1, 0, 1, x);
    else
        g.fillRect (0, getHeight() - 1, x, 1);

    const Colour blackNoteColour (findColour (blackNoteColourId));

    for (octave = 0; octave < 128; octave += 12)
    {
        for (int black = 0; black < 5; ++black)
        {
            const int noteNum = octave + blackNotes [black];

            if (noteNum >= rangeStart && noteNum <= rangeEnd)
            {
                getKeyPos (noteNum, x, w);

                if (orientation == horizontalKeyboard)
                    drawBlackNote (noteNum, g, x, 0, w, blackNoteLength,
                                   state.isNoteOnForChannels (midiInChannelMask, noteNum),
                                   noteUnderMouse == noteNum,
                                   blackNoteColour);
                else if (orientation == verticalKeyboardFacingLeft)
                    drawBlackNote (noteNum, g, getWidth() - blackNoteLength, x, blackNoteLength, w,
                                   state.isNoteOnForChannels (midiInChannelMask, noteNum),
                                   noteUnderMouse == noteNum,
                                   blackNoteColour);
                else if (orientation == verticalKeyboardFacingRight)
                    drawBlackNote (noteNum, g, 0, getHeight() - x - w, blackNoteLength, w,
                                   state.isNoteOnForChannels (midiInChannelMask, noteNum),
                                   noteUnderMouse == noteNum,
                                   blackNoteColour);
            }
        }
    }
}
Exemple #15
0
//==============================================================================
void RightButton::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    if(!state)
    {
    //[/UserPrePaint]

    g.fillAll (Colour (0xff2b2b2b));

    g.setGradientFill (ColourGradient (Colours::white,
                                       40.0f, 32.0f,
                                       Colour (0xffe4e4e4),
                                       56.0f, 24.0f,
                                       true));
    g.fillPath (internalPath1);
    g.setColour (Colour (0xff777777));
    g.strokePath (internalPath1, PathStrokeType (3.0000f, PathStrokeType::curved, PathStrokeType::rounded));

    //[UserPaint] Add your own custom painting code here..
    }
    else
    {
        g.setGradientFill (ColourGradient (Colours::white,
                                           40.0f, 32.0f,
                                           Colour (0xffe4e4e4),
                                           56.0f, 24.0f,
                                           true));
        g.fillPath (internalPath1);

        g.setGradientFill (ColourGradient (Colour (0xe0ffffff),
                                           50.0f, 50.0f,
                                           //x, y,
                                           Colour(0xD000ff00),
                                           75.0f, 75.0f,
                                           true));

        //Draw pad border
        g.strokePath (internalPath1, PathStrokeType (4.0000f, PathStrokeType::curved, PathStrokeType::rounded));

        g.setGradientFill (ColourGradient (Colour (0x309d9d9d),
                                           50.0f, 50.0f,
                                           //x, y,
                                           Colours::red,
                                           150.0f, 50.0f,
                                           true));

        g.fillEllipse(16.0f - pressure/2.0f, 17.0f - pressure/2.0f, pressure, pressure);

        //g.setColour(Colour((uint8)0,(uint8)0,(uint8)0,(uint8)100));

        g.setGradientFill (ColourGradient (Colour (0x309d9d9d),
                                           50.0f, 50.0f,
                                           //x, y,
                                           Colours::red,
                                           150.0f, 50.0f,
                                           true));

        //Pressure border
        g.drawEllipse(16.0f - pressure/2.0f, 17.0f - pressure/2.0f, pressure, pressure,pressure/7.0f);

        g.setColour(Colour (0xff101010));
        g.strokePath (internalPath1, PathStrokeType (1.0000f, PathStrokeType::curved, PathStrokeType::rounded));
    }
    //[/UserPaint]
}
void MidiKeyboardComponent::paint (Graphics& g)
{
    g.fillAll (Colours::white.overlaidWith (findColour (whiteNoteColourId)));

    const Colour lineColour (findColour (keySeparatorLineColourId));
    const Colour textColour (findColour (textLabelColourId));

    int x, w, octave;

    for (octave = 0; octave < 128; octave += 12)
    {
        for (int white = 0; white < 7; ++white)
        {
            const int noteNum = octave + whiteNotes [white];

            if (noteNum >= rangeStart && noteNum <= rangeEnd)
            {
                const Rectangle<int> pos (getWhiteNotePos (noteNum));

                drawWhiteNote (noteNum, g, pos.getX(), pos.getY(), pos.getWidth(), pos.getHeight(),
                               state.isNoteOnForChannels (midiInChannelMask, noteNum),
                               mouseOverNotes.contains (noteNum), lineColour, textColour);
            }
        }
    }

    float x1 = 0.0f, y1 = 0.0f, x2 = 0.0f, y2 = 0.0f;

    if (orientation == verticalKeyboardFacingLeft)
    {
        x1 = getWidth() - 1.0f;
        x2 = getWidth() - 5.0f;
    }
    else if (orientation == verticalKeyboardFacingRight)
        x2 = 5.0f;
    else
        y2 = 5.0f;

    g.setGradientFill (ColourGradient (Colours::black.withAlpha (0.3f), x1, y1,
                                       Colours::transparentBlack, x2, y2, false));

    getKeyPos (rangeEnd, x, w);
    x += w;

    switch (orientation)
    {
        case horizontalKeyboard:            g.fillRect (0, 0, x, 5); break;
        case verticalKeyboardFacingLeft:    g.fillRect (getWidth() - 5, 0, 5, x); break;
        case verticalKeyboardFacingRight:   g.fillRect (0, 0, 5, x); break;
        default: break;
    }

    g.setColour (lineColour);

    switch (orientation)
    {
        case horizontalKeyboard:            g.fillRect (0, getHeight() - 1, x, 1); break;
        case verticalKeyboardFacingLeft:    g.fillRect (0, 0, 1, x); break;
        case verticalKeyboardFacingRight:   g.fillRect (getWidth() - 1, 0, 1, x); break;
        default: break;
    }

    const Colour blackNoteColour (findColour (blackNoteColourId));

    for (octave = 0; octave < 128; octave += 12)
    {
        for (int black = 0; black < 5; ++black)
        {
            const int noteNum = octave + blackNotes [black];

            if (noteNum >= rangeStart && noteNum <= rangeEnd)
            {
                getKeyPos (noteNum, x, w);
                Rectangle<int> pos;

                switch (orientation)
                {
                    case horizontalKeyboard:            pos.setBounds (x, 0, w, blackNoteLength); break;
                    case verticalKeyboardFacingLeft:    pos.setBounds (getWidth() - blackNoteLength, x, blackNoteLength, w); break;
                    case verticalKeyboardFacingRight:   pos.setBounds (0, getHeight() - x - w, blackNoteLength, w); break;
                    default: break;
                }

                drawBlackNote (noteNum, g, pos.getX(), pos.getY(), pos.getWidth(), pos.getHeight(),
                               state.isNoteOnForChannels (midiInChannelMask, noteNum),
                               mouseOverNotes.contains (noteNum), blackNoteColour);
            }
        }
    }
}
void WindowAbout::paint(Graphics& g)
{
    // fill window background with grey colour gradient
    g.setGradientFill(ColourGradient(Colours::darkgrey.darker(0.4f), 0, 0, Colours::darkgrey.darker(1.0f), 0, (float) getHeight(), false));
    g.fillAll();
}
Exemple #18
0
//==============================================================================
void PlugTestAudioProcessorEditor::paint(Graphics& g)
{
	g.setGradientFill(ColourGradient(Colours::white, 0, 0,
		Colours::lightsteelblue, 0, (float)getHeight(), false));
	g.fillAll();
}
Exemple #19
0
//==============================================================================
void Ambix_encoderAudioProcessorEditor::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    g.fillAll (Colours::white);

    g.setGradientFill (ColourGradient (Colour (0xff4e4e4e),
                                       static_cast<float> (proportionOfWidth (0.6314f)), static_cast<float> (proportionOfHeight (0.5842f)),
                                       Colours::black,
                                       static_cast<float> (proportionOfWidth (0.1143f)), static_cast<float> (proportionOfHeight (0.0800f)),
                                       true));
    g.fillRect (0, 0, 330, 400);

    g.setColour (Colours::black);
    g.drawRect (0, 0, 330, 400, 1);

    g.setColour (Colour (0xff2b1d69));
    g.fillRoundedRectangle (165.0f, 310.0f, 154.0f, 77.0f, 4.000f);

    g.setColour (Colours::white);
    g.setFont (Font (17.20f, Font::bold));
    g.drawText (TRANS("AMBIX-ENCODER"),
                -6, 2, 343, 30,
                Justification::centred, true);

    g.setColour (Colours::white);
    g.setFont (Font (10.00f, Font::plain));
    g.drawText (TRANS("elevation"),
                266, 29, 48, 16,
                Justification::centred, true);

    g.setColour (Colours::white);
    g.setFont (Font (10.00f, Font::plain));
    g.drawText (TRANS("azimuth"),
                216, 272, 48, 16,
                Justification::centredRight, true);

    g.setColour (Colours::white);
    g.setFont (Font (10.00f, Font::plain));
    g.drawText (TRANS("size"),
                31, 382, 23, 16,
                Justification::centredRight, true);

    g.setColour (Colours::white);
    g.setFont (Font (10.00f, Font::plain));
    g.drawText (TRANS("max speed"),
                206, 372, 57, 16,
                Justification::centredRight, true);

    g.setColour (Colours::white);
    g.setFont (Font (10.00f, Font::plain));
    g.drawText (TRANS("multiple source width"),
                61, 382, 95, 16,
                Justification::centredRight, true);

    g.setColour (Colour (0xff2b1d69));
    g.fillRoundedRectangle (24.0f, 310.0f, 226.0f, 43.0f, 4.000f);

    g.setColour (Colours::white);
    g.setFont (Font (10.00f, Font::plain));
    g.drawText (TRANS("elevation move"),
                219, 338, 81, 16,
                Justification::centredRight, true);

    g.setColour (Colours::white);
    g.setFont (Font (10.00f, Font::plain));
    g.drawText (TRANS("azimuth move"),
                59, 338, 81, 16,
                Justification::centredRight, true);

    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}
void preenfmLookAndFeel::drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)
{
    const Rectangle<int> activeArea (button.getActiveArea());

    const TabbedButtonBar::Orientation o = button.getTabbedButtonBar().getOrientation();

    const Colour bkg (button.getTabBackgroundColour());

    if (button.getToggleState())
    {
        g.setColour (bkg);
    }
    else
    {
        Point<int> p1, p2;

        switch (o)
        {
            case TabbedButtonBar::TabsAtBottom:   p1 = activeArea.getBottomLeft(); p2 = activeArea.getTopLeft();    break;
            case TabbedButtonBar::TabsAtTop:      p1 = activeArea.getTopLeft();    p2 = activeArea.getBottomLeft(); break;
            case TabbedButtonBar::TabsAtRight:    p1 = activeArea.getTopRight();   p2 = activeArea.getTopLeft();    break;
            case TabbedButtonBar::TabsAtLeft:     p1 = activeArea.getTopLeft();    p2 = activeArea.getTopRight();   break;
            default:                              jassertfalse; break;
        }

        g.setGradientFill (ColourGradient (bkg.brighter (0.2f), (float) p1.x, (float) p1.y,
                                           bkg.darker (0.1f),   (float) p2.x, (float) p2.y, false));
    }

    g.fillRect (activeArea);

    g.setColour (button.findColour (TabbedButtonBar::tabOutlineColourId));

    Rectangle<int> r (activeArea);

    if (o != TabbedButtonBar::TabsAtBottom)   g.fillRect (r.removeFromTop (1));
    if (o != TabbedButtonBar::TabsAtTop)      g.fillRect (r.removeFromBottom (1));
    if (o != TabbedButtonBar::TabsAtRight)    g.fillRect (r.removeFromLeft (1));
    if (o != TabbedButtonBar::TabsAtLeft)     g.fillRect (r.removeFromRight (1));

    const float alpha = button.isEnabled() ? ((isMouseOver || isMouseDown) ? 1.0f : 0.8f) : 0.3f;

    Colour col (bkg.contrasting().withMultipliedAlpha (alpha));

    if (TabbedButtonBar* bar = button.findParentComponentOfClass<TabbedButtonBar>())
    {
        TabbedButtonBar::ColourIds colID = button.isFrontTab() ? TabbedButtonBar::frontTextColourId
                                                               : TabbedButtonBar::tabTextColourId;

        if (bar->isColourSpecified (colID))
            col = bar->findColour (colID);
        else if (isColourSpecified (colID))
            col = findColour (colID);
    }

    const Rectangle<float> area (button.getTextArea().toFloat());

    float length = area.getWidth();
    float depth  = area.getHeight();

    if (button.getTabbedButtonBar().isVertical())
        std::swap (length, depth);


    g.setColour (col);
    g.setFont (Font (depth * .5));
	g.drawFittedText (button.getName().trim(), 0, 0,length, depth, Justification::centred, 1);
}
void MidiKeyboardComponent::paint (Graphics& g)
{
    g.fillAll (findColour (whiteNoteColourId));

    auto lineColour = findColour (keySeparatorLineColourId);
    auto textColour = findColour (textLabelColourId);

    for (int octave = 0; octave < 128; octave += 12)
    {
        for (int white = 0; white < 7; ++white)
        {
            auto noteNum = octave + whiteNotes[white];

            if (noteNum >= rangeStart && noteNum <= rangeEnd)
                drawWhiteNote (noteNum, g, getRectangleForKey (noteNum),
                               state.isNoteOnForChannels (midiInChannelMask, noteNum),
                               mouseOverNotes.contains (noteNum), lineColour, textColour);
        }
    }

    float x1 = 0.0f, y1 = 0.0f, x2 = 0.0f, y2 = 0.0f;
    auto width = getWidth();
    auto height = getHeight();

    if (orientation == verticalKeyboardFacingLeft)
    {
        x1 = width - 1.0f;
        x2 = width - 5.0f;
    }
    else if (orientation == verticalKeyboardFacingRight)
        x2 = 5.0f;
    else
        y2 = 5.0f;

    auto x = getKeyPos (rangeEnd).getEnd();
    auto shadowCol = findColour (shadowColourId);

    if (! shadowCol.isTransparent())
    {
        g.setGradientFill (ColourGradient (shadowCol, x1, y1, shadowCol.withAlpha (0.0f), x2, y2, false));

        switch (orientation)
        {
            case horizontalKeyboard:            g.fillRect (0.0f, 0.0f, x, 5.0f); break;
            case verticalKeyboardFacingLeft:    g.fillRect (width - 5.0f, 0.0f, 5.0f, x); break;
            case verticalKeyboardFacingRight:   g.fillRect (0.0f, 0.0f, 5.0f, x); break;
            default: break;
        }
    }

    if (! lineColour.isTransparent())
    {
        g.setColour (lineColour);

        switch (orientation)
        {
            case horizontalKeyboard:            g.fillRect (0.0f, height - 1.0f, x, 1.0f); break;
            case verticalKeyboardFacingLeft:    g.fillRect (0.0f, 0.0f, 1.0f, x); break;
            case verticalKeyboardFacingRight:   g.fillRect (width - 1.0f, 0.0f, 1.0f, x); break;
            default: break;
        }
    }

    auto blackNoteColour = findColour (blackNoteColourId);

    for (int octave = 0; octave < 128; octave += 12)
    {
        for (int black = 0; black < 5; ++black)
        {
            auto noteNum = octave + blackNotes[black];

            if (noteNum >= rangeStart && noteNum <= rangeEnd)
                drawBlackNote (noteNum, g, getRectangleForKey (noteNum),
                               state.isNoteOnForChannels (midiInChannelMask, noteNum),
                               mouseOverNotes.contains (noteNum), blackNoteColour);
        }
    }
}
//==============================================================================
void GraphComponent::nodePaint (GraphNodeComponent* node, Graphics& g)
{
    int width = node->getWidth(),
        height = node->getHeight();

    bool selected = selectedNodes.isSelected (node),
         locked = node->isLocked();

    // background
    Colour background; 
#if 0
    if (selected)
        background = findColour (GraphComponent::nodeBackBrightColourId);
    else
        background = findColour (GraphComponent::nodeBackColourId);
#endif
    background = node->getNodeColour ();
    
    if (selected)
        background = background.brighter (0.3f);

#if 0
    g.setColour (background);
    g.fillRect (0, 0, width, height);
#else
    g.setGradientFill (ColourGradient(background, 0.0f, 0.0f,
                                      background.darker (0.3f),
                                      0.0f,
                                      height - 1.0f,
                                      false));
    g.fillAll();
#endif

    // plugin text
    if (selected)
        g.setColour (findColour (GraphComponent::nodeTextBrightColourId));
    else
        g.setColour (findColour (GraphComponent::nodeTextColourId));

    String textToDisplay = node->getText ();
    if (textToDisplay != String::empty)
    {
        g.setFont (currentFont);
        
        if (leftToRight)
        {
            int stringWidth = currentFont.getStringWidth (textToDisplay);
            int offX = width / 2 - (int) currentFont.getHeight () / 2;
            int offY = height / 2 - stringWidth / 2 ;
            
            g.drawTextAsPath (textToDisplay,
                              AffineTransform::rotation (double_Pi / 2.0)
                                              .translated (offX, offY));
        }
        else
        {
            g.drawText (textToDisplay,
                        0, 0, width, height,
                        Justification::centred,
                        false);
        }
    }

    // border
    Colour borderColour; 
    if (selected)
        borderColour = findColour (GraphComponent::nodeBorderBrightColourId);
    else
        borderColour = findColour (GraphComponent::nodeBorderColourId);

    if (locked)
        borderColour = borderColour.overlaidWith (Colours::red.withAlpha (0.3f));

    g.setColour (borderColour);
    g.drawRect (0, 0, width, height, 2);
}
Exemple #23
0
//==============================================================================
void Ambix_encoderAudioProcessorEditor::paint (Graphics& g)
{
    //[UserPrePaint] Add your own custom painting code here..
    //[/UserPrePaint]

    //g.fillAll (Colours::white);
    
    g.setGradientFill (ColourGradient (Colour (0xff4e4e4e),
                                       (float) (proportionOfWidth (0.6314f)), (float) (proportionOfHeight (0.5842f)),
                                       Colours::black,
                                       (float) (proportionOfWidth (0.1143f)), (float) (proportionOfHeight (0.0800f)),
                                       true));
    g.fillRect (0, 0, 330, 400);
    
    g.setColour (Colours::black);
    g.drawRect (0, 0, 330, 400, 1);
    
    g.setColour (Colour (0xff2b1d69));
    g.fillRoundedRectangle (165.0f, 310.0f, 154.0f, 77.0f, 4.0000f);
    
    g.setColour (Colours::white);
    g.setFont (Font (17.2000f, Font::bold));
    g.drawText ("AMBIX-ENCODER",
                -6, 2, 343, 30,
                Justification::centred, true);
    
    g.setColour (Colours::white);
    g.setFont (Font (10.0000f, Font::plain));
    g.drawText ("elevation",
                266, 29, 48, 16,
                Justification::centred, true);
    
    g.setColour (Colours::white);
    g.setFont (Font (10.0000f, Font::plain));
    g.drawText ("azimuth",
                216, 272, 48, 16,
                Justification::centredRight, true);
    
    g.setColour (Colours::white);
    g.setFont (Font (10.0000f, Font::plain));
    g.drawText ("size",
                31, 382, 23, 16,
                Justification::centredRight, true);
    
    g.setColour (Colours::white);
    g.setFont (Font (10.0000f, Font::plain));
    g.drawText ("max speed",
                206, 372, 57, 16,
                Justification::centredRight, true);
    
#if INPUT_CHANNELS > 1
    g.setColour (Colours::white);
    g.setFont (Font (10.0000f, Font::plain));
    g.drawText ("multiple source width",
                61, 382, 95, 16,
                Justification::centredRight, true);
#endif
    
    g.setColour (Colour (0xff2b1d69));
    g.fillRoundedRectangle (24.0f, 310.0f, 226.0f, 43.0f, 4.0000f);
    
    g.setColour (Colours::white);
    g.setFont (Font (10.0000f, Font::plain));
    g.drawText ("elevation move",
                219, 338, 81, 16,
                Justification::centredRight, true);
    
    g.setColour (Colours::white);
    g.setFont (Font (10.0000f, Font::plain));
    g.drawText ("azimuth move",
                59, 338, 81, 16,
                Justification::centredRight, true);

    
    /* Version text */
    g.setColour (Colours::white);
    g.setFont (Font (10.00f, Font::plain));
    String version_string;
    version_string << "v" << QUOTE(VERSION);
    g.drawText (version_string,
                getWidth()-51, getHeight()-11, 50, 10,
                Justification::bottomRight, true);
    
    //[UserPaint] Add your own custom painting code here..
    //[/UserPaint]
}
void CtrlrLuaMethodEditorTabsLF::drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)
{
	const Rectangle<int> activeArea (button.getActiveArea());

    const TabbedButtonBar::Orientation o = button.getTabbedButtonBar().getOrientation();

    const Colour bkg (button.getTabBackgroundColour());

    if (button.getToggleState())
    {
        g.setColour (bkg);
    }
    else
    {
        Point<int> p1, p2;

        switch (o)
        {
            case TabbedButtonBar::TabsAtBottom:   p1 = activeArea.getBottomLeft(); p2 = activeArea.getTopLeft();    break;
            case TabbedButtonBar::TabsAtTop:      p1 = activeArea.getTopLeft();    p2 = activeArea.getBottomLeft(); break;
            case TabbedButtonBar::TabsAtRight:    p1 = activeArea.getTopRight();   p2 = activeArea.getTopLeft();    break;
            case TabbedButtonBar::TabsAtLeft:     p1 = activeArea.getTopLeft();    p2 = activeArea.getTopRight();   break;
            default:                              jassertfalse; break;
        }

        g.setGradientFill (ColourGradient (bkg.brighter (0.2f), (float) p1.x, (float) p1.y,
                                           bkg.darker (0.1f),   (float) p2.x, (float) p2.y, false));
    }

    g.fillRect (activeArea);

    g.setColour (button.findColour (TabbedButtonBar::tabOutlineColourId));

    Rectangle<int> r (activeArea);

    if (o != TabbedButtonBar::TabsAtBottom)   g.fillRect (r.removeFromTop (1));
    if (o != TabbedButtonBar::TabsAtTop)      g.fillRect (r.removeFromBottom (1));
    if (o != TabbedButtonBar::TabsAtRight)    g.fillRect (r.removeFromLeft (1));
    if (o != TabbedButtonBar::TabsAtLeft)     g.fillRect (r.removeFromRight (1));

    const float alpha = button.isEnabled() ? ((isMouseOver || isMouseDown) ? 1.0f : 0.8f) : 0.3f;

    Colour col (bkg.contrasting().withMultipliedAlpha (alpha));

    if (TabbedButtonBar* bar = button.findParentComponentOfClass<TabbedButtonBar>())
    {
        TabbedButtonBar::ColourIds colID = button.isFrontTab() ? TabbedButtonBar::frontTextColourId
                                                               : TabbedButtonBar::tabTextColourId;

        if (bar->isColourSpecified (colID))
            col = bar->findColour (colID);
        else if (isColourSpecified (colID))
            col = findColour (colID);
    }

    const Rectangle<float> area (button.getTextArea().toFloat());

    float length = area.getWidth();
    float depth  = area.getHeight();

    if (button.getTabbedButtonBar().isVertical())
        std::swap (length, depth);

    TextLayout textLayout;
    createTabTextLayout (button, length, depth, col, textLayout);

    AffineTransform t;

    switch (o)
    {
        case TabbedButtonBar::TabsAtLeft:   t = t.rotated (float_Pi * -0.5f).translated (area.getX(), area.getBottom()); break;
        case TabbedButtonBar::TabsAtRight:  t = t.rotated (float_Pi *  0.5f).translated (area.getRight(), area.getY()); break;
        case TabbedButtonBar::TabsAtTop:
        case TabbedButtonBar::TabsAtBottom: t = t.translated (area.getX(), area.getY()); break;
        default:                            jassertfalse; break;
    }

    g.addTransform (t);
    textLayout.draw (g, Rectangle<float> (length, depth));
}
Exemple #25
0
void EQGraph::paint (Graphics& g)
{
    int i, lx = getWidth(), ly = getHeight();

    g.fillAll (backColour);

    // paint grid !
    paintBackgroundGrid (g);

    // draw the frequency response
    float frq;
    int iy, oiy = getResponse (ly, getFrequencyX (0.0));
    int halfSampleRate = (int) eff->getSampleRate () / 2;

    Path path;
    path.startNewSubPath (0.0f,
                          (float)(ly - oiy));

    for (i = 2; i < lx; i++)
    {
        frq = getFrequencyX (i / (float) lx);
        if (frq > halfSampleRate) break;
        
        iy = getResponse (ly, frq);

        path.lineTo ((float)(i),
                     (float)(ly - iy));
                     
        oiy = iy;
    }

    // fill path if we want it to
    if (drawStyle != StrokeOnly)
    {
        Path pathToFill (path);

        pathToFill.lineTo ((float) getWidth(), (float) getHeight());
        pathToFill.lineTo (0.0f, (float) getHeight());
        pathToFill.closeSubPath ();

        g.setColour (fillColour);
        g.fillPath (pathToFill);
    }

    // stroke path if we want it to
    if (drawStyle == StrokeOnly
        || drawStyle == FillAndStroke)
    {
        g.setColour (lineColour);
        g.strokePath (path, PathStrokeType (strokeThickness));
    }

    // draw glass overlay
    g.setGradientFill (ColourGradient (Colours::white.withAlpha (0.55f),
                                       320.0f, (float) (-158),
                                       Colours::transparentBlack,
                                       304.0f, 158.0f,
                                       true));
    g.fillEllipse (0.0f, (float) (-80), getWidth (), 158.0f);

    // draw bevel
    LookAndFeel::drawBevel (g,
                            0, 0,
                            getWidth(), getHeight(),
                            2,
                            Colour (0xff828282).darker (0.5f),
                            Colour (0xff828282).brighter (0.5f),
                            true);
}
void ShredderRMSMeter::resized()
{
	cg = ColourGradient (Colours::yellow, (float)getX(), (float)(getY()+getHeight())/2, Colours::red, (float)getX()+getWidth(), (float)(getY()+getHeight())/2, false);
}
Exemple #27
0
void JuceUpdater::paint (Graphics& g)
{
    g.setGradientFill (ColourGradient (Colour::greyLevel (0.85f), 0, 0,
                                       Colour::greyLevel (0.65f), 0, (float) getHeight(), false));
    g.fillAll();
}
void NewLookAndFeel::drawGlassLozenge (Graphics& g,
									   const float x, const float y,
									   const float width, const float height,
									   const Colour& colour,
									   const float outlineThickness,
									   const float cornerSize,
									   const bool flatOnLeft,
									   const bool flatOnRight,
									   const bool flatOnTop,
									   const bool flatOnBottom,
									   const bool isMouseOverButton,
									   const bool isButtonDown) throw()
{
    if (width <= outlineThickness || height <= outlineThickness)
        return;
	
    const float cs = cornerSize < 0 ? jmin (width * 0.5f, height * 0.5f) : cornerSize;
	
    Path outline;
    createRoundedPath (outline, x, y, width, height, cs,
					   ! (flatOnLeft || flatOnTop),
					   ! (flatOnRight || flatOnTop),
					   ! (flatOnLeft || flatOnBottom),
					   ! (flatOnRight || flatOnBottom));

    {
		ColourGradient cg;
		if (isButtonDown) {
			cg  = ColourGradient(colour, 0, y,
				 			     colour.darker (0.1f), 0, y + height, false);
		} else { 
			cg  = ColourGradient(colour.darker(0.1f), 0, y,
							     colour, 0, y + height, false);
		}

		
        g.setGradientFill (cg);
        g.fillPath (outline);
    }
 
    {
        const float leftIndent = flatOnLeft ? 0.0f : cs * 0.4f;
        const float rightIndent = flatOnRight ? 0.0f : cs * 0.4f;
		
        Path highlight;
        createRoundedPath (highlight,
                           x + leftIndent,
                           y + cs * 0.1f,
                           width - (leftIndent + rightIndent),
                           height * 0.2f, cs * 0.2f,
                           ! (flatOnLeft || flatOnTop),
                           ! (flatOnRight || flatOnTop),
                           ! (flatOnLeft || flatOnBottom),
                           ! (flatOnRight || flatOnBottom));
		
		if (!isButtonDown) {
			g.setGradientFill (ColourGradient (colour.brighter (2.0f), 0, y + height * 0.06f,
											   Colours::transparentWhite, 0, y + height * 0.2f, false));
		} else {
			g.setGradientFill (ColourGradient (colour.darker (0.3f), 0, y + height * 0.06f,
											   Colours::transparentBlack, 0, y + height * 0.2f, false));
		}
		g.fillPath (highlight);
    }
	
    {
        const float leftIndent = flatOnLeft ? 0.0f : cs * 0.4f;
        const float rightIndent = flatOnRight ? 0.0f : cs * 0.4f;
		
        Path shadow;
        createRoundedPath (shadow,
                           x + leftIndent,
                           y + height * 0.85f + cs * 0.1f,
                           width - (leftIndent + rightIndent),
                           height * 0.2f, cs * 0.2f,
                           ! (flatOnLeft || flatOnTop),
                           ! (flatOnRight || flatOnTop),
                           ! (flatOnLeft || flatOnBottom),
                           ! (flatOnRight || flatOnBottom));
		
		if (!isButtonDown) {
			g.setGradientFill (ColourGradient (Colours::transparentWhite, 0, y + height * 0.85f,
											   colour.darker (0.4f), 0, y + height, false));
		} 
		g.fillPath (shadow);
    }
    
	g.setColour(Colour::fromRGBA(0, 0, 0, 150));
    g.strokePath (outline, PathStrokeType (outlineThickness));
}
//==============================================================================
void JuceDemoPluginAudioProcessorEditor::paint (Graphics& g)
{
    g.setGradientFill (ColourGradient (Colours::white, 0, 0, Colours::grey, 0, (float) getHeight(), false));
    g.fillAll();
}
void FilterGraph::paint (Graphics& g)
{
    // get size info =======================================================================================
    float width = (float) getWidth();
    float height = (float) getHeight();
    
    // paint the display background ============================================================================
    g.setGradientFill (ColourGradient (Colour (0xff232338), width / 2, height / 2, Colour (0xff21222a), 2.5f, height / 2, true));
    g.fillRoundedRectangle (2.5f, 2.5f, width - 5, height - 5, 10.000f);
    
    // paint the only trace at the moment ======================================================================
    tracePath.clear();
    
    if (traceType == Magnitude)
    {
        float scaleFactor = (((height / 2) - (height - 5) / (numHorizontalLines + 1) - 2.5f) / maxdB);
    
        float traceMagnitude = (float) (filterVector [0].getResponse (lowFreq).magnitudeValue);
        
        for (int i = 1; i < numFilters; i++)
        {
            traceMagnitude *= (float) (filterVector [i].getResponse (lowFreq).magnitudeValue);
        }
        traceMagnitude = 20 * log10 (traceMagnitude);
    
        tracePath.startNewSubPath (2.5f, (height / 2) - (traceMagnitude * scaleFactor));
        
        for (float xPos = 3.5; xPos < (width - 2.5); xPos += 1)
        {
            float freq = xToFreq (xPos);
            
            traceMagnitude = (float) (filterVector [0].getResponse (freq).magnitudeValue);
            
            for (int i = 1; i < numFilters; i++)
            {
                traceMagnitude *= (float) (filterVector [i].getResponse (freq).magnitudeValue);
            }
            traceMagnitude = 20 * log10 (traceMagnitude);
        
            tracePath.lineTo (xPos, (height / 2) - (traceMagnitude * scaleFactor));
        }
    }
    
    if (traceType == Phase)
    {
        float scaleFactor = ((height / 2) - (height - 5) / (numHorizontalLines + 1) - 2.5f) / (float_Pi * maxPhas);
    
        float traceMagnitude = (float) (filterVector [0].getResponse (lowFreq).phaseValue);
        for (int i = 1; i < numFilters; i++)
        {
            traceMagnitude += (float) (filterVector [i].getResponse (lowFreq).phaseValue);
        }
        
        float prevPhase = traceMagnitude;
        float unwrapSummand = 0;
        
        tracePath.startNewSubPath (2.5f, (height / 2) - (traceMagnitude * scaleFactor));
        for (float xPos = 3.5; xPos < (width - 2.5); xPos += 1)
        {
            float freq = xToFreq (xPos);
            
            traceMagnitude = (float) (filterVector [0].getResponse (freq).phaseValue);
            
            for (int i = 1; i < numFilters; i++)
            {
                traceMagnitude += (float) (filterVector [i].getResponse (freq).phaseValue);
            }
        
            if (fabs (traceMagnitude - prevPhase) > 5)
            {
                unwrapSummand += float_Pi * 2;
            }
            
            prevPhase = traceMagnitude;
            
            tracePath.lineTo (xPos, (height / 2) - ((traceMagnitude + unwrapSummand) * scaleFactor));
        }
    }
    
    g.setColour (traceColour);
    g.strokePath (tracePath, PathStrokeType (3.0f));
    
    // paint the display grid lines ===============================================================================
    g.setColour (Colour (0xaaffffff));
    String axisLabel;
    if (traceType == Magnitude)  axisLabel = String (maxdB, 1) + "dB";
    else if (traceType == Phase) 
    {
        axisLabel = String (CharPointer_UTF8 ("\xcf\x80")) + "rad";
        axisLabel = (maxPhas == 1) ? axisLabel : String (maxPhas, 1) + axisLabel;
    }
    
    g.setFont (Font ("Arial Rounded MT", 12.0f, Font::plain));
    g.drawText (axisLabel, 6, (int) ((height - 5) / (numHorizontalLines + 1) -9.5f), 45, 12, Justification::left, false);
    g.drawText (String ("-") + axisLabel, 6, (int) (numHorizontalLines * (height - 5) / (numHorizontalLines + 1) + 3.5f), 45, 12, Justification::left, false);
    
    gridPath.clear();
    for (int lineNum = 1; lineNum < numHorizontalLines + 1; lineNum++)
    {
        float yPos = lineNum * (height - 5) / (numHorizontalLines + 1) + 2.5f;
        gridPath.startNewSubPath (2.5f, yPos);
        gridPath.lineTo (width - 2.5f, yPos);
    }
    
    float order = (pow (10, floor (log10 (lowFreq))));
    float rounded = order * (floor(lowFreq / order) + 1);
    for (float freq = rounded; freq < highFreq; freq += pow (10, floor (log10 (freq))))
    {
        float xPos = freqToX (freq);
        gridPath.startNewSubPath (xPos, 2.5f);
        gridPath.lineTo (xPos, height - 2.5f);
    }
    g.excludeClipRegion (Rectangle <int> (6, (int) ((height - 5) / (numHorizontalLines + 1) -9.5f), 45, 12));
    g.excludeClipRegion (Rectangle <int> (6, (int) (numHorizontalLines * (height - 5) / (numHorizontalLines + 1) + 3.5f), 45, 12));
    g.setColour (Colour (0x60ffffff));   
    g.strokePath (gridPath, PathStrokeType (1.0f));
    
    // draw the boarder ======================================================================================
    g.setColour (Colours::black);
    g.drawRoundedRectangle (2.5f, 2.5f, width - 5, height - 5, 10.000f, 5.000f);
}