Browse Source

Fix onCreate() call

pull/1639/head
Andrew Belt 7 years ago
parent
commit
d37508327f
3 changed files with 4 additions and 4 deletions
  1. +2
    -2
      include/engine.hpp
  2. +1
    -1
      src/app/ModuleBrowser.cpp
  3. +1
    -1
      src/main.cpp

+ 2
- 2
include/engine.hpp View File

@@ -75,9 +75,9 @@ struct Module {
/** Called when the engine sample rate is changed
*/
virtual void onSampleRateChange() {}
/** Called when module is created by the Add Module popup, cloning, or when loading a patch or autosave */
/** Called when module is created by the Module Browser or by cloning, NOT when a patch is loaded */
virtual void onCreate() {}
/** Called when user explicitly deletes the module, not when Rack is closed or a new patch is loaded */
/** Called when user explicitly deletes the module, NOT when Rack is closed or a new patch is loaded */
virtual void onDelete() {}
/** Called when user clicks Initialize in the module context menu */
virtual void onReset() {


+ 1
- 1
src/app/ModuleBrowser.cpp View File

@@ -139,7 +139,7 @@ struct ModelItem : BrowserListItem {
ModuleWidget *moduleWidget = model->createModuleWidget();
if (!moduleWidget)
return;
gRackWidget->moduleContainer->addChild(moduleWidget);
gRackWidget->addModule(moduleWidget);
// Move module nearest to the mouse position
moduleWidget->box.pos = gRackWidget->lastMousePos.minus(moduleWidget->box.size.div(2));
gRackWidget->requestModuleBoxNearest(moduleWidget, moduleWidget->box);


+ 1
- 1
src/main.cpp View File

@@ -44,7 +44,7 @@ int main(int argc, char* argv[]) {
loggerInit(devMode);

// Log environment
info("Rack %s", gApplicationVersion.c_str());
info("%s %s", gApplicationName.c_str(), gApplicationVersion.c_str());
if (devMode)
info("Development mode");
info("Global directory: %s", assetGlobal("").c_str());


Loading…
Cancel
Save