Fix osci-render free version, and remove license registration from free version, and support mono audio input

pull/300/head
James H Ball 2025-04-24 11:29:13 +01:00
rodzic 335bf5f055
commit 7b3930689a
22 zmienionych plików z 138 dodań i 93 usunięć

Wyświetl plik

@ -64,8 +64,10 @@ CommonPluginEditor::CommonPluginEditor(CommonAudioProcessor& p, juce::String app
updateTitle();
#if SOSCI_FEATURES
#if OSCI_PREMIUM
sharedTextureManager.initGL();
#else
visualiser.setVisible(true);
#endif
}

Wyświetl plik

@ -9,7 +9,10 @@
#include "components/SvgButton.h"
#include "components/VolumeComponent.h"
#include "components/DownloaderComponent.h"
#include "components/LicenseRegistrationComponent.h"
#if OSCI_PREMIUM
#include "components/LicenseRegistrationComponent.h"
#endif
class CommonPluginEditor : public juce::AudioProcessorEditor {
public:
@ -39,12 +42,12 @@ public:
juce::String projectFileType;
juce::String currentFileName;
#if SOSCI_FEATURES
#if OSCI_PREMIUM
DownloaderComponent ffmpegDownloader;
SharedTextureManager sharedTextureManager;
#endif
#if SOSCI_FEATURES
#if OSCI_PREMIUM
int VISUALISER_SETTINGS_HEIGHT = 1200;
#else
int VISUALISER_SETTINGS_HEIGHT = 700;
@ -56,7 +59,7 @@ public:
VisualiserComponent visualiser{
audioProcessor,
*this,
#if SOSCI_FEATURES
#if OSCI_PREMIUM
sharedTextureManager,
#endif
audioProcessor.applicationFolder.getChildFile(audioProcessor.ffmpegFileName),
@ -73,9 +76,11 @@ public:
juce::SharedResourcePointer<juce::TooltipWindow> tooltipWindow;
juce::DropShadower tooltipDropShadow{juce::DropShadow(juce::Colours::black.withAlpha(0.5f), 6, {0,0})};
#if OSCI_PREMIUM
LicenseRegistrationComponent licenseRegistration {audioProcessor, [this](bool success) {
visualiser.setVisible(success);
}};
#endif
bool usingNativeMenuBar = false;
#if JUCE_LINUX

Wyświetl plik

@ -433,6 +433,7 @@ bool CommonAudioProcessor::programCrashedAndUserWantsToReset() {
return userWantsToReset;
}
#if OSCI_PREMIUM
juce::String CommonAudioProcessor::getFFmpegURL() {
juce::String ffmpegURL = juce::String("https://github.com/eugeneware/ffmpeg-static/releases/download/b6.0/") +
#if JUCE_WINDOWS
@ -514,3 +515,4 @@ bool CommonAudioProcessor::ensureFFmpegExists(std::function<void()> onStart, std
return false;
}
#endif

Wyświetl plik

@ -62,6 +62,7 @@ public:
std::any getProperty(const std::string& key, std::any defaultValue);
void setProperty(const std::string& key, std::any value);
#if OSCI_PREMIUM
// Get the ffmpeg binary file
juce::File getFFmpegFile() const { return applicationFolder.getChildFile(ffmpegFileName); }
@ -70,6 +71,7 @@ public:
// A static method to get the appropriate ffmpeg URL based on platform
static juce::String getFFmpegURL();
#endif
// Global settings methods
bool getGlobalBoolValue(const juce::String& keyName, bool defaultValue = false) const;

Wyświetl plik

@ -10,7 +10,11 @@ MainComponent::MainComponent(OscirenderAudioProcessor& p, OscirenderAudioProcess
fileButton.setButtonText("Choose File(s)");
fileButton.onClick = [this] {
chooser = std::make_unique<juce::FileChooser>("Open", audioProcessor.getLastOpenedDirectory(), "*.obj;*.svg;*.lua;*.txt;*.gpla;*.gif;*.png;*.jpg;*.jpeg;*.wav;*.aiff;*.ogg;*.flac;*.mp3;*.mp4;*.mov");
juce::String fileFormats = "*.obj;*.svg;*.lua;*.txt;*.gpla;*.gif;*.png;*.jpg;*.jpeg;*.wav;*.aiff;*.ogg;*.flac;*.mp3";
#if OSCI_PREMIUM
fileFormats += ";*.mp4;*.mov";
#endif
chooser = std::make_unique<juce::FileChooser>("Open", audioProcessor.getLastOpenedDirectory(), fileFormats);
auto flags = juce::FileBrowserComponent::openMode | juce::FileBrowserComponent::canSelectMultipleItems |
juce::FileBrowserComponent::canSelectFiles;

Wyświetl plik

@ -16,7 +16,7 @@ OscirenderAudioProcessorEditor::OscirenderAudioProcessorEditor(OscirenderAudioPr
// Register the file removal callback
registerFileRemovedCallback();
#if !SOSCI_FEATURES
#if !OSCI_PREMIUM
addAndMakeVisible(upgradeButton);
upgradeButton.onClick = [this] {
juce::URL("https://osci-render.com/sosci").launchInDefaultBrowser();
@ -95,9 +95,11 @@ OscirenderAudioProcessorEditor::OscirenderAudioProcessorEditor(OscirenderAudioPr
#endif
initialiseMenuBar(model);
#if OSCI_PREMIUM
addChildComponent(licenseRegistration);
licenseRegistration.toFront(true);
#endif
}
OscirenderAudioProcessorEditor::~OscirenderAudioProcessorEditor() {
@ -187,7 +189,9 @@ void OscirenderAudioProcessorEditor::resized() {
auto area = getLocalBounds();
#if OSCI_PREMIUM
licenseRegistration.setBounds(area);
#endif
if (audioProcessor.visualiserParameters.visualiserFullScreen->getBoolValue()) {
visualiser.setBounds(area);
@ -197,7 +201,7 @@ void OscirenderAudioProcessorEditor::resized() {
if (!usingNativeMenuBar) {
auto topBar = area.removeFromTop(25);
menuBar.setBounds(topBar);
#if !SOSCI_FEATURES
#if !OSCI_PREMIUM
upgradeButton.setBounds(topBar.removeFromRight(150).reduced(2, 2));
#endif
}

Wyświetl plik

@ -46,7 +46,7 @@ public:
SettingsComponent settings{audioProcessor, *this};
#if !SOSCI_FEATURES
#if !OSCI_PREMIUM
juce::TextButton upgradeButton{"Upgrade to premium!"};
#endif

Wyświetl plik

@ -506,10 +506,16 @@ void OscirenderAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, ju
juce::AudioBuffer<float> outputBuffer3d = juce::AudioBuffer<float>(3, buffer.getNumSamples());
outputBuffer3d.clear();
if (usingInput && totalNumInputChannels >= 2) {
for (auto channel = 0; channel < juce::jmin(2, totalNumInputChannels); channel++) {
outputBuffer3d.copyFrom(channel, 0, inputBuffer, channel, 0, buffer.getNumSamples());
if (usingInput && totalNumInputChannels >= 1) {
if (totalNumInputChannels >= 2) {
for (auto channel = 0; channel < juce::jmin(2, totalNumInputChannels); channel++) {
outputBuffer3d.copyFrom(channel, 0, inputBuffer, channel, 0, buffer.getNumSamples());
}
} else {
// For mono input, copy the single channel to both left and right
outputBuffer3d.copyFrom(0, 0, inputBuffer, 0, 0, buffer.getNumSamples());
outputBuffer3d.copyFrom(1, 0, inputBuffer, 0, 0, buffer.getNumSamples());
}
// handle all midi messages
@ -535,7 +541,6 @@ void OscirenderAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, ju
auto* channelData = buffer.getArrayOfWritePointers();
for (int sample = 0; sample < buffer.getNumSamples(); ++sample) {
// Update frame animation
if (animateFrames->getBoolValue()) {

Wyświetl plik

@ -34,8 +34,10 @@ SosciPluginEditor::SosciPluginEditor(SosciAudioProcessor& p) : CommonPluginEdito
currentInputDevice = getInputDeviceName();
}
#if OSCI_PREMIUM
addChildComponent(licenseRegistration);
licenseRegistration.toFront(true);
#endif
}
SosciPluginEditor::~SosciPluginEditor() {
@ -56,7 +58,9 @@ void SosciPluginEditor::resized() {
CommonPluginEditor::resized();
auto area = getLocalBounds();
#if OSCI_PREMIUM
licenseRegistration.setBounds(area);
#endif
if (audioProcessor.visualiserParameters.visualiserFullScreen->getBoolValue()) {
visualiser.setBounds(area);

Wyświetl plik

@ -21,7 +21,7 @@ OsciMainMenuBarModel::OsciMainMenuBarModel(OscirenderAudioProcessor& p, Oscirend
juce::DialogWindow::LaunchOptions options;
AboutComponent* about = new AboutComponent(BinaryData::logo_png, BinaryData::logo_pngSize,
juce::String(ProjectInfo::projectName) + " by " + ProjectInfo::companyName + "\n"
#if SOSCI_FEATURES
#if OSCI_PREMIUM
"Thank you for purchasing osci-render premium!\n"
#else
"Free version\n"
@ -52,7 +52,7 @@ OsciMainMenuBarModel::OsciMainMenuBarModel(OscirenderAudioProcessor& p, Oscirend
audioProcessor.setObjectServerPort(juce::Random::getSystemRandom().nextInt(juce::Range<int>(51600, 51700)));
});
#if !SOSCI_FEATURES
#if !OSCI_PREMIUM
addMenuItem(1, "Purchase osci-render premium!", [this] {
juce::URL("https://osci-render.com/sosci").launchInDefaultBrowser();
});

Wyświetl plik

@ -62,7 +62,7 @@ SosciMainMenuBarModel::SosciMainMenuBarModel(SosciPluginEditor& e, SosciAudioPro
juce::DialogWindow::LaunchOptions options;
AboutComponent* about = new AboutComponent(BinaryData::sosci_logo_png, BinaryData::sosci_logo_pngSize,
juce::String(ProjectInfo::projectName) + " by " + ProjectInfo::companyName + "\n"
#if SOSCI_FEATURES
#if OSCI_PREMIUM
"Thank you for purchasing sosci!\n"
#else
"Free version\n"

Wyświetl plik

@ -20,18 +20,26 @@ ImageParser::ImageParser(OscirenderAudioProcessor& p, juce::String extension, ju
if (extension.equalsIgnoreCase(".gif")) {
processGifFile(file);
} else if (isVideoFile(extension)) {
}
#if OSCI_PREMIUM
else if (isVideoFile(extension)) {
processVideoFile(file);
} else {
}
#endif
else {
processImageFile(file);
}
if (frames.size() == 0) {
if (extension.equalsIgnoreCase(".gif")) {
handleError("The image could not be loaded. Please try optimising the GIF with https://ezgif.com/optimize.");
} else if (isVideoFile(extension)) {
}
#if OSCI_PREMIUM
else if (isVideoFile(extension)) {
handleError("The video could not be loaded. Please check that ffmpeg is installed.");
} else {
}
#endif
else {
handleError("The image could not be loaded.");
}
return;
@ -40,10 +48,6 @@ ImageParser::ImageParser(OscirenderAudioProcessor& p, juce::String extension, ju
setFrame(0);
}
bool ImageParser::isVideoFile(const juce::String& extension) const {
return extension.equalsIgnoreCase(".mp4") || extension.equalsIgnoreCase(".mov");
}
void ImageParser::processGifFile(juce::File& file) {
juce::String fileName = file.getFullPathName();
gd_GIF *gif = gd_open_gif(fileName.toRawUTF8());
@ -104,6 +108,11 @@ void ImageParser::processImageFile(juce::File& file) {
}
}
#if OSCI_PREMIUM
bool ImageParser::isVideoFile(const juce::String& extension) const {
return extension.equalsIgnoreCase(".mp4") || extension.equalsIgnoreCase(".mov");
}
void ImageParser::processVideoFile(juce::File& file) {
// Set video processing flag
isVideo = true;
@ -250,11 +259,14 @@ bool ImageParser::loadAllVideoFrames(const juce::File& file, const juce::File& f
// Return true if we successfully loaded at least one frame
return frames.size() > 0;
}
#endif
ImageParser::~ImageParser() {
#if OSCI_PREMIUM
if (ffmpegProcess.isRunning()) {
ffmpegProcess.close();
}
#endif
}
void ImageParser::handleError(juce::String message) {

Wyświetl plik

@ -26,9 +26,11 @@ private:
void handleError(juce::String message);
void processGifFile(juce::File& file);
void processImageFile(juce::File& file);
#if OSCI_PREMIUM
void processVideoFile(juce::File& file);
bool loadAllVideoFrames(const juce::File& file, const juce::File& ffmpegFile);
bool isVideoFile(const juce::String& extension) const;
#endif
const juce::String ALGORITHM = "HILLIGOSS";
@ -42,12 +44,15 @@ private:
int height = -1;
int count = 0;
juce::TemporaryFile temp;
#if OSCI_PREMIUM
// Video processing fields
osci::ReadProcess ffmpegProcess;
bool isVideo = false;
juce::TemporaryFile temp;
std::vector<uint8_t> frameBuffer;
int videoFrameSize = 0;
#endif
// experiments
double scanX = -1;

Wyświetl plik

@ -4,7 +4,7 @@
RecordingSettings::RecordingSettings(RecordingParameters& ps) : parameters(ps) {
#if SOSCI_FEATURES
#if OSCI_PREMIUM
addAndMakeVisible(quality);
addAndMakeVisible(resolution);
addAndMakeVisible(frameRate);
@ -85,7 +85,7 @@ void RecordingSettings::resized() {
auto area = getLocalBounds().reduced(20);
double rowHeight = 30;
#if SOSCI_FEATURES
#if OSCI_PREMIUM
losslessVideo.setBounds(area.removeFromTop(rowHeight));
quality.setBounds(area.removeFromTop(rowHeight).expanded(6, 0));
resolution.setBounds(area.removeFromTop(rowHeight).expanded(6, 0));

Wyświetl plik

@ -31,7 +31,7 @@ public:
private:
#if SOSCI_FEATURES
#if OSCI_PREMIUM
const bool sosciFeatures = true;
#else
const bool sosciFeatures = false;
@ -208,7 +208,7 @@ private:
jux::SwitchButton recordAudio{&parameters.recordAudio};
jux::SwitchButton recordVideo{&parameters.recordVideo};
#if !SOSCI_FEATURES
#if !OSCI_PREMIUM
juce::TextEditor recordVideoWarning{"recordVideoWarning"};
juce::HyperlinkButton sosciLink{"Purchase here", juce::URL("https://osci-render.com/sosci")};
#endif

Wyświetl plik

@ -23,7 +23,7 @@
VisualiserComponent::VisualiserComponent(
CommonAudioProcessor& processor,
CommonPluginEditor& pluginEditor,
#if SOSCI_FEATURES
#if OSCI_PREMIUM
SharedTextureManager& sharedTextureManager,
#endif
juce::File ffmpegFile,
@ -33,7 +33,7 @@ VisualiserComponent::VisualiserComponent(
bool visualiserOnly
) : audioProcessor(processor),
ffmpegFile(ffmpegFile),
#if SOSCI_FEATURES
#if OSCI_PREMIUM
sharedTextureManager(sharedTextureManager),
#endif
settings(settings),
@ -42,7 +42,7 @@ VisualiserComponent::VisualiserComponent(
osci::AudioBackgroundThread("VisualiserComponent" + juce::String(parent != nullptr ? " Child" : ""), processor.threadManager),
parent(parent),
editor(pluginEditor) {
#if SOSCI_FEATURES
#if OSCI_PREMIUM
addAndMakeVisible(editor.ffmpegDownloader);
#endif
@ -51,7 +51,7 @@ VisualiserComponent::VisualiserComponent(
};
addAndMakeVisible(record);
#if SOSCI_FEATURES
#if OSCI_PREMIUM
record.setTooltip("Toggles recording of the oscilloscope's visuals and audio.");
#else
record.setTooltip("Toggles recording of the audio.");
@ -77,7 +77,7 @@ VisualiserComponent::VisualiserComponent(
addAndMakeVisible(settingsButton);
settingsButton.setTooltip("Opens the visualiser settings window.");
#if SOSCI_FEATURES
#if OSCI_PREMIUM
addAndMakeVisible(sharedTextureButton);
sharedTextureButton.setTooltip("Toggles sending the oscilloscope's visuals to a Syphon/Spout receiver.");
sharedTextureButton.onClick = [this] {
@ -185,7 +185,7 @@ void VisualiserComponent::runTask(const std::vector<osci::Point>& points) {
for (auto& effect : settings.parameters.audioEffects) {
point = effect->apply(0, point);
}
#if SOSCI_FEATURES
#if OSCI_PREMIUM
if (settings.isFlippedHorizontal()) {
point.x = -point.x;
}
@ -229,7 +229,7 @@ void VisualiserComponent::runTask(const std::vector<osci::Point>& points) {
for (const osci::Point& rawPoint : points) {
osci::Point point = applyEffects(rawPoint);
#if SOSCI_FEATURES
#if OSCI_PREMIUM
if (settings.isGoniometer()) {
// x and y go to a diagonal currently, so we need to scale them down, and rotate them
point.scale(1.0 / std::sqrt(2.0), 1.0 / std::sqrt(2.0), 1.0);
@ -381,14 +381,14 @@ void VisualiserComponent::setRecording(bool recording) {
stopwatch.stop();
stopwatch.reset();
#if SOSCI_FEATURES
#if OSCI_PREMIUM
bool stillRecording = ffmpegProcess.isRunning() || audioRecorder.isRecording();
#else
bool stillRecording = audioRecorder.isRecording();
#endif
if (recording) {
#if SOSCI_FEATURES
#if OSCI_PREMIUM
recordingVideo = recordingSettings.recordingVideo();
recordingAudio = recordingSettings.recordingAudio();
if (!recordingVideo && !recordingAudio) {
@ -484,7 +484,7 @@ void VisualiserComponent::setRecording(bool recording) {
setPaused(false);
stopwatch.start();
} else if (stillRecording) {
#if SOSCI_FEATURES
#if OSCI_PREMIUM
bool wasRecordingAudio = recordingAudio;
bool wasRecordingVideo = recordingVideo;
recordingAudio = false;
@ -504,7 +504,7 @@ void VisualiserComponent::setRecording(bool recording) {
chooser = std::make_unique<juce::FileChooser>("Save recording", audioProcessor.getLastOpenedDirectory(), "*." + extension);
auto flags = juce::FileBrowserComponent::saveMode | juce::FileBrowserComponent::canSelectFiles | juce::FileBrowserComponent::warnAboutOverwriting;
#if SOSCI_FEATURES
#if OSCI_PREMIUM
chooser->launchAsync(flags, [this, wasRecordingAudio, wasRecordingVideo](const juce::FileChooser& chooser) {
auto file = chooser.getResult();
if (file != juce::File()) {
@ -531,7 +531,7 @@ void VisualiserComponent::setRecording(bool recording) {
}
setBlockOnAudioThread(recording);
#if SOSCI_FEATURES
#if OSCI_PREMIUM
numFrames = 0;
#endif
record.setToggleState(recording, juce::NotificationType::dontSendNotification);
@ -564,7 +564,7 @@ void VisualiserComponent::resized() {
audioInputButton.setBounds(buttons.removeFromRight(30));
}
#if SOSCI_FEATURES
#if OSCI_PREMIUM
sharedTextureButton.setBounds(buttons.removeFromRight(30));
#endif
@ -576,7 +576,7 @@ void VisualiserComponent::resized() {
stopwatch.setVisible(false);
}
#if SOSCI_FEATURES
#if OSCI_PREMIUM
if (child == nullptr && downloading) {
auto bounds = buttons.removeFromRight(160);
editor.ffmpegDownloader.setBounds(bounds.withSizeKeepingCentre(bounds.getWidth() - 10, bounds.getHeight() - 10));
@ -594,7 +594,7 @@ void VisualiserComponent::resized() {
}
void VisualiserComponent::popoutWindow() {
#if SOSCI_FEATURES
#if OSCI_PREMIUM
if (sharedTextureButton.getToggleState()) {
sharedTextureButton.triggerClick();
}
@ -603,7 +603,7 @@ void VisualiserComponent::popoutWindow() {
auto visualiser = new VisualiserComponent(
audioProcessor,
editor,
#if SOSCI_FEATURES
#if OSCI_PREMIUM
sharedTextureManager,
#endif
ffmpegFile,
@ -631,7 +631,7 @@ void VisualiserComponent::popoutWindow() {
void VisualiserComponent::childUpdated() {
popOutButton.setVisible(child == nullptr);
#if SOSCI_FEATURES
#if OSCI_PREMIUM
editor.ffmpegDownloader.setVisible(child == nullptr);
#endif
record.setVisible(child == nullptr);
@ -649,7 +649,7 @@ void VisualiserComponent::childUpdated() {
}
}
#if SOSCI_FEATURES
#if OSCI_PREMIUM
void VisualiserComponent::initialiseSharedTexture() {
sharedTextureSender = sharedTextureManager.addSender(recordingSettings.getCustomSharedTextureServerName(), renderTexture.width, renderTexture.height);
sharedTextureSender->initGL();
@ -712,7 +712,7 @@ void VisualiserComponent::newOpenGLContextCreated() {
wideBlurShader->addFragmentShader(wideBlurFragmentShader);
wideBlurShader->link();
#if SOSCI_FEATURES
#if OSCI_PREMIUM
glowShader = std::make_unique<juce::OpenGLShaderProgram>(openGLContext);
glowShader->addVertexShader(juce::OpenGLHelpers::translateVertexShaderToV3(glowVertexShader));
glowShader->addFragmentShader(glowFragmentShader);
@ -734,7 +734,7 @@ void VisualiserComponent::newOpenGLContextCreated() {
void VisualiserComponent::openGLContextClosing() {
using namespace juce::gl;
#if SOSCI_FEATURES
#if OSCI_PREMIUM
closeSharedTexture();
#endif
@ -750,7 +750,7 @@ void VisualiserComponent::openGLContextClosing() {
glDeleteTextures(1, &renderTexture.id);
screenOpenGLTexture.release();
#if SOSCI_FEATURES
#if OSCI_PREMIUM
glDeleteTextures(1, &glowTexture.id);
reflectionOpenGLTexture.release();
glowShader.reset();
@ -802,14 +802,14 @@ void VisualiserComponent::renderOpenGL() {
renderScope(xSamples, ySamples, zSamples);
}
#if SOSCI_FEATURES
#if OSCI_PREMIUM
if (sharedTextureSender != nullptr) {
sharedTextureSender->renderGL();
}
#endif
if (record.getToggleState()) {
#if SOSCI_FEATURES
#if OSCI_PREMIUM
if (recordingVideo) {
// draw frame to ffmpeg
glBindTexture(GL_TEXTURE_2D, renderTexture.id);
@ -908,7 +908,7 @@ void VisualiserComponent::setupTextures() {
screenOpenGLTexture.loadImage(emptyScreenImage);
screenTexture = { screenOpenGLTexture.getTextureID(), screenTextureImage.getWidth(), screenTextureImage.getHeight() };
#if SOSCI_FEATURES
#if OSCI_PREMIUM
glowTexture = makeTexture(512, 512);
reflectionTexture = createReflectionTexture();
#endif
@ -1134,7 +1134,7 @@ void VisualiserComponent::drawLine(const std::vector<float>& xPoints, const std:
lineShader->setUniform("uNEdges", (GLfloat) nEdges);
setOffsetAndScale(lineShader.get());
#if SOSCI_FEATURES
#if OSCI_PREMIUM
lineShader->setUniform("uFishEye", screenOverlay == ScreenOverlay::VectorDisplay ? VECTOR_DISPLAY_FISH_EYE : 0.0f);
lineShader->setUniform("uShutterSync", settings.getShutterSync());
#else
@ -1156,7 +1156,7 @@ void VisualiserComponent::fade() {
setNormalBlending();
#if SOSCI_FEATURES
#if OSCI_PREMIUM
setShader(afterglowShader.get());
afterglowShader->setUniform("fadeAmount", fadeAmount);
afterglowShader->setUniform("afterglowAmount", (float) settings.getAfterglow());
@ -1214,7 +1214,7 @@ void VisualiserComponent::drawCRT() {
wideBlurShader->setUniform("uOffset", 0.0f, 1.0f / 128.0f);
drawTexture({blur4Texture});
#if SOSCI_FEATURES
#if OSCI_PREMIUM
if (settings.parameters.screenOverlay->isRealisticDisplay()) {
// create glow texture
activateTargetTexture(glowTexture);
@ -1228,7 +1228,7 @@ void VisualiserComponent::drawCRT() {
setShader(outputShader.get());
outputShader->setUniform("uExposure", 0.25f);
outputShader->setUniform("uLineSaturation", (float) settings.getLineSaturation());
#if SOSCI_FEATURES
#if OSCI_PREMIUM
outputShader->setUniform("uScreenSaturation", (float) settings.getScreenSaturation());
outputShader->setUniform("uHueShift", (float) settings.getScreenHue() / 360.0f);
outputShader->setUniform("uOverexposure", (float) settings.getOverexposure());
@ -1242,7 +1242,7 @@ void VisualiserComponent::drawCRT() {
outputShader->setUniform("uGlow", (float) settings.getGlow());
outputShader->setUniform("uAmbient", (float) settings.getAmbient());
setOffsetAndScale(outputShader.get());
#if SOSCI_FEATURES
#if OSCI_PREMIUM
outputShader->setUniform("uFishEye", screenOverlay == ScreenOverlay::VectorDisplay ? VECTOR_DISPLAY_FISH_EYE : 0.0f);
outputShader->setUniform("uRealScreen", settings.parameters.screenOverlay->isRealisticDisplay() ? 1.0f : 0.0f);
#endif
@ -1254,7 +1254,7 @@ void VisualiserComponent::drawCRT() {
blur1Texture,
blur3Texture,
screenTexture,
#if SOSCI_FEATURES
#if OSCI_PREMIUM
reflectionTexture,
glowTexture,
#endif
@ -1264,7 +1264,7 @@ void VisualiserComponent::drawCRT() {
void VisualiserComponent::setOffsetAndScale(juce::OpenGLShaderProgram* shader) {
osci::Point offset;
osci::Point scale = { 1.0f };
#if SOSCI_FEATURES
#if OSCI_PREMIUM
if (settings.getScreenOverlay() == ScreenOverlay::Real) {
offset = REAL_SCREEN_OFFSET;
scale = REAL_SCREEN_SCALE;
@ -1277,7 +1277,7 @@ void VisualiserComponent::setOffsetAndScale(juce::OpenGLShaderProgram* shader) {
shader->setUniform("uScale", (float) scale.x, (float) scale.y);
}
#if SOSCI_FEATURES
#if OSCI_PREMIUM
Texture VisualiserComponent::createReflectionTexture() {
using namespace juce::gl;
@ -1300,7 +1300,7 @@ Texture VisualiserComponent::createScreenTexture() {
if (screenOverlay == ScreenOverlay::Smudged || screenOverlay == ScreenOverlay::SmudgedGraticule) {
screenOpenGLTexture.loadImage(screenTextureImage);
#if SOSCI_FEATURES
#if OSCI_PREMIUM
} else if (screenOverlay == ScreenOverlay::Real) {
screenOpenGLTexture.loadImage(oscilloscopeImage);
} else if (screenOverlay == ScreenOverlay::VectorDisplay) {
@ -1413,7 +1413,7 @@ void VisualiserComponent::paint(juce::Graphics& g) {
void VisualiserComponent::renderScope(const std::vector<float>& xPoints, const std::vector<float>& yPoints, const std::vector<float>& zPoints) {
if (screenOverlay != settings.getScreenOverlay()) {
screenOverlay = settings.getScreenOverlay();
#if SOSCI_FEATURES
#if OSCI_PREMIUM
reflectionTexture = createReflectionTexture();
#endif
screenTexture = createScreenTexture();

Wyświetl plik

@ -37,7 +37,7 @@ public:
VisualiserComponent(
CommonAudioProcessor& processor,
CommonPluginEditor& editor,
#if SOSCI_FEATURES
#if OSCI_PREMIUM
SharedTextureManager& sharedTextureManager,
#endif
juce::File ffmpegFile,
@ -92,7 +92,7 @@ private:
SvgButton settingsButton{ "settings", BinaryData::cog_svg, juce::Colours::white, juce::Colours::white };
SvgButton audioInputButton{ "audioInput", BinaryData::microphone_svg, juce::Colours::white, juce::Colours::red };
#if SOSCI_FEATURES
#if OSCI_PREMIUM
SvgButton sharedTextureButton{ "sharedTexture", BinaryData::spout_svg, juce::Colours::white, juce::Colours::red };
SharedTextureManager& sharedTextureManager;
SharedTextureSender* sharedTextureSender = nullptr;
@ -110,7 +110,7 @@ private:
juce::File ffmpegFile;
bool recordingAudio = true;
#if SOSCI_FEATURES
#if OSCI_PREMIUM
bool recordingVideo = true;
bool downloading = false;
@ -179,7 +179,7 @@ private:
juce::Image screenTextureImage = juce::ImageFileFormat::loadFrom(BinaryData::noise_jpg, BinaryData::noise_jpgSize);
juce::Image emptyScreenImage = juce::ImageFileFormat::loadFrom(BinaryData::empty_jpg, BinaryData::empty_jpgSize);
#if SOSCI_FEATURES
#if OSCI_PREMIUM
juce::Image oscilloscopeImage = juce::ImageFileFormat::loadFrom(BinaryData::real_png, BinaryData::real_pngSize);
juce::Image vectorDisplayImage = juce::ImageFileFormat::loadFrom(BinaryData::vector_display_png, BinaryData::vector_display_pngSize);
@ -220,7 +220,7 @@ private:
chowdsp::ResamplingTypes::LanczosResampler<2048, 8> zResampler;
void setOffsetAndScale(juce::OpenGLShaderProgram* shader);
#if SOSCI_FEATURES
#if OSCI_PREMIUM
void initialiseSharedTexture();
void closeSharedTexture();
#endif

Wyświetl plik

@ -14,7 +14,7 @@ VisualiserSettings::VisualiserSettings(VisualiserParameters& p, int numChannels)
addAndMakeVisible(sweepToggle);
addAndMakeVisible(screenOverlayLabel);
addAndMakeVisible(screenOverlay);
#if SOSCI_FEATURES
#if OSCI_PREMIUM
addAndMakeVisible(positionSize);
addAndMakeVisible(screenColour);
addAndMakeVisible(flipVerticalToggle);
@ -66,7 +66,7 @@ void VisualiserSettings::resized() {
screenOverlay.setBounds(screenOverlayArea.removeFromRight(180));
lineColour.setBounds(area.removeFromTop(lineColour.getHeight()));
#if SOSCI_FEATURES
#if OSCI_PREMIUM
area.removeFromTop(10);
screenColour.setBounds(area.removeFromTop(screenColour.getHeight()));
#endif
@ -77,7 +77,7 @@ void VisualiserSettings::resized() {
area.removeFromTop(10);
lineEffects.setBounds(area.removeFromTop(lineEffects.getHeight()));
#if SOSCI_FEATURES
#if OSCI_PREMIUM
area.removeFromTop(10);
positionSize.setBounds(area.removeFromTop(positionSize.getHeight()));
area.removeFromTop(10);
@ -87,7 +87,7 @@ void VisualiserSettings::resized() {
shutterSyncToggle.setBounds(area.removeFromTop(rowHeight));
#endif
#if !SOSCI_FEATURES
#if !OSCI_PREMIUM
area.removeFromTop(10);
#endif
upsamplingToggle.setBounds(area.removeFromTop(rowHeight));

Wyświetl plik

@ -16,7 +16,7 @@ enum class ScreenOverlay : int {
Graticule = 2,
Smudged = 3,
SmudgedGraticule = 4,
#if SOSCI_FEATURES
#if OSCI_PREMIUM
Real = 5,
VectorDisplay = 6,
MAX = 6,
@ -39,7 +39,7 @@ public:
return "Smudged";
case ScreenOverlay::SmudgedGraticule:
return "Smudged Graticule";
#if SOSCI_FEATURES
#if OSCI_PREMIUM
case ScreenOverlay::Real:
return "Real Oscilloscope";
case ScreenOverlay::VectorDisplay:
@ -60,7 +60,7 @@ public:
unnormalisedValue = (int)ScreenOverlay::Smudged;
} else if (text == "Smudged Graticule") {
unnormalisedValue = (int)ScreenOverlay::SmudgedGraticule;
#if SOSCI_FEATURES
#if OSCI_PREMIUM
} else if (text == "Real Oscilloscope") {
unnormalisedValue = (int)ScreenOverlay::Real;
} else if (text == "Vector Display") {
@ -80,7 +80,7 @@ public:
setValueNotifyingHost(getValueForText(xml->getStringAttribute("screenOverlay")));
}
#if SOSCI_FEATURES
#if OSCI_PREMIUM
bool isRealisticDisplay() {
ScreenOverlay type = (ScreenOverlay)(int)getValueUnnormalised();
return type == ScreenOverlay::Real || type == ScreenOverlay::VectorDisplay;
@ -95,7 +95,7 @@ public:
osci::BooleanParameter* sweepEnabled = new osci::BooleanParameter("Sweep", "sweepEnabled", VERSION_HINT, false, "Plots the audio signal over time, sweeping from left to right");
osci::BooleanParameter* visualiserFullScreen = new osci::BooleanParameter("Visualiser Fullscreen", "visualiserFullScreen", VERSION_HINT, false, "Makes the software visualiser fullscreen.");
#if SOSCI_FEATURES
#if OSCI_PREMIUM
osci::BooleanParameter* flipVertical = new osci::BooleanParameter("Flip Vertical", "flipVertical", VERSION_HINT, false, "Flips the visualiser vertically.");
osci::BooleanParameter* flipHorizontal = new osci::BooleanParameter("Flip Horizontal", "flipHorizontal", VERSION_HINT, false, "Flips the visualiser horizontally.");
osci::BooleanParameter* goniometer = new osci::BooleanParameter("Goniometer", "goniometer", VERSION_HINT, false, "Rotates the visualiser to replicate a goniometer display to show the phase relationship between two channels.");
@ -282,7 +282,7 @@ public:
ambientEffect,
sweepMsEffect,
triggerValueEffect,
#if SOSCI_FEATURES
#if OSCI_PREMIUM
afterglowEffect,
screenSaturationEffect,
screenHueEffect,
@ -291,7 +291,7 @@ public:
};
std::vector<std::shared_ptr<osci::Effect>> audioEffects = {
smoothEffect,
#if SOSCI_FEATURES
#if OSCI_PREMIUM
stereoEffect,
scaleEffect,
offsetEffect,
@ -301,7 +301,7 @@ public:
upsamplingEnabled,
visualiserFullScreen,
sweepEnabled,
#if SOSCI_FEATURES
#if OSCI_PREMIUM
flipVertical,
flipHorizontal,
goniometer,
@ -370,7 +370,7 @@ public:
return parameters.lineSaturationEffect->getActualValue();
}
#if SOSCI_FEATURES
#if OSCI_PREMIUM
double getScreenSaturation() {
return parameters.screenSaturationEffect->getActualValue();
}
@ -453,7 +453,7 @@ private:
"Line Colour"
};
#if SOSCI_FEATURES
#if OSCI_PREMIUM
GroupedSettings screenColour{
std::vector<std::shared_ptr<EffectComponent>>{
std::make_shared<EffectComponent>(*parameters.screenHueEffect),
@ -469,7 +469,7 @@ private:
std::make_shared<EffectComponent>(*parameters.persistenceEffect),
std::make_shared<EffectComponent>(*parameters.focusEffect),
std::make_shared<EffectComponent>(*parameters.glowEffect),
#if SOSCI_FEATURES
#if OSCI_PREMIUM
std::make_shared<EffectComponent>(*parameters.afterglowEffect),
std::make_shared<EffectComponent>(*parameters.overexposureEffect),
#else
@ -489,7 +489,7 @@ private:
GroupedSettings lineEffects{
std::vector<std::shared_ptr<EffectComponent>>{
std::make_shared<EffectComponent>(*parameters.smoothEffect),
#if SOSCI_FEATURES
#if OSCI_PREMIUM
std::make_shared<EffectComponent>(*parameters.stereoEffect),
#endif
},
@ -505,7 +505,7 @@ private:
jux::SwitchButton upsamplingToggle{parameters.upsamplingEnabled};
jux::SwitchButton sweepToggle{parameters.sweepEnabled};
#if SOSCI_FEATURES
#if OSCI_PREMIUM
GroupedSettings positionSize{
std::vector<std::shared_ptr<EffectComponent>>{
std::make_shared<EffectComponent>(*parameters.scaleEffect, 0),

Wyświetl plik

@ -5,13 +5,13 @@ VERSION="$2"
OUTPUT_NAME="$PLUGIN-$VERSION"
# If we are on the free version, we need to disable the build flag SOSCI_FEATURES
# If we are on the free version, we need to disable the build flag OSCI_PREMIUM
if [ "$VERSION" = "free" ]; then
# Edit the jucer file to disable the SOSCI_FEATURES flag
# Edit the jucer file to disable the OSCI_PREMIUM flag
if [ "$OS" = "mac" ]; then
sed -i '' 's/SOSCI_FEATURES=1/SOSCI_FEATURES=0/' "$ROOT/$PLUGIN.jucer"
sed -i '' 's/OSCI_PREMIUM=1/OSCI_PREMIUM=0/' "$ROOT/$PLUGIN.jucer"
else
sed -i 's/SOSCI_FEATURES=1/SOSCI_FEATURES=0/' "$ROOT/$PLUGIN.jucer"
sed -i 's/OSCI_PREMIUM=1/OSCI_PREMIUM=0/' "$ROOT/$PLUGIN.jucer"
fi
fi

Wyświetl plik

@ -5,7 +5,7 @@
pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender"
cppLanguageStandard="20" projectLineFeed="&#10;" headerPath="./include"
version="2.4.12.0" companyName="James H Ball" companyWebsite="https://osci-render.com"
companyEmail="james@ball.sh" defines="NOMINMAX=1&#10;INTERNET_FLAG_NO_AUTO_REDIRECT=0&#10;SOSCI_FEATURES=1&#10;JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1&#10;JUCE_MODAL_LOOPS_PERMITTED=1"
companyEmail="james@ball.sh" defines="NOMINMAX=1&#10;INTERNET_FLAG_NO_AUTO_REDIRECT=0&#10;OSCI_PREMIUM=1&#10;JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1&#10;JUCE_MODAL_LOOPS_PERMITTED=1"
pluginAUMainType="'aumf'">
<MAINGROUP id="j5Ge2T" name="osci-render">
<GROUP id="{5ABCED88-0059-A7AF-9596-DBF91DDB0292}" name="Resources">

Wyświetl plik

@ -5,7 +5,7 @@
aaxIdentifier="sh.ball.sosci" cppLanguageStandard="20" projectLineFeed="&#10;"
headerPath="./include" version="1.1.6.0" companyName="James H Ball"
companyWebsite="https://osci-render.com" companyEmail="james@ball.sh"
defines="NOMINMAX=1&#10;INTERNET_FLAG_NO_AUTO_REDIRECT=0&#10;SOSCI_FEATURES=1&#10;JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1&#10;JUCE_MODAL_LOOPS_PERMITTED=1"
defines="NOMINMAX=1&#10;INTERNET_FLAG_NO_AUTO_REDIRECT=0&#10;OSCI_PREMIUM=1&#10;JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1&#10;JUCE_MODAL_LOOPS_PERMITTED=1"
pluginManufacturerCode="Jhba" pluginCode="Sosc" pluginAUMainType="'aufx'">
<MAINGROUP id="j5Ge2T" name="sosci">
<GROUP id="{5ABCED88-0059-A7AF-9596-DBF91DDB0292}" name="Resources">