korfuri / WhatTheRack

WhatTheRack randomizes your VCV Rack so you make new discoveries
Do What The F*ck You Want To Public License
37 stars 2 forks source link

V2 please! (fixes here make it build but crash). #6

Closed ThePython10110 closed 2 years ago

ThePython10110 commented 2 years ago

It would be nice to have a Rack v2 branch of this. It currently doesn't build for several reasons (on Windows):

ALSO, IT CRASHES RACK 2 AS SOON AS YOU TRY TO ADD MODULES/WIRES SO YOU CAN IGNORE EVERYTHING AFTER THIS.

TLDR: Basically, this builds with Rack v2 and the current version doesn't. It would be great if you just made a new branch.

  1. In WhatTheRackModule.cpp, WhatTheJack.cpp, and CallbackButton.hpp it should be #include "window/Window.hpp" instead of #include "window.hpp".

  2. src/WhatTheJack.cpp:33:36: error: 'INPUT' is not a member of 'rack::app::PortWidget'
    33 |         if (p->type == PortWidget::INPUT) {
      |                                    ^~~~~
    src/WhatTheJack.cpp: In member function 'void WhatTheJack::spawnWire()':
    src/WhatTheJack.cpp:61:8: error: 'struct rack::app::CableWidget' has no member named 'setOutput'; did you mean 'getOutputPos'?
    61 |     w->setOutput(outputs[oidx]);
      |        ^~~~~~~~~
      |        getOutputPos
    src/WhatTheJack.cpp:62:8: error: 'struct rack::app::CableWidget' has no member named 'setInput'; did you mean 'getInputPos'?
    62 |     w->setInput(inputs[iidx]);
      |        ^~~~~~~~
      |        getInputPos
    make: *** [C:\msys64\home\Nolan\Rack-SDK/compile.mk:70: build/src/WhatTheJack.cpp.o] Error 1

    Changing

    w->setOutput(outputs[oidx]);
    w->setInput(inputs[iidx]);

    to

    w->outputPort = outputs[oidx];
    w->inputPort = inputs[iidx];

    seemed to fix this.

  3. src/WhatTheJack.cpp:33:36: error: 'INPUT' is not a member of 'rack::app::PortWidget'
    33 |         if (p->type == PortWidget::INPUT) {
      |                                    ^~~~~

    which can be solved by changing PortWidget::INPUT to engine::Port::INPUT.

  4. src/WhatTheRackModule.cpp:61:25: error: 'struct rack::plugin::Model' has no member named 'tags'; did you mean 'tagIds'?
    61 |         for (int t : m->tags) {
      |                         ^~~~
      |                         tagIds
    src/WhatTheRackModule.cpp:71:25: error: 'struct rack::plugin::Model' has no member named 'tags'; did you mean 'tagIds'?
    71 |         for (int t : m->tags) {
      |                         ^~~~
      |                         tagIds

    which can be fixed by doing what it suggests (changing tags to tagIds

  5. src/WhatTheRackModule.cpp:15:57: error: no matching function for call to 'rack::plugin::Model::createModuleWidget()'
    15 |   ModuleWidget *moduleWidget = model->createModuleWidget();
      |                                ~~~~~~~~~~~~~~~~~~~~~~~~~^~
    In file included from C:\msys64\home\Nolan\Rack-SDK/include/helpers.hpp:2,
                 from C:\msys64\home\Nolan\Rack-SDK/include/rack.hpp:21,
                 from src/WhatTheRack.hpp:1,
                 from src/WhatTheRackModule.cpp:1:
    C:\msys64\home\Nolan\Rack-SDK/include/plugin/Model.hpp:67:36: note: candidate: 'virtual rack::app::ModuleWidget* rack::plugin::Model::createModuleWidget(rack::engine::Module*)'
    67 |         virtual app::ModuleWidget* createModuleWidget(engine::Module* m) {
      |                                    ^~~~~~~~~~~~~~~~~~
    C:\msys64\home\Nolan\Rack-SDK/include/plugin/Model.hpp:67:36: note:   candidate expects 1 argument, 0 provided

    This can be fixed by changing model->createModuleWidget() to model->createModuleWidget(NULL)

  6. Also, the version number needs to be changed to 2.x.x

That was more problems than I expected... I had to keep editing everything.

ThePython10110 commented 2 years ago

Doesn't seem like it's happening... closing.

alefnull commented 2 years ago

don't know if you're still interested in this, but i forked this repo and updated it to work with V2. https://github.com/alefnull/WhatTheRack i've got an open pull request but korfuri said they don't have a setup to try it on V2 and asked if i'd like to adopt the plugin. we're discussing it now, but until then, as far as i can tell my fork builds and works fine.