Help! Managed to disappear all the input/output ports in Skylights Plugin!

Here’s where I’m way out of my depth.

I have this fork of Skylights: GitHub - Chaircrusher/skylights-vcv: A set of skylights for your modular synthesizer Rack. My branch is chaircrusher-v1-port.

These are basically all the changes from the ‘mostly working’ v1 version I posted yesterday. If I look at what I changed it’s all pretty mundane. You can view it here: https://github.com/Skrylar/skylights-vcv/compare/master...Chaircrusher:chaircrusher-v1-port

Basically I made this change – as suggested – replacing Port::create with createInput/createOutput: i.e. going from addInput(Port::create (mm2px(Vec(6, 22)), Port::INPUT, module, adrift_module::I_TRIG_ALL));

to: addInput(createInput (mm2px(Vec(6, 22)), Port::INPUT, module, adrift_module::I_TRIG_ALL));

Now the modules can’t be hooked to anything and look like this:

I honestly can’t see how what I did to make this happen.

This:

addInput(createInput(mm2px(Vec(6, 22)), ...));

looks oddly incomplete… all the calls to createInput that I can find take a port type as a template parameter, for example:

addInput(createInput<PJ301MPort>(Vec(9.507, 88.842), ...));

This is actually what’s in the source code, the funky forum editor nuked the template argument.

addInput(createInput<DavidLTPort>
	    (mm2px(Vec(6, 22)),
	     module,
	     adrift_module::I_TRIG_ALL));

Took a look.
If you replace the DavidLT port with the PJ3301M whatever it works
If you look in the log when you run you will see

[2.757 warn src/window.cpp:75] Failed to load SVG res/cntr_LT.svg

which is what is loaded from the components.cc

This is because your code uses loadSvg with a raw(“res/cntr_LT.svg”);

This diff fixes it

diff --git a/src/components.hh b/src/components.hh
index 5a551a9..eaf8536 100644
--- a/src/components.hh
+++ b/src/components.hh
@@ -3,6 +3,7 @@
 
 struct DavidLTPort : public SvgPort {
    DavidLTPort() {
-      setSvg(APP->window->loadSvg("res/cntr_LT.svg"));
+       rack::INFO( "Loading port" );
+       setSvg(APP->window->loadSvg(asset::plugin(pluginInstance,"res/cntr_LT.svg")));
    }
 };

except of course you want to remove the rack::INFO!

Thanks so much!

I feel a little better from the standpoint that this is a problem in code I didn’t change :wink:

1 Like