Make LenaPi usable on Android devices
- Add app icon - prevend android device from shutting down cpu while playing music - fix scaling bug - fix energy saver for RasPi by reconnecting to music player - minor refactorings and renaming
This commit is contained in:
parent
851b83a53a
commit
1f12d93300
19 changed files with 499 additions and 48 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
#include <EnergySaver.h>
|
||||
|
||||
#include <models/NavigationItemModel.h>
|
||||
#include <models/NavigationListModel.h>
|
||||
|
|
@ -19,6 +20,9 @@ NavigationController::NavigationController(QObject *parent) : QObject(parent),
|
|||
mUiState->showNavigation();
|
||||
mNavList->navigateTo(item);
|
||||
});
|
||||
/* Connect player state to energy saver to prevent device shutdown while playing music.
|
||||
*/
|
||||
connect(mMediaPlayer, &MusicPlayer::isPlayingChanged, this, &NavigationController::startOrStopEnergySaverDependingOnPlayerState);
|
||||
}
|
||||
|
||||
void NavigationController::setDebugOutput(const QString& text)
|
||||
|
|
@ -111,3 +115,16 @@ void NavigationController::onNavigationRequest()
|
|||
mUiState->showMusicPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
void NavigationController::startOrStopEnergySaverDependingOnPlayerState()
|
||||
{
|
||||
auto* energySaver = EnergySaver::instance();
|
||||
assert(energySaver);
|
||||
if(energySaver){
|
||||
if(mMediaPlayer->isPlaying()){
|
||||
energySaver->deactivate();
|
||||
} else {
|
||||
energySaver->activate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue