Merge branch 'custom-resolution-framerate' into develop
Przed Szerokość: | Wysokość: | Rozmiar: 21 KiB Po Szerokość: | Wysokość: | Rozmiar: 25 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 6.3 KiB Po Szerokość: | Wysokość: | Rozmiar: 25 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 84 KiB Po Szerokość: | Wysokość: | Rozmiar: 465 KiB |
Przed Szerokość: | Wysokość: | Rozmiar: 79 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 4.7 MiB |
Przed Szerokość: | Wysokość: | Rozmiar: 33 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 1.5 MiB |
Przed Szerokość: | Wysokość: | Rozmiar: 56 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 4.1 MiB |
Przed Szerokość: | Wysokość: | Rozmiar: 64 KiB |
Po Szerokość: | Wysokość: | Rozmiar: 3.6 MiB |
|
@ -43,8 +43,8 @@ CommonPluginEditor::CommonPluginEditor(CommonAudioProcessor& p, juce::String app
|
||||||
visualiserSettings.setColour(juce::ResizableWindow::backgroundColourId, Colours::dark);
|
visualiserSettings.setColour(juce::ResizableWindow::backgroundColourId, Colours::dark);
|
||||||
|
|
||||||
recordingSettings.setLookAndFeel(&getLookAndFeel());
|
recordingSettings.setLookAndFeel(&getLookAndFeel());
|
||||||
recordingSettings.setSize(350, 230);
|
recordingSettings.setSize(350, 280);
|
||||||
recordingSettingsWindow.centreWithSize(350, 260);
|
recordingSettingsWindow.centreWithSize(350, 320);
|
||||||
#if JUCE_WINDOWS
|
#if JUCE_WINDOWS
|
||||||
// if not standalone, use native title bar for compatibility with DAWs
|
// if not standalone, use native title bar for compatibility with DAWs
|
||||||
recordingSettingsWindow.setUsingNativeTitleBar(processor.wrapperType == juce::AudioProcessor::WrapperType::wrapperType_Standalone);
|
recordingSettingsWindow.setUsingNativeTitleBar(processor.wrapperType == juce::AudioProcessor::WrapperType::wrapperType_Standalone);
|
||||||
|
|
|
@ -17,7 +17,11 @@ EffectComponent::EffectComponent(Effect& effect, int index) : effect(effect), in
|
||||||
|
|
||||||
slider.setSliderStyle(juce::Slider::LinearHorizontal);
|
slider.setSliderStyle(juce::Slider::LinearHorizontal);
|
||||||
slider.setTextBoxStyle(juce::Slider::TextBoxRight, false, TEXT_BOX_WIDTH, slider.getTextBoxHeight());
|
slider.setTextBoxStyle(juce::Slider::TextBoxRight, false, TEXT_BOX_WIDTH, slider.getTextBoxHeight());
|
||||||
slider.setNumDecimalPlacesToDisplay(4);
|
if (effect.parameters[index]->step == 1.0) {
|
||||||
|
slider.setNumDecimalPlacesToDisplay(0);
|
||||||
|
} else {
|
||||||
|
slider.setNumDecimalPlacesToDisplay(4);
|
||||||
|
}
|
||||||
|
|
||||||
lfoSlider.setSliderStyle(juce::Slider::LinearHorizontal);
|
lfoSlider.setSliderStyle(juce::Slider::LinearHorizontal);
|
||||||
lfoSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, TEXT_BOX_WIDTH, lfoSlider.getTextBoxHeight());
|
lfoSlider.setTextBoxStyle(juce::Slider::TextBoxRight, false, TEXT_BOX_WIDTH, lfoSlider.getTextBoxHeight());
|
||||||
|
|
|
@ -15,18 +15,15 @@ AudioBackgroundThread::~AudioBackgroundThread() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioBackgroundThread::prepare(double sampleRate, int samplesPerBlock) {
|
void AudioBackgroundThread::prepare(double sampleRate, int samplesPerBlock) {
|
||||||
if (isThreadRunning()) {
|
bool threadShouldBeRunning = shouldBeRunning;
|
||||||
stop();
|
setShouldBeRunning(false);
|
||||||
}
|
|
||||||
|
|
||||||
isPrepared = false;
|
isPrepared = false;
|
||||||
int requestedDataSize = prepareTask(sampleRate, samplesPerBlock);
|
int requestedDataSize = prepareTask(sampleRate, samplesPerBlock);
|
||||||
consumer = std::make_unique<BufferConsumer>(requestedDataSize);
|
consumer = std::make_unique<BufferConsumer>(requestedDataSize);
|
||||||
isPrepared = true;
|
isPrepared = true;
|
||||||
|
|
||||||
if (shouldBeRunning) {
|
setShouldBeRunning(threadShouldBeRunning);
|
||||||
start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioBackgroundThread::setShouldBeRunning(bool shouldBeRunning, std::function<void()> stopCallback) {
|
void AudioBackgroundThread::setShouldBeRunning(bool shouldBeRunning, std::function<void()> stopCallback) {
|
||||||
|
|
|
@ -58,7 +58,7 @@ void main() {
|
||||||
if (uRealScreen > 0.5) {
|
if (uRealScreen > 0.5) {
|
||||||
vec4 reflection = texture2D(uTexture4, vTexCoord);
|
vec4 reflection = texture2D(uTexture4, vTexCoord);
|
||||||
vec4 screenGlow = texture2D(uTexture5, vTexCoord);
|
vec4 screenGlow = texture2D(uTexture5, vTexCoord);
|
||||||
scatter += max4(screenGlow * reflection * max(1.0 - uAmbient, 0.0), vec4(0.0));
|
scatter += max4(screenGlow * reflection * max(1.0 - 0.5 * uAmbient, 0.0), vec4(0.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
float light = line.r + uGlow * 1.5 * screen.g * screen.g * tightGlow.r;
|
float light = line.r + uGlow * 1.5 * screen.g * screen.g * tightGlow.r;
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
RecordingSettings::RecordingSettings(RecordingParameters& ps) : parameters(ps) {
|
RecordingSettings::RecordingSettings(RecordingParameters& ps) : parameters(ps) {
|
||||||
#if SOSCI_FEATURES
|
#if SOSCI_FEATURES
|
||||||
addAndMakeVisible(quality);
|
addAndMakeVisible(quality);
|
||||||
|
addAndMakeVisible(resolution);
|
||||||
|
addAndMakeVisible(frameRate);
|
||||||
addAndMakeVisible(losslessVideo);
|
addAndMakeVisible(losslessVideo);
|
||||||
addAndMakeVisible(recordAudio);
|
addAndMakeVisible(recordAudio);
|
||||||
addAndMakeVisible(recordVideo);
|
addAndMakeVisible(recordVideo);
|
||||||
|
@ -16,6 +18,11 @@ RecordingSettings::RecordingSettings(RecordingParameters& ps) : parameters(ps) {
|
||||||
|
|
||||||
quality.setSliderOnValueChange();
|
quality.setSliderOnValueChange();
|
||||||
quality.setRangeEnabled(false);
|
quality.setRangeEnabled(false);
|
||||||
|
resolution.setSliderOnValueChange();
|
||||||
|
resolution.setRangeEnabled(false);
|
||||||
|
frameRate.setSliderOnValueChange();
|
||||||
|
frameRate.setRangeEnabled(false);
|
||||||
|
|
||||||
recordAudio.onClick = [this] {
|
recordAudio.onClick = [this] {
|
||||||
if (!recordAudio.getToggleState() && !recordVideo.getToggleState()) {
|
if (!recordAudio.getToggleState() && !recordVideo.getToggleState()) {
|
||||||
recordVideo.setToggleState(true, juce::NotificationType::sendNotification);
|
recordVideo.setToggleState(true, juce::NotificationType::sendNotification);
|
||||||
|
@ -66,6 +73,8 @@ void RecordingSettings::resized() {
|
||||||
#if SOSCI_FEATURES
|
#if SOSCI_FEATURES
|
||||||
losslessVideo.setBounds(area.removeFromTop(rowHeight));
|
losslessVideo.setBounds(area.removeFromTop(rowHeight));
|
||||||
quality.setBounds(area.removeFromTop(rowHeight).expanded(6, 0));
|
quality.setBounds(area.removeFromTop(rowHeight).expanded(6, 0));
|
||||||
|
resolution.setBounds(area.removeFromTop(rowHeight).expanded(6, 0));
|
||||||
|
frameRate.setBounds(area.removeFromTop(rowHeight).expanded(6, 0));
|
||||||
recordAudio.setBounds(area.removeFromTop(rowHeight));
|
recordAudio.setBounds(area.removeFromTop(rowHeight));
|
||||||
recordVideo.setBounds(area.removeFromTop(rowHeight));
|
recordVideo.setBounds(area.removeFromTop(rowHeight));
|
||||||
auto row = area.removeFromTop(rowHeight);
|
auto row = area.removeFromTop(rowHeight);
|
||||||
|
|
|
@ -13,6 +13,10 @@ public:
|
||||||
RecordingParameters() {
|
RecordingParameters() {
|
||||||
qualityParameter.disableLfo();
|
qualityParameter.disableLfo();
|
||||||
qualityParameter.disableSidechain();
|
qualityParameter.disableSidechain();
|
||||||
|
resolution.disableLfo();
|
||||||
|
resolution.disableSidechain();
|
||||||
|
frameRate.disableLfo();
|
||||||
|
frameRate.disableSidechain();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -36,6 +40,22 @@ public:
|
||||||
|
|
||||||
BooleanParameter recordAudio = BooleanParameter("Record Audio", "recordAudio", VERSION_HINT, true, "Record audio along with the video.");
|
BooleanParameter recordAudio = BooleanParameter("Record Audio", "recordAudio", VERSION_HINT, true, "Record audio along with the video.");
|
||||||
BooleanParameter recordVideo = BooleanParameter("Record Video", "recordVideo", VERSION_HINT, sosciFeatures, "Record video output of the visualiser.");
|
BooleanParameter recordVideo = BooleanParameter("Record Video", "recordVideo", VERSION_HINT, sosciFeatures, "Record video output of the visualiser.");
|
||||||
|
|
||||||
|
EffectParameter resolution = EffectParameter(
|
||||||
|
"Resolution",
|
||||||
|
"The resolution of the recorded video. This only changes when not recording.",
|
||||||
|
"resolution",
|
||||||
|
VERSION_HINT, 1024, 128, 2048, 1.0
|
||||||
|
);
|
||||||
|
Effect resolutionEffect = Effect(&resolution);
|
||||||
|
|
||||||
|
EffectParameter frameRate = EffectParameter(
|
||||||
|
"Frame Rate",
|
||||||
|
"The frame rate of the recorded video. This only changes when not recording.",
|
||||||
|
"frameRate",
|
||||||
|
VERSION_HINT, 60.0, 10, 240, 0.01
|
||||||
|
);
|
||||||
|
Effect frameRateEffect = Effect(&frameRate);
|
||||||
|
|
||||||
juce::String compressionPreset = "fast";
|
juce::String compressionPreset = "fast";
|
||||||
|
|
||||||
|
@ -49,6 +69,12 @@ public:
|
||||||
|
|
||||||
auto qualityXml = settingsXml->createNewChildElement("quality");
|
auto qualityXml = settingsXml->createNewChildElement("quality");
|
||||||
qualityEffect.save(qualityXml);
|
qualityEffect.save(qualityXml);
|
||||||
|
|
||||||
|
auto resolutionXml = settingsXml->createNewChildElement("resolution");
|
||||||
|
resolutionEffect.save(resolutionXml);
|
||||||
|
|
||||||
|
auto frameRateXml = settingsXml->createNewChildElement("frameRate");
|
||||||
|
frameRateEffect.save(frameRateXml);
|
||||||
}
|
}
|
||||||
|
|
||||||
// opt to not change any values if not found
|
// opt to not change any values if not found
|
||||||
|
@ -72,6 +98,12 @@ public:
|
||||||
if (auto* qualityXml = settingsXml->getChildByName("quality")) {
|
if (auto* qualityXml = settingsXml->getChildByName("quality")) {
|
||||||
qualityEffect.load(qualityXml);
|
qualityEffect.load(qualityXml);
|
||||||
}
|
}
|
||||||
|
if (auto* resolutionXml = settingsXml->getChildByName("resolution")) {
|
||||||
|
resolutionEffect.load(resolutionXml);
|
||||||
|
}
|
||||||
|
if (auto* frameRateXml = settingsXml->getChildByName("frameRate")) {
|
||||||
|
frameRateEffect.load(frameRateXml);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +127,14 @@ public:
|
||||||
// not supported by all media players)
|
// not supported by all media players)
|
||||||
return 50 * (1.0 - quality) + 1;
|
return 50 * (1.0 - quality) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getVideoToolboxQuality() {
|
||||||
|
if (parameters.losslessVideo.getBoolValue()) {
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
double quality = juce::jlimit(0.0, 1.0, parameters.qualityEffect.getValue());
|
||||||
|
return 100 * quality;
|
||||||
|
}
|
||||||
|
|
||||||
bool recordingVideo() {
|
bool recordingVideo() {
|
||||||
return parameters.recordVideo.getBoolValue();
|
return parameters.recordVideo.getBoolValue();
|
||||||
|
@ -114,11 +154,21 @@ public:
|
||||||
}
|
}
|
||||||
return parameters.customSharedTextureServerName;
|
return parameters.customSharedTextureServerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int getResolution() {
|
||||||
|
return parameters.resolution.getValueUnnormalised();
|
||||||
|
}
|
||||||
|
|
||||||
|
double getFrameRate() {
|
||||||
|
return parameters.frameRate.getValueUnnormalised();
|
||||||
|
}
|
||||||
|
|
||||||
RecordingParameters& parameters;
|
RecordingParameters& parameters;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EffectComponent quality{parameters.qualityEffect};
|
EffectComponent quality{parameters.qualityEffect};
|
||||||
|
EffectComponent resolution{parameters.resolutionEffect};
|
||||||
|
EffectComponent frameRate{parameters.frameRateEffect};
|
||||||
|
|
||||||
jux::SwitchButton losslessVideo{¶meters.losslessVideo};
|
jux::SwitchButton losslessVideo{¶meters.losslessVideo};
|
||||||
jux::SwitchButton recordAudio{¶meters.recordAudio};
|
jux::SwitchButton recordAudio{¶meters.recordAudio};
|
||||||
|
|
|
@ -284,7 +284,7 @@ int VisualiserComponent::prepareTask(double sampleRate, int bufferSize) {
|
||||||
|
|
||||||
audioRecorder.setSampleRate(sampleRate);
|
audioRecorder.setSampleRate(sampleRate);
|
||||||
|
|
||||||
int desiredBufferSize = sampleRate / FRAME_RATE;
|
int desiredBufferSize = sampleRate / recordingSettings.getFrameRate();
|
||||||
|
|
||||||
return desiredBufferSize;
|
return desiredBufferSize;
|
||||||
}
|
}
|
||||||
|
@ -411,7 +411,7 @@ void VisualiserComponent::setRecording(bool recording) {
|
||||||
tempVideoFile = std::make_unique<juce::TemporaryFile>(".mp4");
|
tempVideoFile = std::make_unique<juce::TemporaryFile>(".mp4");
|
||||||
juce::String resolution = std::to_string(renderTexture.width) + "x" + std::to_string(renderTexture.height);
|
juce::String resolution = std::to_string(renderTexture.width) + "x" + std::to_string(renderTexture.height);
|
||||||
juce::String cmd = "\"" + ffmpegFile.getFullPathName() + "\"" +
|
juce::String cmd = "\"" + ffmpegFile.getFullPathName() + "\"" +
|
||||||
" -r " + juce::String(FRAME_RATE) +
|
" -r " + juce::String(recordingSettings.getFrameRate()) +
|
||||||
" -f rawvideo" +
|
" -f rawvideo" +
|
||||||
" -pix_fmt rgba" +
|
" -pix_fmt rgba" +
|
||||||
" -s " + resolution +
|
" -s " + resolution +
|
||||||
|
@ -421,6 +421,14 @@ void VisualiserComponent::setRecording(bool recording) {
|
||||||
" -y" +
|
" -y" +
|
||||||
" -pix_fmt yuv420p" +
|
" -pix_fmt yuv420p" +
|
||||||
" -crf " + juce::String(recordingSettings.getCRF()) +
|
" -crf " + juce::String(recordingSettings.getCRF()) +
|
||||||
|
#if JUCE_MAC
|
||||||
|
#if JUCE_ARM
|
||||||
|
// use software encoding on Apple Silicon
|
||||||
|
" -c:v hevc_videotoolbox" +
|
||||||
|
" -q:v " + juce::String(recordingSettings.getVideoToolboxQuality()) +
|
||||||
|
" -tag:v hvc1" +
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
" -vf vflip" +
|
" -vf vflip" +
|
||||||
" \"" + tempVideoFile->getFile().getFullPathName() + "\"";
|
" \"" + tempVideoFile->getFile().getFullPathName() + "\"";
|
||||||
|
|
||||||
|
@ -717,6 +725,19 @@ void VisualiserComponent::renderOpenGL() {
|
||||||
// we have a new buffer to render
|
// we have a new buffer to render
|
||||||
if (sampleBufferCount != prevSampleBufferCount) {
|
if (sampleBufferCount != prevSampleBufferCount) {
|
||||||
prevSampleBufferCount = sampleBufferCount;
|
prevSampleBufferCount = sampleBufferCount;
|
||||||
|
|
||||||
|
if (!record.getToggleState()) {
|
||||||
|
// don't change resolution or framerate if recording
|
||||||
|
if (recordingSettings.getResolution() != renderTexture.width) {
|
||||||
|
setResolution(recordingSettings.getResolution());
|
||||||
|
}
|
||||||
|
if (recordingSettings.getFrameRate() != currentFrameRate) {
|
||||||
|
currentFrameRate = recordingSettings.getFrameRate();
|
||||||
|
prepare(sampleRate, -1);
|
||||||
|
setupArrays(RESAMPLE_RATIO * sampleRate / recordingSettings.getFrameRate());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
juce::CriticalSection::ScopedLockType lock(samplesLock);
|
juce::CriticalSection::ScopedLockType lock(samplesLock);
|
||||||
|
|
||||||
if (settings.parameters.upsamplingEnabled->getBoolValue()) {
|
if (settings.parameters.upsamplingEnabled->getBoolValue()) {
|
||||||
|
@ -746,7 +767,7 @@ void VisualiserComponent::renderOpenGL() {
|
||||||
}
|
}
|
||||||
|
|
||||||
renderingSemaphore.release();
|
renderingSemaphore.release();
|
||||||
stopwatch.addTime(juce::RelativeTime::seconds(1.0 / FRAME_RATE));
|
stopwatch.addTime(juce::RelativeTime::seconds(1.0 / recordingSettings.getFrameRate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// render texture to screen
|
// render texture to screen
|
||||||
|
@ -821,12 +842,12 @@ void VisualiserComponent::setupTextures() {
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);
|
glBindFramebuffer(GL_FRAMEBUFFER, frameBuffer);
|
||||||
|
|
||||||
// Create textures
|
// Create textures
|
||||||
lineTexture = makeTexture(1024, 1024);
|
lineTexture = makeTexture(recordingSettings.getResolution(), recordingSettings.getResolution());
|
||||||
blur1Texture = makeTexture(512, 512);
|
blur1Texture = makeTexture(512, 512);
|
||||||
blur2Texture = makeTexture(512, 512);
|
blur2Texture = makeTexture(512, 512);
|
||||||
blur3Texture = makeTexture(128, 128);
|
blur3Texture = makeTexture(128, 128);
|
||||||
blur4Texture = makeTexture(128, 128);
|
blur4Texture = makeTexture(128, 128);
|
||||||
renderTexture = makeTexture(1024, 1024);
|
renderTexture = makeTexture(recordingSettings.getResolution(), recordingSettings.getResolution());
|
||||||
|
|
||||||
screenOpenGLTexture.loadImage(emptyScreenImage);
|
screenOpenGLTexture.loadImage(emptyScreenImage);
|
||||||
screenTexture = { screenOpenGLTexture.getTextureID(), screenTextureImage.getWidth(), screenTextureImage.getHeight() };
|
screenTexture = { screenOpenGLTexture.getTextureID(), screenTextureImage.getWidth(), screenTextureImage.getHeight() };
|
||||||
|
@ -839,11 +860,13 @@ void VisualiserComponent::setupTextures() {
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0); // Unbind
|
glBindFramebuffer(GL_FRAMEBUFFER, 0); // Unbind
|
||||||
}
|
}
|
||||||
|
|
||||||
Texture VisualiserComponent::makeTexture(int width, int height) {
|
Texture VisualiserComponent::makeTexture(int width, int height, GLuint textureID) {
|
||||||
using namespace juce::gl;
|
using namespace juce::gl;
|
||||||
|
|
||||||
GLuint textureID;
|
// replace existing texture if it exists, otherwise create new texture
|
||||||
glGenTextures(1, &textureID);
|
if (textureID == 0) {
|
||||||
|
glGenTextures(1, &textureID);
|
||||||
|
}
|
||||||
glBindTexture(GL_TEXTURE_2D, textureID);
|
glBindTexture(GL_TEXTURE_2D, textureID);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, width, height, 0, GL_RGBA, GL_FLOAT, nullptr);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, width, height, 0, GL_RGBA, GL_FLOAT, nullptr);
|
||||||
|
|
||||||
|
@ -860,10 +883,20 @@ Texture VisualiserComponent::makeTexture(int width, int height) {
|
||||||
return { textureID, width, height };
|
return { textureID, width, height };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VisualiserComponent::setResolution(int width) {
|
||||||
|
using namespace juce::gl;
|
||||||
|
|
||||||
|
lineTexture = makeTexture(width, width, lineTexture.id);
|
||||||
|
renderTexture = makeTexture(width, width, renderTexture.id);
|
||||||
|
}
|
||||||
|
|
||||||
void VisualiserComponent::drawLineTexture(const std::vector<float>& xPoints, const std::vector<float>& yPoints, const std::vector<float>& zPoints) {
|
void VisualiserComponent::drawLineTexture(const std::vector<float>& xPoints, const std::vector<float>& yPoints, const std::vector<float>& zPoints) {
|
||||||
using namespace juce::gl;
|
using namespace juce::gl;
|
||||||
|
|
||||||
fadeAmount = juce::jmin(1.0, std::pow(0.5, settings.getPersistence()) * 0.4);
|
double persistence = std::pow(0.5, settings.getPersistence()) * 0.4;
|
||||||
|
persistence *= 60.0 / recordingSettings.getFrameRate();
|
||||||
|
fadeAmount = juce::jmin(1.0, persistence);
|
||||||
|
|
||||||
activateTargetTexture(lineTexture);
|
activateTargetTexture(lineTexture);
|
||||||
fade();
|
fade();
|
||||||
drawLine(xPoints, yPoints, zPoints);
|
drawLine(xPoints, yPoints, zPoints);
|
||||||
|
@ -1072,7 +1105,7 @@ void VisualiserComponent::drawCRT() {
|
||||||
|
|
||||||
activateTargetTexture(blur1Texture);
|
activateTargetTexture(blur1Texture);
|
||||||
setShader(texturedShader.get());
|
setShader(texturedShader.get());
|
||||||
texturedShader->setUniform("uResizeForCanvas", lineTexture.width / 1024.0f);
|
texturedShader->setUniform("uResizeForCanvas", lineTexture.width / (float) recordingSettings.getResolution());
|
||||||
drawTexture({lineTexture});
|
drawTexture({lineTexture});
|
||||||
|
|
||||||
//horizontal blur 512x512
|
//horizontal blur 512x512
|
||||||
|
@ -1131,7 +1164,7 @@ void VisualiserComponent::drawCRT() {
|
||||||
outputShader->setUniform("uFishEye", screenOverlay == ScreenOverlay::VectorDisplay ? VECTOR_DISPLAY_FISH_EYE : 0.0f);
|
outputShader->setUniform("uFishEye", screenOverlay == ScreenOverlay::VectorDisplay ? VECTOR_DISPLAY_FISH_EYE : 0.0f);
|
||||||
outputShader->setUniform("uRealScreen", settings.parameters.screenOverlay->isRealisticDisplay() ? 1.0f : 0.0f);
|
outputShader->setUniform("uRealScreen", settings.parameters.screenOverlay->isRealisticDisplay() ? 1.0f : 0.0f);
|
||||||
#endif
|
#endif
|
||||||
outputShader->setUniform("uResizeForCanvas", lineTexture.width / 1024.0f);
|
outputShader->setUniform("uResizeForCanvas", lineTexture.width / (float) recordingSettings.getResolution());
|
||||||
juce::Colour colour = juce::Colour::fromHSV(settings.getHue() / 360.0f, 1.0, 1.0, 1.0);
|
juce::Colour colour = juce::Colour::fromHSV(settings.getHue() / 360.0f, 1.0, 1.0, 1.0);
|
||||||
outputShader->setUniform("uColour", colour.getFloatRed(), colour.getFloatGreen(), colour.getFloatBlue());
|
outputShader->setUniform("uColour", colour.getFloatRed(), colour.getFloatGreen(), colour.getFloatBlue());
|
||||||
drawTexture({
|
drawTexture({
|
||||||
|
@ -1250,7 +1283,7 @@ Texture VisualiserComponent::createScreenTexture() {
|
||||||
glVertexAttribPointer(glGetAttribLocation(simpleShader->getProgramID(), "vertexPosition"), 2, GL_FLOAT, GL_FALSE, 0, nullptr);
|
glVertexAttribPointer(glGetAttribLocation(simpleShader->getProgramID(), "vertexPosition"), 2, GL_FLOAT, GL_FALSE, 0, nullptr);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
simpleShader->setUniform("colour", 0.01f, 0.05f, 0.01f, 1.0f);
|
simpleShader->setUniform("colour", 0.01f, 0.05f, 0.01f, 1.0f);
|
||||||
glLineWidth(2.0f);
|
glLineWidth(4.0f);
|
||||||
glDrawArrays(GL_LINES, 0, data.size() / 2);
|
glDrawArrays(GL_LINES, 0, data.size() / 2);
|
||||||
glBindTexture(GL_TEXTURE_2D, targetTexture.value().id);
|
glBindTexture(GL_TEXTURE_2D, targetTexture.value().id);
|
||||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||||
|
@ -1306,7 +1339,7 @@ void VisualiserComponent::renderScope(const std::vector<float>& xPoints, const s
|
||||||
|
|
||||||
if (sampleRate != oldSampleRate || scratchVertices.empty()) {
|
if (sampleRate != oldSampleRate || scratchVertices.empty()) {
|
||||||
oldSampleRate = sampleRate;
|
oldSampleRate = sampleRate;
|
||||||
setupArrays(RESAMPLE_RATIO * sampleRate / FRAME_RATE);
|
setupArrays(RESAMPLE_RATIO * sampleRate / recordingSettings.getFrameRate());
|
||||||
}
|
}
|
||||||
intensity = settings.getIntensity() * (41000.0f / sampleRate);
|
intensity = settings.getIntensity() * (41000.0f / sampleRate);
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,6 @@ private:
|
||||||
CommonAudioProcessor& audioProcessor;
|
CommonAudioProcessor& audioProcessor;
|
||||||
|
|
||||||
float intensity;
|
float intensity;
|
||||||
const double FRAME_RATE = 60.0;
|
|
||||||
|
|
||||||
bool visualiserOnly;
|
bool visualiserOnly;
|
||||||
AudioPlayerComponent audioPlayer{audioProcessor};
|
AudioPlayerComponent audioPlayer{audioProcessor};
|
||||||
|
@ -194,6 +193,8 @@ private:
|
||||||
std::vector<float> fullScreenQuad;
|
std::vector<float> fullScreenQuad;
|
||||||
|
|
||||||
GLuint frameBuffer = 0;
|
GLuint frameBuffer = 0;
|
||||||
|
|
||||||
|
double currentFrameRate = 60.0;
|
||||||
Texture lineTexture;
|
Texture lineTexture;
|
||||||
Texture blur1Texture;
|
Texture blur1Texture;
|
||||||
Texture blur2Texture;
|
Texture blur2Texture;
|
||||||
|
@ -209,12 +210,12 @@ private:
|
||||||
juce::Image emptyScreenImage = juce::ImageFileFormat::loadFrom(BinaryData::empty_jpg, BinaryData::empty_jpgSize);
|
juce::Image emptyScreenImage = juce::ImageFileFormat::loadFrom(BinaryData::empty_jpg, BinaryData::empty_jpgSize);
|
||||||
|
|
||||||
#if SOSCI_FEATURES
|
#if SOSCI_FEATURES
|
||||||
juce::Image oscilloscopeImage = juce::ImageFileFormat::loadFrom(BinaryData::real_jpg, BinaryData::real_jpgSize);
|
juce::Image oscilloscopeImage = juce::ImageFileFormat::loadFrom(BinaryData::real_png, BinaryData::real_pngSize);
|
||||||
juce::Image vectorDisplayImage = juce::ImageFileFormat::loadFrom(BinaryData::vector_display_jpg, BinaryData::vector_display_jpgSize);
|
juce::Image vectorDisplayImage = juce::ImageFileFormat::loadFrom(BinaryData::vector_display_png, BinaryData::vector_display_pngSize);
|
||||||
|
|
||||||
juce::Image emptyReflectionImage = juce::ImageFileFormat::loadFrom(BinaryData::no_reflection_jpg, BinaryData::no_reflection_jpgSize);
|
juce::Image emptyReflectionImage = juce::ImageFileFormat::loadFrom(BinaryData::no_reflection_jpg, BinaryData::no_reflection_jpgSize);
|
||||||
juce::Image oscilloscopeReflectionImage = juce::ImageFileFormat::loadFrom(BinaryData::real_reflection_jpg, BinaryData::real_reflection_jpgSize);
|
juce::Image oscilloscopeReflectionImage = juce::ImageFileFormat::loadFrom(BinaryData::real_reflection_png, BinaryData::real_reflection_pngSize);
|
||||||
juce::Image vectorDisplayReflectionImage = juce::ImageFileFormat::loadFrom(BinaryData::vector_display_reflection_jpg, BinaryData::vector_display_reflection_jpgSize);
|
juce::Image vectorDisplayReflectionImage = juce::ImageFileFormat::loadFrom(BinaryData::vector_display_reflection_png, BinaryData::vector_display_reflection_pngSize);
|
||||||
|
|
||||||
OsciPoint REAL_SCREEN_OFFSET = { 0.02, -0.15 };
|
OsciPoint REAL_SCREEN_OFFSET = { 0.02, -0.15 };
|
||||||
OsciPoint REAL_SCREEN_SCALE = { 0.6 };
|
OsciPoint REAL_SCREEN_SCALE = { 0.6 };
|
||||||
|
@ -252,7 +253,8 @@ private:
|
||||||
void initialiseSharedTexture();
|
void initialiseSharedTexture();
|
||||||
void closeSharedTexture();
|
void closeSharedTexture();
|
||||||
#endif
|
#endif
|
||||||
Texture makeTexture(int width, int height);
|
Texture makeTexture(int width, int height, GLuint textureID = 0);
|
||||||
|
void setResolution(int width);
|
||||||
void setupArrays(int num_points);
|
void setupArrays(int num_points);
|
||||||
void setupTextures();
|
void setupTextures();
|
||||||
void drawLineTexture(const std::vector<float>& xPoints, const std::vector<float>& yPoints, const std::vector<float>& zPoints);
|
void drawLineTexture(const std::vector<float>& xPoints, const std::vector<float>& yPoints, const std::vector<float>& zPoints);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginCharacteristicsValue="pluginWantsMidiIn"
|
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginCharacteristicsValue="pluginWantsMidiIn"
|
||||||
pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender"
|
pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender"
|
||||||
cppLanguageStandard="20" projectLineFeed=" " headerPath="./include"
|
cppLanguageStandard="20" projectLineFeed=" " headerPath="./include"
|
||||||
version="2.4.4.0" companyName="James H Ball" companyWebsite="https://osci-render.com"
|
version="2.4.5.0" companyName="James H Ball" companyWebsite="https://osci-render.com"
|
||||||
companyEmail="james@ball.sh" defines="NOMINMAX=1 INTERNET_FLAG_NO_AUTO_REDIRECT=0 SOSCI_FEATURES=1"
|
companyEmail="james@ball.sh" defines="NOMINMAX=1 INTERNET_FLAG_NO_AUTO_REDIRECT=0 SOSCI_FEATURES=1"
|
||||||
pluginAUMainType="'aumf'">
|
pluginAUMainType="'aumf'">
|
||||||
<MAINGROUP id="j5Ge2T" name="osci-render">
|
<MAINGROUP id="j5Ge2T" name="osci-render">
|
||||||
|
@ -37,13 +37,13 @@
|
||||||
<FILE id="RgmiPU" name="no_reflection.jpg" compile="0" resource="1"
|
<FILE id="RgmiPU" name="no_reflection.jpg" compile="0" resource="1"
|
||||||
file="Resources/oscilloscope/no_reflection.jpg"/>
|
file="Resources/oscilloscope/no_reflection.jpg"/>
|
||||||
<FILE id="dNtZYs" name="noise.jpg" compile="0" resource="1" file="Resources/oscilloscope/noise.jpg"/>
|
<FILE id="dNtZYs" name="noise.jpg" compile="0" resource="1" file="Resources/oscilloscope/noise.jpg"/>
|
||||||
<FILE id="FyEDbA" name="real.jpg" compile="0" resource="1" file="Resources/oscilloscope/real.jpg"/>
|
<FILE id="ZeLdkV" name="real.png" compile="0" resource="1" file="Resources/oscilloscope/real.png"/>
|
||||||
<FILE id="v8E6y9" name="real_reflection.jpg" compile="0" resource="1"
|
<FILE id="LRgixi" name="real_reflection.png" compile="0" resource="1"
|
||||||
file="Resources/oscilloscope/real_reflection.jpg"/>
|
file="Resources/oscilloscope/real_reflection.png"/>
|
||||||
<FILE id="QrCP4w" name="vector_display.jpg" compile="0" resource="1"
|
<FILE id="arGLS1" name="vector_display.png" compile="0" resource="1"
|
||||||
file="Resources/oscilloscope/vector_display.jpg"/>
|
file="Resources/oscilloscope/vector_display.png"/>
|
||||||
<FILE id="s3VNsJ" name="vector_display_reflection.jpg" compile="0"
|
<FILE id="a6URcP" name="vector_display_reflection.png" compile="0"
|
||||||
resource="1" file="Resources/oscilloscope/vector_display_reflection.jpg"/>
|
resource="1" file="Resources/oscilloscope/vector_display_reflection.png"/>
|
||||||
</GROUP>
|
</GROUP>
|
||||||
<GROUP id="{82BCD6F1-A8BF-F30B-5587-81EE70168883}" name="svg">
|
<GROUP id="{82BCD6F1-A8BF-F30B-5587-81EE70168883}" name="svg">
|
||||||
<FILE id="rl17ZK" name="cog.svg" compile="0" resource="1" file="Resources/svg/cog.svg"/>
|
<FILE id="rl17ZK" name="cog.svg" compile="0" resource="1" file="Resources/svg/cog.svg"/>
|
||||||
|
|
16
sosci.jucer
|
@ -3,7 +3,7 @@
|
||||||
<JUCERPROJECT id="HH2E72" name="sosci" projectType="audioplug" useAppConfig="0"
|
<JUCERPROJECT id="HH2E72" name="sosci" projectType="audioplug" useAppConfig="0"
|
||||||
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginManufacturer="jameshball"
|
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginManufacturer="jameshball"
|
||||||
aaxIdentifier="sh.ball.sosci" cppLanguageStandard="20" projectLineFeed=" "
|
aaxIdentifier="sh.ball.sosci" cppLanguageStandard="20" projectLineFeed=" "
|
||||||
headerPath="./include" version="1.0.4.0" companyName="James H Ball"
|
headerPath="./include" version="1.0.5.0" companyName="James H Ball"
|
||||||
companyWebsite="https://osci-render.com" companyEmail="james@ball.sh"
|
companyWebsite="https://osci-render.com" companyEmail="james@ball.sh"
|
||||||
defines="NOMINMAX=1 INTERNET_FLAG_NO_AUTO_REDIRECT=0 SOSCI_FEATURES=1"
|
defines="NOMINMAX=1 INTERNET_FLAG_NO_AUTO_REDIRECT=0 SOSCI_FEATURES=1"
|
||||||
pluginManufacturerCode="Jhba" pluginCode="Sosc" pluginAUMainType="'aufx'">
|
pluginManufacturerCode="Jhba" pluginCode="Sosc" pluginAUMainType="'aufx'">
|
||||||
|
@ -32,13 +32,13 @@
|
||||||
<FILE id="ZgcesA" name="no_reflection.jpg" compile="0" resource="1"
|
<FILE id="ZgcesA" name="no_reflection.jpg" compile="0" resource="1"
|
||||||
file="Resources/oscilloscope/no_reflection.jpg"/>
|
file="Resources/oscilloscope/no_reflection.jpg"/>
|
||||||
<FILE id="dNtZYs" name="noise.jpg" compile="0" resource="1" file="Resources/oscilloscope/noise.jpg"/>
|
<FILE id="dNtZYs" name="noise.jpg" compile="0" resource="1" file="Resources/oscilloscope/noise.jpg"/>
|
||||||
<FILE id="xxXx4Q" name="real.jpg" compile="0" resource="1" file="Resources/oscilloscope/real.jpg"/>
|
<FILE id="LAmlcm" name="real.png" compile="0" resource="1" file="Resources/oscilloscope/real.png"/>
|
||||||
<FILE id="nuEXXn" name="real_reflection.jpg" compile="0" resource="1"
|
<FILE id="FKUOID" name="real_reflection.png" compile="0" resource="1"
|
||||||
file="Resources/oscilloscope/real_reflection.jpg"/>
|
file="Resources/oscilloscope/real_reflection.png"/>
|
||||||
<FILE id="bdQp0Q" name="vector_display.jpg" compile="0" resource="1"
|
<FILE id="P9kYdq" name="vector_display.png" compile="0" resource="1"
|
||||||
file="Resources/oscilloscope/vector_display.jpg"/>
|
file="Resources/oscilloscope/vector_display.png"/>
|
||||||
<FILE id="XojumY" name="vector_display_reflection.jpg" compile="0"
|
<FILE id="IiqBke" name="vector_display_reflection.png" compile="0"
|
||||||
resource="1" file="Resources/oscilloscope/vector_display_reflection.jpg"/>
|
resource="1" file="Resources/oscilloscope/vector_display_reflection.png"/>
|
||||||
</GROUP>
|
</GROUP>
|
||||||
<GROUP id="{08DE8F94-4A00-7C71-4AF3-4C34C821A5DF}" name="sosci">
|
<GROUP id="{08DE8F94-4A00-7C71-4AF3-4C34C821A5DF}" name="sosci">
|
||||||
<FILE id="jtOYDo" name="clean.sosci" compile="0" resource="1" file="Resources/sosci/clean.sosci"/>
|
<FILE id="jtOYDo" name="clean.sosci" compile="0" resource="1" file="Resources/sosci/clean.sosci"/>
|
||||||
|
|