kopia lustrzana https://github.com/jameshball/osci-render
Move volume component to a nicer position and get spout input working
rodzic
14b00e0354
commit
769492c22c
|
@ -6,6 +6,8 @@
|
||||||
MainComponent::MainComponent(OscirenderAudioProcessor& p, OscirenderAudioProcessorEditor& editor) : audioProcessor(p), pluginEditor(editor) {
|
MainComponent::MainComponent(OscirenderAudioProcessor& p, OscirenderAudioProcessorEditor& editor) : audioProcessor(p), pluginEditor(editor) {
|
||||||
setText("Main Settings");
|
setText("Main Settings");
|
||||||
|
|
||||||
|
addAndMakeVisible(editor.volume);
|
||||||
|
|
||||||
addAndMakeVisible(fileButton);
|
addAndMakeVisible(fileButton);
|
||||||
fileButton.setButtonText("Choose File(s)");
|
fileButton.setButtonText("Choose File(s)");
|
||||||
|
|
||||||
|
@ -233,7 +235,11 @@ void MainComponent::resized() {
|
||||||
createFile.setBounds(row.removeFromLeft(buttonWidth));
|
createFile.setBounds(row.removeFromLeft(buttonWidth));
|
||||||
|
|
||||||
bounds.removeFromTop(padding);
|
bounds.removeFromTop(padding);
|
||||||
bounds.expand(10, 0);
|
bounds.expand(15, 0);
|
||||||
|
|
||||||
|
auto volumeArea = bounds.removeFromLeft(30);
|
||||||
|
pluginEditor.volume.setBounds(volumeArea.withSizeKeepingCentre(volumeArea.getWidth(), juce::jmin(volumeArea.getHeight(), 300)));
|
||||||
|
|
||||||
if (!audioProcessor.visualiserParameters.visualiserFullScreen->getBoolValue()) {
|
if (!audioProcessor.visualiserParameters.visualiserFullScreen->getBoolValue()) {
|
||||||
auto minDim = juce::jmin(bounds.getWidth(), bounds.getHeight());
|
auto minDim = juce::jmin(bounds.getWidth(), bounds.getHeight());
|
||||||
juce::Point<int> localTopLeft = {bounds.getX(), bounds.getY()};
|
juce::Point<int> localTopLeft = {bounds.getX(), bounds.getY()};
|
||||||
|
@ -241,9 +247,6 @@ void MainComponent::resized() {
|
||||||
auto shiftedBounds = bounds;
|
auto shiftedBounds = bounds;
|
||||||
shiftedBounds.setX(topLeft.getX());
|
shiftedBounds.setX(topLeft.getX());
|
||||||
shiftedBounds.setY(topLeft.getY());
|
shiftedBounds.setY(topLeft.getY());
|
||||||
//if (minDim < 35) {
|
pluginEditor.visualiser.setBounds(shiftedBounds.withSizeKeepingCentre(minDim, minDim + 25).reduced(10));
|
||||||
// minDim = 35;
|
|
||||||
//}
|
|
||||||
pluginEditor.visualiser.setBounds(shiftedBounds.withSizeKeepingCentre(minDim - 25, minDim));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,6 @@ OscirenderAudioProcessorEditor::OscirenderAudioProcessorEditor(OscirenderAudioPr
|
||||||
upgradeButton.setColour(juce::TextButton::textColourOffId, Colours::veryDark);
|
upgradeButton.setColour(juce::TextButton::textColourOffId, Colours::veryDark);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
addAndMakeVisible(volume);
|
|
||||||
|
|
||||||
addAndMakeVisible(console);
|
addAndMakeVisible(console);
|
||||||
console.setConsoleOpen(false);
|
console.setConsoleOpen(false);
|
||||||
|
|
||||||
|
@ -200,11 +198,6 @@ void OscirenderAudioProcessorEditor::resized() {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
area.removeFromTop(2);
|
|
||||||
area.removeFromLeft(3);
|
|
||||||
auto volumeArea = area.removeFromLeft(30);
|
|
||||||
volume.setBounds(volumeArea.withSizeKeepingCentre(volumeArea.getWidth(), juce::jmin(volumeArea.getHeight(), 300)));
|
|
||||||
area.removeFromLeft(3);
|
|
||||||
bool editorVisible = false;
|
bool editorVisible = false;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,10 +9,23 @@ public:
|
||||||
: juce::Thread("SyphonFrameGrabber"), pollIntervalMs(pollMs), manager(manager), parser(parser) {
|
: juce::Thread("SyphonFrameGrabber"), pollIntervalMs(pollMs), manager(manager), parser(parser) {
|
||||||
// Create the invisible OpenGL context component
|
// Create the invisible OpenGL context component
|
||||||
glContextComponent = std::make_unique<InvisibleOpenGLContextComponent>();
|
glContextComponent = std::make_unique<InvisibleOpenGLContextComponent>();
|
||||||
|
|
||||||
|
// Make sure the context is properly initialized before creating the receiver
|
||||||
|
glContextComponent->getContext().makeActive();
|
||||||
|
|
||||||
|
// Create the receiver after the context is active
|
||||||
receiver = manager.addReceiver(server, app);
|
receiver = manager.addReceiver(server, app);
|
||||||
if (receiver) {
|
if (receiver) {
|
||||||
receiver->setUseCPUImage(true); // for pixel access
|
receiver->setUseCPUImage(true); // for pixel access
|
||||||
|
|
||||||
|
// Initialize the receiver with the active GL context
|
||||||
|
receiver->initGL();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Release the context
|
||||||
|
glContextComponent->getContext().deactivateCurrentContext();
|
||||||
|
|
||||||
|
// Start the thread after everything is set up
|
||||||
startThread();
|
startThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,12 +41,15 @@ public:
|
||||||
void run() override {
|
void run() override {
|
||||||
while (!threadShouldExit()) {
|
while (!threadShouldExit()) {
|
||||||
{
|
{
|
||||||
|
bool activated = false;
|
||||||
if (glContextComponent) {
|
if (glContextComponent) {
|
||||||
glContextComponent->getContext().makeActive();
|
activated = glContextComponent->getContext().makeActive();
|
||||||
}
|
}
|
||||||
|
if (juce::OpenGLContext::getCurrentContext() != nullptr) {
|
||||||
receiver->renderGL();
|
receiver->renderGL();
|
||||||
if (glContextComponent) {
|
}
|
||||||
glContextComponent->getContext().deactivateCurrentContext();
|
if (activated && glContextComponent) {
|
||||||
|
juce::OpenGLContext::deactivateCurrentContext();
|
||||||
}
|
}
|
||||||
if (isActive() && receiver->isConnected) {
|
if (isActive() && receiver->isConnected) {
|
||||||
juce::Image image = receiver->getImage();
|
juce::Image image = receiver->getImage();
|
||||||
|
@ -61,6 +77,7 @@ private:
|
||||||
SharedTextureReceiver* receiver = nullptr;
|
SharedTextureReceiver* receiver = nullptr;
|
||||||
ImageParser& parser;
|
ImageParser& parser;
|
||||||
std::unique_ptr<InvisibleOpenGLContextComponent> glContextComponent;
|
std::unique_ptr<InvisibleOpenGLContextComponent> glContextComponent;
|
||||||
|
juce::CriticalSection openGLLock; // To protect OpenGL context operations
|
||||||
|
|
||||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SyphonFrameGrabber)
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SyphonFrameGrabber)
|
||||||
};
|
};
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8c77ff43e2d22ae927bfb3a268d0724e4174b53f
|
Subproject commit aeabce4a83b16c7277ba0d4ff0c8160726c82f8d
|
Ładowanie…
Reference in New Issue