MCPcopy Create free account
hub / github.com/audacity/audacity / HideSplashScreen

Method HideSplashScreen

src/AudacityApp.cpp:1333–1371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1331}
1332
1333void AudacityApp::HideSplashScreen(bool fadeOut)
1334{
1335 const int fadeDurationMs = 120;
1336 const int fadeStepMs = 16;
1337
1338 const int maxTransparency = 255;
1339 const int numSteps = fadeDurationMs / fadeStepMs;
1340 const int transparencyDecrement = maxTransparency / numSteps;
1341
1342 int currentAlpha = maxTransparency;
1343
1344 // Splash was already destroyed
1345 if (!mSplashScreen) {
1346 return;
1347 }
1348
1349 if (!fadeOut) {
1350 mSplashScreen->Destroy();
1351 mSplashScreen.release();
1352 return;
1353 }
1354
1355 mSplashTimer.Start(fadeStepMs);
1356
1357 mSplashTimer.Bind(wxEVT_TIMER, [this, currentAlpha, transparencyDecrement](wxTimerEvent& evt) mutable {
1358 currentAlpha -= transparencyDecrement;
1359 if (!mSplashScreen) {
1360 mSplashTimer.Stop();
1361 }
1362 else if (currentAlpha <= 0) {
1363 mSplashTimer.Stop();
1364 mSplashScreen->Destroy();
1365 mSplashScreen.release();
1366 }
1367 else if (mSplashScreen->CanSetTransparent()) {
1368 mSplashScreen->SetTransparent(currentAlpha);
1369 }
1370 });
1371}
1372
1373// Some of the many initialization steps
1374void AudacityApp::OnInit0()

Callers

nothing calls this directly

Calls 5

BindMethod · 0.80
DestroyMethod · 0.45
releaseMethod · 0.45
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected