diff --git a/Resources/oscilloscope/oscilloscope.html b/Resources/oscilloscope/oscilloscope.html
index 769f1d8..bceafe4 100644
--- a/Resources/oscilloscope/oscilloscope.html
+++ b/Resources/oscilloscope/oscilloscope.html
@@ -99,6 +99,7 @@
else return '+'+this.toFixed(k);
}
+ console.log()
var toggleVisible = function(string)
{
var element = document.getElementById(string);
@@ -144,14 +145,6 @@
-
-
- XXY OSCILLOSCOPE
-
-
-
-
-
@@ -200,15 +193,6 @@ oninput="controls.audioVolume=this.value; audioVolumeOutput.value=parseFloat(thi
|
-
-
- Version 0.96 (May 2022). Made
-by Neil Thapen.
-Line-drawing code adapted from
-woscope by e1ml.
-Thanks to e1ml and ompuco for inspiration.
-
-
@@ -236,95 +220,6 @@ oninput="controls.sweepMsDiv=Math.pow(2, this.value-2); msDivOutput.value = cont
-
-
-
-
- SIGNAL GENERATOR
-
-  x =
-
-
- y =
-
-
-
-
-
-
- Use javascript expressions, e.g. 'Math.tan(t)'.
-t is the time, n is the number of samples.
-
-
-
-
-
- MICROPHONE
- |
  Hide graticule
+onchange="controls.grid=!controls.grid"> Hide graticule
|
-
-
- [reset all]
-
-
diff --git a/Resources/oscilloscope/oscilloscope.js b/Resources/oscilloscope/oscilloscope.js
index f426282..c3867e1 100644
--- a/Resources/oscilloscope/oscilloscope.js
+++ b/Resources/oscilloscope/oscilloscope.js
@@ -117,23 +117,10 @@ var UI =
{
sidebarWidth : 360,
- init : function()
- {
- var kHzText = (AudioSystem.sampleRate/1000).toFixed(1)+"kHz";
- document.getElementById("samplerate").innerHTML=kHzText;
+ init : function() {
mainGain.oninput();
trigger.oninput();
- this.xInput = document.getElementById("xInput");
- this.yInput = document.getElementById("yInput");
- this.xInput.value = controls.xExpression;
- this.yInput.value = controls.yExpression;
},
-
- compile : function() //doesn't compile anything anymore
- {
- controls.xExpression = this.xInput.value;
- controls.yExpression = this.yInput.value;
- }
}
var Render =
@@ -696,60 +683,66 @@ var sweepPosition = -1;
var belowTrigger = false;
function doScriptProcessor(event) {
- fetch(Juce.getBackendResourceAddress("audio"))
- .then((response) => response.arrayBuffer())
- .then((buffer) => {
- var dataView = new DataView(buffer);
+ if (!killed) {
+ fetch(Juce.getBackendResourceAddress("audio"))
+ .then((response) => response.arrayBuffer())
+ .then((buffer) => {
+ var dataView = new DataView(buffer);
- for (var i = 0; i < xSamples.length; i++) {
- xSamples[i] = dataView.getFloat32(i * 4 * 2, true);
- ySamples[i] = dataView.getFloat32(i * 4 * 2 + 4, true);
- }
-
- if (controls.sweepOn) {
- var gain = Math.pow(2.0,controls.mainGain);
- var sweepMinTime = controls.sweepMsDiv*10/1000;
- var triggerValue = controls.sweepTriggerValue;
- for (var i=0; i 1.1 && belowTrigger && ySamples[i]>=triggerValue)
- sweepPosition =-1.3;
- belowTrigger = ySamples[i] 1.1 && belowTrigger && ySamples[i]>=triggerValue)
+ sweepPosition =-1.3;
+ belowTrigger = ySamples[i] bounds = getLocalBounds().withTrimmedTop(20).reduced(20);
auto buttonWidth = 120;
auto buttonHeight = 30;
auto padding = 10;
@@ -244,6 +237,11 @@ void MainComponent::resized() {
bounds.removeFromTop(padding);
if (!pluginEditor.visualiserFullScreen) {
auto minDim = juce::jmin(bounds.getWidth(), bounds.getHeight());
- pluginEditor.visualiser.setBounds(bounds.withSizeKeepingCentre(minDim, minDim));
+ juce::Point localTopLeft = {bounds.getX(), bounds.getY()};
+ juce::Point topLeft = pluginEditor.getLocalPoint(this, localTopLeft);
+ auto shiftedBounds = bounds;
+ shiftedBounds.setX(topLeft.getX());
+ shiftedBounds.setY(topLeft.getY());
+ pluginEditor.visualiser.setBounds(shiftedBounds.withSizeKeepingCentre(minDim, minDim));
}
}
diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp
index e8723d2..3c33a78 100644
--- a/Source/PluginEditor.cpp
+++ b/Source/PluginEditor.cpp
@@ -100,10 +100,7 @@ OscirenderAudioProcessorEditor::OscirenderAudioProcessorEditor(OscirenderAudioPr
addAndMakeVisible(lua);
addAndMakeVisible(luaResizerBar);
-
- if (visualiserFullScreen) {
- addAndMakeVisible(visualiser);
- }
+ addAndMakeVisible(visualiser);
tooltipDropShadow.setOwner(&tooltipWindow);
}
diff --git a/Source/components/VisualiserComponent.h b/Source/components/VisualiserComponent.h
index ab49447..36a771c 100644
--- a/Source/components/VisualiserComponent.h
+++ b/Source/components/VisualiserComponent.h
@@ -100,7 +100,6 @@ private:
.withResourceProvider(provider)
.withNativeFunction("toggleFullscreen", [this](auto& var, auto complete) {
enableFullScreen();
- complete("toggleFullscreen");
})
);