kopia lustrzana https://github.com/jameshball/osci-render
Add toggle for syhpon/spout
rodzic
961c6ada19
commit
9cd2c5b4d3
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,14.5C19,14.5 21,16.67 21,18A2,2 0 0,1 19,20A2,2 0 0,1 17,18C17,16.67 19,14.5 19,14.5M5,18V9A2,2 0 0,1 3,7A2,2 0 0,1 5,5V4A2,2 0 0,1 7,2H9A2,2 0 0,1 11,4V5H19A2,2 0 0,1 21,7V9L21,11A1,1 0 0,1 22,12A1,1 0 0,1 21,13H17A1,1 0 0,1 16,12A1,1 0 0,1 17,11V9H11V18H12A2,2 0 0,1 14,20V22H2V20A2,2 0 0,1 4,18H5Z" /></svg>
|
Po Szerokość: | Wysokość: | Rozmiar: 383 B |
|
@ -2,9 +2,10 @@
|
||||||
#include "../SosciPluginEditor.h"
|
#include "../SosciPluginEditor.h"
|
||||||
#include "../SosciPluginProcessor.h"
|
#include "../SosciPluginProcessor.h"
|
||||||
|
|
||||||
SosciMainMenuBarModel::SosciMainMenuBarModel(SosciPluginEditor& editor, SosciAudioProcessor& processor) : editor(editor), processor(processor) {
|
SosciMainMenuBarModel::SosciMainMenuBarModel(SosciPluginEditor& e, SosciAudioProcessor& processor) : editor(e), processor(processor) {
|
||||||
addTopLevelMenu("File");
|
addTopLevelMenu("File");
|
||||||
addTopLevelMenu("About");
|
addTopLevelMenu("About");
|
||||||
|
addTopLevelMenu("Recording");
|
||||||
addTopLevelMenu("Audio");
|
addTopLevelMenu("Audio");
|
||||||
|
|
||||||
addMenuItem(0, "Open", [&]() { editor.openProject(); });
|
addMenuItem(0, "Open", [&]() { editor.openProject(); });
|
||||||
|
@ -32,13 +33,17 @@ SosciMainMenuBarModel::SosciMainMenuBarModel(SosciPluginEditor& editor, SosciAud
|
||||||
|
|
||||||
juce::DialogWindow* dw = options.launchAsync();
|
juce::DialogWindow* dw = options.launchAsync();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
addMenuItem(2, "Settings...", [this] {
|
||||||
|
editor.openRecordingSettings();
|
||||||
|
});
|
||||||
|
|
||||||
addMenuItem(2, "Force Disable Brightness Input", [&]() {
|
addMenuItem(3, "Force Disable Brightness Input", [&]() {
|
||||||
processor.forceDisableBrightnessInput = !processor.forceDisableBrightnessInput;
|
processor.forceDisableBrightnessInput = !processor.forceDisableBrightnessInput;
|
||||||
menuItemsChanged();
|
menuItemsChanged();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (editor.processor.wrapperType == juce::AudioProcessor::WrapperType::wrapperType_Standalone) {
|
if (editor.processor.wrapperType == juce::AudioProcessor::WrapperType::wrapperType_Standalone) {
|
||||||
addMenuItem(2, "Settings...", [&]() { editor.openAudioSettings(); });
|
addMenuItem(3, "Settings...", [&]() { editor.openAudioSettings(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ VisualiserComponent::VisualiserComponent(juce::File& lastOpenedDirectory, juce::
|
||||||
};
|
};
|
||||||
|
|
||||||
addAndMakeVisible(record);
|
addAndMakeVisible(record);
|
||||||
|
record.setTooltip("Toggles recording of the oscilloscope's visuals and audio.");
|
||||||
record.setPulseAnimation(true);
|
record.setPulseAnimation(true);
|
||||||
record.onClick = [this] {
|
record.onClick = [this] {
|
||||||
setRecording(record.getToggleState());
|
setRecording(record.getToggleState());
|
||||||
|
@ -39,11 +40,29 @@ VisualiserComponent::VisualiserComponent(juce::File& lastOpenedDirectory, juce::
|
||||||
|
|
||||||
if (parent == nullptr && !visualiserOnly) {
|
if (parent == nullptr && !visualiserOnly) {
|
||||||
addAndMakeVisible(fullScreenButton);
|
addAndMakeVisible(fullScreenButton);
|
||||||
|
fullScreenButton.setTooltip("Toggles fullscreen mode.");
|
||||||
}
|
}
|
||||||
if (child == nullptr && parent == nullptr && !visualiserOnly) {
|
if (child == nullptr && parent == nullptr && !visualiserOnly) {
|
||||||
addAndMakeVisible(popOutButton);
|
addAndMakeVisible(popOutButton);
|
||||||
|
popOutButton.setTooltip("Opens the oscilloscope in a new window.");
|
||||||
}
|
}
|
||||||
addAndMakeVisible(settingsButton);
|
addAndMakeVisible(settingsButton);
|
||||||
|
settingsButton.setTooltip("Opens the visualiser settings window.");
|
||||||
|
//if (visualiserOnly) {
|
||||||
|
addAndMakeVisible(sharedTextureButton);
|
||||||
|
sharedTextureButton.setTooltip("Toggles sending the oscilloscope's visuals to a Syphon/Spout receiver.");
|
||||||
|
sharedTextureButton.onClick = [this] {
|
||||||
|
if (sharedTextureSender != nullptr) {
|
||||||
|
openGLContext.executeOnGLThread([this](juce::OpenGLContext& context) {
|
||||||
|
closeSharedTexture();
|
||||||
|
}, false);
|
||||||
|
} else {
|
||||||
|
openGLContext.executeOnGLThread([this](juce::OpenGLContext& context) {
|
||||||
|
initialiseSharedTexture();
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//}
|
||||||
|
|
||||||
fullScreenButton.onClick = [this]() {
|
fullScreenButton.onClick = [this]() {
|
||||||
enableFullScreen();
|
enableFullScreen();
|
||||||
|
@ -277,6 +296,9 @@ void VisualiserComponent::resized() {
|
||||||
popOutButton.setBounds(buttonRow.removeFromRight(30));
|
popOutButton.setBounds(buttonRow.removeFromRight(30));
|
||||||
}
|
}
|
||||||
settingsButton.setBounds(buttonRow.removeFromRight(30));
|
settingsButton.setBounds(buttonRow.removeFromRight(30));
|
||||||
|
//if (visualiserOnly) {
|
||||||
|
sharedTextureButton.setBounds(buttonRow.removeFromRight(30));
|
||||||
|
//}
|
||||||
record.setBounds(buttonRow.removeFromRight(25));
|
record.setBounds(buttonRow.removeFromRight(25));
|
||||||
if (record.getToggleState()) {
|
if (record.getToggleState()) {
|
||||||
stopwatch.setVisible(true);
|
stopwatch.setVisible(true);
|
||||||
|
@ -293,6 +315,9 @@ void VisualiserComponent::resized() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualiserComponent::popoutWindow() {
|
void VisualiserComponent::popoutWindow() {
|
||||||
|
if (sharedTextureButton.getToggleState()) {
|
||||||
|
sharedTextureButton.triggerClick();
|
||||||
|
}
|
||||||
setRecording(false);
|
setRecording(false);
|
||||||
auto visualiser = new VisualiserComponent(lastOpenedDirectory, ffmpegFile, haltRecording, threadManager, settings, recordingParameters, this);
|
auto visualiser = new VisualiserComponent(lastOpenedDirectory, ffmpegFile, haltRecording, threadManager, settings, recordingParameters, this);
|
||||||
visualiser->settings.setLookAndFeel(&getLookAndFeel());
|
visualiser->settings.setLookAndFeel(&getLookAndFeel());
|
||||||
|
@ -338,10 +363,12 @@ void VisualiserComponent::initialiseSharedTexture() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualiserComponent::closeSharedTexture() {
|
void VisualiserComponent::closeSharedTexture() {
|
||||||
if (SharedTextureManager::getInstanceWithoutCreating() != nullptr) {
|
if (sharedTextureSender != nullptr) {
|
||||||
SharedTextureManager::getInstance()->removeSender(sharedTextureSender);
|
if (SharedTextureManager::getInstanceWithoutCreating() != nullptr) {
|
||||||
|
SharedTextureManager::getInstance()->removeSender(sharedTextureSender);
|
||||||
|
}
|
||||||
|
sharedTextureSender = nullptr;
|
||||||
}
|
}
|
||||||
sharedTextureSender = nullptr;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,18 +421,12 @@ void VisualiserComponent::newOpenGLContextCreated() {
|
||||||
glGenBuffers(1, &vertexIndexBuffer);
|
glGenBuffers(1, &vertexIndexBuffer);
|
||||||
|
|
||||||
setupTextures();
|
setupTextures();
|
||||||
|
|
||||||
if (parent == nullptr) {
|
|
||||||
initialiseSharedTexture();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualiserComponent::openGLContextClosing() {
|
void VisualiserComponent::openGLContextClosing() {
|
||||||
using namespace juce::gl;
|
using namespace juce::gl;
|
||||||
|
|
||||||
if (parent == nullptr) {
|
closeSharedTexture();
|
||||||
closeSharedTexture();
|
|
||||||
}
|
|
||||||
|
|
||||||
glDeleteBuffers(1, &quadIndexBuffer);
|
glDeleteBuffers(1, &quadIndexBuffer);
|
||||||
glDeleteBuffers(1, &vertexIndexBuffer);
|
glDeleteBuffers(1, &vertexIndexBuffer);
|
||||||
|
@ -447,11 +468,11 @@ void VisualiserComponent::renderOpenGL() {
|
||||||
renderScope(xSamples, ySamples, zSamples);
|
renderScope(xSamples, ySamples, zSamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parent == nullptr) {
|
//if (parent == nullptr) {
|
||||||
if (sharedTextureSender != nullptr) {
|
if (sharedTextureSender != nullptr) {
|
||||||
sharedTextureSender->renderGL();
|
sharedTextureSender->renderGL();
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (record.getToggleState()) {
|
if (record.getToggleState()) {
|
||||||
if (recordingVideo) {
|
if (recordingVideo) {
|
||||||
|
|
|
@ -75,6 +75,7 @@ private:
|
||||||
SvgButton fullScreenButton{ "fullScreen", BinaryData::fullscreen_svg, juce::Colours::white, juce::Colours::white };
|
SvgButton fullScreenButton{ "fullScreen", BinaryData::fullscreen_svg, juce::Colours::white, juce::Colours::white };
|
||||||
SvgButton popOutButton{ "popOut", BinaryData::open_in_new_svg, juce::Colours::white, juce::Colours::white };
|
SvgButton popOutButton{ "popOut", BinaryData::open_in_new_svg, juce::Colours::white, juce::Colours::white };
|
||||||
SvgButton settingsButton{ "settings", BinaryData::cog_svg, juce::Colours::white, juce::Colours::white };
|
SvgButton settingsButton{ "settings", BinaryData::cog_svg, juce::Colours::white, juce::Colours::white };
|
||||||
|
SvgButton sharedTextureButton{ "sharedTexture", BinaryData::spout_svg, juce::Colours::white, juce::Colours::red };
|
||||||
|
|
||||||
std::function<void(FullScreenMode)> fullScreenCallback;
|
std::function<void(FullScreenMode)> fullScreenCallback;
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,8 @@
|
||||||
<FILE id="CE6di2" name="range.svg" compile="0" resource="1" file="Resources/svg/range.svg"/>
|
<FILE id="CE6di2" name="range.svg" compile="0" resource="1" file="Resources/svg/range.svg"/>
|
||||||
<FILE id="n79IAy" name="record.svg" compile="0" resource="1" file="Resources/svg/record.svg"/>
|
<FILE id="n79IAy" name="record.svg" compile="0" resource="1" file="Resources/svg/record.svg"/>
|
||||||
<FILE id="OaqZb1" name="right_arrow.svg" compile="0" resource="1" file="Resources/svg/right_arrow.svg"/>
|
<FILE id="OaqZb1" name="right_arrow.svg" compile="0" resource="1" file="Resources/svg/right_arrow.svg"/>
|
||||||
|
<FILE id="yiDo4s" name="spout.svg" compile="0" resource="1" file="Resources/svg/spout.svg"/>
|
||||||
|
<FILE id="I34qEM" name="spout_off.svg" compile="0" resource="1" file="Resources/svg/spout_off.svg"/>
|
||||||
<FILE id="rXjNlx" name="threshold.svg" compile="0" resource="1" file="Resources/svg/threshold.svg"/>
|
<FILE id="rXjNlx" name="threshold.svg" compile="0" resource="1" file="Resources/svg/threshold.svg"/>
|
||||||
<FILE id="rFYmV8" name="timer.svg" compile="0" resource="1" file="Resources/svg/timer.svg"/>
|
<FILE id="rFYmV8" name="timer.svg" compile="0" resource="1" file="Resources/svg/timer.svg"/>
|
||||||
<FILE id="qC6QiP" name="volume.svg" compile="0" resource="1" file="Resources/svg/volume.svg"/>
|
<FILE id="qC6QiP" name="volume.svg" compile="0" resource="1" file="Resources/svg/volume.svg"/>
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
<FILE id="CE6di2" name="range.svg" compile="0" resource="1" file="Resources/svg/range.svg"/>
|
<FILE id="CE6di2" name="range.svg" compile="0" resource="1" file="Resources/svg/range.svg"/>
|
||||||
<FILE id="n79IAy" name="record.svg" compile="0" resource="1" file="Resources/svg/record.svg"/>
|
<FILE id="n79IAy" name="record.svg" compile="0" resource="1" file="Resources/svg/record.svg"/>
|
||||||
<FILE id="OaqZb1" name="right_arrow.svg" compile="0" resource="1" file="Resources/svg/right_arrow.svg"/>
|
<FILE id="OaqZb1" name="right_arrow.svg" compile="0" resource="1" file="Resources/svg/right_arrow.svg"/>
|
||||||
|
<FILE id="z3A7FT" name="spout.svg" compile="0" resource="1" file="Resources/svg/spout.svg"/>
|
||||||
<FILE id="rXjNlx" name="threshold.svg" compile="0" resource="1" file="Resources/svg/threshold.svg"/>
|
<FILE id="rXjNlx" name="threshold.svg" compile="0" resource="1" file="Resources/svg/threshold.svg"/>
|
||||||
<FILE id="rFYmV8" name="timer.svg" compile="0" resource="1" file="Resources/svg/timer.svg"/>
|
<FILE id="rFYmV8" name="timer.svg" compile="0" resource="1" file="Resources/svg/timer.svg"/>
|
||||||
<FILE id="qC6QiP" name="volume.svg" compile="0" resource="1" file="Resources/svg/volume.svg"/>
|
<FILE id="qC6QiP" name="volume.svg" compile="0" resource="1" file="Resources/svg/volume.svg"/>
|
||||||
|
@ -242,7 +243,9 @@
|
||||||
<XCODE_MAC targetFolder="Builds/sosci/MacOSX" extraLinkerFlags="-Wl,-weak_reference_mismatches,weak"
|
<XCODE_MAC targetFolder="Builds/sosci/MacOSX" extraLinkerFlags="-Wl,-weak_reference_mismatches,weak"
|
||||||
extraDefs="JUCE_SILENCE_XCODE_15_LINKER_WARNING=1" smallIcon="pSc1mq"
|
extraDefs="JUCE_SILENCE_XCODE_15_LINKER_WARNING=1" smallIcon="pSc1mq"
|
||||||
bigIcon="pSc1mq" applicationCategory="public.app-category.music"
|
bigIcon="pSc1mq" applicationCategory="public.app-category.music"
|
||||||
microphonePermissionNeeded="1">
|
microphonePermissionNeeded="1" frameworkSearchPaths="../../../External/syphon"
|
||||||
|
extraCustomFrameworks="../../../External/syphon/Syphon.framework"
|
||||||
|
embeddedFrameworks="../../../External/syphon/Syphon.framework">
|
||||||
<CONFIGURATIONS>
|
<CONFIGURATIONS>
|
||||||
<CONFIGURATION isDebug="1" name="Debug" targetName="sosci"/>
|
<CONFIGURATION isDebug="1" name="Debug" targetName="sosci"/>
|
||||||
<CONFIGURATION name="Release" targetName="sosci"/>
|
<CONFIGURATION name="Release" targetName="sosci"/>
|
||||||
|
|
Ładowanie…
Reference in New Issue