Merge pull request #1156 from redtide/gui-misc

UI misc
This commit is contained in:
redtide 2023-04-13 17:42:27 +02:00 committed by GitHub
commit 4c1ec3a30a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 524 additions and 344 deletions

View file

@ -102,6 +102,7 @@ std::string getDescriptionBlob(sfizz_synth_t* handle)
synth.sendMessage(*client, 0, "/num_samples", "", nullptr);
synth.sendMessage(*client, 0, "/root_path", "", nullptr);
synth.sendMessage(*client, 0, "/image", "", nullptr);
synth.sendMessage(*client, 0, "/image_controls", "", nullptr);
synth.sendMessage(*client, 0, "/key/slots", "", nullptr);
synth.sendMessage(*client, 0, "/sw/last/slots", "", nullptr);
synth.sendMessage(*client, 0, "/cc/slots", "", nullptr);
@ -149,6 +150,8 @@ InstrumentDescription parseDescriptionBlob(absl::string_view blob)
desc.rootPath = args[0].s;
else if (Messages::matchOSC("/image", path, indices) && !strcmp(sig, "s"))
desc.image = args[0].s;
else if (Messages::matchOSC("/image_controls", path, indices) && !strcmp(sig, "s"))
desc.image_controls = args[0].s;
else if (Messages::matchOSC("/key/slots", path, indices) && !strcmp(sig, "b"))
copyArgToBitSpan(args[0], desc.keyUsed.span());
else if (Messages::matchOSC("/sw/last/slots", path, indices) && !strcmp(sig, "b"))
@ -187,6 +190,7 @@ std::ostream& operator<<(std::ostream& os, const InstrumentDescription& desc)
os << " root_path: " << desc.rootPath << "\n";
os << " image: " << desc.image << "\n";
os << " image_controls: " << desc.image_controls << "\n";
os << " keys:\n";
for (unsigned i = 0; i < 128; ++i) {

View file

@ -24,6 +24,7 @@ struct InstrumentDescription {
uint32_t numSamples {};
std::string rootPath;
std::string image;
std::string image_controls;
BitArray<128> keyUsed {};
BitArray<128> keyswitchUsed {};
BitArray<128> sustainOrSostenuto {};

View file

@ -31,8 +31,12 @@ set(EDITOR_RESOURCES
Fonts/Roboto-Regular.ttf
Themes/Default/theme.xml
Themes/Dark/theme.xml
PARENT_SCOPE)
PARENT_SCOPE
)
set(UI_RESOURCES
resources/Themes/Default/theme.xml
resources/Themes/Dark/theme.xml
)
function(copy_editor_resources TARGET SOURCE_DIR DESTINATION_DIR)
set(_deps)
foreach(res ${EDITOR_RESOURCES})
@ -51,6 +55,7 @@ endfunction()
set(UI_FILES layout/main.fl layout/about.fl)
source_group("Editor UI" FILES ${UI_FILES})
source_group("Editor Resources" FILES ${UI_RESOURCES})
# editor
add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
@ -63,6 +68,8 @@ add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
src/editor/EditorController.h
src/editor/GUIComponents.h
src/editor/GUIComponents.cpp
src/editor/GUIDefs.h
src/editor/GUIDefs.cpp
src/editor/GUIHelpers.h
src/editor/GUIHelpers.cpp
src/editor/GUIPiano.h
@ -83,7 +90,9 @@ add_library(sfizz_editor STATIC EXCLUDE_FROM_ALL
src/editor/layout/about.hpp
src/editor/utility/vstgui_after.h
src/editor/utility/vstgui_before.h
${UI_FILES})
${UI_FILES}
${UI_RESOURCES}
)
add_library(sfizz::editor ALIAS sfizz_editor)
target_include_directories(sfizz_editor PUBLIC "src")
target_link_libraries(sfizz_editor PUBLIC sfizz::messaging sfizz::plugins-common)

View file

@ -3,16 +3,16 @@ version 1.0304
header_name {.h}
code_name {.cxx}
widget_class mainView {open
xywh {624 612 800 475} type Double
xywh {624 564 775 515} type Double
class LogicalGroup visible
} {
Fl_Box imageContainer_ {
image {../resources/background.png} xywh {0 110 800 300}
image {../resources/background.png} xywh {0 110 775 335}
class Background
}
Fl_Group {} {
comment {palette=invertedPalette} open
xywh {0 0 814 110}
xywh {0 0 775 110}
class LogicalGroup
} {
Fl_Group {} {
@ -45,28 +45,28 @@ widget_class mainView {open
class HomeButton
}
}
Fl_Group {} {
xywh {185 5 390 100} box ROUNDED_BOX
Fl_Group {} {open
xywh {185 5 365 100} box ROUNDED_BOX
class RoundedGroup
} {
Fl_Box {} {
label {Separator 1}
xywh {195 41 370 5} box BORDER_BOX labeltype NO_LABEL
xywh {195 40 345 5} box BORDER_BOX labeltype NO_LABEL
class HLine
}
Fl_Box {} {
label {Separator 2}
xywh {195 73 370 5} box BORDER_BOX labeltype NO_LABEL
xywh {195 75 345 5} box BORDER_BOX labeltype NO_LABEL
class HLine
}
Fl_Box sfzFileLabel_ {
label {DefaultInstrument.sfz}
comment {tag=kTagLoadSfzFile}
xywh {195 13 320 30} labelsize 20 align 20
xywh {195 10 270 30} labelsize 20 align 20
class ClickableLabel
}
Fl_Box keyswitchLabel_ {
xywh {265 45 310 35} labelsize 20 align 20
xywh {255 45 285 30} labelsize 20 align 20
class Label
}
Fl_Box keyswitchBadge_ {
@ -75,59 +75,59 @@ widget_class mainView {open
}
Fl_Box keyswitchInactiveLabel_ {
label {No key switch}
xywh {195 45 360 30} labelsize 20 align 20 hide
xywh {195 45 345 30} labelsize 20 align 20 hide
class InactiveLabel
}
Fl_Box {} {
label {Voices:}
xywh {195 78 60 25} labelsize 14 align 24
xywh {195 78 60 25} align 24
class Label
}
Fl_Button {} {
comment {tag=kTagPreviousSfzFile}
xywh {488 18 25 25} labelsize 24
xywh {465 15 25 25} labelsize 24
class PreviousFileButton
}
Fl_Button {} {
comment {tag=kTagNextSfzFile}
xywh {513 18 25 25} labelsize 24
xywh {490 15 25 25} labelsize 24
class NextFileButton
}
Fl_Button fileOperationsMenu_ {
comment {tag=kTagFileOperations}
xywh {538 18 25 25} labelsize 24
xywh {515 15 25 25} labelsize 24
class ChevronDropDown
}
Fl_Box infoVoicesLabel_ {
xywh {260 78 40 25} labelsize 14 align 16
xywh {255 78 40 25} align 16
class Label
}
Fl_Box {} {
label {Max:}
xywh {322 78 40 25} labelsize 14 align 24
xywh {315 78 40 25} align 24
class Label
}
Fl_Box numVoicesLabel_ {
xywh {378 78 35 25} labelsize 14 align 16
xywh {355 78 35 25} align 16
class Label
}
Fl_Box {} {
label {Memory:}
xywh {456 78 60 25} labelsize 14 align 24
xywh {430 78 60 25} align 24
class Label
}
Fl_Box memoryLabel_ {
xywh {522 78 50 25} labelsize 14 align 16
xywh {490 78 50 25} align 16
class Label
}
Fl_Button numVoicesSlider_ {
comment {tag=kTagSetNumVoices}
xywh {420 82 20 20} labelsize 16
xywh {390 82 20 20} labelsize 16
class ChevronValueDropDown
}
}
Fl_Group {} {
xywh {580 5 215 100} box ROUNDED_BOX
xywh {555 5 215 100} box ROUNDED_BOX
class RoundedGroup
} {
Fl_Dial {} {
@ -136,339 +136,329 @@ widget_class mainView {open
}
Fl_Box {} {
label Center
xywh {582 70 60 5} labelsize 14 hide
xywh {582 70 60 5} hide
class ValueLabel
}
Fl_Box volumeCCKnob_ {
label Volume
comment {tag=kTagSetCCVolume}
xywh {586 10 70 90} box BORDER_BOX labelsize 14 align 17
xywh {560 10 70 90} box BORDER_BOX align 17
class KnobCCBox
}
Fl_Box panCCKnob_ {
label Pan
comment {tag=kTagSetCCPan}
xywh {663 10 70 90} box BORDER_BOX labelsize 14 align 17
xywh {635 10 70 90} box BORDER_BOX align 17
class KnobCCBox
}
Fl_Box {meters_[0]} {
xywh {739 10 23 90} box BORDER_BOX
xywh {710 10 23 90} box BORDER_BOX
class VMeter
}
Fl_Box {meters_[1]} {
xywh {763 10 23 90} box BORDER_BOX
xywh {740 10 23 90} box BORDER_BOX
class VMeter
}
}
}
Fl_Group {subPanels_[kPanelInfo]} {
xywh {5 110 790 300} hide
xywh {0 110 775 335} hide
class LogicalGroup
} {
Fl_Group {} {
xywh {5 110 790 300} box ROUNDED_BOX
class RoundedGroup
xywh {0 110 775 335} box BORDER_BOX
class SquaredTransparentGroup
} {
Fl_Box {} {
label {Curves:}
xywh {20 120 60 25} align 20
class Label
class InfoLabel
}
Fl_Box {} {
label {Masters:}
xywh {20 145 60 25} align 20
class Label
class InfoLabel
}
Fl_Box {} {
label {Groups:}
xywh {20 170 60 25} align 20
class Label
class InfoLabel
}
Fl_Box {} {
label {Regions:}
xywh {20 195 60 25} align 20
class Label
class InfoLabel
}
Fl_Box {} {
label {Samples:}
xywh {20 220 60 25} align 20
class Label
class InfoLabel
}
Fl_Box infoCurvesLabel_ {
label 0
xywh {120 120 40 25} align 16
class Label
class InfoLabel
}
Fl_Box infoMastersLabel_ {
label 0
xywh {120 145 40 25} align 16
class Label
class InfoLabel
}
Fl_Box infoGroupsLabel_ {
label 0
xywh {120 170 40 25} align 16
class Label
class InfoLabel
}
Fl_Box infoRegionsLabel_ {
label 0
xywh {120 195 40 25} align 16
class Label
class InfoLabel
}
Fl_Box infoSamplesLabel_ {
label 0
xywh {120 220 40 25} align 16
class Label
class InfoLabel
}
}
}
Fl_Group {subPanels_[kPanelControls]} {
xywh {5 110 790 300} hide
xywh {0 110 775 335} hide
class LogicalGroup
} {
Fl_Group {} {
xywh {5 110 790 300} box ROUNDED_BOX
class RoundedGroup
} {
Fl_Group controlsPanel_ {
xywh {5 110 790 300} box THIN_DOWN_FRAME labelsize 14
class ControlsPanel
} {}
}
Fl_Group controlsPanel_ {
xywh {0 110 775 335} box BORDER_BOX
class ControlsPanel
} {}
}
Fl_Group {subPanels_[kPanelSettings]} {
xywh {0 110 825 360}
xywh {0 110 775 335}
class LogicalGroup
} {
Fl_Group {} {open
xywh {5 110 790 300} box ROUNDED_BOX
class RoundedGroup
xywh {0 110 775 335} box BORDER_BOX
class SquaredGroup
} {
Fl_Spinner oversamplingSlider_ {
comment {tag=kTagSetOversampling}
xywh {175 195 70 25} labelsize 14 textsize 14
xywh {180 195 70 25}
class ValueMenu
}
Fl_Box {} {
label Oversampling
xywh {20 195 85 25} labelsize 14 align 20
xywh {10 195 85 25} align 20
class Label
}
Fl_Box {} {
label {Preload size}
xywh {20 170 75 25} labelsize 14 align 20
xywh {10 170 75 25} align 20
class Label
}
Fl_Spinner preloadSizeSlider_ {
comment {tag=kTagSetPreloadSize}
xywh {175 170 70 25} labelsize 14 textsize 14
xywh {180 170 70 25}
class ValueMenu
}
Fl_Spinner sampleQualitySlider_ {
comment {tag=kTagSetSampleQuality}
xywh {435 145 80 25} labelsize 14 textsize 14
xywh {430 145 80 25}
class ValueMenu
}
Fl_Box {} {
label Sample
xywh {290 145 50 25} labelsize 14 align 20
xywh {270 145 50 25} align 20
class Label
}
Fl_Box {} {
label Oscillator
xywh {290 195 60 25} labelsize 14 align 20
xywh {270 195 60 25} align 20
class Label
}
Fl_Spinner oscillatorQualitySlider_ {
comment {tag=kTagSetOscillatorQuality}
xywh {435 195 80 25} labelsize 14 textsize 14
xywh {430 195 80 25}
class ValueMenu
}
Fl_Spinner themeMenu_ {
comment {tag=kTagThemeMenu}
xywh {680 145 100 25} labelsize 14 textsize 14
xywh {665 145 100 25}
class OptionMenu
}
Fl_Box {} {
label Theme
xywh {555 145 45 25} labelsize 14 align 20
xywh {525 145 45 25} align 20
class Label
}
Fl_Box {} {
label {User SFZ folder}
xywh {555 170 95 25} labelsize 14 align 20
xywh {525 170 95 25} align 20
class Label
}
Fl_Button userFilesDirButton_ {
label DefaultPath
comment {tag=kTagChooseUserFilesDir}
xywh {680 170 100 25} labelsize 14
xywh {665 170 100 25}
class ValueButton
}
Fl_Box {} {
label {Root key}
xywh {555 285 60 25} labelsize 14 align 20
xywh {525 310 60 25} align 20
class Label
}
Fl_Box {} {
label Frequency
xywh {555 310 70 25} labelsize 14 align 20
xywh {525 335 70 25} align 20
class Label
}
Fl_Dial stretchedTuningSlider_ {
comment {tag=kTagSetStretchedTuning}
xywh {720 337 48 48} value 0.5
xywh {700 360 48 48} value 0.5
class StyledKnob
}
Fl_Box {} {
label Stretch
xywh {555 345 50 25} labelsize 14 align 20
xywh {525 370 50 25} align 20
class Label
}
Fl_Box {} {
label {Scala file}
xywh {555 260 60 25} labelsize 14 align 20
xywh {525 285 60 25} align 20
class Label
}
Fl_Button scalaFileButton_ {
label DefaultScale
comment {tag=kTagLoadScalaFile}
xywh {655 260 100 25} labelsize 14
xywh {624 285 100 25}
class ValueButton
}
Fl_Spinner scalaRootKeySlider_ {
comment {tag=kTagSetScalaRootKey}
xywh {715 285 35 25} labelsize 14 textsize 14
xywh {685 310 35 25}
class ValueMenu
}
Fl_Spinner scalaRootOctaveSlider_ {
comment {tag=kTagSetScalaRootKey}
xywh {750 285 30 25} labelsize 14 textsize 14
xywh {720 310 30 25}
class ValueMenu
}
Fl_Button scalaResetButton_ {
comment {tag=kTagResetScalaFile}
xywh {755 260 25 25} labelsize 14
xywh {725 285 25 25}
class ResetSomethingButton
}
Fl_Box {} {
label {... when freewheeling}
xywh {290 170 145 25} labelsize 14 align 20
label {when freewheeling}
xywh {270 170 145 25} align 20
class Label
}
Fl_Spinner freewheelingSampleQualitySlider_ {
comment {tag=kTagSetFreewheelingSampleQuality}
xywh {435 170 80 25} labelsize 14 textsize 14
xywh {430 170 80 25}
class ValueMenu
}
Fl_Box {} {
label {Sustain cancels release}
xywh {20 220 145 25} labelsize 14 align 20
xywh {10 220 145 25} align 20
class Label
}
Fl_Check_Button sustainCancelsReleaseCheckbox_ {
comment {tag=kTagSetSustainCancelsRelease}
xywh {200 220 25 25} down_box DOWN_BOX
xywh {180 220 25 25} down_box DOWN_BOX
class Checkbox
}
Fl_Box sfizzVersionLabel_ {
label SFIZZ_VERSION
xywh {20 145 225 20} labelsize 14
xywh {10 145 225 20}
class Label
}
Fl_Box {} {
label {Rendering quality}
xywh {290 115 110 25} labelsize 14 align 20
xywh {270 115 110 25} align 20
class Label
}
Fl_Box {} {
label {Separator 2}
xywh {20 135 225 5} box BORDER_BOX labeltype NO_LABEL
xywh {10 135 240 5} box BORDER_BOX labeltype NO_LABEL
class HLine
}
Fl_Box {} {
label {Engine options}
xywh {20 115 95 25} labelsize 14 align 20
xywh {10 115 95 25} align 20
class Label
}
Fl_Box {} {
label {Separator 2}
xywh {580 135 185 5} box BORDER_BOX labeltype NO_LABEL
class HLine
}
Fl_Box {} {
label Other
xywh {555 115 40 25} labelsize 14 align 20
xywh {525 115 40 25} align 20
class Label
}
Fl_Box {} {
label Tuning
xywh {555 230 225 25} labelsize 14 align 20
xywh {525 255 225 25} align 20
class Label
}
Fl_Box {} {
label {Separator 2}
xywh {290 135 225 5} box BORDER_BOX labeltype NO_LABEL
label {Separator Rendering}
xywh {270 135 239 5} box BORDER_BOX labeltype NO_LABEL
class HLine
}
Fl_Box {} {
label {Separator 2}
xywh {555 135 225 5} box BORDER_BOX labeltype NO_LABEL
label {Separator Other}
xywh {525 135 240 5} box BORDER_BOX labeltype NO_LABEL
class HLine
}
Fl_Box {} {
label {Separator 2}
xywh {555 250 225 5} box BORDER_BOX labeltype NO_LABEL
label {Separator Tuning}
xywh {525 275 225 5} box BORDER_BOX labeltype NO_LABEL
class HLine
}
Fl_Button tuningFrequencyDropdown_ {
comment {tag=kTagSetTuningFrequency}
xywh {755 310 25 25} labelsize 24
xywh {725 335 25 25} labelsize 24
class ChevronValueDropDown
}
Fl_Text_Editor tuningFrequencyEdit_ {
comment {tag=kTagSetTuningFrequency}
xywh {695 310 60 25} labelsize 14
xywh {665 335 60 25}
class TextEdit
}
Fl_Box {} {
label {... when freewheeling}
xywh {290 220 145 25} labelsize 14 align 20
label {when freewheeling}
xywh {270 220 145 25} align 20
class Label
}
Fl_Spinner freewheelingOscillatorQualitySlider_ {
comment {tag=kTagSetFreewheelingOscillatorQuality}
xywh {435 220 80 25} labelsize 14 textsize 14
xywh {430 220 80 25}
class ValueMenu
}
Fl_Box {} {
label Zoom
xywh {555 195 95 25} labelsize 12 align 20
xywh {525 195 95 25} align 20
class Label
}
Fl_Spinner zoomMenu_ {
comment {tag=kTagZoomMenu}
xywh {680 195 100 25} labelsize 12 textsize 12
xywh {665 195 100 25}
class OptionMenu
}
Fl_Button defaultZoomButton_ {
label {Set Default}
comment {tag=kTagSetDefaultZoom}
xywh {680 220 100 25} labelsize 12
xywh {665 220 100 25}
class ValueButton
}
}
}
Fl_Box piano_ {
xywh {0 410 800 70} labelsize 16
xywh {0 445 775 70} labelsize 16
class Piano
}
Fl_Group {subPanels_[kPanelGeneral]} {
xywh {5 110 790 300} hide
xywh {0 110 775 335} hide
class LogicalGroup
} {}
Fl_Box lblHover_ {
comment {palette=invertedPalette} selected
xywh {5 105 170 25} labelsize 14 hide
comment {palette=invertedPalette}
xywh {5 105 170 25} hide
class HoverBox
}
}

View file

@ -6,6 +6,7 @@
#include "DlgAbout.h"
#include "GUIComponents.h"
#include "GUIDefs.h"
#include "GitBuildId.h"
#include "NativeHelpers.h"
@ -15,23 +16,25 @@
#include <absl/strings/str_cat.h>
using namespace gui;
SAboutDialog::SAboutDialog(const CRect& bounds)
: CViewContainer(bounds)
{
SharedPointer<CBitmap> logo = owned(new CBitmap("logo_orange.png"));
setBackgroundColor(CColor(0x00, 0x00, 0x00, 0xc0));
setBackgroundColor(kColorControlsScrollerTransparency);
CView* aboutView = nullptr;
{
auto createaboutView = [](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
CViewContainer* container = new CViewContainer(bounds);
container->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00));
container->setBackgroundColor(kColorTransparent);
return container;
};
auto createLogo = [&logo](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
CViewContainer* container = new CViewContainer(bounds);
container->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00));
container->setBackgroundColor(kColorTransparent);
container->setBackground(logo);
return container;
};
@ -40,9 +43,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds);
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFont(font);
lbl->setFontColor(CColor(0xff, 0xff, 0xff, 0xff));
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFontColor(kWhiteCColor);
lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align);
const char* version = SFIZZ_VERSION;
@ -62,9 +65,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds);
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFont(font);
lbl->setFontColor(CColor(0xff, 0xff, 0xff, 0xff));
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFontColor(kWhiteCColor);
lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align);
lbl->setText(absl::StrCat(
u8"Maintainers: Paul Ferrand, Jean-Pierre Cimalando\n"
@ -77,9 +80,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
auto createHoverBox = [](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label);
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFontColor(CColor(0xfd, 0x98, 0x00, 0xff));
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFontColor(kColorOrange);
lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align);
lbl->setFont(font);
return lbl;
@ -89,9 +92,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds);
auto font = makeOwned<CFontDesc>("Roboto", fontsize, kBoldFace);
lbl->setFont(font);
lbl->setFontColor(CColor(0xfd, 0x98, 0x00, 0xff));
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFontColor(kColorOrange);
lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align);
lbl->setText(label);
return lbl;
@ -101,9 +104,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
CMultiLineTextLabel* lbl = new CMultiLineTextLabel(bounds);
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFont(font);
lbl->setFontColor(CColor(0xff, 0xff, 0xff, 0xff));
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFontColor(kWhiteCColor);
lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(kColorTransparent);
lbl->setHoriAlign(align);
lbl->setText(label);
return lbl;
@ -113,9 +116,9 @@ SAboutDialog::SAboutDialog(const CRect& bounds)
STextButton* btn = new STextButton(bounds, this, tag, glyph);
btn->setFont(makeOwned<CFontDesc>("Sfizz Misc Icons", fontsize));
btn->setTextColor(kWhiteCColor);
btn->setHighlightColor(CColor(0xfd, 0x98, 0x00, 0xff));
btn->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
btn->setFrameColorHighlighted(CColor(0x00, 0x00, 0x00, 0x00));
btn->setHighlightColor(kColorOrange);
btn->setFrameColor(kColorTransparent);
btn->setFrameColorHighlighted(kColorTransparent);
btn->setGradient(nullptr);
btn->setGradientHighlighted(nullptr);
return btn;

View file

@ -54,6 +54,7 @@ enum class EditId : int {
UIZoom,
//
BackgroundImage,
ControlsImage,
//
PluginFormat,
PluginHost,

View file

@ -7,6 +7,7 @@
#include "Editor.h"
#include "EditorController.h"
#include "EditIds.h"
#include "GUIDefs.h"
#include "GUIComponents.h"
#include "GUIHelpers.h"
#include "GUIPiano.h"
@ -44,9 +45,10 @@
#include "utility/vstgui_after.h"
using namespace VSTGUI;
using namespace gui;
const int Editor::viewWidth { 800 };
const int Editor::viewHeight { 475 };
const int Editor::viewWidth { 775 };
const int Editor::viewHeight { 515 };
struct Editor::Impl : EditorController::Receiver,
public IControlListener,
@ -178,6 +180,7 @@ struct Editor::Impl : EditorController::Receiver,
SharedPointer<CBitmap> backgroundBitmap_;
SharedPointer<CBitmap> defaultBackgroundBitmap_;
SharedPointer<CBitmap> controlsBitmap_;
CTextLabel* sfizzVersionLabel_ = nullptr;
@ -256,6 +259,7 @@ struct Editor::Impl : EditorController::Receiver,
void updateSWLastCurrent(int sw);
void updateSWLastLabel(unsigned sw, const char* label);
void updateBackgroundImage(const char* filepath);
void updateControlsImage(const char* filepath);
void updateMemoryUsed(uint64_t mem);
// edition of CC by UI
@ -366,9 +370,9 @@ void Editor::close()
SLevelMeter* Editor::Impl::createVMeter(const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
SLevelMeter* meter = new SLevelMeter(bounds);
Palette* palette = &theme_->invertedPalette;
meter->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
meter->setNormalFillColor(CColor(0x00, 0xaa, 0x11));
meter->setDangerFillColor(CColor(0xaa, 0x00, 0x00));
meter->setFrameColor(kColorTransparent);
meter->setNormalFillColor(kColorMeterNormal);
meter->setDangerFillColor(kColorMeterDanger);
meter->setBackColor(palette->knobInactiveTrack);
return meter;
};
@ -574,6 +578,12 @@ void Editor::Impl::uiReceiveValue(EditId id, const EditValue& v)
updateBackgroundImage(value.c_str());
}
break;
case EditId::ControlsImage:
{
const std::string& value = v.to_string();
updateControlsImage(value.c_str());
}
break;
case EditId::PluginOutputs:
{
const int value = static_cast<int>(v.to_float());
@ -726,6 +736,7 @@ void Editor::Impl::createFrameContents()
defaultBackgroundBitmap_ = background;
backgroundBitmap_ = background;
controlsBitmap_ = nullptr;
{
theme = new Theme;
@ -742,7 +753,7 @@ void Editor::Impl::createFrameContents()
auto createLogicalGroup = [](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
CViewContainer* container = new CViewContainer(bounds);
container->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00));
container->setBackgroundColor(kColorTransparent);
return container;
};
auto createRoundedGroup = [this, &palette](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
@ -753,14 +764,19 @@ void Editor::Impl::createFrameContents()
});
return box;
};
#if 0
auto createSquaredGroup = [this, &palette](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
auto* box = new SBoxContainer(bounds);
auto* box = new CViewContainer(bounds);
OnThemeChanged.push_back([box, palette]() {
box->setBackgroundColor(palette->boxBackground);
});
return box;
};
auto createSquaredTransparentGroup = [](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
auto* box = new CViewContainer(bounds);
box->setBackgroundColor(kColorInfoTransparency);
return box;
};
#if 0
auto createTitleGroup = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign, int fontsize) {
auto* box = new STitleContainer(bounds, label);
box->setCornerRadius(10.0);
@ -783,8 +799,8 @@ void Editor::Impl::createFrameContents()
};
auto createLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(kColorTransparent);
OnThemeChanged.push_back([lbl, palette]() {
lbl->setFontColor(palette->text);
});
@ -793,10 +809,20 @@ void Editor::Impl::createFrameContents()
lbl->setFont(font);
return lbl;
};
auto createInfoLabel = [](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label);
lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(kColorTransparent);
lbl->setFontColor(kWhiteCColor);
lbl->setHoriAlign(align);
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFont(font);
return lbl;
};
auto createInactiveLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(kColorTransparent);
OnThemeChanged.push_back([lbl, palette]() {
lbl->setFontColor(palette->inactiveText);
});
@ -816,8 +842,8 @@ void Editor::Impl::createFrameContents()
};
auto createValueLabel = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFrameColor(kColorTransparent);
lbl->setBackColor(kColorTransparent);
OnThemeChanged.push_back([lbl, palette]() {
lbl->setFontColor(palette->text);
});
@ -828,7 +854,7 @@ void Editor::Impl::createFrameContents()
};
auto createBadge = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label);
lbl->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFrameColor(kColorTransparent);
OnThemeChanged.push_back([lbl, palette]() {
lbl->setBackColor(palette->valueBackground);
lbl->setFontColor(palette->valueText);
@ -851,9 +877,9 @@ void Editor::Impl::createFrameContents()
button->setInactiveColor(palette->inactiveText);
button->setHighlightColor(palette->highlightedText);
});
button->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
button->setFrameColorHighlighted(CColor(0x00, 0x00, 0x00, 0x00));
SharedPointer<CGradient> gradient = owned(CGradient::create(0.0, 1.0, CColor(0x00, 0x00, 0x00, 0x00), CColor(0x00, 0x00, 0x00, 0x00)));
button->setFrameColor(kColorTransparent);
button->setFrameColorHighlighted(kColorTransparent);
SharedPointer<CGradient> gradient = owned(CGradient::create(0.0, 1.0, kColorTransparent, kColorTransparent));
button->setGradient(gradient);
button->setGradientHighlighted(gradient);
return button;
@ -871,8 +897,8 @@ void Editor::Impl::createFrameContents()
button->setGradient(gradient);
button->setGradientHighlighted(gradient);
});
button->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
button->setFrameColorHighlighted(CColor(0x00, 0x00, 0x00, 0x00));
button->setFrameColor(kColorTransparent);
button->setFrameColorHighlighted(kColorTransparent);
return button;
};
auto createValueMenu = [this, &palette](const CRect& bounds, int tag, const char*, CHoriTxtAlign align, int fontsize) {
@ -884,7 +910,7 @@ void Editor::Impl::createFrameContents()
vm->setFontColor(palette->valueText);
vm->setBackColor(palette->valueBackground);
});
vm->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
vm->setFrameColor(kColorTransparent);
vm->setStyle(CParamDisplay::kRoundRectStyle);
vm->setRoundRectRadius(5.0);
return vm;
@ -898,7 +924,7 @@ void Editor::Impl::createFrameContents()
cb->setFontColor(palette->valueText);
cb->setBackColor(palette->valueBackground);
});
cb->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
cb->setFrameColor(kColorTransparent);
cb->setStyle(CParamDisplay::kRoundRectStyle);
cb->setRoundRectRadius(5.0);
return cb;
@ -906,11 +932,20 @@ void Editor::Impl::createFrameContents()
auto createHoverBox = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign align, int fontsize) {
CTextLabel* lbl = new CTextLabel(bounds, label);
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
#if 0
OnThemeChanged.push_back([lbl, palette]() {
lbl->setFontColor(palette->valueText);
lbl->setBackColor(palette->valueBackground);
lbl->setFrameColor(palette->valueText);
});
#else
// XP-style tooltips: Theme-based tooltips are nearly unreadable
lbl->setFontColor(kBlackCColor);
lbl->setBackColor(kColorTooltipBackground);
lbl->setFrameColor(kBlackCColor);
lbl->setStyle(CParamDisplay::kRoundRectStyle);
lbl->setRoundRectRadius(5.0);
#endif
lbl->setHoriAlign(align);
lbl->setFont(font);
lbl->setAutosizeFlags(kAutosizeAll);
@ -923,8 +958,8 @@ void Editor::Impl::createFrameContents()
btn->setTextColor(palette->icon);
btn->setHighlightColor(palette->iconHighlight);
});
btn->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
btn->setFrameColorHighlighted(CColor(0x00, 0x00, 0x00, 0x00));
btn->setFrameColor(kColorTransparent);
btn->setFrameColorHighlighted(kColorTransparent);
btn->setGradient(nullptr);
btn->setGradientHighlighted(nullptr);
return btn;
@ -990,8 +1025,8 @@ void Editor::Impl::createFrameContents()
menu->setFontColor(palette->icon);
menu->setHoverColor(palette->iconHighlight);
});
menu->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
menu->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
menu->setFrameColor(kColorTransparent);
menu->setBackColor(kColorTransparent);
return menu;
};
auto createChevronValueDropDown = [this, &palette](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int fontsize) {
@ -1005,8 +1040,8 @@ void Editor::Impl::createFrameContents()
menu->setFontColor(palette->icon);
menu->setHoverColor(palette->iconHighlight);
});
menu->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
menu->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
menu->setFrameColor(kColorTransparent);
menu->setBackColor(kColorTransparent);
return menu;
};
auto createKnob48 = [this, &knob48](const CRect& bounds, int tag, const char*, CHoriTxtAlign, int) {
@ -1052,19 +1087,21 @@ void Editor::Impl::createFrameContents()
auto createControlsPanel = [this, &palette](const CRect& bounds, int, const char*, CHoriTxtAlign, int fontsize) {
auto* panel = new SControlsPanel(bounds);
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
panel->setNameLabelFont(font);
panel->setKnobFont(font);
panel->setCCLabelFont(font);
panel->setKnobFont(font);
panel->setKnobFontColor(kWhiteCColor);
panel->setKnobLineIndicatorColor(kWhiteCColor);
panel->setKnobRotatorColor(kColorControlsTransparency);
panel->setNameLabelFont(font);
panel->setNameLabelFontColor(kWhiteCColor);
panel->setNameLabelBackColor(kColorControlsTransparency);
OnThemeChanged.push_back([panel, palette]() {
panel->setNameLabelFontColor(palette->knobText);
panel->setValueEditFontColor(palette->knobText);
auto shadingColor = palette->knobText;
shadingColor.alpha = 70;
panel->setShadingRectangleColor(shadingColor);
panel->setCCLabelFontColor(palette->knobLabelText);
panel->setCCLabelBackColor(palette->knobLabelBackground);
panel->setKnobFontColor(palette->knobText);
panel->setKnobLineIndicatorColor(palette->knobLineIndicator);
panel->setKnobActiveTrackColor(palette->knobActiveTrack);
panel->setKnobInactiveTrackColor(palette->knobInactiveTrack);
});
@ -1081,7 +1118,7 @@ void Editor::Impl::createFrameContents()
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
edit->setFont(font);
edit->setHoriAlign(align);
edit->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
edit->setFrameColor(kColorTransparent);
edit->setStyle(CParamDisplay::kRoundRectStyle);
edit->setRoundRectRadius(5.0);
OnThemeChanged.push_back([edit, palette]() {
@ -1112,7 +1149,7 @@ void Editor::Impl::createFrameContents()
CViewContainer* box = new CViewContainer(bounds);
mainView->addView(box);
box->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0xc0));
box->setBackgroundColor(kColorTransparentDark);
CRect textSize = CRect(0, 0, 400, 80).centerInside(bounds);
CMultiLineTextLabel* textLabel = new CMultiLineTextLabel(textSize);
@ -1927,6 +1964,17 @@ void Editor::Impl::updateBackgroundImage(const char* filepath)
applyBackgroundForCurrentPanel();
}
void Editor::Impl::updateControlsImage(const char* filepath)
{
controlsBitmap_ = loadAnyFormatImage(filepath);
if (!controlsBitmap_) {
return;
}
applyBackgroundForCurrentPanel();
}
void Editor::Impl::setupCurrentPanel()
{
for (unsigned i = 0; i < kNumPanels; ++i) {
@ -1940,10 +1988,19 @@ void Editor::Impl::setupCurrentPanel()
void Editor::Impl::applyBackgroundForCurrentPanel()
{
CBitmap* bitmap;
if (activePanel_ == kPanelGeneral)
imageContainer_->setBackgroundColor(theme_->frameBackground);
if (activePanel_ == kPanelGeneral || activePanel_ == kPanelInfo) {
bitmap = backgroundBitmap_;
else
bitmap = defaultBackgroundBitmap_;
} else if (activePanel_ == kPanelControls) {
bitmap = controlsBitmap_;
if (!controlsBitmap_) {
imageContainer_->setBackground(nullptr);
return;
}
} else {
return;
}
downscaleToWidthAndHeight(bitmap, imageContainer_->getViewSize().getSize());

View file

@ -4,6 +4,7 @@
// license. You should have receive a LICENSE.md file along with the code.
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
#include "GUIDefs.h"
#include "GUIComponents.h"
#include "ColorHelpers.h"
#include <complex>
@ -17,11 +18,13 @@
#include "utility/vstgui_after.h"
#include "absl/strings/numbers.h"
using namespace gui;
///
SBoxContainer::SBoxContainer(const CRect& size)
: CViewContainer(size)
{
CViewContainer::setBackgroundColor(CColor(0, 0, 0, 0));
CViewContainer::setBackgroundColor(kColorTransparent);
}
void SBoxContainer::setCornerRadius(CCoord radius)
@ -529,6 +532,14 @@ void SStyledKnob::setLineIndicatorColor(const CColor& color)
invalid();
}
void SStyledKnob::setRotatorColor(const CColor &color)
{
if (rotatorColor_ == color)
return;
rotatorColor_ = color;
invalid();
}
void SStyledKnob::setFont(CFontRef font)
{
if (font_ == font)
@ -570,8 +581,19 @@ void SStyledKnob::draw(CDrawContext* dc)
rect.centerInside(bounds);
rect.extend(-lineWidth, -lineWidth);
CRect knobRect(rect);
knobRect.centerInside(bounds);
knobRect.extend(-lineWidth, -lineWidth);
SharedPointer<CGraphicsPath> path;
// rotator
path = owned(dc->createGraphicsPath());
path->addEllipse(knobRect);
dc->setFillColor(rotatorColor_);
dc->drawGraphicsPath(path, CDrawContext::kPathFilled);
// inactive track
path = owned(dc->createGraphicsPath());
path->addArc(rect, angle1, angle2, true);
@ -644,24 +666,26 @@ SKnobCCBox::SKnobCCBox(const CRect& size, IControlListener* listener, int32_t ta
menuEntry_(makeOwned<CMenuItem>("Use HDCC", tag)),
menuListener_(owned(new MenuListener(*this)))
{
setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00));
setBackgroundColor(kColorTransparent);
label_->setText("Parameter");
label_->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
label_->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
label_->setFontColor(CColor(0x00, 0x00, 0x00, 0xff));
label_->setBackColor(kColorTransparent);
label_->setFrameColor(kColorTransparent);
label_->setFontColor(kBlackCColor);
label_->setStyle(CParamDisplay::kRoundRectStyle);
label_->setRoundRectRadius(5.0);
knob_->setLineIndicatorColor(CColor(0x00, 0x00, 0x00, 0xff));
knob_->setLineIndicatorColor(kBlackCColor);
ccLabel_->setText("CC 1");
ccLabel_->setStyle(CParamDisplay::kRoundRectStyle);
ccLabel_->setRoundRectRadius(5.0);
ccLabel_->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
ccLabel_->setFontColor(CColor(0xff, 0xff, 0xff));
ccLabel_->setFrameColor(kColorTransparent);
ccLabel_->setFontColor(kWhiteCColor);
valueEdit_->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
valueEdit_->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
valueEdit_->setFontColor(CColor(0x00, 0x00, 0x00, 0xff));
valueEdit_->setBackColor(kColorTransparent);
valueEdit_->setFrameColor(kColorTransparent);
valueEdit_->setFontColor(kBlackCColor);
valueEdit_->registerViewListener(this);
setHDMode(false);
valueEdit_->setVisible(false);
@ -882,7 +906,7 @@ SControlsPanel::SControlsPanel(const CRect& size)
// slot 0 always exists, keep the default style on the views there
getOrCreateSlot(0);
setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00));
setBackgroundColor(kColorTransparent);
setScrollbarWidth(10.0);
@ -982,6 +1006,13 @@ void SControlsPanel::setNameLabelFontColor(CColor color)
syncAllSlotStyles();
}
void SControlsPanel::setNameLabelBackColor(CColor color)
{
slots_[0]->box->setNameLabelBackColor(color);
slots_[0]->box->setValueEditBackColor(color);
syncAllSlotStyles();
}
void SControlsPanel::setCCLabelFont(CFontRef font)
{
slots_[0]->box->setCCLabelFont(font);
@ -1036,6 +1067,12 @@ void SControlsPanel::setKnobLineIndicatorColor(CColor color)
syncAllSlotStyles();
}
void SControlsPanel::setKnobRotatorColor(CColor color)
{
slots_[0]->box->setKnobRotatorColor(color);
syncAllSlotStyles();
}
void SControlsPanel::setKnobFont(CFontRef font)
{
slots_[0]->box->setKnobFont(font);
@ -1055,9 +1092,9 @@ void SControlsPanel::recalculateSubViews()
// maybe the operation just created the scroll bar
if (CScrollbar* vsb = getVerticalScrollbar()) {
// update scrollbar style
vsb->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
vsb->setBackgroundColor(CColor(0x00, 0x00, 0x00, 0x00));
vsb->setScrollerColor(CColor(0x00, 0x00, 0x00, 0x80));
vsb->setFrameColor(kColorTransparent);
vsb->setBackgroundColor(kColorTransparent);
vsb->setScrollerColor(kColorControlsScrollerTransparency);
}
}
@ -1149,6 +1186,7 @@ void SControlsPanel::syncSlotStyle(uint32_t index)
if (cur != ref) {
cur->setNameLabelFont(ref->getNameLabelFont());
cur->setNameLabelFontColor(ref->getNameLabelFontColor());
cur->setNameLabelBackColor(ref->getNameLabelBackColor());
cur->setValueEditFont(ref->getValueEditFont());
cur->setValueEditFontColor(ref->getValueEditFontColor());
@ -1162,6 +1200,7 @@ void SControlsPanel::syncSlotStyle(uint32_t index)
cur->setKnobActiveTrackColor(ref->getKnobActiveTrackColor());
cur->setKnobInactiveTrackColor(ref->getKnobInactiveTrackColor());
cur->setKnobLineIndicatorColor(ref->getKnobLineIndicatorColor());
cur->setKnobRotatorColor(ref->getKnobRotatorColor());
cur->setKnobFont(ref->getKnobFont());
cur->setKnobFontColor(ref->getKnobFontColor());
}

View file

@ -5,6 +5,7 @@
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
#pragma once
#include "GUIDefs.h"
#include <bitset>
#include <vector>
#include <memory>
@ -248,6 +249,9 @@ public:
const CColor& getLineIndicatorColor() const { return lineIndicatorColor_; }
void setLineIndicatorColor(const CColor& color);
const CColor& getRotatorColor() const { return rotatorColor_; }
void setRotatorColor(const CColor& color);
void setFont(CFontRef font);
CFontRef getFont() const { return font_; }
@ -268,6 +272,7 @@ private:
CColor activeTrackColor_;
CColor inactiveTrackColor_;
CColor lineIndicatorColor_;
CColor rotatorColor_ { gui::kColorTransparent };
bool hideValue_ { false };
SharedPointer<CFontDesc> font_ = kNormalFont;
@ -315,6 +320,9 @@ public:
void setNameLabelFontColor(CColor color) { label_->setFontColor(color); label_->invalid(); }
CColor getNameLabelFontColor() const { return label_->getFontColor(); }
void setNameLabelBackColor(CColor color) { label_->setBackColor(color); label_->invalid(); }
CColor getNameLabelBackColor() const { return label_->getBackColor(); }
void setValueEditFont(CFontRef font);
CFontRef getValueEditFont() const { return label_->getFont(); }
@ -345,6 +353,9 @@ public:
void setKnobLineIndicatorColor(CColor color) { knob_->setLineIndicatorColor(color); knob_->invalid(); }
CColor getKnobLineIndicatorColor() const { return knob_->getLineIndicatorColor(); }
void setKnobRotatorColor(CColor color) { knob_->setRotatorColor(color); knob_->invalid(); }
CColor getKnobRotatorColor() const { return knob_->getRotatorColor(); }
void setKnobFont(CFontRef font) { knob_->setFont(font); knob_->invalid(); }
CFontRef getKnobFont() const { return knob_->getFont(); }
@ -403,6 +414,7 @@ public:
void setNameLabelFont(CFontRef font);
void setNameLabelFontColor(CColor color);
void setNameLabelBackColor(CColor color);
void setCCLabelFont(CFontRef font);
void setCCLabelBackColor(CColor color);
void setCCLabelFontColor(CColor color);
@ -412,6 +424,7 @@ public:
void setKnobActiveTrackColor(CColor color);
void setKnobInactiveTrackColor(CColor color);
void setKnobLineIndicatorColor(CColor color);
void setKnobRotatorColor(CColor color);
void setKnobFont(CFontRef font);
void setKnobFontColor(CColor color);

View file

@ -0,0 +1,26 @@
// SPDX-License-Identifier: BSD-2-Clause
// This code is part of the sfizz library and is licensed under a BSD 2-clause
// license. You should have receive a LICENSE.md file along with the code.
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
#include "GUIDefs.h"
#include "utility/vstgui_before.h"
#include "vstgui/lib/ccolor.h"
#include "utility/vstgui_after.h"
namespace gui {
const CColor kColorTransparent { CColor(0x00, 0x00, 0x00, 0x00) };
const CColor kColorTransparentDark { CColor(0x00, 0x00, 0x00, 0xc0) };
const CColor kColorOrange { CColor(0xfd, 0x98, 0x00, 0xff) };
const CColor kColorControlsScrollerTransparency { CColor(0x00, 0x00, 0x00, 0x80) };
const CColor kColorControlsTransparency { CColor(0x00, 0x00, 0x00, 0x80) };
const CColor kColorInfoTransparency { CColor(0x00, 0x00, 0x00, 0x99) };
const CColor kColorMeterDanger { CColor(0xaa, 0x00, 0x00) };
const CColor kColorMeterNormal { CColor(0x00, 0xaa, 0x11) };
const CColor kColorTooltipBackground { CColor(0xff, 0xff, 0xd2, 0xff) };
}

View file

@ -0,0 +1,28 @@
// SPDX-License-Identifier: BSD-2-Clause
// This code is part of the sfizz library and is licensed under a BSD 2-clause
// license. You should have receive a LICENSE.md file along with the code.
// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
#pragma once
#include "utility/vstgui_before.h"
#include "vstgui/lib/vstguifwd.h"
#include "utility/vstgui_after.h"
using VSTGUI::CColor;
namespace gui {
extern const CColor kColorTransparent;
extern const CColor kColorTransparentDark;
extern const CColor kColorOrange;
extern const CColor kColorControlsScrollerTransparency;
extern const CColor kColorControlsTransparency;
extern const CColor kColorInfoTransparency;
extern const CColor kColorMeterDanger;
extern const CColor kColorMeterNormal;
extern const CColor kColorTooltipBackground;
}

View file

@ -1,11 +1,11 @@
/* This file is generated by the layout maker tool. */
auto* const view__0 = createLogicalGroup(CRect(0, 0, 800, 475), -1, "", kCenterText, 14);
auto* const view__0 = createLogicalGroup(CRect(0, 0, 775, 515), -1, "", kCenterText, 14);
mainView = view__0;
auto* const view__1 = createBackground(CRect(0, 110, 800, 410), -1, "", kCenterText, 14);
auto* const view__1 = createBackground(CRect(0, 110, 775, 445), -1, "", kCenterText, 14);
imageContainer_ = view__1;
view__0->addView(view__1);
enterPalette(invertedPalette);
auto* const view__2 = createLogicalGroup(CRect(0, 0, 814, 110), -1, "", kCenterText, 14);
auto* const view__2 = createLogicalGroup(CRect(0, 0, 775, 110), -1, "", kCenterText, 14);
view__0->addView(view__2);
auto* const view__3 = createRoundedGroup(CRect(5, 4, 180, 105), -1, "", kCenterText, 14);
view__2->addView(view__3);
@ -23,229 +23,225 @@ view__3->addView(view__7);
auto* const view__8 = createHomeButton(CRect(11, 69, 43, 101), kTagFirstChangePanel+kPanelGeneral, "", kCenterText, 30);
panelButtons_[kPanelGeneral] = view__8;
view__3->addView(view__8);
auto* const view__9 = createRoundedGroup(CRect(185, 5, 575, 105), -1, "", kCenterText, 14);
auto* const view__9 = createRoundedGroup(CRect(185, 5, 550, 105), -1, "", kCenterText, 14);
view__2->addView(view__9);
auto* const view__10 = createHLine(CRect(10, 36, 380, 41), -1, "", kCenterText, 14);
auto* const view__10 = createHLine(CRect(10, 35, 355, 40), -1, "", kCenterText, 14);
view__9->addView(view__10);
auto* const view__11 = createHLine(CRect(10, 68, 380, 73), -1, "", kCenterText, 14);
auto* const view__11 = createHLine(CRect(10, 70, 355, 75), -1, "", kCenterText, 14);
view__9->addView(view__11);
auto* const view__12 = createClickableLabel(CRect(10, 8, 330, 38), kTagLoadSfzFile, "DefaultInstrument.sfz", kLeftText, 20);
auto* const view__12 = createClickableLabel(CRect(10, 5, 280, 35), kTagLoadSfzFile, "DefaultInstrument.sfz", kLeftText, 20);
sfzFileLabel_ = view__12;
view__9->addView(view__12);
auto* const view__13 = createLabel(CRect(80, 40, 390, 75), -1, "", kLeftText, 20);
auto* const view__13 = createLabel(CRect(70, 40, 355, 70), -1, "", kLeftText, 20);
keyswitchLabel_ = view__13;
view__9->addView(view__13);
auto* const view__14 = createBadge(CRect(10, 42, 70, 68), -1, "", kCenterText, 20);
keyswitchBadge_ = view__14;
view__9->addView(view__14);
auto* const view__15 = createInactiveLabel(CRect(10, 40, 370, 70), -1, "No key switch", kLeftText, 20);
auto* const view__15 = createInactiveLabel(CRect(10, 40, 355, 70), -1, "No key switch", kLeftText, 20);
keyswitchInactiveLabel_ = view__15;
view__9->addView(view__15);
view__15->setVisible(false);
auto* const view__16 = createLabel(CRect(10, 73, 70, 98), -1, "Voices:", kRightText, 14);
view__9->addView(view__16);
auto* const view__17 = createPreviousFileButton(CRect(303, 13, 328, 38), kTagPreviousSfzFile, "", kCenterText, 24);
auto* const view__17 = createPreviousFileButton(CRect(280, 10, 305, 35), kTagPreviousSfzFile, "", kCenterText, 24);
view__9->addView(view__17);
auto* const view__18 = createNextFileButton(CRect(328, 13, 353, 38), kTagNextSfzFile, "", kCenterText, 24);
auto* const view__18 = createNextFileButton(CRect(305, 10, 330, 35), kTagNextSfzFile, "", kCenterText, 24);
view__9->addView(view__18);
auto* const view__19 = createChevronDropDown(CRect(353, 13, 378, 38), kTagFileOperations, "", kCenterText, 24);
auto* const view__19 = createChevronDropDown(CRect(330, 10, 355, 35), kTagFileOperations, "", kCenterText, 24);
fileOperationsMenu_ = view__19;
view__9->addView(view__19);
auto* const view__20 = createLabel(CRect(75, 73, 115, 98), -1, "", kCenterText, 14);
auto* const view__20 = createLabel(CRect(70, 73, 110, 98), -1, "", kCenterText, 14);
infoVoicesLabel_ = view__20;
view__9->addView(view__20);
auto* const view__21 = createLabel(CRect(137, 73, 177, 98), -1, "Max:", kRightText, 14);
auto* const view__21 = createLabel(CRect(130, 73, 170, 98), -1, "Max:", kRightText, 14);
view__9->addView(view__21);
auto* const view__22 = createLabel(CRect(193, 73, 228, 98), -1, "", kCenterText, 14);
auto* const view__22 = createLabel(CRect(170, 73, 205, 98), -1, "", kCenterText, 14);
numVoicesLabel_ = view__22;
view__9->addView(view__22);
auto* const view__23 = createLabel(CRect(271, 73, 331, 98), -1, "Memory:", kRightText, 14);
auto* const view__23 = createLabel(CRect(245, 73, 305, 98), -1, "Memory:", kRightText, 14);
view__9->addView(view__23);
auto* const view__24 = createLabel(CRect(337, 73, 387, 98), -1, "", kCenterText, 14);
auto* const view__24 = createLabel(CRect(305, 73, 355, 98), -1, "", kCenterText, 14);
memoryLabel_ = view__24;
view__9->addView(view__24);
auto* const view__25 = createChevronValueDropDown(CRect(235, 77, 255, 97), kTagSetNumVoices, "", kCenterText, 16);
auto* const view__25 = createChevronValueDropDown(CRect(205, 77, 225, 97), kTagSetNumVoices, "", kCenterText, 16);
numVoicesSlider_ = view__25;
view__9->addView(view__25);
auto* const view__26 = createRoundedGroup(CRect(580, 5, 795, 105), -1, "", kCenterText, 14);
auto* const view__26 = createRoundedGroup(CRect(555, 5, 770, 105), -1, "", kCenterText, 14);
view__2->addView(view__26);
auto* const view__27 = createKnob48(CRect(7, 15, 55, 63), -1, "", kCenterText, 14);
auto* const view__27 = createKnob48(CRect(32, 15, 80, 63), -1, "", kCenterText, 14);
view__26->addView(view__27);
view__27->setVisible(false);
auto* const view__28 = createValueLabel(CRect(2, 65, 62, 70), -1, "Center", kCenterText, 14);
auto* const view__28 = createValueLabel(CRect(27, 65, 87, 70), -1, "Center", kCenterText, 14);
view__26->addView(view__28);
view__28->setVisible(false);
auto* const view__29 = createKnobCCBox(CRect(6, 5, 76, 95), kTagSetCCVolume, "Volume", kCenterText, 14);
auto* const view__29 = createKnobCCBox(CRect(5, 5, 75, 95), kTagSetCCVolume, "Volume", kCenterText, 14);
volumeCCKnob_ = view__29;
view__26->addView(view__29);
auto* const view__30 = createKnobCCBox(CRect(83, 5, 153, 95), kTagSetCCPan, "Pan", kCenterText, 14);
auto* const view__30 = createKnobCCBox(CRect(80, 5, 150, 95), kTagSetCCPan, "Pan", kCenterText, 14);
panCCKnob_ = view__30;
view__26->addView(view__30);
auto* const view__31 = createVMeter(CRect(159, 5, 182, 95), -1, "", kCenterText, 14);
auto* const view__31 = createVMeter(CRect(155, 5, 178, 95), -1, "", kCenterText, 14);
meters_[0] = view__31;
view__26->addView(view__31);
auto* const view__32 = createVMeter(CRect(183, 5, 206, 95), -1, "", kCenterText, 14);
auto* const view__32 = createVMeter(CRect(185, 5, 208, 95), -1, "", kCenterText, 14);
meters_[1] = view__32;
view__26->addView(view__32);
enterPalette(defaultPalette);
auto* const view__33 = createLogicalGroup(CRect(5, 110, 795, 410), -1, "", kCenterText, 14);
auto* const view__33 = createLogicalGroup(CRect(0, 110, 775, 445), -1, "", kCenterText, 14);
subPanels_[kPanelInfo] = view__33;
view__0->addView(view__33);
view__33->setVisible(false);
auto* const view__34 = createRoundedGroup(CRect(0, 0, 790, 300), -1, "", kCenterText, 14);
auto* const view__34 = createSquaredTransparentGroup(CRect(0, 0, 775, 335), -1, "", kCenterText, 14);
view__33->addView(view__34);
auto* const view__35 = createLabel(CRect(15, 10, 75, 35), -1, "Curves:", kLeftText, 14);
auto* const view__35 = createInfoLabel(CRect(20, 10, 80, 35), -1, "Curves:", kLeftText, 14);
view__34->addView(view__35);
auto* const view__36 = createLabel(CRect(15, 35, 75, 60), -1, "Masters:", kLeftText, 14);
auto* const view__36 = createInfoLabel(CRect(20, 35, 80, 60), -1, "Masters:", kLeftText, 14);
view__34->addView(view__36);
auto* const view__37 = createLabel(CRect(15, 60, 75, 85), -1, "Groups:", kLeftText, 14);
auto* const view__37 = createInfoLabel(CRect(20, 60, 80, 85), -1, "Groups:", kLeftText, 14);
view__34->addView(view__37);
auto* const view__38 = createLabel(CRect(15, 85, 75, 110), -1, "Regions:", kLeftText, 14);
auto* const view__38 = createInfoLabel(CRect(20, 85, 80, 110), -1, "Regions:", kLeftText, 14);
view__34->addView(view__38);
auto* const view__39 = createLabel(CRect(15, 110, 75, 135), -1, "Samples:", kLeftText, 14);
auto* const view__39 = createInfoLabel(CRect(20, 110, 80, 135), -1, "Samples:", kLeftText, 14);
view__34->addView(view__39);
auto* const view__40 = createLabel(CRect(115, 10, 155, 35), -1, "0", kCenterText, 14);
auto* const view__40 = createInfoLabel(CRect(120, 10, 160, 35), -1, "0", kCenterText, 14);
infoCurvesLabel_ = view__40;
view__34->addView(view__40);
auto* const view__41 = createLabel(CRect(115, 35, 155, 60), -1, "0", kCenterText, 14);
auto* const view__41 = createInfoLabel(CRect(120, 35, 160, 60), -1, "0", kCenterText, 14);
infoMastersLabel_ = view__41;
view__34->addView(view__41);
auto* const view__42 = createLabel(CRect(115, 60, 155, 85), -1, "0", kCenterText, 14);
auto* const view__42 = createInfoLabel(CRect(120, 60, 160, 85), -1, "0", kCenterText, 14);
infoGroupsLabel_ = view__42;
view__34->addView(view__42);
auto* const view__43 = createLabel(CRect(115, 85, 155, 110), -1, "0", kCenterText, 14);
auto* const view__43 = createInfoLabel(CRect(120, 85, 160, 110), -1, "0", kCenterText, 14);
infoRegionsLabel_ = view__43;
view__34->addView(view__43);
auto* const view__44 = createLabel(CRect(115, 110, 155, 135), -1, "0", kCenterText, 14);
auto* const view__44 = createInfoLabel(CRect(120, 110, 160, 135), -1, "0", kCenterText, 14);
infoSamplesLabel_ = view__44;
view__34->addView(view__44);
auto* const view__45 = createLogicalGroup(CRect(5, 110, 795, 410), -1, "", kCenterText, 14);
auto* const view__45 = createLogicalGroup(CRect(0, 110, 775, 445), -1, "", kCenterText, 14);
subPanels_[kPanelControls] = view__45;
view__0->addView(view__45);
view__45->setVisible(false);
auto* const view__46 = createRoundedGroup(CRect(0, 0, 790, 300), -1, "", kCenterText, 14);
auto* const view__46 = createControlsPanel(CRect(0, 0, 775, 335), -1, "", kCenterText, 14);
controlsPanel_ = view__46;
view__45->addView(view__46);
auto* const view__47 = createControlsPanel(CRect(0, 0, 790, 300), -1, "", kCenterText, 14);
controlsPanel_ = view__47;
view__46->addView(view__47);
auto* const view__48 = createLogicalGroup(CRect(0, 110, 825, 470), -1, "", kCenterText, 14);
subPanels_[kPanelSettings] = view__48;
view__0->addView(view__48);
auto* const view__49 = createRoundedGroup(CRect(5, 0, 795, 300), -1, "", kCenterText, 14);
auto* const view__47 = createLogicalGroup(CRect(0, 110, 775, 445), -1, "", kCenterText, 14);
subPanels_[kPanelSettings] = view__47;
view__0->addView(view__47);
auto* const view__48 = createSquaredGroup(CRect(0, 0, 775, 335), -1, "", kCenterText, 14);
view__47->addView(view__48);
auto* const view__49 = createValueMenu(CRect(180, 85, 250, 110), kTagSetOversampling, "", kCenterText, 14);
oversamplingSlider_ = view__49;
view__48->addView(view__49);
auto* const view__50 = createValueMenu(CRect(170, 85, 240, 110), kTagSetOversampling, "", kCenterText, 14);
oversamplingSlider_ = view__50;
view__49->addView(view__50);
auto* const view__51 = createLabel(CRect(15, 85, 100, 110), -1, "Oversampling", kLeftText, 14);
view__49->addView(view__51);
auto* const view__52 = createLabel(CRect(15, 60, 90, 85), -1, "Preload size", kLeftText, 14);
view__49->addView(view__52);
auto* const view__53 = createValueMenu(CRect(170, 60, 240, 85), kTagSetPreloadSize, "", kCenterText, 14);
preloadSizeSlider_ = view__53;
view__49->addView(view__53);
auto* const view__54 = createValueMenu(CRect(430, 35, 510, 60), kTagSetSampleQuality, "", kCenterText, 14);
sampleQualitySlider_ = view__54;
view__49->addView(view__54);
auto* const view__55 = createLabel(CRect(285, 35, 335, 60), -1, "Sample", kLeftText, 14);
view__49->addView(view__55);
auto* const view__56 = createLabel(CRect(285, 85, 345, 110), -1, "Oscillator", kLeftText, 14);
view__49->addView(view__56);
auto* const view__57 = createValueMenu(CRect(430, 85, 510, 110), kTagSetOscillatorQuality, "", kCenterText, 14);
oscillatorQualitySlider_ = view__57;
view__49->addView(view__57);
auto* const view__58 = createOptionMenu(CRect(675, 35, 775, 60), kTagThemeMenu, "", kCenterText, 14);
themeMenu_ = view__58;
view__49->addView(view__58);
auto* const view__59 = createLabel(CRect(550, 35, 595, 60), -1, "Theme", kLeftText, 14);
view__49->addView(view__59);
auto* const view__60 = createLabel(CRect(550, 60, 645, 85), -1, "User SFZ folder", kLeftText, 14);
view__49->addView(view__60);
auto* const view__61 = createValueButton(CRect(675, 60, 775, 85), kTagChooseUserFilesDir, "DefaultPath", kCenterText, 14);
userFilesDirButton_ = view__61;
view__49->addView(view__61);
auto* const view__62 = createLabel(CRect(550, 175, 610, 200), -1, "Root key", kLeftText, 14);
view__49->addView(view__62);
auto* const view__63 = createLabel(CRect(550, 200, 620, 225), -1, "Frequency", kLeftText, 14);
view__49->addView(view__63);
auto* const view__64 = createStyledKnob(CRect(715, 227, 763, 275), kTagSetStretchedTuning, "", kCenterText, 14);
stretchedTuningSlider_ = view__64;
view__49->addView(view__64);
auto* const view__65 = createLabel(CRect(550, 235, 600, 260), -1, "Stretch", kLeftText, 14);
view__49->addView(view__65);
auto* const view__66 = createLabel(CRect(550, 150, 610, 175), -1, "Scala file", kLeftText, 14);
view__49->addView(view__66);
auto* const view__67 = createValueButton(CRect(650, 150, 750, 175), kTagLoadScalaFile, "DefaultScale", kCenterText, 14);
scalaFileButton_ = view__67;
view__49->addView(view__67);
auto* const view__68 = createValueMenu(CRect(710, 175, 745, 200), kTagSetScalaRootKey, "", kCenterText, 14);
scalaRootKeySlider_ = view__68;
view__49->addView(view__68);
auto* const view__69 = createValueMenu(CRect(745, 175, 775, 200), kTagSetScalaRootKey, "", kCenterText, 14);
scalaRootOctaveSlider_ = view__69;
view__49->addView(view__69);
auto* const view__70 = createResetSomethingButton(CRect(750, 150, 775, 175), kTagResetScalaFile, "", kCenterText, 14);
scalaResetButton_ = view__70;
view__49->addView(view__70);
auto* const view__71 = createLabel(CRect(285, 60, 430, 85), -1, "... when freewheeling", kLeftText, 14);
view__49->addView(view__71);
auto* const view__72 = createValueMenu(CRect(430, 60, 510, 85), kTagSetFreewheelingSampleQuality, "", kCenterText, 14);
freewheelingSampleQualitySlider_ = view__72;
view__49->addView(view__72);
auto* const view__73 = createLabel(CRect(15, 110, 160, 135), -1, "Sustain cancels release", kLeftText, 14);
view__49->addView(view__73);
auto* const view__74 = createCheckbox(CRect(195, 110, 220, 135), kTagSetSustainCancelsRelease, "", kCenterText, 14);
sustainCancelsReleaseCheckbox_ = view__74;
view__49->addView(view__74);
auto* const view__75 = createLabel(CRect(15, 35, 240, 55), -1, "SFIZZ_VERSION", kCenterText, 14);
sfizzVersionLabel_ = view__75;
view__49->addView(view__75);
auto* const view__76 = createLabel(CRect(285, 5, 395, 30), -1, "Rendering quality", kLeftText, 14);
view__49->addView(view__76);
auto* const view__77 = createHLine(CRect(15, 25, 240, 30), -1, "", kCenterText, 14);
view__49->addView(view__77);
auto* const view__78 = createLabel(CRect(15, 5, 110, 30), -1, "Engine options", kLeftText, 14);
view__49->addView(view__78);
auto* const view__79 = createHLine(CRect(575, 25, 760, 30), -1, "", kCenterText, 14);
view__49->addView(view__79);
auto* const view__80 = createLabel(CRect(550, 5, 590, 30), -1, "Other", kLeftText, 14);
view__49->addView(view__80);
auto* const view__81 = createLabel(CRect(550, 120, 775, 145), -1, "Tuning", kLeftText, 14);
view__49->addView(view__81);
auto* const view__82 = createHLine(CRect(285, 25, 510, 30), -1, "", kCenterText, 14);
view__49->addView(view__82);
auto* const view__83 = createHLine(CRect(550, 25, 775, 30), -1, "", kCenterText, 14);
view__49->addView(view__83);
auto* const view__84 = createHLine(CRect(550, 140, 775, 145), -1, "", kCenterText, 14);
view__49->addView(view__84);
auto* const view__85 = createChevronValueDropDown(CRect(750, 200, 775, 225), kTagSetTuningFrequency, "", kCenterText, 24);
tuningFrequencyDropdown_ = view__85;
view__49->addView(view__85);
auto* const view__86 = createTextEdit(CRect(690, 200, 750, 225), kTagSetTuningFrequency, "", kCenterText, 14);
tuningFrequencyEdit_ = view__86;
view__49->addView(view__86);
auto* const view__87 = createLabel(CRect(285, 110, 430, 135), -1, "... when freewheeling", kLeftText, 14);
view__49->addView(view__87);
auto* const view__88 = createValueMenu(CRect(430, 110, 510, 135), kTagSetFreewheelingOscillatorQuality, "", kCenterText, 14);
freewheelingOscillatorQualitySlider_ = view__88;
view__49->addView(view__88);
auto* const view__89 = createLabel(CRect(550, 85, 645, 110), -1, "Zoom", kLeftText, 12);
view__49->addView(view__89);
auto* const view__90 = createOptionMenu(CRect(675, 85, 775, 110), kTagZoomMenu, "", kCenterText, 12);
zoomMenu_ = view__90;
view__49->addView(view__90);
auto* const view__91 = createValueButton(CRect(675, 110, 775, 135), kTagSetDefaultZoom, "Set Default", kCenterText, 12);
defaultZoomButton_ = view__91;
view__49->addView(view__91);
auto* const view__92 = createPiano(CRect(0, 410, 800, 480), -1, "", kCenterText, 16);
piano_ = view__92;
view__0->addView(view__92);
auto* const view__93 = createLogicalGroup(CRect(5, 110, 795, 410), -1, "", kCenterText, 14);
subPanels_[kPanelGeneral] = view__93;
view__0->addView(view__93);
view__93->setVisible(false);
auto* const view__50 = createLabel(CRect(10, 85, 95, 110), -1, "Oversampling", kLeftText, 14);
view__48->addView(view__50);
auto* const view__51 = createLabel(CRect(10, 60, 85, 85), -1, "Preload size", kLeftText, 14);
view__48->addView(view__51);
auto* const view__52 = createValueMenu(CRect(180, 60, 250, 85), kTagSetPreloadSize, "", kCenterText, 14);
preloadSizeSlider_ = view__52;
view__48->addView(view__52);
auto* const view__53 = createValueMenu(CRect(430, 35, 510, 60), kTagSetSampleQuality, "", kCenterText, 14);
sampleQualitySlider_ = view__53;
view__48->addView(view__53);
auto* const view__54 = createLabel(CRect(270, 35, 320, 60), -1, "Sample", kLeftText, 14);
view__48->addView(view__54);
auto* const view__55 = createLabel(CRect(270, 85, 330, 110), -1, "Oscillator", kLeftText, 14);
view__48->addView(view__55);
auto* const view__56 = createValueMenu(CRect(430, 85, 510, 110), kTagSetOscillatorQuality, "", kCenterText, 14);
oscillatorQualitySlider_ = view__56;
view__48->addView(view__56);
auto* const view__57 = createOptionMenu(CRect(665, 35, 765, 60), kTagThemeMenu, "", kCenterText, 14);
themeMenu_ = view__57;
view__48->addView(view__57);
auto* const view__58 = createLabel(CRect(525, 35, 570, 60), -1, "Theme", kLeftText, 14);
view__48->addView(view__58);
auto* const view__59 = createLabel(CRect(525, 60, 620, 85), -1, "User SFZ folder", kLeftText, 14);
view__48->addView(view__59);
auto* const view__60 = createValueButton(CRect(665, 60, 765, 85), kTagChooseUserFilesDir, "DefaultPath", kCenterText, 14);
userFilesDirButton_ = view__60;
view__48->addView(view__60);
auto* const view__61 = createLabel(CRect(525, 200, 585, 225), -1, "Root key", kLeftText, 14);
view__48->addView(view__61);
auto* const view__62 = createLabel(CRect(525, 225, 595, 250), -1, "Frequency", kLeftText, 14);
view__48->addView(view__62);
auto* const view__63 = createStyledKnob(CRect(700, 250, 748, 298), kTagSetStretchedTuning, "", kCenterText, 14);
stretchedTuningSlider_ = view__63;
view__48->addView(view__63);
auto* const view__64 = createLabel(CRect(525, 260, 575, 285), -1, "Stretch", kLeftText, 14);
view__48->addView(view__64);
auto* const view__65 = createLabel(CRect(525, 175, 585, 200), -1, "Scala file", kLeftText, 14);
view__48->addView(view__65);
auto* const view__66 = createValueButton(CRect(624, 175, 724, 200), kTagLoadScalaFile, "DefaultScale", kCenterText, 14);
scalaFileButton_ = view__66;
view__48->addView(view__66);
auto* const view__67 = createValueMenu(CRect(685, 200, 720, 225), kTagSetScalaRootKey, "", kCenterText, 14);
scalaRootKeySlider_ = view__67;
view__48->addView(view__67);
auto* const view__68 = createValueMenu(CRect(720, 200, 750, 225), kTagSetScalaRootKey, "", kCenterText, 14);
scalaRootOctaveSlider_ = view__68;
view__48->addView(view__68);
auto* const view__69 = createResetSomethingButton(CRect(725, 175, 750, 200), kTagResetScalaFile, "", kCenterText, 14);
scalaResetButton_ = view__69;
view__48->addView(view__69);
auto* const view__70 = createLabel(CRect(270, 60, 415, 85), -1, "when freewheeling", kLeftText, 14);
view__48->addView(view__70);
auto* const view__71 = createValueMenu(CRect(430, 60, 510, 85), kTagSetFreewheelingSampleQuality, "", kCenterText, 14);
freewheelingSampleQualitySlider_ = view__71;
view__48->addView(view__71);
auto* const view__72 = createLabel(CRect(10, 110, 155, 135), -1, "Sustain cancels release", kLeftText, 14);
view__48->addView(view__72);
auto* const view__73 = createCheckbox(CRect(180, 110, 205, 135), kTagSetSustainCancelsRelease, "", kCenterText, 14);
sustainCancelsReleaseCheckbox_ = view__73;
view__48->addView(view__73);
auto* const view__74 = createLabel(CRect(10, 35, 235, 55), -1, "SFIZZ_VERSION", kCenterText, 14);
sfizzVersionLabel_ = view__74;
view__48->addView(view__74);
auto* const view__75 = createLabel(CRect(270, 5, 380, 30), -1, "Rendering quality", kLeftText, 14);
view__48->addView(view__75);
auto* const view__76 = createHLine(CRect(10, 25, 250, 30), -1, "", kCenterText, 14);
view__48->addView(view__76);
auto* const view__77 = createLabel(CRect(10, 5, 105, 30), -1, "Engine options", kLeftText, 14);
view__48->addView(view__77);
auto* const view__78 = createLabel(CRect(525, 5, 565, 30), -1, "Other", kLeftText, 14);
view__48->addView(view__78);
auto* const view__79 = createLabel(CRect(525, 145, 750, 170), -1, "Tuning", kLeftText, 14);
view__48->addView(view__79);
auto* const view__80 = createHLine(CRect(270, 25, 509, 30), -1, "", kCenterText, 14);
view__48->addView(view__80);
auto* const view__81 = createHLine(CRect(525, 25, 765, 30), -1, "", kCenterText, 14);
view__48->addView(view__81);
auto* const view__82 = createHLine(CRect(525, 165, 750, 170), -1, "", kCenterText, 14);
view__48->addView(view__82);
auto* const view__83 = createChevronValueDropDown(CRect(725, 225, 750, 250), kTagSetTuningFrequency, "", kCenterText, 24);
tuningFrequencyDropdown_ = view__83;
view__48->addView(view__83);
auto* const view__84 = createTextEdit(CRect(665, 225, 725, 250), kTagSetTuningFrequency, "", kCenterText, 14);
tuningFrequencyEdit_ = view__84;
view__48->addView(view__84);
auto* const view__85 = createLabel(CRect(270, 110, 415, 135), -1, "when freewheeling", kLeftText, 14);
view__48->addView(view__85);
auto* const view__86 = createValueMenu(CRect(430, 110, 510, 135), kTagSetFreewheelingOscillatorQuality, "", kCenterText, 14);
freewheelingOscillatorQualitySlider_ = view__86;
view__48->addView(view__86);
auto* const view__87 = createLabel(CRect(525, 85, 620, 110), -1, "Zoom", kLeftText, 14);
view__48->addView(view__87);
auto* const view__88 = createOptionMenu(CRect(665, 85, 765, 110), kTagZoomMenu, "", kCenterText, 14);
zoomMenu_ = view__88;
view__48->addView(view__88);
auto* const view__89 = createValueButton(CRect(665, 110, 765, 135), kTagSetDefaultZoom, "Set Default", kCenterText, 14);
defaultZoomButton_ = view__89;
view__48->addView(view__89);
auto* const view__90 = createPiano(CRect(0, 445, 775, 515), -1, "", kCenterText, 16);
piano_ = view__90;
view__0->addView(view__90);
auto* const view__91 = createLogicalGroup(CRect(0, 110, 775, 445), -1, "", kCenterText, 14);
subPanels_[kPanelGeneral] = view__91;
view__0->addView(view__91);
view__91->setVisible(false);
enterPalette(invertedPalette);
auto* const view__94 = createHoverBox(CRect(5, 105, 175, 130), -1, "", kCenterText, 14);
lblHover_ = view__94;
view__0->addView(view__94);
view__94->setVisible(false);
auto* const view__92 = createHoverBox(CRect(5, 105, 175, 130), -1, "", kCenterText, 14);
lblHover_ = view__92;
view__0->addView(view__92);
view__92->setVisible(false);
enterPalette(defaultPalette);

View file

@ -560,7 +560,9 @@ sfizz_ui_update_description(sfizz_ui_t *self, const InstrumentDescription& desc)
const fs::path rootPath = fs::u8path(desc.rootPath);
const fs::path imagePath = rootPath / fs::u8path(desc.image);
const fs::path imageCtrlPath = rootPath / fs::u8path(desc.image_controls);
self->uiReceiveValue(EditId::BackgroundImage, imagePath.u8string());
self->uiReceiveValue(EditId::ControlsImage, imageCtrlPath.u8string());
for (unsigned key = 0; key < 128; ++key) {
bool keyUsed = desc.keyUsed.test(key);

View file

@ -238,6 +238,9 @@ bool SfizzVstEditor::processUpdate(FUnknown* changedUnknown, int32 message)
const fs::path imagePath = rootPath / fs::u8path(desc.image);
uiReceiveValue(EditId::BackgroundImage, imagePath.u8string());
const fs::path ctrlImagePath = rootPath / fs::u8path(desc.image_controls);
uiReceiveValue(EditId::ControlsImage, ctrlImagePath.u8string());
for (unsigned key = 0; key < 128; ++key) {
bool keyUsed = desc.keyUsed.test(key);
bool keyswitchUsed = desc.keyswitchUsed.test(key);

View file

@ -429,6 +429,9 @@ void Synth::Impl::handleControlOpcodes(const std::vector<Opcode>& members)
case hash("image"):
image_ = absl::StrCat(defaultPath_, absl::StrReplaceAll(trim(member.value), { { "\\", "/" } }));
break;
case hash("image_controls"):
image_controls_ = absl::StrCat(defaultPath_, absl::StrReplaceAll(trim(member.value), { { "\\", "/" } }));
break;
case hash("note_offset"):
noteOffset_ = member.read(Default::noteOffset);
break;

View file

@ -125,6 +125,10 @@ void sfz::Synth::dispatchMessage(Client& client, int delay, const char* path, co
client.receive<'s'>(delay, path, impl.image_.c_str());
} break;
MATCH("/image_controls", "") {
client.receive<'s'>(delay, path, impl.image_controls_.c_str());
} break;
//----------------------------------------------------------------------
MATCH("/sw/last/slots", "") {

View file

@ -334,6 +334,7 @@ struct Synth::Impl final: public Parser::Listener {
// Control opcodes
std::string defaultPath_ { "" };
std::string image_ { "" };
std::string image_controls_ { "" };
int noteOffset_ { Default::noteOffset };
int octaveOffset_ { Default::octaveOffset };