diff --git a/src/common/dsp/AdsrEnvelope.h b/src/common/dsp/AdsrEnvelope.h index 2c8de7c2a5e..216f57a9742 100644 --- a/src/common/dsp/AdsrEnvelope.h +++ b/src/common/dsp/AdsrEnvelope.h @@ -3,6 +3,7 @@ //------------------------------------------------------------------------------------------------------- #pragma once +#include // for std::min #include "DspUtilities.h" #include "SurgeStorage.h" #include "SurgeVoiceState.h" diff --git a/src/common/dsp/Oscillator.h b/src/common/dsp/Oscillator.h index 8e442543383..315ed83effa 100644 --- a/src/common/dsp/Oscillator.h +++ b/src/common/dsp/Oscillator.h @@ -1,3 +1,5 @@ +#pragma once + #include "SurgeStorage.h" #include "DspUtilities.h" #include diff --git a/src/common/gui/COscillatorDisplay.cpp b/src/common/gui/COscillatorDisplay.cpp index 211702dd304..cba7f37f8cc 100644 --- a/src/common/gui/COscillatorDisplay.cpp +++ b/src/common/gui/COscillatorDisplay.cpp @@ -1,6 +1,7 @@ //------------------------------------------------------------------------------------------------------- // Copyright 2005 Claes Johanson & Vember Audio //------------------------------------------------------------------------------------------------------- +#include "SurgeGUIEditor.h" #include "COscillatorDisplay.h" #include "Oscillator.h" #include @@ -692,6 +693,14 @@ void COscillatorDisplay::populateMenu(COptionMenu* contextMenu, int selectedItem auto action = [this](CCommandMenuItem* item) { this->loadWavetableFromFile(); }; actionItem->setActions(action, nullptr); contextMenu->addEntry(actionItem); + + auto contentItem = new CCommandMenuItem(CCommandMenuItem::Desc("Download Additional Content")); + auto contentAction = [](CCommandMenuItem *item) + { + Surge::UserInteractions::openURL(SurgeGUIEditor::additionalContentURL); + }; + contentItem->setActions(contentAction,nullptr); + contextMenu->addEntry(contentItem); } bool COscillatorDisplay::populateMenuForCategory(COptionMenu* contextMenu, diff --git a/src/common/gui/CPatchBrowser.cpp b/src/common/gui/CPatchBrowser.cpp index 53039cc6c18..11585734e93 100644 --- a/src/common/gui/CPatchBrowser.cpp +++ b/src/common/gui/CPatchBrowser.cpp @@ -2,7 +2,8 @@ // Copyright 2005 Claes Johanson & Vember Audio //------------------------------------------------------------------------------------------------------- #include "CPatchBrowser.h" - +#include "UserInteractions.h" +#include "SurgeGUIEditor.h" #include using namespace VSTGUI; @@ -109,6 +110,16 @@ CMouseEventResult CPatchBrowser::onMouseDown(CPoint& where, const CButtonState& } // contextMenu->addEntry("refresh list"); + + contextMenu->addSeparator(); + auto contentItem = new CCommandMenuItem(CCommandMenuItem::Desc("Download Additional Content")); + auto contentAction = [](CCommandMenuItem *item) + { + Surge::UserInteractions::openURL(SurgeGUIEditor::additionalContentURL); + }; + contentItem->setActions(contentAction,nullptr); + contextMenu->addEntry(contentItem); + getFrame()->addView(contextMenu); // add to frame contextMenu->setDirty(); contextMenu->popup(); diff --git a/src/common/gui/SurgeGUIEditor.cpp b/src/common/gui/SurgeGUIEditor.cpp index 7056b75faa5..bb2b8eedf88 100644 --- a/src/common/gui/SurgeGUIEditor.cpp +++ b/src/common/gui/SurgeGUIEditor.cpp @@ -3003,8 +3003,8 @@ void SurgeGUIEditor::showSettingsMenu(CRect &menuRect) }); eid++; - addCallbackMenu(settingsMenu, "Download Extra Content", []() { - Surge::UserInteractions::openURL("https://github.com/surge-synthesizer/surge-synthesizer.github.io/wiki/Additional-Content"); + addCallbackMenu(settingsMenu, "Download Additional Content", []() { + Surge::UserInteractions::openURL(SurgeGUIEditor::additionalContentURL); }); eid++; @@ -3173,4 +3173,7 @@ Steinberg::tresult PLUGIN_API SurgeGUIEditor::onSize(Steinberg::ViewRect* newSiz #endif +std::string SurgeGUIEditor::additionalContentURL = "https://github.com/surge-synthesizer/surge-synthesizer.github.io/wiki/Additional-Content"; +; + //------------------------------------------------------------------------------------------------ diff --git a/src/common/gui/SurgeGUIEditor.h b/src/common/gui/SurgeGUIEditor.h index 2191a596ad9..58367a72e4b 100644 --- a/src/common/gui/SurgeGUIEditor.h +++ b/src/common/gui/SurgeGUIEditor.h @@ -33,6 +33,7 @@ typedef VSTGUI::PluginGUIEditor EditorType; #include "SurgeSynthesizer.h" #include +#include class SurgeGUIEditor : public EditorType, public VSTGUI::IControlListener, public VSTGUI::IKeyboardHook { @@ -183,6 +184,12 @@ class SurgeGUIEditor : public EditorType, public VSTGUI::IControlListener, publi void showTuningMenu(VSTGUI::CPoint &where); void tuningFileDropped(std::string fn); std::string tuningCacheForToggle = ""; + + /* + ** Menu and Manual URLs + */ +public: + static std::string additionalContentURL; private: /**