MCPcopy Create free account
hub / github.com/VCVRack/Rack / PlugWidget

Method PlugWidget

src/app/CableWidget.cpp:52–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51
52PlugWidget::PlugWidget() {
53 internal = new Internal;
54
55 internal->fb = new widget::FramebufferWidget;
56 addChild(internal->fb);
57
58 internal->plugTransform = new widget::TransformWidget;
59 internal->fb->addChild(internal->plugTransform);
60
61 internal->plugTint = new TintWidget;
62 internal->plugTransform->addChild(internal->plugTint);
63
64 internal->plug = new widget::SvgWidget;
65 internal->plug->setSvg(window::Svg::load(asset::system("res/ComponentLibrary/Plug.svg")));
66 internal->plugTint->addChild(internal->plug);
67 internal->plugTransform->setSize(internal->plug->getSize());
68 internal->plugTransform->setPosition(internal->plug->getSize().mult(-0.5));
69 internal->plugTint->setSize(internal->plug->getSize());
70
71 internal->plugPort = new widget::SvgWidget;
72 internal->plugPort->setSvg(window::Svg::load(asset::system("res/ComponentLibrary/PlugPort.svg")));
73 internal->plugPort->setPosition(internal->plugPort->getSize().mult(-0.5));
74 internal->fb->addChild(internal->plugPort);
75
76 internal->plugLight = new PlugLight;
77 internal->plugLight->setPosition(internal->plugLight->getSize().mult(-0.5));
78 addChild(internal->plugLight);
79
80 setSize(internal->plug->getSize());
81}
82
83
84PlugWidget::~PlugWidget() {

Callers

nothing calls this directly

Calls 8

loadFunction · 0.85
systemFunction · 0.85
addChildMethod · 0.80
setPositionMethod · 0.80
multMethod · 0.80
setSvgMethod · 0.45
setSizeMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected