Skip to content

Commit 8c97448

Browse files
committed
More warning fixes
1 parent 276a3ca commit 8c97448

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

examples/graphics/source/examples/SpectrumAnalyzer.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -390,32 +390,32 @@ class SpectrumAnalyzerDemo
390390
frequencySlider->setRange ({ 20.0, 22000.0 });
391391
frequencySlider->setSkewFactorFromMidpoint (440.0);
392392
frequencySlider->setValue (440.0);
393-
frequencySlider->onValueChanged = [this] (float value)
393+
frequencySlider->onValueChanged = [this] (double value)
394394
{
395-
currentFrequency = value;
396-
signalGenerator.setFrequency (value);
395+
currentFrequency = (float) value;
396+
signalGenerator.setFrequency ((float) value);
397397
};
398398
addAndMakeVisible (*frequencySlider);
399399

400400
// Amplitude control
401401
amplitudeSlider = std::make_unique<yup::Slider> (yup::Slider::LinearBarHorizontal, "Amplitude");
402402
amplitudeSlider->setRange ({ 0.0, 1.0 });
403403
amplitudeSlider->setValue (0.5);
404-
amplitudeSlider->onValueChanged = [this] (float value)
404+
amplitudeSlider->onValueChanged = [this] (double value)
405405
{
406-
currentAmplitude = value;
407-
signalGenerator.setAmplitude (value);
406+
currentAmplitude = (float) value;
407+
signalGenerator.setAmplitude ((float) value);
408408
};
409409
addAndMakeVisible (*amplitudeSlider);
410410

411411
// Sweep duration control
412412
sweepDurationSlider = std::make_unique<yup::Slider> (yup::Slider::LinearBarHorizontal, "Sweep Duration");
413413
sweepDurationSlider->setRange ({ 1.0, 60.0 });
414414
sweepDurationSlider->setValue (10.0);
415-
sweepDurationSlider->onValueChanged = [this] (float value)
415+
sweepDurationSlider->onValueChanged = [this] (double value)
416416
{
417-
sweepDurationSeconds = value;
418-
signalGenerator.setSweepParameters (20.0, 22000.0, value);
417+
sweepDurationSeconds = (float) value;
418+
signalGenerator.setSweepParameters (20.0, 22000.0, (float) value);
419419
};
420420
addAndMakeVisible (*sweepDurationSlider);
421421

@@ -466,29 +466,29 @@ class SpectrumAnalyzerDemo
466466
releaseSlider = std::make_unique<yup::Slider> (yup::Slider::LinearBarHorizontal, "Release");
467467
releaseSlider->setRange ({ 0.0, 5.0 });
468468
releaseSlider->setValue (1.0);
469-
releaseSlider->onValueChanged = [this] (float value)
469+
releaseSlider->onValueChanged = [this] (double value)
470470
{
471-
analyzerComponent.setReleaseTimeSeconds (value);
471+
analyzerComponent.setReleaseTimeSeconds ((float) value);
472472
};
473473
addAndMakeVisible (*releaseSlider);
474474

475475
// Overlap control for responsiveness
476476
overlapSlider = std::make_unique<yup::Slider> (yup::Slider::LinearBarHorizontal, "Overlap");
477477
overlapSlider->setRange ({ 0.0, 0.95 });
478478
overlapSlider->setValue (0.75);
479-
overlapSlider->onValueChanged = [this] (float value)
479+
overlapSlider->onValueChanged = [this] (double value)
480480
{
481-
analyzerComponent.setOverlapFactor (value);
481+
analyzerComponent.setOverlapFactor ((float) value);
482482
};
483483
addAndMakeVisible (*overlapSlider);
484484

485485
// Smoothing time control
486486
smoothingSlider = std::make_unique<yup::Slider> (yup::Slider::LinearBarHorizontal, "Smoothing");
487487
smoothingSlider->setRange ({ 0.001, 0.5 });
488488
smoothingSlider->setValue (0.05);
489-
smoothingSlider->onValueChanged = [this] (float value)
489+
smoothingSlider->onValueChanged = [this] (double value)
490490
{
491-
setSmoothingTime (value);
491+
setSmoothingTime ((float) value);
492492
};
493493
addAndMakeVisible (*smoothingSlider);
494494

0 commit comments

Comments
 (0)