@@ -242,6 +242,7 @@ class ParticlesAudioProcessor : public BasicStereoSynthPlugin, public AudioProce
242242
243243 // If we want to allow midi "sidechain" output (the only way to support plugin midi effects in some hosts) then
244244 // we need to leave some midi data in the buffer that we were given at the start
245+ // Note: this is currently disabled by the way the plugin is built. This may be desirable in future versions
245246 midiInput.clear ();
246247 midiInput.addEvents (midiEventsForCurrentSampleRange, 0 , audio.getNumSamples (), 0 );
247248 }
@@ -270,6 +271,8 @@ class ParticlesPluginEditor: public AudioProcessorEditor {
270271
271272 ParticleSimulationVisualiser simulationVisualiser;
272273 std::vector<std::unique_ptr<ParameterControl>> parameterControls;
274+
275+ HyperlinkButton vitlingButton;
273276public:
274277 explicit ParticlesPluginEditor (ParticlesAudioProcessor &proc):
275278 AudioProcessorEditor(proc),
@@ -280,11 +283,17 @@ class ParticlesPluginEditor: public AudioProcessorEditor {
280283 // Allow user to resize within sensible limits so that we can still show all controls and a reasonable
281284 // picture of the simulation
282285 setResizable (true , true );
283- setResizeLimits (700 , 500 , 1400 , 1200 );
286+ setResizeLimits (760 , 560 , 1400 , 1200 );
284287
285288 // Create default rotary controllers for all parameters exposed in the parameter state
286289 createSimpleControls (proc.state , Params::all ());
287290
291+ vitlingButton.setURL (URL (" https://www.vitling.xyz" ));
292+ vitlingButton.setButtonText (" Plugin by Vitling" );
293+ vitlingButton.setColour (HyperlinkButton::ColourIds::textColourId, Colours::white);
294+
295+ addAndMakeVisible (vitlingButton);
296+
288297 addAndMakeVisible (simulationVisualiser);
289298
290299 // Don't wait until resize to set the bounds of subcomponents
@@ -317,17 +326,26 @@ class ParticlesPluginEditor: public AudioProcessorEditor {
317326
318327 // Lay out parameter controls in a grid
319328 const auto controlWidth = 100 , controlHeight = 100 , controlPanelWidth = 200 ;
320- auto x = 0 , y = 0 ;
329+ // auto x = 0, y = 0;
330+
331+ auto pNum = 0 ;
332+
321333 for (auto &control: parameterControls) {
334+
335+ // Hack to get sim/sound parameters separated visually
336+ if (pNum == 5 ) pNum++;
337+
338+ int x = (pNum % 2 ) * controlWidth;
339+ int y = (pNum / 2 ) * controlHeight + 20 + (pNum >5 ? 20 : 0 );
340+
322341 control->slider .setBounds (x,y,controlWidth,controlHeight-20 );
323342 control->label .setBounds (x,y + controlHeight-20 ,controlWidth,20 );
324- x+=controlWidth;
325- if (x >= controlPanelWidth) {
326- x = 0 ;
327- y+=controlHeight;
328- }
343+
344+ pNum++;
329345 }
330346
347+ vitlingButton.setBounds (0 ,540 ,200 ,20 );
348+
331349 // Use the rest of the available space right of the control panel for the simulation visualiser
332350 simulationVisualiser.setBounds (controlPanelWidth,0 ,bounds.getWidth ()-controlPanelWidth, bounds.getHeight ());
333351 }
@@ -345,6 +363,12 @@ class ParticlesPluginEditor: public AudioProcessorEditor {
345363 void paint (Graphics &g) override {
346364 g.setGradientFill (colourfulBackground ());
347365 g.fillAll ();
366+ g.setColour (Colours::white);
367+ g.drawText (" Simulation" , 0 ,0 ,200 ,20 ,Justification::centred, false );
368+ g.drawText (" Synthesiser" , 0 ,320 ,200 ,20 ,Justification::centred, false );
369+ g.drawLine (0 ,20 ,200 ,20 );
370+ g.drawLine (0 ,320 ,200 ,320 );
371+ g.drawLine (0 ,340 ,200 ,340 );
348372 }
349373};
350374
0 commit comments