Change shutter length to a toggle and rename to shutter sync

pull/284/head
James H Ball 2025-02-11 19:42:36 +00:00
rodzic 3948affd10
commit 8d71ce7573
9 zmienionych plików z 48 dodań i 24 usunięć

Wyświetl plik

@ -52,7 +52,7 @@ public:
#endif
#if SOSCI_FEATURES
int VISUALISER_SETTINGS_HEIGHT = 1200;
int VISUALISER_SETTINGS_HEIGHT = 1250;
#else
int VISUALISER_SETTINGS_HEIGHT = 800;
#endif

Wyświetl plik

@ -86,7 +86,14 @@ public:
const String getApplicationName() override { return CharPointer_UTF8 (JucePlugin_Name); }
const String getApplicationVersion() override { return JucePlugin_VersionString; }
bool moreThanOneInstanceAllowed() override { return true; }
void anotherInstanceStarted (const String&) override {}
void anotherInstanceStarted (const String& commandLine) override
{
if (mainWindow != nullptr)
{
mainWindow->toFront(true);
mainWindow->handleCommandLine(commandLine);
}
}
virtual StandaloneFilterWindow* createWindow()
{
@ -128,7 +135,7 @@ public:
}
//==============================================================================
void initialise (const String&) override
void initialise (const String& commandLine) override
{
mainWindow = rawToUniquePtr (createWindow());
@ -143,6 +150,7 @@ public:
else
{
pluginHolder = createPluginHolder();
mainWindow->handleCommandLine(commandLine);
}
}

Wyświetl plik

@ -902,6 +902,25 @@ public:
std::unique_ptr<StandalonePluginHolder> pluginHolder;
void handleCommandLine(const String& commandLine)
{
if (commandLine.isNotEmpty())
{
handleOpenFile(commandLine);
}
}
void handleOpenFile(const String& fileName)
{
if (auto* processor = getAudioProcessor())
{
// if (processor->openProjectCallback)
// {
// processor->openProjectCallback(File(fileName));
// }
}
}
private:
void updateContent()
{

Wyświetl plik

@ -7,7 +7,7 @@ uniform float uSize;
uniform float uNEdges;
uniform float uFadeAmount;
uniform float uIntensity;
uniform float uShutterLength;
uniform bool uShutterSync;
uniform float uGain;
attribute vec3 aStart, aEnd;
attribute float aIdx;
@ -61,10 +61,12 @@ void main () {
uvl.y = side * vSize;
float intensityScale = floor(aIdx / 4.0 + 0.5)/uNEdges;
float avgIntensityScale = floor((uNEdges / 2.0) / 4.0 + 0.5)/uNEdges;
float shutterLength = clamp(uShutterLength, 0.0, 1.0);
float adjustedIntensity = mix(intensityScale, avgIntensityScale, shutterLength);
float intensityFade = mix(1.0 - uFadeAmount, 1.0, adjustedIntensity);
if (uShutterSync) {
float avgIntensityScale = floor(uNEdges / 4.0 + 0.5)/uNEdges;
intensityScale = avgIntensityScale;
}
float intensityFade = mix(1.0 - uFadeAmount, 1.0, intensityScale);
uvl.w *= intensity * intensityFade;

Wyświetl plik

@ -1092,10 +1092,10 @@ void VisualiserComponent::drawLine(const std::vector<float>& xPoints, const std:
#if SOSCI_FEATURES
lineShader->setUniform("uFishEye", screenOverlay == ScreenOverlay::VectorDisplay ? VECTOR_DISPLAY_FISH_EYE : 0.0f);
lineShader->setUniform("uShutterLength", (GLfloat) settings.getShutterLength());
lineShader->setUniform("uShutterSync", settings.getShutterSync());
#else
lineShader->setUniform("uFishEye", 0.0f);
lineShader->setUniform("uShutterLength", 0.0f);
lineShader->setUniform("uShutterSync", false);
#endif
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vertexIndexBuffer);

Wyświetl plik

@ -20,6 +20,7 @@ VisualiserSettings::VisualiserSettings(VisualiserParameters& p, int numChannels)
addAndMakeVisible(flipVerticalToggle);
addAndMakeVisible(flipHorizontalToggle);
addAndMakeVisible(goniometerToggle);
addAndMakeVisible(shutterSyncToggle);
#endif
for (int i = 1; i <= parameters.screenOverlay->max; i++) {
@ -83,6 +84,7 @@ void VisualiserSettings::resized() {
flipVerticalToggle.setBounds(area.removeFromTop(rowHeight));
flipHorizontalToggle.setBounds(area.removeFromTop(rowHeight));
goniometerToggle.setBounds(area.removeFromTop(rowHeight));
shutterSyncToggle.setBounds(area.removeFromTop(rowHeight));
#endif
#if !SOSCI_FEATURES

Wyświetl plik

@ -99,6 +99,7 @@ public:
BooleanParameter* flipVertical = new BooleanParameter("Flip Vertical", "flipVertical", VERSION_HINT, false, "Flips the visualiser vertically.");
BooleanParameter* flipHorizontal = new BooleanParameter("Flip Horizontal", "flipHorizontal", VERSION_HINT, false, "Flips the visualiser horizontally.");
BooleanParameter* goniometer = new BooleanParameter("Goniometer", "goniometer", VERSION_HINT, false, "Rotates the visualiser to replicate a goniometer display to show the phase relationship between two channels.");
BooleanParameter* shutterSync = new BooleanParameter("Shutter Sync", "shutterSync", VERSION_HINT, false, "Controls whether the camera's shutter speed is in sync with framerate. This makes the brightness of a single frame constant. This can be beneficial when the drawing frequency and frame rate are in sync.");
std::shared_ptr<Effect> screenSaturationEffect = std::make_shared<Effect>(
new EffectParameter(
@ -178,14 +179,6 @@ public:
VERSION_HINT, 0.0, -1.0, 1.0
),
});
std::shared_ptr<Effect> shutterLengthEffect = std::make_shared<Effect>(
new EffectParameter(
"Shutter Length",
"Controls the percentage of time the camera shutter is open over a frame. This can be beneficial when the drawing frequency and frame rate are in sync.",
"shutterLength",
VERSION_HINT, 0.0, 0.0, 1.0
)
);
#endif
std::shared_ptr<Effect> persistenceEffect = std::make_shared<Effect>(
@ -294,7 +287,6 @@ public:
screenSaturationEffect,
screenHueEffect,
overexposureEffect,
shutterLengthEffect,
#endif
};
std::vector<std::shared_ptr<Effect>> audioEffects = {
@ -313,6 +305,7 @@ public:
flipVertical,
flipHorizontal,
goniometer,
shutterSync,
#endif
};
std::vector<IntParameter*> integers = {
@ -406,8 +399,8 @@ public:
return parameters.goniometer->getBoolValue();
}
double getShutterLength() {
return parameters.shutterLengthEffect->getActualValue();
bool getShutterSync() {
return parameters.shutterSync->getBoolValue();
}
#endif
@ -479,7 +472,6 @@ private:
#if SOSCI_FEATURES
std::make_shared<EffectComponent>(*parameters.afterglowEffect),
std::make_shared<EffectComponent>(*parameters.overexposureEffect),
std::make_shared<EffectComponent>(*parameters.shutterLengthEffect),
#else
std::make_shared<EffectComponent>(*parameters.ambientEffect),
#endif
@ -527,6 +519,7 @@ private:
jux::SwitchButton flipVerticalToggle{parameters.flipVertical};
jux::SwitchButton flipHorizontalToggle{parameters.flipHorizontal};
jux::SwitchButton goniometerToggle{parameters.goniometer};
jux::SwitchButton shutterSyncToggle{parameters.shutterSync};
#endif
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(VisualiserSettings)

Wyświetl plik

@ -4,7 +4,7 @@
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginCharacteristicsValue="pluginWantsMidiIn"
pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender"
cppLanguageStandard="20" projectLineFeed="&#10;" headerPath="./include"
version="2.4.10.1" companyName="James H Ball" companyWebsite="https://osci-render.com"
version="2.4.10.2" 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"
pluginAUMainType="'aumf'">
<MAINGROUP id="j5Ge2T" name="osci-render">

Wyświetl plik

@ -3,7 +3,7 @@
<JUCERPROJECT id="HH2E72" name="sosci" projectType="audioplug" useAppConfig="0"
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginManufacturer="jameshball"
aaxIdentifier="sh.ball.sosci" cppLanguageStandard="20" projectLineFeed="&#10;"
headerPath="./include" version="1.1.4.1" companyName="James H Ball"
headerPath="./include" version="1.1.4.2" 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"
pluginManufacturerCode="Jhba" pluginCode="Sosc" pluginAUMainType="'aufx'">