Skip to content

Commit 7967b99

Browse files
committed
Code formatting
1 parent dfe8e3a commit 7967b99

18 files changed

+322
-235
lines changed

examples/graphics/source/examples/FilterDemo.h

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -946,8 +946,7 @@ class FilterDemo
946946
for (int sample = 0; sample < numSamples; ++sample)
947947
{
948948
// Check if any parameters are changing and update filter coefficients if needed
949-
if (smoothedFrequency.isSmoothing() || smoothedQ.isSmoothing() ||
950-
smoothedGain.isSmoothing() || smoothedOrder.isSmoothing())
949+
if (smoothedFrequency.isSmoothing() || smoothedQ.isSmoothing() || smoothedGain.isSmoothing() || smoothedOrder.isSmoothing())
951950
{
952951
updateAudioFilterParametersSmooth();
953952
}
@@ -1217,7 +1216,7 @@ class FilterDemo
12171216
currentUIFilter = uiRbj;
12181217

12191218
// Set default filter type settings
1220-
currentFilterTypeId = 1; // RBJ
1219+
currentFilterTypeId = 1; // RBJ
12211220
currentResponseTypeId = 1; // Lowpass
12221221
}
12231222

@@ -1237,11 +1236,21 @@ class FilterDemo
12371236
// Map combo box selection to UI filter instance
12381237
switch (currentFilterTypeId)
12391238
{
1240-
case 1: currentUIFilter = uiRbj; break;
1241-
case 2: currentUIFilter = uiSvf; break;
1242-
case 3: currentUIFilter = uiFirstOrder; break;
1243-
case 4: currentUIFilter = uiButterworthFilter; break;
1244-
default: currentUIFilter = uiRbj; break;
1239+
case 1:
1240+
currentUIFilter = uiRbj;
1241+
break;
1242+
case 2:
1243+
currentUIFilter = uiSvf;
1244+
break;
1245+
case 3:
1246+
currentUIFilter = uiFirstOrder;
1247+
break;
1248+
case 4:
1249+
currentUIFilter = uiButterworthFilter;
1250+
break;
1251+
default:
1252+
currentUIFilter = uiRbj;
1253+
break;
12451254
}
12461255

12471256
// Synchronize smoothed values with current UI values when switching filters
@@ -1327,11 +1336,21 @@ class FilterDemo
13271336
// Map filter type to audio filter instance (using stored filter type, not UI)
13281337
switch (currentFilterTypeId)
13291338
{
1330-
case 1: currentAudioFilter = audioRbj; break;
1331-
case 2: currentAudioFilter = audioSvf; break;
1332-
case 3: currentAudioFilter = audioFirstOrder; break;
1333-
case 4: currentAudioFilter = audioButterworthFilter; break;
1334-
default: currentAudioFilter = audioRbj; break;
1339+
case 1:
1340+
currentAudioFilter = audioRbj;
1341+
break;
1342+
case 2:
1343+
currentAudioFilter = audioSvf;
1344+
break;
1345+
case 3:
1346+
currentAudioFilter = audioFirstOrder;
1347+
break;
1348+
case 4:
1349+
currentAudioFilter = audioButterworthFilter;
1350+
break;
1351+
default:
1352+
currentAudioFilter = audioRbj;
1353+
break;
13351354
}
13361355

13371356
// Synchronize smoothed values with current UI values when switching filters

examples/graphics/source/examples/SpectrumAnalyzer.h

Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class SpectrumAnalyzerDemo
252252

253253
void visibilityChanged() override
254254
{
255-
if (!isVisible())
255+
if (! isVisible())
256256
{
257257
deviceManager.removeAudioCallback (this);
258258
stopTimer();
@@ -288,7 +288,7 @@ class SpectrumAnalyzerDemo
288288
}
289289
}
290290

291-
// AudioIODeviceCallback methods
291+
// AudioIODeviceCallback methods
292292
void audioDeviceIOCallbackWithContext (const float* const* inputChannelData,
293293
int numInputChannels,
294294
float* const* outputChannelData,
@@ -474,8 +474,7 @@ class SpectrumAnalyzerDemo
474474
// Create parameter labels with proper font sizing
475475
auto labelFont = font.withHeight (12.0f);
476476

477-
for (const auto& labelText : { "Signal Type:", "Frequency:", "Amplitude:", "Sweep Duration:",
478-
"FFT Size:", "Window:", "Display:", "Release:" })
477+
for (const auto& labelText : { "Signal Type:", "Frequency:", "Amplitude:", "Sweep Duration:", "FFT Size:", "Window:", "Display:", "Release:" })
479478
{
480479
auto label = parameterLabels.add (std::make_unique<yup::Label> (labelText));
481480
label->setText (labelText);
@@ -555,18 +554,27 @@ class SpectrumAnalyzerDemo
555554

556555
switch (signalTypeCombo->getSelectedId())
557556
{
558-
case 1: signalType = SignalGenerator::SignalType::singleTone; break;
559-
case 2: signalType = SignalGenerator::SignalType::frequencySweep; break;
560-
case 3: signalType = SignalGenerator::SignalType::whiteNoise; break;
561-
case 4: signalType = SignalGenerator::SignalType::pinkNoise; break;
562-
case 5: signalType = SignalGenerator::SignalType::brownNoise; break;
557+
case 1:
558+
signalType = SignalGenerator::SignalType::singleTone;
559+
break;
560+
case 2:
561+
signalType = SignalGenerator::SignalType::frequencySweep;
562+
break;
563+
case 3:
564+
signalType = SignalGenerator::SignalType::whiteNoise;
565+
break;
566+
case 4:
567+
signalType = SignalGenerator::SignalType::pinkNoise;
568+
break;
569+
case 5:
570+
signalType = SignalGenerator::SignalType::brownNoise;
571+
break;
563572
}
564573

565574
signalGenerator.setSignalType (signalType);
566575

567576
// Enable/disable frequency and sweep controls based on signal type
568-
bool isToneOrSweep = (signalType == SignalGenerator::SignalType::singleTone ||
569-
signalType == SignalGenerator::SignalType::frequencySweep);
577+
bool isToneOrSweep = (signalType == SignalGenerator::SignalType::singleTone || signalType == SignalGenerator::SignalType::frequencySweep);
570578
frequencySlider->setEnabled (signalType == SignalGenerator::SignalType::singleTone);
571579
sweepDurationSlider->setEnabled (signalType == SignalGenerator::SignalType::frequencySweep);
572580
}
@@ -575,7 +583,7 @@ class SpectrumAnalyzerDemo
575583
{
576584
int selectedId = fftSizeCombo->getSelectedId();
577585
currentFFTSize = 32 << (selectedId - 1); // 32, 64, 128, 256, ..., 16384
578-
586+
579587
// Update the analyzer component (which will update the state)
580588
analyzerComponent.setFFTSize (currentFFTSize);
581589
}
@@ -586,17 +594,39 @@ class SpectrumAnalyzerDemo
586594

587595
switch (windowTypeCombo->getSelectedId())
588596
{
589-
case 1: windowType = yup::WindowType::rectangular; break;
590-
case 2: windowType = yup::WindowType::hann; break;
591-
case 3: windowType = yup::WindowType::hamming; break;
592-
case 4: windowType = yup::WindowType::blackman; break;
593-
case 5: windowType = yup::WindowType::blackmanHarris; break;
594-
case 6: windowType = yup::WindowType::kaiser; break;
595-
case 7: windowType = yup::WindowType::gaussian; break;
596-
case 8: windowType = yup::WindowType::tukey; break;
597-
case 9: windowType = yup::WindowType::bartlett; break;
598-
case 10: windowType = yup::WindowType::welch; break;
599-
case 11: windowType = yup::WindowType::flattop; break;
597+
case 1:
598+
windowType = yup::WindowType::rectangular;
599+
break;
600+
case 2:
601+
windowType = yup::WindowType::hann;
602+
break;
603+
case 3:
604+
windowType = yup::WindowType::hamming;
605+
break;
606+
case 4:
607+
windowType = yup::WindowType::blackman;
608+
break;
609+
case 5:
610+
windowType = yup::WindowType::blackmanHarris;
611+
break;
612+
case 6:
613+
windowType = yup::WindowType::kaiser;
614+
break;
615+
case 7:
616+
windowType = yup::WindowType::gaussian;
617+
break;
618+
case 8:
619+
windowType = yup::WindowType::tukey;
620+
break;
621+
case 9:
622+
windowType = yup::WindowType::bartlett;
623+
break;
624+
case 10:
625+
windowType = yup::WindowType::welch;
626+
break;
627+
case 11:
628+
windowType = yup::WindowType::flattop;
629+
break;
600630
}
601631

602632
analyzerComponent.setWindowType (windowType);
@@ -608,8 +638,12 @@ class SpectrumAnalyzerDemo
608638

609639
switch (displayTypeCombo->getSelectedId())
610640
{
611-
case 1: displayType = yup::SpectrumAnalyzerComponent::DisplayType::filled; break;
612-
case 2: displayType = yup::SpectrumAnalyzerComponent::DisplayType::lines; break;
641+
case 1:
642+
displayType = yup::SpectrumAnalyzerComponent::DisplayType::filled;
643+
break;
644+
case 2:
645+
displayType = yup::SpectrumAnalyzerComponent::DisplayType::lines;
646+
break;
613647
}
614648

615649
analyzerComponent.setDisplayType (displayType);

0 commit comments

Comments
 (0)