| 845 | } |
| 846 | |
| 847 | void SerialNodeComponent::paint(Graphics& g) |
| 848 | { |
| 849 | auto b = getLocalBounds().toFloat(); |
| 850 | |
| 851 | auto t = JUCE_LIVE_CONSTANT_OFF(1000.0f); |
| 852 | signalDotOffset = (double)Time::getMillisecondCounter() / jmax(1.0f, t); |
| 853 | |
| 854 | |
| 855 | Colour fc = getOutlineColour(); |
| 856 | |
| 857 | g.setColour(JUCE_LIVE_CONSTANT_OFF(Colour(0xff232323))); |
| 858 | |
| 859 | g.fillRect(b); |
| 860 | |
| 861 | g.setGradientFill(ColourGradient(JUCE_LIVE_CONSTANT_OFF(Colour(0x22000000)), 0.0f, (float)UIValues::HeaderHeight, Colours::transparentBlack, 0.0f, 50.0f, false)); |
| 862 | |
| 863 | auto copy = b; |
| 864 | g.fillRect(copy.removeFromTop(50.0f)); |
| 865 | |
| 866 | g.setColour(fc); |
| 867 | g.drawRect(b, 1.0f); |
| 868 | |
| 869 | int yStart = 0; |
| 870 | |
| 871 | if (auto ng = findParentComponentOfClass<DspNetworkGraph>()) |
| 872 | { |
| 873 | yStart = (ng->getLocalArea(this, getLocalBounds()).getY() + 15 + UIValues::HeaderHeight) % 10; |
| 874 | } |
| 875 | |
| 876 | for (int i = yStart; i < getHeight() + 10; i += 10) |
| 877 | { |
| 878 | float multiplier = (float)i / float(getHeight()); |
| 879 | multiplier += JUCE_LIVE_CONSTANT_OFF(0.5f); |
| 880 | g.setColour(fc.withMultipliedAlpha( multiplier * JUCE_LIVE_CONSTANT_OFF(0.08f))); |
| 881 | g.fillRect(2, i, getWidth() - 2, 9 ); |
| 882 | } |
| 883 | |
| 884 | for (int i = 0; i < node->getNumChannelsToDisplay(); i++) |
| 885 | { |
| 886 | paintSerialCable(g, i); |
| 887 | } |
| 888 | |
| 889 | drawHelp(g); |
| 890 | |
| 891 | if (addPosition != -1) |
| 892 | { |
| 893 | g.fillAll(Colours::white.withAlpha(0.01f)); |
| 894 | |
| 895 | g.setColour(Colours::white.withAlpha(0.08f)); |
| 896 | g.fillRoundedRectangle(getInsertRuler(addPosition), 2.5f); |
| 897 | } |
| 898 | |
| 899 | if (insertPosition != -1) |
| 900 | { |
| 901 | g.setColour(Colour(SIGNAL_COLOUR).withAlpha(0.05f)); |
| 902 | g.fillRoundedRectangle(getLocalBounds().toFloat(), 5.0f); |
| 903 | |
| 904 | g.setColour(Colour(SIGNAL_COLOUR)); |
nothing calls this directly
no test coverage detected