| 733 | #endif |
| 734 | |
| 735 | void onAction(const ActionEvent& e) override { |
| 736 | ui::Menu* menu = createMenu(); |
| 737 | menu->cornerFlags = BND_CORNER_TOP; |
| 738 | menu->box.pos = getAbsoluteOffset(math::Vec(0, box.size.y)); |
| 739 | |
| 740 | std::string cpuMeterText = "F3"; |
| 741 | if (settings::cpuMeter) |
| 742 | cpuMeterText += " " CHECKMARK_STRING; |
| 743 | menu->addChild(createMenuItem("Performance meters", cpuMeterText, [=]() { |
| 744 | settings::cpuMeter ^= true; |
| 745 | })); |
| 746 | |
| 747 | #ifdef HAVE_LIBLO |
| 748 | if (isStandalone()) { |
| 749 | CardinalPluginContext* const context = static_cast<CardinalPluginContext*>(APP); |
| 750 | CardinalBasePlugin* const plugin = static_cast<CardinalBasePlugin*>(context->plugin); |
| 751 | |
| 752 | // const bool remoteServerStarted = this->remoteServerStarted; |
| 753 | const std::string remoteControlText = remoteServerStarted ? " " CHECKMARK_STRING : ""; |
| 754 | |
| 755 | menu->addChild(createMenuItem("Enable OSC remote control", remoteControlText, [=]() { |
| 756 | if (remoteServerStarted) { |
| 757 | remoteServerStarted = false; |
| 758 | plugin->stopRemoteServer(); |
| 759 | return; |
| 760 | } |
| 761 | |
| 762 | async_dialog_text_input("OSC network port", CARDINAL_DEFAULT_REMOTE_PORT, [=](char* const port) { |
| 763 | if (port == nullptr) |
| 764 | return; |
| 765 | |
| 766 | if (plugin->startRemoteServer(port)) |
| 767 | remoteServerStarted = true; |
| 768 | |
| 769 | std::free(port); |
| 770 | }); |
| 771 | })); |
| 772 | } |
| 773 | #endif |
| 774 | |
| 775 | if (isUsingNativeAudio()) { |
| 776 | if (supportsAudioInput()) { |
| 777 | const bool enabled = isAudioInputEnabled(); |
| 778 | std::string rightText; |
| 779 | if (enabled) |
| 780 | rightText = CHECKMARK_STRING; |
| 781 | menu->addChild(createMenuItem("Enable Audio Input", rightText, [enabled]() { |
| 782 | if (!enabled) |
| 783 | requestAudioInput(); |
| 784 | })); |
| 785 | } |
| 786 | |
| 787 | if (supportsMIDI()) { |
| 788 | std::string rightText; |
| 789 | if (isMIDIEnabled()) |
| 790 | rightText = CHECKMARK_STRING; |
| 791 | menu->addChild(createMenuItem("Enable/Reconnect MIDI", rightText, []() { |
| 792 | requestMIDI(); |
nothing calls this directly
no test coverage detected