MCPcopy Create free account
hub / github.com/KikoPlayProject/KikoPlay / initSignals

Method initSignals

UI/mainwindow.cpp:336–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336void MainWindow::initSignals()
337{
338 QObject::connect(GlobalObjects::mpvplayer, &MPVPlayer::stateChanged, this, [=](MPVPlayer::PlayState state){
339#ifdef Q_OS_WIN
340 if (winTaskbarProgress && state == MPVPlayer::Play && !GlobalObjects::mpvplayer->getCurrentFile().isEmpty())
341 {
342 winTaskbarProgress->show();
343 winTaskbarProgress->resume();
344 }
345 else if (winTaskbarProgress && state == MPVPlayer::Pause && !GlobalObjects::mpvplayer->getCurrentFile().isEmpty())
346 {
347 winTaskbarProgress->show();
348 winTaskbarProgress->pause();
349 }
350 else if (winTaskbarProgress && state == MPVPlayer::Stop)
351 {
352 winTaskbarProgress->hide();
353 }
354#endif
355 if (state == MPVPlayer::Stop)
356 {
357 auto geo = originalGeo;
358 if (isMaximized())
359 {
360 showNormal();
361 }
362 listWindow->setVisible(listShowState);
363 playerWindow->toggleListCollapseState(listShowState? listWindow->currentList() : -1);
364 setGeometry(geo);
365 }
366#ifdef Q_OS_WIN
367 elaAppBar->setScreenSave(!(state == MPVPlayer::Play && !GlobalObjects::mpvplayer->getCurrentFile().isEmpty()));
368#endif
369 });
370#ifdef Q_OS_WIN
371 QObject::connect(GlobalObjects::mpvplayer, &MPVPlayer::positionChanged, this, [this](int val) {
372 if (winTaskbarProgress && !GlobalObjects::mpvplayer->getCurrentFile().isEmpty())
373 {
374 winTaskbarProgress->setValue(val);
375 }
376 });
377 QObject::connect(GlobalObjects::mpvplayer, &MPVPlayer::durationChanged, this, [this](int duration){
378 if (winTaskbarProgress)
379 {
380 winTaskbarProgress->setRange(0, duration);
381 }
382 });
383#endif
384#ifdef KSERVICE
385 new EventListener(EventBus::getEventBus(), EventBus::EVENT_REQUIRE_LOGIN, [=](const EventParam *){
386 KLogin login(this);
387 login.exec();
388 }, this);
389#endif
390}
391
392void MainWindow::restoreSize()
393{

Callers

nothing calls this directly

Calls 11

resumeMethod · 0.80
setVisibleMethod · 0.80
currentListMethod · 0.80
setScreenSaveMethod · 0.80
setRangeMethod · 0.80
isEmptyMethod · 0.45
showMethod · 0.45
pauseMethod · 0.45
hideMethod · 0.45
setValueMethod · 0.45

Tested by

no test coverage detected