diff --git a/vst/SfizzVstEditor.cpp b/vst/SfizzVstEditor.cpp index 8448b218..b57af2c5 100644 --- a/vst/SfizzVstEditor.cpp +++ b/vst/SfizzVstEditor.cpp @@ -13,7 +13,7 @@ using namespace VSTGUI; -static ViewRect sfizzUiViewRect {0, 0, 684, 684}; +static ViewRect sfizzUiViewRect {0, 0, 482, 225}; SfizzVstEditor::SfizzVstEditor(void *controller) : VSTGUIEditor(controller, &sfizzUiViewRect), @@ -203,8 +203,7 @@ void SfizzVstEditor::loadSfzFile(const std::string& filePath) ctl->sendMessage(msg); msg->release(); - if (_fileLabel) - _fileLabel->setText(("File: " + filePath).c_str()); + updateFileLabel(filePath); } void SfizzVstEditor::createFrameContents() @@ -259,8 +258,8 @@ void SfizzVstEditor::createFrameContents() panel->addView(topLeftLabel); CRect row = topRow; - row.top += 200.0; - row.bottom += 200.0; + row.top += 45.0; + row.bottom += 45.0; row.left += 100.0; row.right -= 100.0; @@ -363,13 +362,13 @@ void SfizzVstEditor::createFrameContents() for (unsigned i = 0; i < kNumPanels; ++i) { CRect btnRect = topRow; - btnRect.left = topRow.right - (kNumPanels - i) * 20; - btnRect.right = btnRect.left + 20; + btnRect.left = topRow.right - (kNumPanels - i) * 50; + btnRect.right = btnRect.left + 50; const char *text; switch (i) { - case kPanelGeneral: text = "G"; break; - case kPanelSettings: text = "S"; break; + case kPanelGeneral: text = "File"; break; + case kPanelSettings: text = "Setup"; break; default: text = "?"; break; } @@ -392,8 +391,7 @@ void SfizzVstEditor::updateStateDisplay() const SfizzVstState& state = controller->getSfizzState(); const SfizzUiState& uiState = controller->getSfizzUiState(); - if (_fileLabel) - _fileLabel->setText(("File: " + state.sfzFile).c_str()); + updateFileLabel(state.sfzFile); if (_volumeSlider) _volumeSlider->setValue(state.volume); if (_numVoicesSlider) @@ -406,6 +404,25 @@ void SfizzVstEditor::updateStateDisplay() setActivePanel(uiState.activePanel); } +void SfizzVstEditor::updateFileLabel(const std::string& filePath) +{ + if (_fileLabel) { + std::string fileName; + if (filePath.empty()) + fileName = ""; + else { +#if defined (_WIN32) + size_t pos = filePath.find_last_of("/\\"); +#else + size_t pos = filePath.rfind('/'); +#endif + fileName = (pos != filePath.npos) ? + filePath.substr(pos + 1) : filePath; + } + _fileLabel->setText(fileName.c_str()); + } +} + void SfizzVstEditor::setActivePanel(unsigned panelId) { panelId = std::max(0, std::min(kNumPanels - 1, static_cast(panelId))); diff --git a/vst/SfizzVstEditor.h b/vst/SfizzVstEditor.h index 3b0244b7..d023f4ed 100644 --- a/vst/SfizzVstEditor.h +++ b/vst/SfizzVstEditor.h @@ -45,6 +45,7 @@ private: void createFrameContents(); void updateStateDisplay(); + void updateFileLabel(const std::string& filePath); void setActivePanel(unsigned panelId); template diff --git a/vst/resources/logo.png b/vst/resources/logo.png index e67a60a3..2474e991 100644 Binary files a/vst/resources/logo.png and b/vst/resources/logo.png differ diff --git a/vst/resources/logo.svg b/vst/resources/logo.svg index f4a65f2c..6b9e1029 100644 --- a/vst/resources/logo.svg +++ b/vst/resources/logo.svg @@ -1,78 +1,246 @@ - - - - -Created by potrace 1.11, written by Peter Selinger 2001-2013 - - - - - - - - - + + + sfizz logo + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + sfizz logo + 2020-05-16 + + + Tobiasz 'unfa' KaroĊ„ + + + + + CC-0 + + + + + + + + + + + + + +