void CtrlrEditor::performMidiChannelChange(const int menuItemID)
{
	if (isPanelActive())
	{
		if (menuItemID >= 0x6100 && menuItemID <= 0x6111)
		{
			getActivePanel()->setProperty (Ids::panelMidiInputChannelDevice, menuItemID - 0x6100);
		}
		else if (menuItemID >= 0x6200 && menuItemID <= 0x6211)
		{
			getActivePanel()->setProperty (Ids::panelMidiOutputChannelDevice, menuItemID - 0x6200);
		}
		else if (menuItemID >= 0x6300 && menuItemID <= 0x6311)
		{
			getActivePanel()->setProperty (Ids::panelMidiControllerChannelDevice, menuItemID - 0x6300);
		}
		else if (menuItemID >= 0x6400 && menuItemID <= 0x6411)
		{
			getActivePanel()->setProperty (Ids::panelMidiInputChannelHost, menuItemID - 0x6400);
		}
		else if (menuItemID >= 0x6500 && menuItemID <= 0x6511)
		{
			getActivePanel()->setProperty (Ids::panelMidiOutputChannelHost, menuItemID - 0x6500);
		}
	}
}
void CtrlrEditor::performMidiHostOptionChange(const int menuItemID)
{
	if (isPanelActive())
	{
		getActivePanel()->setMidiOptionBool ((const CtrlrPanelMidiOption)(menuItemID - MENU_OFFSET_MIDI), !getActivePanel()->getMidiOptionBool((const CtrlrPanelMidiOption)(menuItemID - MENU_OFFSET_MIDI)));
	}
}
void CtrlrEditor::performProgramChange(const int menuItemID)
{
	_DBG("CtrlrEditor::performProgramChange");
	if (isPanelActive())
	{
		getActivePanel()->getCtrlrMIDILibrary().setProgram (menuItemID);
	}
}
void CtrlrEditor::performMidiOptionChange(const int menuItemID)
{
	if (menuItemID == optMidiSnapshotOnLoad)
	{
		if (isPanelActive())
		{
			getActivePanel()->setProperty (Ids::panelMidiSnapshotAfterLoad, !getPanelProperty(Ids::panelMidiSnapshotAfterLoad));
		}
	}
	else if (menuItemID == optMidiSnapshotOnProgramChange)
	{
		if (isPanelActive())
		{
			getActivePanel()->setProperty (Ids::panelMidiSnapshotAfterProgramChange, !getPanelProperty(Ids::panelMidiSnapshotAfterProgramChange));
		}
	}
}
void CtrlrEditor::performMidiThruChange(const int menuItemID)
{
	const Identifier optionId = CtrlrPanel::getMidiOptionIdentifier((const CtrlrPanelMidiOption)(menuItemID - MENU_OFFSET_MIDI));

	if (isPanelActive() && optionId != Ids::null)
	{
		getActivePanel()->setProperty (optionId, !getActivePanel()->getProperty(optionId));
	}
}
void CtrlrEditor::sliderValueChanged (Slider* slider)
{
	if (slider->getName() == "Snapshot delay")
	{
		if (isPanelActive())
		{
			getActivePanel()->setProperty(Ids::panelMidiSnapshotDelay, slider->getValue());
		}
	}
}
void CtrlrEditor::performMidiDeviceChange(const int menuItemID)
{
	if (isPanelActive())
	{
		if (menuItemID > MENU_OFFSET_MIDI_DEV_IN && menuItemID < MENU_OFFSET_MIDI_DEV_OUT)
		{
			getActivePanel()->setProperty(Ids::panelMidiInputDevice, owner.getCtrlrMidiDeviceManager().getDeviceName(menuItemID - MENU_OFFSET_MIDI_DEV_IN - 2, CtrlrMidiDeviceManager::inputDevice));
		}
		else if (menuItemID > MENU_OFFSET_MIDI_DEV_OUT && menuItemID < MENU_OFFSET_MIDI_DEV_CTRLR)
		{
			getActivePanel()->setProperty(Ids::panelMidiOutputDevice, owner.getCtrlrMidiDeviceManager().getDeviceName(menuItemID - MENU_OFFSET_MIDI_DEV_OUT - 2, CtrlrMidiDeviceManager::outputDevice));
		}
		else if (menuItemID > MENU_OFFSET_MIDI_DEV_CTRLR && menuItemID < MENU_OFFSET_MIDI_HOST_IN)
		{
			getActivePanel()->setProperty(Ids::panelMidiControllerDevice, owner.getCtrlrMidiDeviceManager().getDeviceName(menuItemID - MENU_OFFSET_MIDI_DEV_CTRLR - 2, CtrlrMidiDeviceManager::controllerDevice));
		}
	}
}
bool CtrlrEditor::perform (const InvocationInfo &info)
{
	// _DBG("CtrlrEditor::perform commandID="+STR(info.commandID));
	switch (info.commandID)
	{
		case showKeyboardMappingDialog:
			performShowKeyboardMappingDialog(info.commandID);
			break;

		case showMidiMonitor:
			owner.getWindowManager().toggle(CtrlrManagerWindowManager::MidiMonWindow, true);
			break;

		case showLogViewer:
			owner.getWindowManager().toggle(CtrlrManagerWindowManager::LogViewer, true);
			break;

		case showMidiCalculator:
			owner.getWindowManager().toggle(CtrlrManagerWindowManager::MIDICalculator, true);
			break;

		case doSaveState:
			owner.saveStateToDisk();
			break;

		case doOpenPanel:
			owner.openPanelFromFile(nullptr);
			break;

		case doNewPanel:
			owner.addPanel(ValueTree());
			break;

		case doRefreshPropertyLists:
			if (isPanelActive())
			{
				if (getActivePanel()->getEditor(false))
				{
					CtrlrPanelProperties *props = getActivePanel()->getEditor(false)->getPropertiesPanel();
					if (props)
					{
						props->refreshAll();
					}
				}
			}
			break;

		case showGlobalSettingsDialog:
			owner.getWindowManager().showModalDialog ("Ctrlr/Settings", ScopedPointer <CtrlrSettings> (new CtrlrSettings(owner)), true, this);
			break;

		case showAboutDialog:
			owner.getWindowManager().showModalDialog ("Ctrlr/About", ScopedPointer <CtrlrAbout> (new CtrlrAbout(owner)), false, this);
			break;

		case doZoomIn:
			if (getActivePanelEditor())
			{
				getActivePanelEditor()->setProperty(Ids::uiPanelZoom, (double)getActivePanelEditor()->getProperty(Ids::uiPanelZoom) + 0.1);
			}
			break;

		case doZoomOut:
			if (getActivePanelEditor())
			{
				getActivePanelEditor()->setProperty(Ids::uiPanelZoom, (double)getActivePanelEditor()->getProperty(Ids::uiPanelZoom) - 0.1);
			}
			break;

		case doCopy:
			getActivePanel()->getCanvas()->copy();
			break;

		case doCut:
			getActivePanel()->getCanvas()->cut();
			break;

		case doPaste:
			getActivePanel()->getCanvas()->paste();
			break;

		case doUndo:
			getActivePanel()->undo();
			break;

		case doRedo:
			getActivePanel()->redo();
			break;

		case doSave:
			getActivePanel()->savePanel();
			break;

		case doClose:
			if (AlertWindow::showYesNoCancelBox (AlertWindow::QuestionIcon, "Close panel", "Are you sure you want to close this panel", "Yes", "No", "Cancel", this) == 1)
			{
				owner.removePanel (getActivePanelEditor());
			}
			break;

		case doSaveAs:
			getActivePanel()->savePanelAs(doExportFileText);
			break;

		case doSaveVersioned:
			getActivePanel()->savePanelVersioned();
			break;

		case doExportFileText:
		case doExportFileZText:
		case doExportFileBin:
		case doExportFileZBin:
		case doExportFileZBinRes:
		case doExportFileInstance:
		case doExportFileInstanceRestricted:
		case doExportGenerateUID:
			getActivePanel()->savePanelAs (info.commandID);
			break;

		case doViewPropertyDisplayIDs:
			if (getActivePanel()) getActivePanel()->setProperty (Ids::panelPropertyDisplayIDs, !getActivePanel()->getProperty(Ids::panelPropertyDisplayIDs));
			break;

		case doPanelMode:
			if (getActivePanelEditor()) getActivePanelEditor()->setProperty (Ids::uiPanelEditMode, !getActivePanelEditor()->getProperty(Ids::uiPanelEditMode));
			break;

		case doPanelLock:
			if (getActivePanelEditor()) getActivePanelEditor()->setProperty (Ids::uiPanelLock, !(bool)getActivePanelEditor()->getProperty(Ids::uiPanelLock));
			break;

		case doPanelDisableCombosOnEdit:
			if (getActivePanelEditor()) getActivePanelEditor()->setProperty (Ids::uiPanelDisableCombosOnEdit, !(bool)getActivePanelEditor()->getProperty(Ids::uiPanelDisableCombosOnEdit));
			break;

		case showLuaEditor:
			if (getActivePanel()) getActivePanel()->getPanelWindowManager().toggle (CtrlrPanelWindowManager::LuaMethodEditor, true);
			break;

		case showLuaConsole:
			if (getActivePanel()) getActivePanel()->getPanelWindowManager().toggle (CtrlrPanelWindowManager::LuaConsole, true);
			break;

		case showComparatorTables:
			if (getActivePanel()) getActivePanel()->dumpComparatorTables();
			break;

		case showMidiLibrary:
			if (getActivePanel()) getActivePanel()->getPanelWindowManager().toggle (CtrlrPanelWindowManager::MIDILibrary, true);
			break;

		case showModulatorList:
			if (getActivePanel()) getActivePanel()->getPanelWindowManager().toggle (CtrlrPanelWindowManager::ModulatorList, true);
			break;

		case showLayers:
			if (getActivePanel()) getActivePanel()->getPanelWindowManager().toggle (CtrlrPanelWindowManager::LayerEditor, true);
			break;

		case doSendSnapshot:
			if (getActivePanel()) getActivePanel()->sendSnapshot();
			break;

		case doSnapshotStore:
			if (getActivePanel()) getActivePanel()->getCtrlrMIDILibrary().snapshot();
			break;

		case showBufferEditor:
			if (getActivePanel()) getActivePanel()->getPanelWindowManager().toggle (CtrlrPanelWindowManager::BufferEditor, true);
			break;

		case showMidiToolbar:
			if (getActivePanel())
				if (getActivePanel()->getEditor())
				{
					getActivePanel()->getEditor()->toggleMIDIToolbar ();
					resized();
				}
			break;

		case doSaveSaveToCurrentProgram:
		case doSaveSaveToNewProgram:
		case doNewBank:
			break;

		case doIdentityRequest:
			if (isPanelActive())
			{
			}
			break;

		case doEditBufferRequest:
			if (isPanelActive())
			{
			}
			break;

		case doCurrentBankRequest:
			if (isPanelActive())
			{
			}
			break;

		case doCurrentProgramRequest:
			if (isPanelActive())
			{
			}
			break;

		case doAllProgramsRequest:
			if (isPanelActive())
			{
			}
			break;

		case optMidiInputFromHost:
		case optMidiInputFromHostCompare:
		case optMidiOutuptToHost:
			if (info.invocationMethod == ApplicationCommandTarget::InvocationInfo::direct)
				performMidiHostOptionChange(info.commandID);
			break;

		case optMidiSnapshotOnLoad:
		case optMidiSnapshotOnProgramChange:
			if (info.invocationMethod == ApplicationCommandTarget::InvocationInfo::direct)
				performMidiOptionChange(info.commandID);
			break;

		case optMidiThruD2D:
		case optMidiThruD2H:
		case optMidiThruH2D:
		case optMidiThruH2H:
		case optMidiThruD2DChannelize:
		case optMidiThruD2HChannelize:
		case optMidiThruH2DChannelize:
		case optMidiThruH2HChannelize:
			if (info.invocationMethod == ApplicationCommandTarget::InvocationInfo::direct)
				performMidiThruChange(info.commandID);
			break;

		case doCrash:
			invalidCtrlrPtr->cancelPendingUpdate();
			break;

		case doDumpVstTables:
			owner.getVstManager().dump();
			if (isPanelActive())
			{
				getActivePanel()->dump();
			}
			break;

		case doQuit:
			JUCEApplication::quit();

		case doRegisterExtension:
			tempResult = owner.getNativeObject().registerFileHandler();
			if (tempResult.wasOk())
			{
				INFO("Register file handler", "Registration successful");
			}
			else
			{
				WARN("Registration failed");
			}
			break;

        case doKeyGenerator:
            performKeyGenerator();
            break;

		default:
			break;
	}

	return (true);
}
void CtrlrEditor::performCustomRequest(const int menuItemID)
{
	if (isPanelActive())
	{
	}
}
void CtrlrEditor::getCommandInfo (CommandID commandID, ApplicationCommandInfo &result)
{
	const String globalCategory ("Global");
	const String panelCategory ("Panel");

	switch (commandID)
	{
		case doSaveState:
			result.setInfo ("Save CTRLR state", "Saves the CTRLR state to disk", globalCategory, 0);
			result.addDefaultKeypress ('s', ModifierKeys::commandModifier | ModifierKeys::altModifier);
			break;

		case doOpenPanel:
			result.setInfo ("Open Panel", "Open a panel from a file", globalCategory, 0);
			result.addDefaultKeypress ('o', ModifierKeys::commandModifier);
			break;

		case doNewPanel:
			result.setInfo ("New Panel", "Create a new empty panel", globalCategory, 0);
			result.addDefaultKeypress ('n', ModifierKeys::commandModifier);
			break;

		case showGlobalSettingsDialog:
			result.setInfo ("Preferences", "Show global CTRLR preferences", globalCategory, 0);
			result.addDefaultKeypress ('p', ModifierKeys::commandModifier);
			break;

		case showMidiMonitor:
			result.setInfo ("MIDI Monitor", "A small MIDI monitor that will display received and sent data", globalCategory, 0);
			result.addDefaultKeypress ('m', ModifierKeys::commandModifier);
			break;

		case showLogViewer:
			result.setInfo ("Log viewer", "You can view diagnostic messages here, useful when debugging problems", globalCategory, 0);
			result.addDefaultKeypress ('l', ModifierKeys::commandModifier);
			break;

		case showMidiCalculator:
			result.setInfo ("MIDI Calculator", "A useful tool to translate Heximal, Binary, Decimal values", globalCategory, 0);
			result.addDefaultKeypress ('j', ModifierKeys::commandModifier);
			break;

		case showAboutDialog:
			result.setInfo ("About", "About CTRLR", globalCategory, 0);
			result.addDefaultKeypress ('a', ModifierKeys::commandModifier);
			break;

		case showKeyboardMappingDialog:
			result.setInfo ("Keyboard mapping", "Change default keyboard mappings", globalCategory, 0);
			result.addDefaultKeypress ('k', ModifierKeys::commandModifier);
			break;

		case doViewPropertyDisplayIDs:
			result.setInfo ("Property IDs/Names", "View property names or property IDs", panelCategory, 0);
			result.setTicked (isPanelActive() ? (bool)getActivePanel()->getProperty(Ids::panelPropertyDisplayIDs) : false);
			result.setActive (isPanelActive());
			break;

		case doZoomIn:
			result.setInfo ("Zoom In", "Zoom in the panel", panelCategory, 0);
			result.addDefaultKeypress ('+', ModifierKeys::commandModifier);
			result.setActive (isPanelActive());
			break;

		case doZoomOut:
			result.setInfo ("Zoom Out", "Zoom out the panel", panelCategory, 0);
			result.addDefaultKeypress ('-', ModifierKeys::commandModifier);
			result.setActive (isPanelActive());
			break;

		case doCopy:
			result.setInfo ("Copy", "Copy selected components to clipboard", panelCategory, 0);
			result.addDefaultKeypress ('c', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doCut:
			result.setInfo ("Cut", "Cut selected components to clipboard", panelCategory, 0);
			result.addDefaultKeypress ('x', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doPaste:
			result.setInfo ("Paste", "Paste components from clipboard", panelCategory, 0);
			result.addDefaultKeypress ('v', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doUndo:
			result.setInfo ("Undo", "Undo last transaction", panelCategory, 0);
			result.addDefaultKeypress ('z', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doRedo:
			result.setInfo ("Redo", "Redo last transaction", panelCategory, 0);
			result.addDefaultKeypress ('y', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doSave:
			result.setInfo ("Save", "Save panel to a file", panelCategory, 0);
			result.addDefaultKeypress ('s', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doClose:
			result.setInfo ("Close", "Close the current panel", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case doSaveAs:
			result.setInfo ("Save As", "Save panel as a new file", panelCategory, 0);
			result.addDefaultKeypress ('s', ModifierKeys::commandModifier | ModifierKeys::shiftModifier);
			result.setActive (isPanelActive(true));
			break;

		case doSaveVersioned:
			result.setInfo ("Save versioned", "Save panel to a new versioned file", panelCategory, 0);
			result.addDefaultKeypress ('s', ModifierKeys::altModifier | ModifierKeys::shiftModifier);
			result.setActive (isPanelActive(true));
			break;

		case doPanelMode:
			result.setInfo ("Panel mode", "Switches panel from and to EDIT mode", panelCategory, 0);
			result.addDefaultKeypress ('e', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doPanelLock:
			result.setInfo ("Panel lock", "Locks components in edit mode", panelCategory, 0);
			result.addDefaultKeypress ('l', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			if (isPanelActive(true))
			{
				result.setTicked ((bool)getActivePanelEditor()->getProperty(Ids::uiPanelLock));
			}
			break;

		case doPanelDisableCombosOnEdit:
			result.setInfo ("Disable combos on edit", "Combo boxes will not open when editing panel", panelCategory, 0);
			result.setActive (isPanelActive(true));
			if (isPanelActive(true))
			{
				result.setTicked ((bool)getActivePanelEditor()->getProperty(Ids::uiPanelDisableCombosOnEdit));
			}
			break;

		case showLuaEditor:
			result.setInfo ("LUA Editor", "Show/hide the LUA editor window", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case doRefreshDeviceList:
			result.setInfo ("Refresh devices", "Refresh the list of devices available in the OS", panelCategory, 0);
			result.setActive (true);
			break;

		case showLuaConsole:
			result.setInfo ("LUA Console", "Show/hide the LUA console", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case showComparatorTables:
			result.setInfo ("Comparator tables", "Show/hide the dump for the comparator tables", panelCategory, 0);
			result.setActive (isPanelActive());
			break;

		case showMidiLibrary:
			result.setInfo ("MIDI Library", "Show/hide the MIDI LIbrary window", panelCategory, 0);
			result.setActive (isPanelActive());
			result.addDefaultKeypress ('l', ModifierKeys::altModifier | ModifierKeys::shiftModifier);
			break;

		case showLayers:
			result.setInfo ("Layer editor", "Show/hide the layer editor", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case showModulatorList:
			result.setInfo ("Modulator list", "Show/hide the modulator list window", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case showBufferEditor:
			result.setInfo ("Buffer Editor", "Show/hide the buffer editor", panelCategory, 0);
			result.addDefaultKeypress ('b', ModifierKeys::commandModifier);
			result.setActive (isPanelActive(true));
			break;

		case doSendSnapshot:
			result.setInfo ("Send Snapshot", "Send all values from the panel as their defines MIDI messages", panelCategory, 0);
			result.setActive (isPanelActive());
			break;

		case doSnapshotStore:
			result.setInfo ("Program snapshot", "Save the current panel state as a snapshot", panelCategory, 0);
			result.setActive (isPanelActive());
			break;

		case doRefreshPropertyLists:
			result.setInfo ("Refresh property lists", "Refreshes all dynamic lists that occur in the property pane", panelCategory, 0);
			result.setActive (isPanelActive());
			break;

		case doExportFileText:
			result.setInfo ("Export XML", "Export panel to a XML file with no compression, might be very large", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case doExportFileZText:
			result.setInfo ("Export compressed XML", "Export panel to a zlib compressed XML file", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case doExportFileBin:
			result.setInfo ("Export binary", "Export panel to a binary file, unlike XML is unreadable but loads faster", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case doExportFileZBin:
			result.setInfo ("Export compressed binary", "Export panel to a zlib compressed binary file", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case doExportFileZBinRes:
			result.setInfo ("Export compressed binary + resources", "Export panel to a zlib compressed binary file with resources included", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case doExportFileInstance:
			result.setInfo ("Export instance", "Exports the panel as a standalone instance (executable/loadable file)", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case doExportFileInstanceRestricted:
			result.setInfo ("Export restricted instance", "Exports the panel as a standalone restricted instance (executable/loadable file). It won't be editable.", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case doExportGenerateUID:
			result.setInfo ("Re-generate UID ["+getPanelProperty(Ids::panelUID).toString()+"]", "Each panel has a Unique ID that can be re-generated", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case optMidiInputFromHost:
			result.setInfo ("Input from plugin host", "Accept MIDI events from host and process them", panelCategory, 0);
			result.setActive (!JUCEApplication::isStandaloneApp());
			result.setTicked (isPanelActive() ? getActivePanel()->getMidiOptionBool((const CtrlrPanelMidiOption)optMidiInputFromHost) : false);
			break;

		case doShowMidiSettingsDialog:
			result.setInfo("Settings", "Show a more user friendly MIDI settings dialog", panelCategory, 0);
			result.setActive (isPanelActive(true));
			break;

		case optMidiInputFromHostCompare:
			result.setInfo ("Input from host to comparator", "This option tells Ctrlr to route all incomming MIDI events from the MIDI host to the Comparator engine, messages that will match modulators in the panel will be treated as comming from a MIDI device", panelCategory, 0);
			result.setActive (!JUCEApplication::isStandaloneApp());
			result.setTicked (isPanelActive() ? getActivePanel()->getMidiOptionBool((const CtrlrPanelMidiOption)optMidiInputFromHostCompare) : false);
			break;

		case optMidiOutuptToHost:
			result.setInfo ("Output to plugin host", "All MIDI output goes to the MIDI host (if supported by the plugin format and the host)", panelCategory, 0);
			result.setActive (!JUCEApplication::isStandaloneApp());
			result.setTicked (isPanelActive() ? getActivePanel()->getMidiOptionBool((const CtrlrPanelMidiOption)optMidiOutuptToHost) : false);
			break;

		case optMidiSnapshotOnLoad:
			result.setInfo ("Snapshot on load", "After the panel is loaded a Snapshot will be sent", panelCategory, 0);
			result.setActive (isPanelActive());
			result.setTicked (getPanelProperty(Ids::panelMidiSnapshotAfterLoad));
			break;

		case optMidiSnapshotOnProgramChange:
			result.setInfo ("Snapshot on program change", "After each program change event on the panel a Snapshot will be sent", panelCategory, 0);
			result.setActive (isPanelActive());
			result.setTicked (getPanelProperty(Ids::panelMidiSnapshotAfterProgramChange));
			break;

		case optMidiThruD2D:
			result.setInfo ("Input device -> Output device", "Send all MIDI messages comming from the MIDI input device via the MIDI output device", panelCategory, 0);
			result.setActive (isPanelActive());
			if (isPanelActive())
				result.setTicked (getActivePanel()->getMidiOptionBool (panelMidiThruD2D));
			break;

		case optMidiThruD2H:
			result.setInfo ("Input device -> Plugin host", "Send all MIDI messages from the MIDI input device to the plugin host (if supported by the plugin format and the host)", panelCategory, 0);
			result.setActive (isPanelActive() && (JUCEApplication::isStandaloneApp() == false));
			if (isPanelActive())
				result.setTicked (getActivePanel()->getMidiOptionBool (panelMidiThruD2H));

			break;

		case optMidiThruH2D:
			result.setInfo ("Plugin host -> Output device", "Send all MIDI messages comming from the plugin host the MIDI output device", panelCategory, 0);
			result.setActive (isPanelActive() && (JUCEApplication::isStandaloneApp() == false));
			if (isPanelActive())
				result.setTicked (getActivePanel()->getMidiOptionBool (panelMidiThruH2D));
			break;

		case optMidiThruH2H:
			result.setInfo ("Plugin host -> Plugin host", "Send all MIDI messages comming from the plugin host back to it (if supported by the plugin format and the host)", panelCategory, 0);
			result.setActive (isPanelActive() && (JUCEApplication::isStandaloneApp() == false));
			if (isPanelActive())
				result.setTicked (getActivePanel()->getMidiOptionBool (panelMidiThruH2H));
			break;

		case optMidiThruD2DChannelize:
			result.setInfo ("Change channel: Input device -> Output device", "Change the channel of MIDI messages comming in on the MIDI input device to the MIDI channel set for the output device", panelCategory, 0);
			result.setActive (isPanelActive() && (JUCEApplication::isStandaloneApp() == false));
			if (isPanelActive())
				result.setTicked (getActivePanel()->getMidiOptionBool (panelMidiThruD2DChannelize));
			break;

		case optMidiThruD2HChannelize:
			result.setInfo ("Change channel: Input device -> Plugin host", "Change the channel of MIDI messages comming in on the MIDI input device to the MIDI channel set for the output to plugin host", panelCategory, 0);
			result.setActive (isPanelActive() && (JUCEApplication::isStandaloneApp() == false));
			if (isPanelActive())
				result.setTicked (getActivePanel()->getMidiOptionBool (panelMidiThruD2HChannelize));
			break;

		case optMidiThruH2DChannelize:
			result.setInfo ("Change channel: Plugin host -> Output device", "Change the channel of MIDI messages comming in from the plugin host to the MIDI channel set for the output device", panelCategory, 0);
			result.setActive (isPanelActive() && (JUCEApplication::isStandaloneApp() == false));
			if (isPanelActive())
				result.setTicked (getActivePanel()->getMidiOptionBool (panelMidiThruH2DChannelize));
			break;

		case optMidiThruH2HChannelize:
			result.setInfo ("Change channel: Plugin host -> Plugin host", "Change the channel of MIDI messages comming in from the plugin host to the MIDI channel set for the output to plugin host", panelCategory, 0);
			result.setActive (isPanelActive() && (JUCEApplication::isStandaloneApp() == false));
			if (isPanelActive())
				result.setTicked (getActivePanel()->getMidiOptionBool (panelMidiThruH2HChannelize));
			break;

		case doCrash:
			result.setInfo ("Crash Ctrlr", "Simulate Ctrlr crashing to see what happens", globalCategory, 0);
			result.setActive (true);
			break;

		case doDumpVstTables:
			result.setInfo ("Dump Memory Info", "Dump information stored in memory in some readable format", globalCategory, 0);
			result.setActive (true);
			break;

		case doRegisterExtension:
			result.setInfo ("Register file extensions", "Register Ctrlr to hanle .panel file extension", globalCategory, 0);
			result.setActive (true);
			break;

        case doKeyGenerator:
            result.setInfo ("Key Generator", "Generate a private key for signing panels", globalCategory, 0);
            result.setActive (true);
            break;

        case doProgramWizard:
            result.setInfo ("Program wizard", "Wizard to generate program requests", globalCategory, 0);
            result.setActive (true);
            break;

		case doQuit:
			result.setInfo ("Quit", "Quit Ctrlr", globalCategory, 0);
			result.setActive (JUCEApplication::isStandaloneApp());
			break;
	}
}