Skip to content

Commit

Permalink
- cleanup HISE menubar commands
Browse files Browse the repository at this point in the history
- fix some minor doc issues
  • Loading branch information
christoph-hart committed May 29, 2024
1 parent 400eaf8 commit 8fe5e55
Show file tree
Hide file tree
Showing 8 changed files with 321 additions and 602 deletions.
682 changes: 229 additions & 453 deletions hi_backend/backend/BackendApplicationCommands.cpp

Large diffs are not rendered by default.

177 changes: 85 additions & 92 deletions hi_backend/backend/BackendApplicationCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,57 +75,64 @@ class BackendCommandTarget: public ApplicationCommandTarget,
Macros,
Keyboard,
Settings,
WorkspaceScript,
WorkspaceSampler,
WorkspaceCustom,

numToolbarButtons,
MenuFileOffset = 0x20000,

MenuSnippetFileNew,
MenuSnippetFileImport,
MenuSnippetClose,
// FILE MENU
MenuProjectNew = 0x20000,
MenuProjectLoad,
MenuProjectShowInFinder,
MenuProjectRecentOffset,
// ------------------------
MenuSnippetFileNew = 0x22000,
MenuNewFile,
MenuOpenFile,
MenuFileBrowseExamples,
MenuOpenFileFromProjectOffset,
MenuSaveFile = 0x23000,
MenuSaveFileAs,
MenuOpenXmlBackup,
MenuSaveFileXmlBackup,
MenuSaveFileAsXmlBackup,
MenuOpenXmlBackup,
MenuFileXmlBackupMenuOffset,
MenuProjectNew = 0x24000,
MenuProjectLoad,
MenuCloseProject,
MenuFileImportProjectFromHXI,
MenuFileXmlBackupMenuOffset,
// --------------------------
MenuOpenFile = 0x23000,
MenuSaveFile,
MenuSaveFileAs,
MenuOpenFileFromProjectOffset,
// ---------------------------
MenuFileImportSnippet,
MenuFileExtractEmbeddeSnippetFiles,
MenuFileCreateRecoveryXml,
MenuProjectShowInFinder,
MenuProjectRecentOffset,

MenuRevertFile = 0x26000,
MenuFileSaveUserPreset,
MenuFileUserPresetMenuOffset,
MenuFileSettingsProject = 0x28000,
MenuFileSettingsPreset,
MenuSnippetClose,
// --------------------------------
MenuFileSettings,
MenuFileSettingsCompiler,
MenuFileSettingsUser,
MenuFileSettingCheckSanity,
MenuFileSettingsCleanBuildDirectory,
MenuFileCreateThirdPartyNode,
MenuToolsEditShortcuts,
// --------------------------------
MenuFileQuit,
MenuReplaceWithClipboardContent,
MenuFileImportProjectFromHXI,

MenuRevertFile = 0x26000,

// Export Menu
MenuExportFileAsPlugin,
MenuExportFileAsEffectPlugin,
MenuExportFileAsMidiFXPlugin,
MenuExportFileAsStandaloneApp,
MenuExportProject,
MenuExportFileAsSnippet,
// ------------------------------------
MenuExportFileAsSnippet,
MenuExportProjectAsExpansion,
// --------------------------------------
MenuExportCheckAllSampleMaps,
MenuExportCheckPluginParameters,
MenuExportValidateUserPresets,
MenuExportCheckUnusedImages,
// --------------------------------------
MenuExportRestoreToDefault,
MenuExportUnloadAllSampleMaps,
MenuExportUnloadAllAudioFiles,
MenuExportCleanBuildDirectory,
// --------------------------------------
MenuExportSampleDataForInstaller,
MenuExportWavetablesToMonolith,
MenuExportCompileFilesInPool,
MenuExportCompileNetworksAsDll,

// Edit Menu
MenuEditOffset = 0x30000,
MenuEditUndo,
MenuEditRedo,
Expand All @@ -135,75 +142,67 @@ class BackendCommandTarget: public ApplicationCommandTarget,
MenuEditMoveDown,
MenuEditCopyAsSnippet,
MenuEditPasteAsSnippet,
MenuViewShowSelectedProcessorInPopup,
MenuEditPlotModulator,
MenuEditCreateScriptVariable,
MenuEditCreateBase64State,
MenuEditCloseAllChains,

// View Menu
MenuViewGotoUndo,
MenuViewGotoRedo,
// ----------------------
MenuViewToggleSnippetBrowser,
MenuViewRotate,
MenuViewFullscreen,
MenuViewReset,
MenuViewEnableGlobalLayoutMode,
// -----------------------------
WorkspaceScript,
WorkspaceSampler,
WorkspaceCustom,
MenuViewAddFloatingWindow,
MenuViewAddInterfacePreview,
MenuViewGotoUndo,
MenuViewGotoRedo,
MenuViewToggleSnippetBrowser,
MenuOneColumn,
MenuTwoColumns,
MenuThreeColumns,
MenuViewShowPool,
MenuViewShowInspector,
MenuViewShowPluginPopupPreview,
MenuViewIncreaseCodeFontSize,
MenuViewDecreaseCodeFontSize,
// --------------------------------
MenuViewClearConsole,
MenuViewResetLookAndFeel,
MenuViewShowAllHiddenProcessors,

MenuViewReset,

// Tools Menu
// Scripting Tools
MenuToolsRecompile = 0x50000,

MenuToolsCreateInterface,
MenuToolsSanityCheck,
MenuToolsClearConsole,
MenuToolsEditShortcuts,
MenuToolsSetCompileTimeOut,
MenuToolsUseBackgroundThreadForCompile,
MenuToolsRecompileScriptsOnReload,
MenuToolsEnableCallStack,
MenuToolsCheckCyclicReferences,
MenuToolsConvertSVGToPathData,
MenuToolsBroadcasterWizard,
MenuToolsCreateExternalScriptFile,
MenuToolsConvertSVGToPathData,
MenuToolsRestoreToDefault,
MenuToolsValidateUserPresets,
MenuToolsExternalScriptFileOffset,
MenuToolsResolveMissingSamples = 0x60000,
MenuToolsDeleteMissingSamples,
MenuToolsGetMissingSampleList,
MenuToolsCheckAllSampleMaps,

// ---------------------------------
// Sample Management
MenuToolsApplySampleMapProperties,
MenuToolsImportArchivedSamples,
MenuToolsCheckUnusedImages,
MenuToolsRedirectScriptFolder,
MenuToolsCheckPluginParameterSanity,
MenuToolsForcePoolSearch,
MenuToolsConvertAllSamplesToMonolith,
MenuToolsConvertSampleMapToWavetableBanks,
MenuToolsUpdateSampleMapIdsBasedOnFileName,
MenuToolsConvertSfzToSampleMaps,
MenuToolsRemoveAllSampleMaps,
MenuToolsUnloadAllAudioFiles,
MenuToolsCreateRSAKeys,
MenuToolsCreateDummyLicenseFile,
MenuToolsEnableAutoSaving,
// ----------------------------------
// Wavetable Tools
MenuToolsConvertSampleMapToWavetableBanks,
MenuToolsWavetablesToMonolith,
// ----------------------------------
// DSP Tools
MenuToolsEnableDebugLogging,
MenuToolsShowDspNetworkDllInfo,
MenuToolsRecordOneSecond,
MenuToolsSimulateChangingBufferSize,
MenuToolsShowDspNetworkDllInfo,
MenuToolsCreateRnboTemplate,
MenuHelpShowAboutPage = 0x70000,
MenuHelpShowDocumentation,
MenuHelpCheckVersion,
MenuToolsCreateThirdPartyNode,
// ----------------------------------
// License Management
MenuToolsCreateRSAKeys,
MenuToolsCreateDummyLicenseFile,

// HELP Menu
MenuHelpShowDocumentation = 0x70000,
MenuFileBrowseExamples,
MenuHelpCheckVersion,
MenuHelpShowAboutPage,

numCommands
};

Expand Down Expand Up @@ -307,13 +306,11 @@ class BackendCommandTarget: public ApplicationCommandTarget,

static void createScriptVariableDeclaration(CopyPasteTarget *currentCopyPasteTarget);
static void recompileAllScripts(BackendRootWindow * bpe);
static void toggleFullscreen(BackendRootWindow * bpe);
static void resetLookAndFeel(BackendRootWindow* bpe);
static void closeAllChains(BackendRootWindow *bpe);
static void validatePluginParameters(BackendRootWindow *bpe);

static void showAboutPage(BackendRootWindow * bpe);
static void checkVersion(BackendRootWindow *bpe);
static void setColumns(BackendRootWindow * bpe, BackendCommandTarget* target, ColumnMode columns);
static void plotModulator(CopyPasteTarget *currentCopyPasteTarget);
static void resolveMissingSamples(BackendRootWindow *bpe);
static void setCompileTimeOut(BackendRootWindow * bpe);
Expand All @@ -334,19 +331,16 @@ class BackendCommandTarget: public ApplicationCommandTarget,



static void closeProject(BackendRootWindow *bpe);

static void showProjectInFinder(BackendRootWindow *bpe);
static void saveUserPreset(BackendRootWindow *bpe);

static void loadUserPreset(BackendRootWindow *bpe, const File &fileToLoad);
static void saveFileXml(BackendRootWindow * bpe);
static void saveFileAsXml(BackendRootWindow * bpe);
static void openFileFromXml(BackendRootWindow * bpe, const File &fileToLoad);
static String exportFileAsSnippet(BackendRootWindow* bpe, bool copyToClipboard=true);
static void showFilePresetSettings(BackendRootWindow * bpe);

static void showFileProjectSettings(BackendRootWindow * bpe);
static void showFileUserSettings(BackendRootWindow * bpe);
static void showFileCompilerSettings(BackendRootWindow * bpe);
static void checkSettingSanity(BackendRootWindow * bpe);
static void togglePluginPopupWindow(BackendRootWindow * bpe);
static void changeCodeFontSize(BackendRootWindow *bpe, bool increase);
static void createRSAKeys(BackendRootWindow * bpe);
Expand All @@ -369,7 +363,6 @@ class BackendCommandTarget: public ApplicationCommandTarget,
static void createBase64State(CopyPasteTarget* target);
static void createUserInterface(BackendRootWindow * bpe);
static void checkUnusedImages(BackendRootWindow * bpe);
static void addInterfacePreview(BackendRootWindow * bpe);
static void updateSampleMapIds(BackendRootWindow * bpe);
static void toggleCallStackEnabled(BackendRootWindow * bpe);
static void testPlugin(const String& pluginToLoad);
Expand Down
40 changes: 1 addition & 39 deletions hi_backend/backend/BackendEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,18 +417,6 @@ MainTopBar::MainTopBar(FloatingTile* parent) :
pluginPreviewButton->setShape(f.createPath("Plugin Preview"), false, true, true);
pluginPreviewButton->addListener(this);

addAndMakeVisible(scriptingWorkSpaceButton = new HiseShapeButton("Scripting Workspace", this, f));
scriptingWorkSpaceButton->setTooltip("Show Scripting Workspace");
scriptingWorkSpaceButton->setCommandToTrigger(getRootWindow()->getBackendProcessor()->getCommandManager(), BackendCommandTarget::WorkspaceScript, true);

addAndMakeVisible(samplerWorkSpaceButton = new HiseShapeButton("Sampler Workspace", this, f));
samplerWorkSpaceButton->setTooltip("Show Sampler Workspace");
samplerWorkSpaceButton->setCommandToTrigger(getRootWindow()->getBackendProcessor()->getCommandManager(), BackendCommandTarget::WorkspaceSampler, true);

addAndMakeVisible(customWorkSpaceButton = new HiseShapeButton("Custom Workspace", this, f));
customWorkSpaceButton->setTooltip("Show Scripting Workspace");
customWorkSpaceButton->setCommandToTrigger(getRootWindow()->getBackendProcessor()->getCommandManager(), BackendCommandTarget::WorkspaceCustom, true);

addAndMakeVisible(peakMeter = new ClickablePeakMeter(getRootWindow()->getMainSynthChain()));

addAndMakeVisible(settingsButton = new ShapeButton("Audio Settings", Colours::white.withAlpha(0.6f), Colours::white.withAlpha(0.8f), Colours::white));
Expand Down Expand Up @@ -641,10 +629,6 @@ void MainTopBar::resized()

layoutButton->setVisible(false);

scriptingWorkSpaceButton->setVisible(false);
samplerWorkSpaceButton->setVisible(false);
customWorkSpaceButton->setVisible(false);

auto bWidth = getHeight() * 2;

frontendArea = getLocalBounds().withSizeKeepingCentre(bWidth * 3, getHeight());
Expand Down Expand Up @@ -1335,29 +1319,7 @@ void MainTopBar::togglePopup(PopupType t, bool shouldShow)
void MainTopBar::applicationCommandInvoked(const ApplicationCommandTarget::InvocationInfo& info)
{

switch (info.commandID)
{
case BackendCommandTarget::WorkspaceScript:
mainWorkSpaceButton->setToggleStateAndUpdateIcon(false);
scriptingWorkSpaceButton->setToggleStateAndUpdateIcon(true);
samplerWorkSpaceButton->setToggleStateAndUpdateIcon(false);
customWorkSpaceButton->setToggleStateAndUpdateIcon(false);
break;
case BackendCommandTarget::WorkspaceSampler:
mainWorkSpaceButton->setToggleStateAndUpdateIcon(false);
scriptingWorkSpaceButton->setToggleStateAndUpdateIcon(false);
samplerWorkSpaceButton->setToggleStateAndUpdateIcon(true);
customWorkSpaceButton->setToggleStateAndUpdateIcon(false);
break;

case BackendCommandTarget::WorkspaceCustom:
mainWorkSpaceButton->setToggleStateAndUpdateIcon(false);
scriptingWorkSpaceButton->setToggleStateAndUpdateIcon(false);
samplerWorkSpaceButton->setToggleStateAndUpdateIcon(false);
customWorkSpaceButton->setToggleStateAndUpdateIcon(true);
break;
}


}

MainTopBar::QuickPlayComponent::QuickPlayComponent(MainController* mc):
Expand Down
5 changes: 0 additions & 5 deletions hi_backend/backend/BackendEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,6 @@ class MainTopBar : public FloatingTileContent,
ScopedPointer<ShapeButton> customPopupButton;
ScopedPointer<ShapeButton> keyboardPopupButton;

ScopedPointer<HiseShapeButton> mainWorkSpaceButton;
ScopedPointer<HiseShapeButton> scriptingWorkSpaceButton;
ScopedPointer<HiseShapeButton> samplerWorkSpaceButton;
ScopedPointer<HiseShapeButton> customWorkSpaceButton;

struct QuickPlayComponent: public Component,
public ControlledObject,
public SettableTooltipClient,
Expand Down
13 changes: 1 addition & 12 deletions hi_backend/backend/CompileExporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,18 +1009,7 @@ bool CompileExporter::checkSanity(TargetTypes type, BuildOption option)
}
}
}

if((type != TargetTypes::EffectPlugin) && !shouldBeSilent() && PresetHandler::showYesNoWindow("Check Sample references", "Do you want to validate all sample references"))
{
const String faultySample = checkSampleReferences(chainToExport);

if(faultySample.isNotEmpty())
{
printErrorMessage("Wrong / missing sample reference", "The sample " + faultySample + " is missing or an absolute path");
return false;
}
}


return true;
}

Expand Down
2 changes: 1 addition & 1 deletion hi_core/hi_core/BackgroundThreads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ ComponentWithHelp::~ComponentWithHelp()
}

SampleDataExporter::SampleDataExporter(MainController* mc) :
DialogWindowWithBackgroundThread("Export Samples for Installer"),
DialogWindowWithBackgroundThread("Package sample monolith files"),
ControlledObject(mc),
synthChain(getMainController()->getMainSynthChain())
{
Expand Down
2 changes: 2 additions & 0 deletions hi_tools/hi_markdown/MarkdownElements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,8 @@ struct MarkdownParser::ContentFooter : public MarkdownParser::Element
{
int nextIndex = i + 1;

links.nextLink = list[nextIndex].url.withAnchor("");

while (nextIndex < list.size() && links.nextLink == links.thisLink)
{
nextIndex++;
Expand Down
2 changes: 2 additions & 0 deletions hi_tools/hi_markdown/MarkdownLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,8 @@ juce::String MarkdownLink::Helpers::getMarkdownHeader(const String& content)
{
if (content.contains("---"))
{
jassert(!content.endsWith("---"));

return content.upToLastOccurrenceOf("---\n", true, true);
}

Expand Down

0 comments on commit 8fe5e55

Please sign in to comment.