diff --git a/plugins/editor/layout/main.fl b/plugins/editor/layout/main.fl index ebaf09ee..84a6f380 100644 --- a/plugins/editor/layout/main.fl +++ b/plugins/editor/layout/main.fl @@ -11,7 +11,7 @@ widget_class mainView {open class Background } Fl_Group {} { - comment {theme=darkTheme} + comment {theme=darkTheme} open xywh {0 0 800 110} class LogicalGroup } { @@ -95,7 +95,7 @@ widget_class mainView {open class Label } Fl_Box numVoicesLabel_ { - xywh {380 76 50 25} labelsize 12 align 16 + xywh {380 76 35 25} labelsize 12 align 16 class Label } Fl_Box {} { @@ -107,6 +107,11 @@ widget_class mainView {open xywh {500 76 50 25} labelsize 12 align 16 class Label } + Fl_Button numVoicesSlider_ { + comment {tag=kTagSetNumVoices} + xywh {415 80 20 20} labelsize 16 + class ChevronValueDropDown + } } Fl_Group {} {open xywh {570 5 225 100} box ROUNDED_BOX @@ -211,43 +216,33 @@ widget_class mainView {open } {} } } - Fl_Group {subPanels_[kPanelSettings]} {open + Fl_Group {subPanels_[kPanelSettings]} {open selected xywh {5 109 790 316} class LogicalGroup } { Fl_Group {} { label Engine open - xywh {260 135 280 100} box ROUNDED_BOX labelsize 12 align 17 + xywh {295 135 205 100} box ROUNDED_BOX labelsize 12 align 17 class TitleGroup } { - Fl_Spinner numVoicesSlider_ { - comment {tag=kTagSetNumVoices} - xywh {285 195 60 25} labelsize 12 textsize 12 - class ValueMenu - } - Fl_Box {} { - label Polyphony - xywh {275 155 80 25} labelsize 12 - class ValueLabel - } Fl_Spinner oversamplingSlider_ { comment {tag=kTagSetOversampling} - xywh {370 195 60 25} labelsize 12 textsize 12 + xywh {330 195 60 25} labelsize 12 textsize 12 class ValueMenu } Fl_Box {} { label Oversampling - xywh {360 155 80 25} labelsize 12 + xywh {320 155 80 25} labelsize 12 class ValueLabel } Fl_Box {} { label {Preload size} - xywh {445 155 80 25} labelsize 12 + xywh {405 155 80 25} labelsize 12 class ValueLabel } Fl_Spinner preloadSizeSlider_ { comment {tag=kTagSetPreloadSize} - xywh {455 195 60 25} labelsize 12 textsize 12 + xywh {415 195 60 25} labelsize 12 textsize 12 class ValueMenu } } @@ -303,7 +298,7 @@ widget_class mainView {open class ValueMenu } Fl_Button scalaResetButton_ { - comment {tag=kTagResetScalaFile} selected + comment {tag=kTagResetScalaFile} xywh {295 330 25 25} labelsize 12 class ResetSomethingButton } diff --git a/plugins/editor/src/editor/Editor.cpp b/plugins/editor/src/editor/Editor.cpp index b4f3f08e..d64e60d7 100644 --- a/plugins/editor/src/editor/Editor.cpp +++ b/plugins/editor/src/editor/Editor.cpp @@ -561,35 +561,6 @@ void Editor::Impl::createFrameContents() Theme* theme = &defaultTheme; auto enterTheme = [&theme](Theme& t) { theme = &t; }; - typedef CViewContainer LogicalGroup; - typedef SBoxContainer RoundedGroup; - typedef STitleContainer TitleGroup; - typedef CKickButton SfizzMainButton; - typedef CTextLabel Label; - typedef CViewContainer HLine; - typedef CAnimKnob Knob48; - typedef SStyledKnob StyledKnob; - typedef CTextLabel ValueLabel; - typedef CViewContainer VMeter; - typedef SValueMenu ValueMenu; - typedef CViewContainer Background; -#if 0 - typedef CTextButton Button; -#endif - typedef STextButton ClickableLabel; - typedef STextButton ValueButton; - typedef STextButton LoadFileButton; - typedef STextButton CCButton; - typedef STextButton HomeButton; - typedef STextButton SettingsButton; - typedef STextButton EditFileButton; - typedef STextButton PreviousFileButton; - typedef STextButton NextFileButton; - typedef STextButton ResetSomethingButton; - typedef SPiano Piano; - typedef SActionMenu ChevronDropDown; - typedef SControlsPanel ControlsPanel; - auto createLogicalGroup = [](const CRect& bounds, int, const char*, CHoriTxtAlign, int) { CViewContainer* container = new CViewContainer(bounds); container->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00)); @@ -729,12 +700,14 @@ void Editor::Impl::createFrameContents() auto createSettingsButton = [&createGlyphButton](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int fontsize) { return createGlyphButton(u8"\ue2e4", bounds, tag, fontsize); }; +#if 0 auto createEditFileButton = [&createGlyphButton](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int fontsize) { return createGlyphButton(u8"\ue148", bounds, tag, fontsize); }; auto createLoadFileButton = [&createGlyphButton](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int fontsize) { return createGlyphButton(u8"\ue1a3", bounds, tag, fontsize); }; +#endif auto createPreviousFileButton = [&createGlyphButton](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int fontsize) { return createGlyphButton(u8"\ue0d9", bounds, tag, fontsize); }; @@ -762,6 +735,19 @@ void Editor::Impl::createFrameContents() menu->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); return menu; }; + auto createChevronValueDropDown = [this, &theme](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int fontsize) { + SValueMenu* menu = new SValueMenu(bounds, this, tag); + menu->setValueToStringFunction2([](float, std::string& result, CParamDisplay*) -> bool { + result = u8"\ue0d7"; + return true; + }); + menu->setFont(makeOwned("Sfizz Fluent System R20", fontsize)); + menu->setFontColor(theme->icon); + menu->setHoverColor(theme->iconHighlight); + menu->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00)); + menu->setBackColor(CColor(0x00, 0x00, 0x00, 0x00)); + return menu; + }; auto createBackground = [&background](const CRect& bounds, int, const char*, CHoriTxtAlign, int) { CViewContainer* container = new CViewContainer(bounds); container->setBackground(background); @@ -836,12 +822,6 @@ void Editor::Impl::createFrameContents() for (int value : {1, 2, 4, 8, 16, 32, 64, 96, 128, 160, 192, 224, 256}) numVoicesSlider_->addEntry(std::to_string(value), value); - numVoicesSlider_->setValueToStringFunction2( - [](float value, std::string& result, CParamDisplay*) -> bool - { - result = std::to_string(static_cast(value)); - return true; - }); for (int log2value = 0; log2value <= 3; ++log2value) { int value = 1 << log2value; @@ -1383,11 +1363,13 @@ void Editor::Impl::performCCValueChange(unsigned cc, float value) void Editor::Impl::performCCBeginEdit(unsigned cc) { // TODO(jpc) CC as parameters and automation + (void)cc; } void Editor::Impl::performCCEndEdit(unsigned cc) { // TODO(jpc) CC as parameters and automation + (void)cc; } void Editor::Impl::setActivePanel(unsigned panelId) diff --git a/plugins/editor/src/editor/GUIComponents.cpp b/plugins/editor/src/editor/GUIComponents.cpp index bc3d718b..c0025af0 100644 --- a/plugins/editor/src/editor/GUIComponents.cpp +++ b/plugins/editor/src/editor/GUIComponents.cpp @@ -164,6 +164,12 @@ SValueMenu::SValueMenu(const CRect& bounds, IControlListener* listener, int32_t setWheelInc(0.0f); } +void SValueMenu::setHoverColor(const CColor& color) +{ + hoverColor_ = color; + invalid(); +} + CMenuItem* SValueMenu::addEntry(CMenuItem* item, float value, int32_t index) { if (index < 0 || index > getNbEntries()) { @@ -197,6 +203,30 @@ int32_t SValueMenu::getNbEntries() const return static_cast(menuItems_.size()); } +void SValueMenu::draw(CDrawContext* dc) +{ + CColor backupColor = fontColor; + if (hovered_) + fontColor = hoverColor_; + CParamDisplay::draw(dc); + if (hovered_) + fontColor = backupColor; +} + +CMouseEventResult SValueMenu::onMouseEntered(CPoint& where, const CButtonState& buttons) +{ + hovered_ = true; + invalid(); + return CParamDisplay::onMouseEntered(where, buttons); +} + +CMouseEventResult SValueMenu::onMouseExited(CPoint& where, const CButtonState& buttons) +{ + hovered_ = false; + invalid(); + return CParamDisplay::onMouseExited(where, buttons); +} + CMouseEventResult SValueMenu::onMouseDown(CPoint& where, const CButtonState& buttons) { (void)where; diff --git a/plugins/editor/src/editor/GUIComponents.h b/plugins/editor/src/editor/GUIComponents.h index 8c2237ec..b7de29ff 100644 --- a/plugins/editor/src/editor/GUIComponents.h +++ b/plugins/editor/src/editor/GUIComponents.h @@ -92,16 +92,25 @@ private: class SValueMenu : public CParamDisplay { public: explicit SValueMenu(const CRect& bounds, IControlListener* listener, int32_t tag); + CColor getHoverColor() const { return hoverColor_; } + void setHoverColor(const CColor& color); CMenuItem* addEntry(CMenuItem* item, float value, int32_t index = -1); CMenuItem* addEntry(const UTF8String& title, float value, int32_t index = -1, int32_t itemFlags = CMenuItem::kNoFlags); CMenuItem* addSeparator(int32_t index = -1); int32_t getNbEntries() const; protected: + void draw(CDrawContext* dc) override; + CMouseEventResult onMouseEntered(CPoint& where, const CButtonState& buttons) override; + CMouseEventResult onMouseExited(CPoint& where, const CButtonState& buttons) override; CMouseEventResult onMouseDown(CPoint& where, const CButtonState& buttons) override; bool onWheel(const CPoint& where, const CMouseWheelAxis& axis, const float& distance, const CButtonState& buttons) override; private: + CColor hoverColor_; + bool hovered_ = false; + + // class MenuListener; // diff --git a/plugins/editor/src/editor/layout/main.hpp b/plugins/editor/src/editor/layout/main.hpp index d127a3bf..469887fc 100644 --- a/plugins/editor/src/editor/layout/main.hpp +++ b/plugins/editor/src/editor/layout/main.hpp @@ -1,167 +1,165 @@ /* This file is generated by the layout maker tool. */ -LogicalGroup* const view__0 = createLogicalGroup(CRect(0, 0, 800, 475), -1, "", kCenterText, 14); +auto* const view__0 = createLogicalGroup(CRect(0, 0, 800, 475), -1, "", kCenterText, 14); mainView = view__0; -Background* const view__1 = createBackground(CRect(190, 110, 790, 390), -1, "", kCenterText, 14); +auto* const view__1 = createBackground(CRect(190, 110, 790, 390), -1, "", kCenterText, 14); view__0->addView(view__1); enterTheme(darkTheme); -LogicalGroup* const view__2 = createLogicalGroup(CRect(0, 0, 800, 110), -1, "", kCenterText, 14); +auto* const view__2 = createLogicalGroup(CRect(0, 0, 800, 110), -1, "", kCenterText, 14); view__0->addView(view__2); -RoundedGroup* const view__3 = createRoundedGroup(CRect(5, 4, 180, 105), -1, "", kCenterText, 14); +auto* const view__3 = createRoundedGroup(CRect(5, 4, 180, 105), -1, "", kCenterText, 14); view__2->addView(view__3); -SfizzMainButton* const view__4 = createSfizzMainButton(CRect(30, 5, 150, 65), kTagFirstChangePanel+kPanelGeneral, "", kCenterText, 14); +auto* const view__4 = createSfizzMainButton(CRect(30, 5, 150, 65), kTagFirstChangePanel+kPanelGeneral, "", kCenterText, 14); view__3->addView(view__4); -HomeButton* const view__5 = createHomeButton(CRect(44, 69, 69, 94), kTagFirstChangePanel+kPanelGeneral, "", kCenterText, 24); +auto* const view__5 = createHomeButton(CRect(44, 69, 69, 94), kTagFirstChangePanel+kPanelGeneral, "", kCenterText, 24); view__3->addView(view__5); -CCButton* const view__6 = createCCButton(CRect(76, 69, 101, 94), kTagFirstChangePanel+kPanelControls, "", kCenterText, 24); +auto* const view__6 = createCCButton(CRect(76, 69, 101, 94), kTagFirstChangePanel+kPanelControls, "", kCenterText, 24); view__3->addView(view__6); -SettingsButton* const view__7 = createSettingsButton(CRect(107, 69, 132, 94), kTagFirstChangePanel+kPanelSettings, "", kCenterText, 24); +auto* const view__7 = createSettingsButton(CRect(107, 69, 132, 94), kTagFirstChangePanel+kPanelSettings, "", kCenterText, 24); view__3->addView(view__7); -RoundedGroup* const view__8 = createRoundedGroup(CRect(185, 5, 565, 105), -1, "", kCenterText, 14); +auto* const view__8 = createRoundedGroup(CRect(185, 5, 565, 105), -1, "", kCenterText, 14); view__2->addView(view__8); -HLine* const view__9 = createHLine(CRect(10, 36, 370, 41), -1, "", kCenterText, 14); +auto* const view__9 = createHLine(CRect(10, 36, 370, 41), -1, "", kCenterText, 14); view__8->addView(view__9); -HLine* const view__10 = createHLine(CRect(10, 68, 370, 73), -1, "", kCenterText, 14); +auto* const view__10 = createHLine(CRect(10, 68, 370, 73), -1, "", kCenterText, 14); view__8->addView(view__10); -ClickableLabel* const view__11 = createClickableLabel(CRect(10, 6, 260, 37), kTagLoadSfzFile, "DefaultInstrument.sfz", kLeftText, 20); +auto* const view__11 = createClickableLabel(CRect(10, 6, 260, 37), kTagLoadSfzFile, "DefaultInstrument.sfz", kLeftText, 20); sfzFileLabel_ = view__11; view__8->addView(view__11); -Label* const view__12 = createLabel(CRect(10, 39, 260, 69), -1, "Key switch:", kLeftText, 20); +auto* const view__12 = createLabel(CRect(10, 39, 260, 69), -1, "Key switch:", kLeftText, 20); view__8->addView(view__12); -Label* const view__13 = createLabel(CRect(10, 71, 70, 96), -1, "Voices:", kRightText, 12); +auto* const view__13 = createLabel(CRect(10, 71, 70, 96), -1, "Voices:", kRightText, 12); view__8->addView(view__13); -PreviousFileButton* const view__14 = createPreviousFileButton(CRect(295, 9, 320, 34), kTagPreviousSfzFile, "", kCenterText, 24); +auto* const view__14 = createPreviousFileButton(CRect(295, 9, 320, 34), kTagPreviousSfzFile, "", kCenterText, 24); view__8->addView(view__14); -NextFileButton* const view__15 = createNextFileButton(CRect(320, 9, 345, 34), kTagNextSfzFile, "", kCenterText, 24); +auto* const view__15 = createNextFileButton(CRect(320, 9, 345, 34), kTagNextSfzFile, "", kCenterText, 24); view__8->addView(view__15); -ChevronDropDown* const view__16 = createChevronDropDown(CRect(345, 9, 370, 34), kTagFileOperations, "", kCenterText, 24); +auto* const view__16 = createChevronDropDown(CRect(345, 9, 370, 34), kTagFileOperations, "", kCenterText, 24); fileOperationsMenu_ = view__16; view__8->addView(view__16); -Label* const view__17 = createLabel(CRect(75, 71, 125, 96), -1, "", kCenterText, 12); +auto* const view__17 = createLabel(CRect(75, 71, 125, 96), -1, "", kCenterText, 12); infoVoicesLabel_ = view__17; view__8->addView(view__17); -Label* const view__18 = createLabel(CRect(130, 71, 190, 96), -1, "Max:", kRightText, 12); +auto* const view__18 = createLabel(CRect(130, 71, 190, 96), -1, "Max:", kRightText, 12); view__8->addView(view__18); -Label* const view__19 = createLabel(CRect(195, 71, 245, 96), -1, "", kCenterText, 12); +auto* const view__19 = createLabel(CRect(195, 71, 230, 96), -1, "", kCenterText, 12); numVoicesLabel_ = view__19; view__8->addView(view__19); -Label* const view__20 = createLabel(CRect(250, 71, 310, 96), -1, "Memory:", kRightText, 12); +auto* const view__20 = createLabel(CRect(250, 71, 310, 96), -1, "Memory:", kRightText, 12); view__8->addView(view__20); -Label* const view__21 = createLabel(CRect(315, 71, 365, 96), -1, "", kCenterText, 12); +auto* const view__21 = createLabel(CRect(315, 71, 365, 96), -1, "", kCenterText, 12); memoryLabel_ = view__21; view__8->addView(view__21); -RoundedGroup* const view__22 = createRoundedGroup(CRect(570, 5, 795, 105), -1, "", kCenterText, 14); -view__2->addView(view__22); -Knob48* const view__23 = createKnob48(CRect(45, 15, 93, 63), -1, "", kCenterText, 14); -view__22->addView(view__23); -view__23->setVisible(false); -ValueLabel* const view__24 = createValueLabel(CRect(40, 65, 100, 70), -1, "Center", kCenterText, 12); -view__22->addView(view__24); +auto* const view__22 = createChevronValueDropDown(CRect(230, 75, 250, 95), kTagSetNumVoices, "", kCenterText, 16); +numVoicesSlider_ = view__22; +view__8->addView(view__22); +auto* const view__23 = createRoundedGroup(CRect(570, 5, 795, 105), -1, "", kCenterText, 14); +view__2->addView(view__23); +auto* const view__24 = createKnob48(CRect(45, 15, 93, 63), -1, "", kCenterText, 14); +view__23->addView(view__24); view__24->setVisible(false); -StyledKnob* const view__25 = createStyledKnob(CRect(110, 15, 158, 63), kTagSetVolume, "", kCenterText, 14); -volumeSlider_ = view__25; -view__22->addView(view__25); -ValueLabel* const view__26 = createValueLabel(CRect(105, 65, 165, 87), -1, "0.0 dB", kCenterText, 12); -volumeLabel_ = view__26; -view__22->addView(view__26); -VMeter* const view__27 = createVMeter(CRect(175, 15, 210, 70), -1, "", kCenterText, 14); -view__22->addView(view__27); +auto* const view__25 = createValueLabel(CRect(40, 65, 100, 70), -1, "Center", kCenterText, 12); +view__23->addView(view__25); +view__25->setVisible(false); +auto* const view__26 = createStyledKnob(CRect(110, 15, 158, 63), kTagSetVolume, "", kCenterText, 14); +volumeSlider_ = view__26; +view__23->addView(view__26); +auto* const view__27 = createValueLabel(CRect(105, 65, 165, 87), -1, "0.0 dB", kCenterText, 12); +volumeLabel_ = view__27; +view__23->addView(view__27); +auto* const view__28 = createVMeter(CRect(175, 15, 210, 70), -1, "", kCenterText, 14); +view__23->addView(view__28); enterTheme(defaultTheme); -LogicalGroup* const view__28 = createLogicalGroup(CRect(5, 110, 796, 395), -1, "", kCenterText, 14); -subPanels_[kPanelGeneral] = view__28; -view__0->addView(view__28); -view__28->setVisible(false); -RoundedGroup* const view__29 = createRoundedGroup(CRect(0, 0, 175, 280), -1, "", kCenterText, 14); -view__28->addView(view__29); -Label* const view__30 = createLabel(CRect(15, 10, 75, 35), -1, "Curves:", kLeftText, 14); +auto* const view__29 = createLogicalGroup(CRect(5, 110, 796, 395), -1, "", kCenterText, 14); +subPanels_[kPanelGeneral] = view__29; +view__0->addView(view__29); +view__29->setVisible(false); +auto* const view__30 = createRoundedGroup(CRect(0, 0, 175, 280), -1, "", kCenterText, 14); view__29->addView(view__30); -Label* const view__31 = createLabel(CRect(15, 35, 75, 60), -1, "Masters:", kLeftText, 14); -view__29->addView(view__31); -Label* const view__32 = createLabel(CRect(15, 60, 75, 85), -1, "Groups:", kLeftText, 14); -view__29->addView(view__32); -Label* const view__33 = createLabel(CRect(15, 85, 75, 110), -1, "Regions:", kLeftText, 14); -view__29->addView(view__33); -Label* const view__34 = createLabel(CRect(15, 110, 75, 135), -1, "Samples:", kLeftText, 14); -view__29->addView(view__34); -Label* const view__35 = createLabel(CRect(115, 10, 155, 35), -1, "0", kCenterText, 14); -infoCurvesLabel_ = view__35; -view__29->addView(view__35); -Label* const view__36 = createLabel(CRect(115, 35, 155, 60), -1, "0", kCenterText, 14); -infoMastersLabel_ = view__36; -view__29->addView(view__36); -Label* const view__37 = createLabel(CRect(115, 60, 155, 85), -1, "0", kCenterText, 14); -infoGroupsLabel_ = view__37; -view__29->addView(view__37); -Label* const view__38 = createLabel(CRect(115, 85, 155, 110), -1, "0", kCenterText, 14); -infoRegionsLabel_ = view__38; -view__29->addView(view__38); -Label* const view__39 = createLabel(CRect(115, 110, 155, 135), -1, "0", kCenterText, 14); -infoSamplesLabel_ = view__39; -view__29->addView(view__39); -LogicalGroup* const view__40 = createLogicalGroup(CRect(5, 110, 795, 395), -1, "", kCenterText, 14); -subPanels_[kPanelControls] = view__40; -view__0->addView(view__40); -view__40->setVisible(false); -RoundedGroup* const view__41 = createRoundedGroup(CRect(0, 0, 790, 285), -1, "", kCenterText, 14); -view__40->addView(view__41); -ControlsPanel* const view__42 = createControlsPanel(CRect(0, 0, 790, 285), -1, "", kCenterText, 14); -controlsPanel_ = view__42; +auto* const view__31 = createLabel(CRect(15, 10, 75, 35), -1, "Curves:", kLeftText, 14); +view__30->addView(view__31); +auto* const view__32 = createLabel(CRect(15, 35, 75, 60), -1, "Masters:", kLeftText, 14); +view__30->addView(view__32); +auto* const view__33 = createLabel(CRect(15, 60, 75, 85), -1, "Groups:", kLeftText, 14); +view__30->addView(view__33); +auto* const view__34 = createLabel(CRect(15, 85, 75, 110), -1, "Regions:", kLeftText, 14); +view__30->addView(view__34); +auto* const view__35 = createLabel(CRect(15, 110, 75, 135), -1, "Samples:", kLeftText, 14); +view__30->addView(view__35); +auto* const view__36 = createLabel(CRect(115, 10, 155, 35), -1, "0", kCenterText, 14); +infoCurvesLabel_ = view__36; +view__30->addView(view__36); +auto* const view__37 = createLabel(CRect(115, 35, 155, 60), -1, "0", kCenterText, 14); +infoMastersLabel_ = view__37; +view__30->addView(view__37); +auto* const view__38 = createLabel(CRect(115, 60, 155, 85), -1, "0", kCenterText, 14); +infoGroupsLabel_ = view__38; +view__30->addView(view__38); +auto* const view__39 = createLabel(CRect(115, 85, 155, 110), -1, "0", kCenterText, 14); +infoRegionsLabel_ = view__39; +view__30->addView(view__39); +auto* const view__40 = createLabel(CRect(115, 110, 155, 135), -1, "0", kCenterText, 14); +infoSamplesLabel_ = view__40; +view__30->addView(view__40); +auto* const view__41 = createLogicalGroup(CRect(5, 110, 795, 395), -1, "", kCenterText, 14); +subPanels_[kPanelControls] = view__41; +view__0->addView(view__41); +view__41->setVisible(false); +auto* const view__42 = createRoundedGroup(CRect(0, 0, 790, 285), -1, "", kCenterText, 14); view__41->addView(view__42); -LogicalGroup* const view__43 = createLogicalGroup(CRect(5, 109, 795, 425), -1, "", kCenterText, 14); -subPanels_[kPanelSettings] = view__43; -view__0->addView(view__43); -TitleGroup* const view__44 = createTitleGroup(CRect(255, 26, 535, 126), -1, "Engine", kCenterText, 12); -view__43->addView(view__44); -ValueMenu* const view__45 = createValueMenu(CRect(25, 60, 85, 85), kTagSetNumVoices, "", kCenterText, 12); -numVoicesSlider_ = view__45; +auto* const view__43 = createControlsPanel(CRect(0, 0, 790, 285), -1, "", kCenterText, 14); +controlsPanel_ = view__43; +view__42->addView(view__43); +auto* const view__44 = createLogicalGroup(CRect(5, 109, 795, 425), -1, "", kCenterText, 14); +subPanels_[kPanelSettings] = view__44; +view__0->addView(view__44); +auto* const view__45 = createTitleGroup(CRect(290, 26, 495, 126), -1, "Engine", kCenterText, 12); view__44->addView(view__45); -ValueLabel* const view__46 = createValueLabel(CRect(15, 20, 95, 45), -1, "Polyphony", kCenterText, 12); -view__44->addView(view__46); -ValueMenu* const view__47 = createValueMenu(CRect(110, 60, 170, 85), kTagSetOversampling, "", kCenterText, 12); -oversamplingSlider_ = view__47; -view__44->addView(view__47); -ValueLabel* const view__48 = createValueLabel(CRect(100, 20, 180, 45), -1, "Oversampling", kCenterText, 12); -view__44->addView(view__48); -ValueLabel* const view__49 = createValueLabel(CRect(185, 20, 265, 45), -1, "Preload size", kCenterText, 12); -view__44->addView(view__49); -ValueMenu* const view__50 = createValueMenu(CRect(195, 60, 255, 85), kTagSetPreloadSize, "", kCenterText, 12); -preloadSizeSlider_ = view__50; +auto* const view__46 = createValueMenu(CRect(35, 60, 95, 85), kTagSetOversampling, "", kCenterText, 12); +oversamplingSlider_ = view__46; +view__45->addView(view__46); +auto* const view__47 = createValueLabel(CRect(25, 20, 105, 45), -1, "Oversampling", kCenterText, 12); +view__45->addView(view__47); +auto* const view__48 = createValueLabel(CRect(110, 20, 190, 45), -1, "Preload size", kCenterText, 12); +view__45->addView(view__48); +auto* const view__49 = createValueMenu(CRect(120, 60, 180, 85), kTagSetPreloadSize, "", kCenterText, 12); +preloadSizeSlider_ = view__49; +view__45->addView(view__49); +auto* const view__50 = createTitleGroup(CRect(170, 161, 585, 261), -1, "Tuning", kCenterText, 12); view__44->addView(view__50); -TitleGroup* const view__51 = createTitleGroup(CRect(170, 161, 585, 261), -1, "Tuning", kCenterText, 12); -view__43->addView(view__51); -ValueLabel* const view__52 = createValueLabel(CRect(155, 20, 235, 45), -1, "Root key", kCenterText, 12); -view__51->addView(view__52); -ValueMenu* const view__53 = createValueMenu(CRect(250, 60, 310, 85), kTagSetTuningFrequency, "", kCenterText, 12); -tuningFrequencySlider_ = view__53; -view__51->addView(view__53); -ValueLabel* const view__54 = createValueLabel(CRect(240, 20, 320, 45), -1, "Frequency", kCenterText, 12); -view__51->addView(view__54); -StyledKnob* const view__55 = createStyledKnob(CRect(340, 45, 388, 93), kTagSetStretchedTuning, "", kCenterText, 14); -stretchedTuningSlider_ = view__55; -view__51->addView(view__55); -ValueLabel* const view__56 = createValueLabel(CRect(325, 20, 405, 45), -1, "Stretch", kCenterText, 12); -view__51->addView(view__56); -ValueLabel* const view__57 = createValueLabel(CRect(20, 20, 120, 45), -1, "Scala file", kCenterText, 12); -view__51->addView(view__57); -ValueButton* const view__58 = createValueButton(CRect(20, 60, 120, 85), kTagLoadScalaFile, "DefaultScale", kCenterText, 12); -scalaFileButton_ = view__58; -view__51->addView(view__58); -ValueMenu* const view__59 = createValueMenu(CRect(165, 60, 200, 85), kTagSetScalaRootKey, "", kCenterText, 12); -scalaRootKeySlider_ = view__59; -view__51->addView(view__59); -ValueMenu* const view__60 = createValueMenu(CRect(200, 60, 230, 85), kTagSetScalaRootKey, "", kCenterText, 12); -scalaRootOctaveSlider_ = view__60; -view__51->addView(view__60); -ResetSomethingButton* const view__61 = createResetSomethingButton(CRect(120, 60, 145, 85), kTagResetScalaFile, "", kCenterText, 12); -scalaResetButton_ = view__61; -view__51->addView(view__61); -TitleGroup* const view__62 = createTitleGroup(CRect(615, 161, 754, 261), -1, "Files", kCenterText, 12); -userFilesGroup_ = view__62; -view__43->addView(view__62); -ValueLabel* const view__63 = createValueLabel(CRect(20, 20, 120, 45), -1, "User SFZ folder", kCenterText, 12); -view__62->addView(view__63); -ValueButton* const view__64 = createValueButton(CRect(20, 60, 120, 85), kTagChooseUserFilesDir, "DefaultPath", kCenterText, 12); -userFilesDirButton_ = view__64; -view__62->addView(view__64); -Piano* const view__65 = createPiano(CRect(5, 400, 795, 470), -1, "", kCenterText, 12); -piano_ = view__65; -view__0->addView(view__65); +auto* const view__51 = createValueLabel(CRect(155, 20, 235, 45), -1, "Root key", kCenterText, 12); +view__50->addView(view__51); +auto* const view__52 = createValueMenu(CRect(250, 60, 310, 85), kTagSetTuningFrequency, "", kCenterText, 12); +tuningFrequencySlider_ = view__52; +view__50->addView(view__52); +auto* const view__53 = createValueLabel(CRect(240, 20, 320, 45), -1, "Frequency", kCenterText, 12); +view__50->addView(view__53); +auto* const view__54 = createStyledKnob(CRect(340, 45, 388, 93), kTagSetStretchedTuning, "", kCenterText, 14); +stretchedTuningSlider_ = view__54; +view__50->addView(view__54); +auto* const view__55 = createValueLabel(CRect(325, 20, 405, 45), -1, "Stretch", kCenterText, 12); +view__50->addView(view__55); +auto* const view__56 = createValueLabel(CRect(20, 20, 120, 45), -1, "Scala file", kCenterText, 12); +view__50->addView(view__56); +auto* const view__57 = createValueButton(CRect(20, 60, 120, 85), kTagLoadScalaFile, "DefaultScale", kCenterText, 12); +scalaFileButton_ = view__57; +view__50->addView(view__57); +auto* const view__58 = createValueMenu(CRect(165, 60, 200, 85), kTagSetScalaRootKey, "", kCenterText, 12); +scalaRootKeySlider_ = view__58; +view__50->addView(view__58); +auto* const view__59 = createValueMenu(CRect(200, 60, 230, 85), kTagSetScalaRootKey, "", kCenterText, 12); +scalaRootOctaveSlider_ = view__59; +view__50->addView(view__59); +auto* const view__60 = createResetSomethingButton(CRect(120, 60, 145, 85), kTagResetScalaFile, "", kCenterText, 12); +scalaResetButton_ = view__60; +view__50->addView(view__60); +auto* const view__61 = createTitleGroup(CRect(615, 161, 754, 261), -1, "Files", kCenterText, 12); +userFilesGroup_ = view__61; +view__44->addView(view__61); +auto* const view__62 = createValueLabel(CRect(20, 20, 120, 45), -1, "User SFZ folder", kCenterText, 12); +view__61->addView(view__62); +auto* const view__63 = createValueButton(CRect(20, 60, 120, 85), kTagChooseUserFilesDir, "DefaultPath", kCenterText, 12); +userFilesDirButton_ = view__63; +view__61->addView(view__63); +auto* const view__64 = createPiano(CRect(5, 400, 795, 470), -1, "", kCenterText, 12); +piano_ = view__64; +view__0->addView(view__64); diff --git a/plugins/editor/tools/layout-maker/sources/main.cpp b/plugins/editor/tools/layout-maker/sources/main.cpp index 31fc0bfa..3ef47982 100644 --- a/plugins/editor/tools/layout-maker/sources/main.cpp +++ b/plugins/editor/tools/layout-maker/sources/main.cpp @@ -95,7 +95,7 @@ static void codegen_item(int& idCounter, int parentId, int parentX, int parentY, else if (item.align & 8) align = "kRightText"; - std::cout << item.classname << "* const view__" << id << " = create" << item.classname << "(CRect(" << relX << ", " << relY << ", " << (relX + item.w) << ", " << (relY + item.h) << "), " << tag << ", \"" << label << "\", " << align << ", " << item.labelsize << ");\n"; + std::cout << "auto"/*item.classname*/ << "* const view__" << id << " = create" << item.classname << "(CRect(" << relX << ", " << relY << ", " << (relX + item.w) << ", " << (relY + item.h) << "), " << tag << ", \"" << label << "\", " << align << ", " << item.labelsize << ");\n"; if (!item.id.empty()) std::cout << item.id << " = view__" << id << ";\n";