Skip to content

Commit a1fc7fa

Browse files
committed
Code formatting
1 parent 56a2932 commit a1fc7fa

File tree

1 file changed

+84
-47
lines changed

1 file changed

+84
-47
lines changed

examples/graphics/source/examples/FilterDemo.h

Lines changed: 84 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,7 @@ class FilterDemo
932932
for (int sample = 0; sample < numSamples; ++sample)
933933
{
934934
// Check if any parameters are changing and update filter coefficients if needed
935-
if (smoothedFrequency.isSmoothing() || smoothedQ.isSmoothing() ||
936-
smoothedGain.isSmoothing() || smoothedOrder.isSmoothing())
935+
if (smoothedFrequency.isSmoothing() || smoothedQ.isSmoothing() || smoothedGain.isSmoothing() || smoothedOrder.isSmoothing())
937936
{
938937
updateAudioFilterParametersSmooth();
939938
}
@@ -1204,21 +1203,19 @@ class FilterDemo
12041203

12051204
// Store in arrays for easy management
12061205
allAudioFilters = {
1207-
audioButterworth, audioRbj, audioBessel, audioChebyshev1, audioChebyshev2,
1208-
audioElliptic, audioLegendre, audioSvf, audioMoog
1206+
audioButterworth, audioRbj, audioBessel, audioChebyshev1, audioChebyshev2, audioElliptic, audioLegendre, audioSvf, audioMoog
12091207
};
12101208

12111209
allUIFilters = {
1212-
uiButterworth, uiRbj, uiBessel, uiChebyshev1, uiChebyshev2,
1213-
uiElliptic, uiLegendre, uiSvf, uiMoog
1210+
uiButterworth, uiRbj, uiBessel, uiChebyshev1, uiChebyshev2, uiElliptic, uiLegendre, uiSvf, uiMoog
12141211
};
12151212

12161213
// Set default filters
12171214
currentAudioFilter = audioButterworth;
12181215
currentUIFilter = uiButterworth;
12191216

12201217
// Set default filter type settings
1221-
currentFilterTypeId = 1; // Butterworth
1218+
currentFilterTypeId = 1; // Butterworth
12221219
currentResponseTypeId = 1; // Lowpass
12231220
}
12241221

@@ -1238,16 +1235,36 @@ class FilterDemo
12381235
// Map combo box selection to UI filter instance
12391236
switch (currentFilterTypeId)
12401237
{
1241-
case 1: currentUIFilter = uiButterworth; break;
1242-
case 2: currentUIFilter = uiRbj; break;
1243-
case 3: currentUIFilter = uiBessel; break;
1244-
case 4: currentUIFilter = uiChebyshev1; break;
1245-
case 5: currentUIFilter = uiChebyshev2; break;
1246-
case 6: currentUIFilter = uiElliptic; break;
1247-
case 7: currentUIFilter = uiLegendre; break;
1248-
case 8: currentUIFilter = uiSvf; break;
1249-
case 9: currentUIFilter = uiMoog; break;
1250-
default: currentUIFilter = uiButterworth; break;
1238+
case 1:
1239+
currentUIFilter = uiButterworth;
1240+
break;
1241+
case 2:
1242+
currentUIFilter = uiRbj;
1243+
break;
1244+
case 3:
1245+
currentUIFilter = uiBessel;
1246+
break;
1247+
case 4:
1248+
currentUIFilter = uiChebyshev1;
1249+
break;
1250+
case 5:
1251+
currentUIFilter = uiChebyshev2;
1252+
break;
1253+
case 6:
1254+
currentUIFilter = uiElliptic;
1255+
break;
1256+
case 7:
1257+
currentUIFilter = uiLegendre;
1258+
break;
1259+
case 8:
1260+
currentUIFilter = uiSvf;
1261+
break;
1262+
case 9:
1263+
currentUIFilter = uiMoog;
1264+
break;
1265+
default:
1266+
currentUIFilter = uiButterworth;
1267+
break;
12511268
}
12521269

12531270
// Synchronize smoothed values with current UI values when switching filters
@@ -1305,20 +1322,20 @@ class FilterDemo
13051322
if (currentFilterTypeId == 4) // Chebyshev I
13061323
{
13071324
cheby1->setParameters (yup::ChebyshevFilter<float>::Type::Type1,
1308-
getFilterType (currentResponseTypeId),
1309-
order,
1310-
freq,
1311-
currentSampleRate,
1312-
0.5); // Ripple
1325+
getFilterType (currentResponseTypeId),
1326+
order,
1327+
freq,
1328+
currentSampleRate,
1329+
0.5); // Ripple
13131330
}
13141331
else if (currentFilterTypeId == 5) // Chebyshev II
13151332
{
13161333
cheby1->setParameters (yup::ChebyshevFilter<float>::Type::Type2,
1317-
getFilterType (currentResponseTypeId),
1318-
order,
1319-
freq,
1320-
currentSampleRate,
1321-
40.0); // Stopband attenuation
1334+
getFilterType (currentResponseTypeId),
1335+
order,
1336+
freq,
1337+
currentSampleRate,
1338+
40.0); // Stopband attenuation
13221339
}
13231340
}
13241341
else if (auto elliptic = std::dynamic_pointer_cast<yup::EllipticFilter<float>> (currentAudioFilter))
@@ -1368,20 +1385,20 @@ class FilterDemo
13681385
if (currentFilterTypeId == 4) // Chebyshev I
13691386
{
13701387
cheby1->setParameters (yup::ChebyshevFilter<float>::Type::Type1,
1371-
getFilterType (currentResponseTypeId),
1372-
order,
1373-
freq,
1374-
currentSampleRate,
1375-
0.5); // Ripple
1388+
getFilterType (currentResponseTypeId),
1389+
order,
1390+
freq,
1391+
currentSampleRate,
1392+
0.5); // Ripple
13761393
}
13771394
else if (currentFilterTypeId == 5) // Chebyshev II
13781395
{
13791396
cheby1->setParameters (yup::ChebyshevFilter<float>::Type::Type2,
1380-
getFilterType (currentResponseTypeId),
1381-
order,
1382-
freq,
1383-
currentSampleRate,
1384-
40.0); // Stopband attenuation
1397+
getFilterType (currentResponseTypeId),
1398+
order,
1399+
freq,
1400+
currentSampleRate,
1401+
40.0); // Stopband attenuation
13851402
}
13861403
}
13871404
else if (auto elliptic = std::dynamic_pointer_cast<yup::EllipticFilter<float>> (currentUIFilter))
@@ -1399,16 +1416,36 @@ class FilterDemo
13991416
// Map filter type to audio filter instance (using stored filter type, not UI)
14001417
switch (currentFilterTypeId)
14011418
{
1402-
case 1: currentAudioFilter = audioButterworth; break;
1403-
case 2: currentAudioFilter = audioRbj; break;
1404-
case 3: currentAudioFilter = audioBessel; break;
1405-
case 4: currentAudioFilter = audioChebyshev1; break;
1406-
case 5: currentAudioFilter = audioChebyshev2; break;
1407-
case 6: currentAudioFilter = audioElliptic; break;
1408-
case 7: currentAudioFilter = audioLegendre; break;
1409-
case 8: currentAudioFilter = audioSvf; break;
1410-
case 9: currentAudioFilter = audioMoog; break;
1411-
default: currentAudioFilter = audioButterworth; break;
1419+
case 1:
1420+
currentAudioFilter = audioButterworth;
1421+
break;
1422+
case 2:
1423+
currentAudioFilter = audioRbj;
1424+
break;
1425+
case 3:
1426+
currentAudioFilter = audioBessel;
1427+
break;
1428+
case 4:
1429+
currentAudioFilter = audioChebyshev1;
1430+
break;
1431+
case 5:
1432+
currentAudioFilter = audioChebyshev2;
1433+
break;
1434+
case 6:
1435+
currentAudioFilter = audioElliptic;
1436+
break;
1437+
case 7:
1438+
currentAudioFilter = audioLegendre;
1439+
break;
1440+
case 8:
1441+
currentAudioFilter = audioSvf;
1442+
break;
1443+
case 9:
1444+
currentAudioFilter = audioMoog;
1445+
break;
1446+
default:
1447+
currentAudioFilter = audioButterworth;
1448+
break;
14121449
}
14131450

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

0 commit comments

Comments
 (0)