2024-08-10 19:26:56 +00:00
# pragma once
2024-09-12 22:09:54 +00:00
# define VERSION_HINT 2
2024-08-10 19:26:56 +00:00
# include <JuceHeader.h>
2024-11-06 20:15:09 +00:00
# include "../components/EffectComponent.h"
# include "../components/SvgButton.h"
2024-08-13 13:55:30 +00:00
# include "../LookAndFeel.h"
2024-11-06 20:15:09 +00:00
# include "../components/SwitchButton.h"
2024-11-09 22:51:42 +00:00
# include "../audio/SmoothEffect.h"
2025-01-10 15:22:55 +00:00
# include "../audio/StereoEffect.h"
2024-08-10 19:26:56 +00:00
2025-01-07 18:28:55 +00:00
enum class ScreenOverlay : int {
2025-02-09 15:48:46 +00:00
INVALID = - 1 ,
2024-12-26 23:00:52 +00:00
Empty = 1 ,
Graticule = 2 ,
Smudged = 3 ,
SmudgedGraticule = 4 ,
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2024-12-28 15:37:19 +00:00
Real = 5 ,
VectorDisplay = 6 ,
2024-12-30 11:55:45 +00:00
MAX = 6 ,
# else
MAX = 4 ,
# endif
2024-12-26 23:00:52 +00:00
} ;
2025-04-23 14:26:33 +00:00
class ScreenOverlayParameter : public osci : : IntParameter {
2024-12-26 23:00:52 +00:00
public :
2025-04-23 14:26:33 +00:00
ScreenOverlayParameter ( juce : : String name , juce : : String id , int versionHint , ScreenOverlay value ) : osci : : IntParameter ( name , id , versionHint , ( int ) value , 1 , ( int ) ScreenOverlay : : MAX ) { }
2024-12-26 23:00:52 +00:00
juce : : String getText ( float value , int maximumStringLength = 100 ) const override {
2025-01-07 18:28:55 +00:00
switch ( ( ScreenOverlay ) ( int ) getUnnormalisedValue ( value ) ) {
case ScreenOverlay : : Empty :
2024-12-26 23:00:52 +00:00
return " Empty " ;
2025-01-07 18:28:55 +00:00
case ScreenOverlay : : Graticule :
2024-12-26 23:00:52 +00:00
return " Graticule " ;
2025-01-07 18:28:55 +00:00
case ScreenOverlay : : Smudged :
2024-12-26 23:00:52 +00:00
return " Smudged " ;
2025-01-07 18:28:55 +00:00
case ScreenOverlay : : SmudgedGraticule :
2024-12-26 23:00:52 +00:00
return " Smudged Graticule " ;
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2025-01-07 18:28:55 +00:00
case ScreenOverlay : : Real :
2024-12-26 23:00:52 +00:00
return " Real Oscilloscope " ;
2025-01-07 18:28:55 +00:00
case ScreenOverlay : : VectorDisplay :
2024-12-28 15:37:19 +00:00
return " Vector Display " ;
2024-12-30 11:55:45 +00:00
# endif
2024-12-26 23:00:52 +00:00
default :
return " Unknown " ;
}
}
float getValueForText ( const juce : : String & text ) const override {
int unnormalisedValue ;
if ( text = = " Empty " ) {
2025-01-07 18:28:55 +00:00
unnormalisedValue = ( int ) ScreenOverlay : : Empty ;
2024-12-26 23:00:52 +00:00
} else if ( text = = " Graticule " ) {
2025-01-07 18:28:55 +00:00
unnormalisedValue = ( int ) ScreenOverlay : : Graticule ;
2024-12-26 23:00:52 +00:00
} else if ( text = = " Smudged " ) {
2025-01-07 18:28:55 +00:00
unnormalisedValue = ( int ) ScreenOverlay : : Smudged ;
2024-12-26 23:00:52 +00:00
} else if ( text = = " Smudged Graticule " ) {
2025-01-07 18:28:55 +00:00
unnormalisedValue = ( int ) ScreenOverlay : : SmudgedGraticule ;
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2024-12-26 23:00:52 +00:00
} else if ( text = = " Real Oscilloscope " ) {
2025-01-07 18:28:55 +00:00
unnormalisedValue = ( int ) ScreenOverlay : : Real ;
2024-12-28 15:37:19 +00:00
} else if ( text = = " Vector Display " ) {
2025-01-07 18:28:55 +00:00
unnormalisedValue = ( int ) ScreenOverlay : : VectorDisplay ;
2024-12-30 11:55:45 +00:00
# endif
2024-12-26 23:00:52 +00:00
} else {
2025-01-07 18:28:55 +00:00
unnormalisedValue = ( int ) ScreenOverlay : : Empty ;
2024-12-26 23:00:52 +00:00
}
return getNormalisedValue ( unnormalisedValue ) ;
}
void save ( juce : : XmlElement * xml ) {
2025-01-07 18:28:55 +00:00
xml - > setAttribute ( " screenOverlay " , getText ( getValue ( ) ) ) ;
2024-12-26 23:00:52 +00:00
}
void load ( juce : : XmlElement * xml ) {
2025-01-07 18:28:55 +00:00
setValueNotifyingHost ( getValueForText ( xml - > getStringAttribute ( " screenOverlay " ) ) ) ;
2024-12-26 23:00:52 +00:00
}
2024-12-28 15:37:19 +00:00
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2024-12-28 15:37:19 +00:00
bool isRealisticDisplay ( ) {
2025-01-07 18:28:55 +00:00
ScreenOverlay type = ( ScreenOverlay ) ( int ) getValueUnnormalised ( ) ;
return type = = ScreenOverlay : : Real | | type = = ScreenOverlay : : VectorDisplay ;
2024-12-28 15:37:19 +00:00
}
2024-12-30 11:55:45 +00:00
# endif
2024-12-26 23:00:52 +00:00
} ;
2024-09-12 22:09:54 +00:00
class VisualiserParameters {
public :
2025-05-08 20:26:03 +00:00
double getIntensity ( ) {
return intensityEffect - > getActualValue ( ) / 100 ;
}
double getPersistence ( ) {
return persistenceEffect - > getActualValue ( ) - 1.33 ;
}
double getHue ( ) {
return hueEffect - > getActualValue ( ) ;
}
double getLineSaturation ( ) {
return lineSaturationEffect - > getActualValue ( ) ;
}
# if OSCI_PREMIUM
double getScreenSaturation ( ) {
return screenSaturationEffect - > getActualValue ( ) ;
}
double getScreenHue ( ) {
return screenHueEffect - > getActualValue ( ) ;
}
double getAfterglow ( ) {
return afterglowEffect - > getActualValue ( ) ;
}
double getOverexposure ( ) {
return overexposureEffect - > getActualValue ( ) ;
}
bool isFlippedVertical ( ) {
return flipVertical - > getBoolValue ( ) ;
}
bool isFlippedHorizontal ( ) {
return flipHorizontal - > getBoolValue ( ) ;
}
bool isGoniometer ( ) {
return goniometer - > getBoolValue ( ) ;
}
bool getShutterSync ( ) {
return shutterSync - > getBoolValue ( ) ;
}
# endif
double getFocus ( ) {
return focusEffect - > getActualValue ( ) / 100 ;
}
double getNoise ( ) {
return noiseEffect - > getActualValue ( ) / 5 ;
}
double getGlow ( ) {
return glowEffect - > getActualValue ( ) * 3 ;
}
double getAmbient ( ) {
return ambientEffect - > getActualValue ( ) ;
}
ScreenOverlay getScreenOverlay ( ) {
return ( ScreenOverlay ) screenOverlay - > getValueUnnormalised ( ) ;
}
bool getUpsamplingEnabled ( ) {
return upsamplingEnabled - > getBoolValue ( ) ;
}
bool isSweepEnabled ( ) {
return sweepEnabled - > getBoolValue ( ) ;
}
double getSweepSeconds ( ) {
return sweepMsEffect - > getActualValue ( ) / 1000.0 ;
}
double getTriggerValue ( ) {
return triggerValueEffect - > getActualValue ( ) ;
}
2025-01-07 18:28:55 +00:00
ScreenOverlayParameter * screenOverlay = new ScreenOverlayParameter ( " Screen Overlay " , " screenOverlay " , VERSION_HINT , ScreenOverlay : : SmudgedGraticule ) ;
2025-04-23 14:26:33 +00:00
osci : : BooleanParameter * upsamplingEnabled = new osci : : BooleanParameter ( " Upsample Audio " , " upsamplingEnabled " , VERSION_HINT , true , " Upsamples the audio before visualising it to make it appear more realistic, at the expense of performance. " ) ;
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. " ) ;
2024-09-12 22:09:54 +00:00
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2025-04-23 14:26:33 +00:00
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. " ) ;
osci : : BooleanParameter * shutterSync = new osci : : 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. " ) ;
2025-01-10 12:41:34 +00:00
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > screenSaturationEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2025-01-10 12:41:34 +00:00
" Screen Saturation " ,
" Controls how saturated the colours are on the oscilloscope screen. " ,
" screenSaturation " ,
VERSION_HINT , 1.0 , 0.0 , 5.0
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > screenHueEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2025-02-02 20:26:18 +00:00
" Screen Hue " ,
" Controls the hue shift of the oscilloscope screen. " ,
" screenHue " ,
VERSION_HINT , 0 , 0 , 359 , 1
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > afterglowEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2025-02-02 13:46:27 +00:00
" Afterglow " ,
" Controls how quickly the image disappears after glowing brightly. Closely related to persistence. " ,
" afterglow " ,
2025-02-02 23:09:42 +00:00
VERSION_HINT , 1.0 , 0.0 , 10.0
2025-02-02 21:10:02 +00:00
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > overexposureEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2025-02-02 21:10:02 +00:00
" Overexposure " ,
" Controls at which point the line becomes overexposed and clips, turning white. " ,
" overexposure " ,
VERSION_HINT , 0.5 , 0.0 , 1.0
2025-02-02 13:46:27 +00:00
)
) ;
2025-01-10 15:22:55 +00:00
std : : shared_ptr < StereoEffect > stereoEffectApplication = std : : make_shared < StereoEffect > ( ) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > stereoEffect = std : : make_shared < osci : : Effect > (
2025-01-10 15:22:55 +00:00
stereoEffectApplication ,
2025-04-23 14:26:33 +00:00
new osci : : EffectParameter (
2025-01-10 15:22:55 +00:00
" Stereo " ,
" Turns mono audio that is uninteresting to visualise into stereo audio that is interesting to visualise. " ,
" stereo " ,
VERSION_HINT , 0.0 , 0.0 , 1.0
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > scaleEffect = std : : make_shared < osci : : Effect > (
[ this ] ( int index , osci : : Point input , const std : : vector < std : : atomic < double > > & values , double sampleRate ) {
2025-01-10 12:41:34 +00:00
input . scale ( values [ 0 ] . load ( ) , values [ 1 ] . load ( ) , 1.0 ) ;
return input ;
2025-04-23 14:26:33 +00:00
} , std : : vector < osci : : EffectParameter * > {
new osci : : EffectParameter (
2025-01-10 12:41:34 +00:00
" X Scale " ,
" Controls the horizontal scale of the oscilloscope display. " ,
" xScale " ,
VERSION_HINT , 1.0 , - 3.0 , 3.0
) ,
2025-04-23 14:26:33 +00:00
new osci : : EffectParameter (
2025-01-10 12:41:34 +00:00
" Y Scale " ,
" Controls the vertical scale of the oscilloscope display. " ,
" yScale " ,
VERSION_HINT , 1.0 , - 3.0 , 3.0
) ,
} ) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > offsetEffect = std : : make_shared < osci : : Effect > (
[ this ] ( int index , osci : : Point input , const std : : vector < std : : atomic < double > > & values , double sampleRate ) {
2025-01-10 12:41:34 +00:00
input . translate ( values [ 0 ] . load ( ) , values [ 1 ] . load ( ) , 0.0 ) ;
return input ;
2025-04-23 14:26:33 +00:00
} , std : : vector < osci : : EffectParameter * > {
new osci : : EffectParameter (
2025-01-10 12:41:34 +00:00
" X Offset " ,
" Controls the horizontal position offset of the oscilloscope display. " ,
" xOffset " ,
VERSION_HINT , 0.0 , - 1.0 , 1.0
) ,
2025-04-23 14:26:33 +00:00
new osci : : EffectParameter (
2025-01-10 12:41:34 +00:00
" Y Offset " ,
" Controls the vertical position offset of the oscilloscope display. " ,
" yOffset " ,
VERSION_HINT , 0.0 , - 1.0 , 1.0
) ,
} ) ;
# endif
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > persistenceEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2024-09-12 22:09:54 +00:00
" Persistence " ,
" Controls how long the light glows for on the oscilloscope display. " ,
" persistence " ,
VERSION_HINT , 0.5 , 0 , 6.0
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > hueEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2025-02-02 20:26:18 +00:00
" Line Hue " ,
" Controls the hue of the beam of the oscilloscope. " ,
2024-09-12 22:09:54 +00:00
" hue " ,
VERSION_HINT , 125 , 0 , 359 , 1
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > intensityEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2025-02-02 20:26:18 +00:00
" Line Intensity " ,
2024-09-12 22:09:54 +00:00
" Controls how bright the electron beam of the oscilloscope is. " ,
" intensity " ,
2024-11-17 12:18:30 +00:00
VERSION_HINT , 5.0 , 0.0 , 10.0
2024-09-12 22:09:54 +00:00
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > lineSaturationEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2025-01-05 22:54:02 +00:00
" Line Saturation " ,
" Controls how saturated the colours are on the oscilloscope lines. " ,
" lineSaturation " ,
VERSION_HINT , 1.0 , 0.0 , 5.0
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > focusEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2024-09-29 19:36:16 +00:00
" Focus " ,
" Controls how focused the electron beam of the oscilloscope is. " ,
" focus " ,
2025-01-05 22:54:02 +00:00
VERSION_HINT , 1.0 , 0.3 , 10.0
2024-09-29 19:36:16 +00:00
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > noiseEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2024-11-06 20:15:09 +00:00
" Noise " ,
" Controls how much noise/grain is added to the oscilloscope display. " ,
" noise " ,
2024-11-17 12:18:30 +00:00
VERSION_HINT , 0.0 , 0.0 , 1.0
2024-11-06 20:15:09 +00:00
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > glowEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2024-11-09 21:37:20 +00:00
" Glow " ,
" Controls how much the light glows on the oscilloscope display. " ,
" glow " ,
VERSION_HINT , 0.3 , 0.0 , 1.0
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > ambientEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2024-12-26 23:00:52 +00:00
" Ambient Light " ,
" Controls how much ambient light is added to the oscilloscope display. " ,
" ambient " ,
2024-12-28 15:37:19 +00:00
VERSION_HINT , 0.7 , 0.0 , 5.0
2024-12-26 23:00:52 +00:00
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > smoothEffect = std : : make_shared < osci : : Effect > (
2024-11-09 22:51:42 +00:00
std : : make_shared < SmoothEffect > ( ) ,
2025-04-23 14:26:33 +00:00
new osci : : EffectParameter (
2024-11-09 22:51:42 +00:00
" Smoothing " ,
" This works as a low-pass frequency filter, effectively reducing the sample rate of the audio being visualised. " ,
" visualiserSmoothing " ,
VERSION_HINT , 0 , 0.0 , 1.0
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > sweepMsEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2024-11-17 12:18:30 +00:00
" Sweep (ms) " ,
" The number of milliseconds it takes for the oscilloscope to sweep from left to right. " ,
" sweepMs " ,
2025-01-06 11:17:42 +00:00
VERSION_HINT , 10.0 , 0.0 , 1000.0
2025-01-03 16:37:36 +00:00
)
) ;
2025-04-23 14:26:33 +00:00
std : : shared_ptr < osci : : Effect > triggerValueEffect = std : : make_shared < osci : : Effect > (
new osci : : EffectParameter (
2025-01-03 16:37:36 +00:00
" Trigger Value " ,
" The trigger value sets the signal level that starts waveform capture to display a stable waveform. " ,
" triggerValue " ,
VERSION_HINT , 0.0 , - 1.0 , 1.0
2024-11-17 12:18:30 +00:00
)
) ;
2024-11-09 22:51:42 +00:00
2025-04-23 14:26:33 +00:00
std : : vector < std : : shared_ptr < osci : : Effect > > effects = {
2025-01-10 12:41:34 +00:00
persistenceEffect ,
hueEffect ,
intensityEffect ,
lineSaturationEffect ,
focusEffect ,
noiseEffect ,
glowEffect ,
ambientEffect ,
sweepMsEffect ,
triggerValueEffect ,
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2025-02-02 13:46:27 +00:00
afterglowEffect ,
screenSaturationEffect ,
2025-02-02 20:26:18 +00:00
screenHueEffect ,
2025-02-02 21:10:02 +00:00
overexposureEffect ,
2025-02-02 13:46:27 +00:00
# endif
2025-01-10 12:41:34 +00:00
} ;
2025-04-23 14:26:33 +00:00
std : : vector < std : : shared_ptr < osci : : Effect > > audioEffects = {
2025-01-10 12:41:34 +00:00
smoothEffect ,
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2025-01-10 15:22:55 +00:00
stereoEffect ,
2025-01-10 12:41:34 +00:00
scaleEffect ,
offsetEffect ,
# endif
} ;
2025-04-23 14:26:33 +00:00
std : : vector < osci : : BooleanParameter * > booleans = {
2025-01-10 12:41:34 +00:00
upsamplingEnabled ,
visualiserFullScreen ,
sweepEnabled ,
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2025-01-10 12:41:34 +00:00
flipVertical ,
flipHorizontal ,
2025-02-08 21:04:26 +00:00
goniometer ,
2025-02-11 19:42:36 +00:00
shutterSync ,
2025-01-10 12:41:34 +00:00
# endif
} ;
2025-04-23 14:26:33 +00:00
std : : vector < osci : : IntParameter * > integers = {
2025-01-10 12:41:34 +00:00
screenOverlay ,
} ;
2024-09-12 22:09:54 +00:00
} ;
2025-02-02 20:26:18 +00:00
class GroupedSettings : public juce : : GroupComponent {
public :
GroupedSettings ( std : : vector < std : : shared_ptr < EffectComponent > > effects , juce : : String label ) : effects ( effects ) , juce : : GroupComponent ( label , label ) {
for ( auto effect : effects ) {
addAndMakeVisible ( effect . get ( ) ) ;
effect - > setSliderOnValueChange ( ) ;
}
setColour ( groupComponentBackgroundColourId , Colours : : veryDark . withMultipliedBrightness ( 3.0 ) ) ;
}
void resized ( ) override {
auto area = getLocalBounds ( ) ;
area . removeFromTop ( 35 ) ;
double rowHeight = 30 ;
for ( auto effect : effects ) {
effect - > setBounds ( area . removeFromTop ( rowHeight ) ) ;
}
}
int getHeight ( ) {
return 40 + effects . size ( ) * 30 ;
}
private :
std : : vector < std : : shared_ptr < EffectComponent > > effects ;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR ( GroupedSettings )
} ;
2025-01-08 13:06:01 +00:00
class VisualiserSettings : public juce : : Component , public juce : : AudioProcessorParameter : : Listener {
2024-08-10 19:26:56 +00:00
public :
2024-09-22 17:49:58 +00:00
VisualiserSettings ( VisualiserParameters & , int numChannels = 2 ) ;
2024-08-10 19:26:56 +00:00
~ VisualiserSettings ( ) ;
2025-01-06 11:17:42 +00:00
void paint ( juce : : Graphics & g ) override ;
2024-08-10 19:26:56 +00:00
void resized ( ) override ;
2025-01-08 13:06:01 +00:00
void parameterValueChanged ( int parameterIndex , float newValue ) override ;
void parameterGestureChanged ( int parameterIndex , bool gestureIsStarting ) override ;
2024-08-10 19:26:56 +00:00
2024-09-12 22:09:54 +00:00
VisualiserParameters & parameters ;
2024-09-22 17:49:58 +00:00
int numChannels ;
2024-09-12 22:09:54 +00:00
private :
2025-02-02 20:26:18 +00:00
GroupedSettings lineColour {
std : : vector < std : : shared_ptr < EffectComponent > > {
std : : make_shared < EffectComponent > ( * parameters . hueEffect ) ,
std : : make_shared < EffectComponent > ( * parameters . lineSaturationEffect ) ,
std : : make_shared < EffectComponent > ( * parameters . intensityEffect ) ,
} ,
" Line Colour "
} ;
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2025-02-02 20:26:18 +00:00
GroupedSettings screenColour {
std : : vector < std : : shared_ptr < EffectComponent > > {
std : : make_shared < EffectComponent > ( * parameters . screenHueEffect ) ,
std : : make_shared < EffectComponent > ( * parameters . screenSaturationEffect ) ,
std : : make_shared < EffectComponent > ( * parameters . ambientEffect ) ,
} ,
" Screen Colour "
} ;
# endif
GroupedSettings lightEffects {
std : : vector < std : : shared_ptr < EffectComponent > > {
std : : make_shared < EffectComponent > ( * parameters . persistenceEffect ) ,
std : : make_shared < EffectComponent > ( * parameters . focusEffect ) ,
std : : make_shared < EffectComponent > ( * parameters . glowEffect ) ,
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2025-02-02 20:26:18 +00:00
std : : make_shared < EffectComponent > ( * parameters . afterglowEffect ) ,
2025-02-02 21:10:02 +00:00
std : : make_shared < EffectComponent > ( * parameters . overexposureEffect ) ,
2025-02-02 20:26:18 +00:00
# else
std : : make_shared < EffectComponent > ( * parameters . ambientEffect ) ,
# endif
} ,
" Light Effects "
} ;
GroupedSettings videoEffects {
std : : vector < std : : shared_ptr < EffectComponent > > {
std : : make_shared < EffectComponent > ( * parameters . noiseEffect ) ,
} ,
" Video Effects "
} ;
GroupedSettings lineEffects {
std : : vector < std : : shared_ptr < EffectComponent > > {
std : : make_shared < EffectComponent > ( * parameters . smoothEffect ) ,
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2025-02-02 20:26:18 +00:00
std : : make_shared < EffectComponent > ( * parameters . stereoEffect ) ,
# endif
} ,
" Line Effects "
} ;
2024-11-17 12:18:30 +00:00
EffectComponent sweepMs { * parameters . sweepMsEffect } ;
2025-01-03 16:37:36 +00:00
EffectComponent triggerValue { * parameters . triggerValueEffect } ;
2024-08-13 13:55:30 +00:00
2025-01-07 18:28:55 +00:00
juce : : Label screenOverlayLabel { " Screen Overlay " , " Screen Overlay " } ;
juce : : ComboBox screenOverlay ;
2024-12-26 23:00:52 +00:00
2024-09-12 22:09:54 +00:00
jux : : SwitchButton upsamplingToggle { parameters . upsamplingEnabled } ;
2024-11-17 12:18:30 +00:00
jux : : SwitchButton sweepToggle { parameters . sweepEnabled } ;
2024-08-10 19:26:56 +00:00
2025-04-24 10:29:13 +00:00
# if OSCI_PREMIUM
2025-02-02 20:26:18 +00:00
GroupedSettings positionSize {
std : : vector < std : : shared_ptr < EffectComponent > > {
std : : make_shared < EffectComponent > ( * parameters . scaleEffect , 0 ) ,
std : : make_shared < EffectComponent > ( * parameters . scaleEffect , 1 ) ,
std : : make_shared < EffectComponent > ( * parameters . offsetEffect , 0 ) ,
std : : make_shared < EffectComponent > ( * parameters . offsetEffect , 1 ) ,
} ,
" Line Position & Scale "
} ;
2025-01-10 12:41:34 +00:00
jux : : SwitchButton flipVerticalToggle { parameters . flipVertical } ;
jux : : SwitchButton flipHorizontalToggle { parameters . flipHorizontal } ;
2025-02-08 21:04:26 +00:00
jux : : SwitchButton goniometerToggle { parameters . goniometer } ;
2025-02-11 19:42:36 +00:00
jux : : SwitchButton shutterSyncToggle { parameters . shutterSync } ;
2025-01-10 12:41:34 +00:00
# endif
2024-08-10 19:26:56 +00:00
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR ( VisualiserSettings )
} ;
2024-08-13 13:55:30 +00:00
2025-01-06 11:17:42 +00:00
class ScrollableComponent : public juce : : Component {
public :
ScrollableComponent ( juce : : Component & component ) : component ( component ) {
addAndMakeVisible ( viewport ) ;
viewport . setViewedComponent ( & component , false ) ;
viewport . setScrollBarsShown ( true , false , true , false ) ;
}
void paint ( juce : : Graphics & g ) override {
g . fillAll ( Colours : : darker ) ;
}
void resized ( ) override {
viewport . setBounds ( getLocalBounds ( ) ) ;
}
private :
juce : : Viewport viewport ;
juce : : Component & component ;
} ;
2025-01-06 18:27:23 +00:00
class SettingsWindow : public juce : : DialogWindow {
2024-08-13 13:55:30 +00:00
public :
2025-02-15 16:28:48 +00:00
SettingsWindow ( juce : : String name , juce : : Component & component , int windowWidth , int windowHeight , int componentWidth , int componentHeight ) : juce : : DialogWindow ( name , Colours : : darker , true , true ) , component ( component ) {
2025-01-06 18:27:23 +00:00
setContentComponent ( & viewport ) ;
2025-02-15 16:28:48 +00:00
centreWithSize ( windowWidth , windowHeight ) ;
setResizeLimits ( windowWidth , windowHeight , componentWidth , componentHeight ) ;
2025-02-01 18:14:16 +00:00
setResizable ( true , false ) ;
2025-01-06 18:27:23 +00:00
viewport . setColour ( juce : : ScrollBar : : trackColourId , juce : : Colours : : white ) ;
2025-01-01 16:38:58 +00:00
viewport . setViewedComponent ( & component , false ) ;
2025-01-03 16:37:36 +00:00
viewport . setScrollBarsShown ( true , false , true , false ) ;
2025-01-01 16:38:58 +00:00
setAlwaysOnTop ( true ) ;
2024-12-15 19:23:31 +00:00
}
2025-01-06 11:17:42 +00:00
2024-08-13 13:55:30 +00:00
void closeButtonPressed ( ) override {
setVisible ( false ) ;
}
2025-01-06 11:17:42 +00:00
2025-01-01 16:38:58 +00:00
private :
juce : : Viewport viewport ;
juce : : Component & component ;
2024-08-13 13:55:30 +00:00
} ;