diff --git a/assets/resources.qrc b/assets/resources.qrc index e21d154..8a5dba6 100644 --- a/assets/resources.qrc +++ b/assets/resources.qrc @@ -38,6 +38,7 @@ player-hot.png coverlogo.png black.png + bg-equilizer.png Roboto-Regular.ttf diff --git a/include/f1x/openauto/autoapp/Configuration/Configuration.hpp b/include/f1x/openauto/autoapp/Configuration/Configuration.hpp index 778752a..92a2dec 100644 --- a/include/f1x/openauto/autoapp/Configuration/Configuration.hpp +++ b/include/f1x/openauto/autoapp/Configuration/Configuration.hpp @@ -59,9 +59,12 @@ public: std::string getMp3MasterPath() const override; void setMp3MasterPath(const std::string& value) override; - std::string getMp3SubFolder() const override; void setMp3SubFolder(const std::string& value) override; + int32_t getMp3Track() const override; + void setMp3Track(int32_t value) override; + bool mp3AutoPlay() const override; + void mp3AutoPlay(bool value) override; aasdk::proto::enums::VideoFPS::Enum getVideoFPS() const override; void setVideoFPS(aasdk::proto::enums::VideoFPS::Enum value) override; @@ -106,6 +109,8 @@ private: bool hideAlpha_; std::string mp3MasterPath_; std::string mp3SubFolder_; + int32_t mp3Track_; + bool mp3AutoPlay_; aasdk::proto::enums::VideoFPS::Enum videoFPS_; aasdk::proto::enums::VideoResolution::Enum videoResolution_; @@ -134,6 +139,8 @@ private: static const std::string cGeneralMp3MasterPathKey; static const std::string cGeneralMp3SubFolderKey; + static const std::string cGeneralMp3TrackKey; + static const std::string cGeneralMp3AutoPlayKey; static const std::string cVideoFPSKey; static const std::string cVideoResolutionKey; diff --git a/include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp b/include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp index 2c51846..a2e4632 100644 --- a/include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp +++ b/include/f1x/openauto/autoapp/Configuration/IConfiguration.hpp @@ -67,9 +67,12 @@ public: virtual std::string getMp3MasterPath() const = 0; virtual void setMp3MasterPath(const std::string& value) = 0; - virtual std::string getMp3SubFolder() const = 0; virtual void setMp3SubFolder(const std::string& value) = 0; + virtual int32_t getMp3Track() const = 0; + virtual void setMp3Track(int32_t value) = 0; + virtual bool mp3AutoPlay() const = 0; + virtual void mp3AutoPlay(bool value) = 0; virtual aasdk::proto::enums::VideoFPS::Enum getVideoFPS() const = 0; virtual void setVideoFPS(aasdk::proto::enums::VideoFPS::Enum value) = 0; diff --git a/include/f1x/openauto/autoapp/UI/MainWindow.hpp b/include/f1x/openauto/autoapp/UI/MainWindow.hpp index d874a4e..82e97a4 100644 --- a/include/f1x/openauto/autoapp/UI/MainWindow.hpp +++ b/include/f1x/openauto/autoapp/UI/MainWindow.hpp @@ -119,6 +119,7 @@ private slots: void customButtonPressed7(); void playerShow(); void playerHide(); + void updateBG(); void on_horizontalSliderProgressPlayer_sliderMoved(int position); void on_horizontalSliderVolumePlayer_sliderMoved(int position); @@ -182,6 +183,7 @@ private: QString selectedMp3file; QString musicfolder = "/media/CSSTORAGE/Music"; QString albumfolder = "/"; + QMediaPlaylist *playlist; bool customBrightnessControl = false; diff --git a/src/autoapp/Configuration/Configuration.cpp b/src/autoapp/Configuration/Configuration.cpp index 42b83a4..1a36f9b 100644 --- a/src/autoapp/Configuration/Configuration.cpp +++ b/src/autoapp/Configuration/Configuration.cpp @@ -43,6 +43,8 @@ const std::string Configuration::cGeneralHandednessOfTrafficTypeKey = "General.H const std::string Configuration::cGeneralMp3MasterPathKey = "General.Mp3MasterPath"; const std::string Configuration::cGeneralMp3SubFolderKey = "General.Mp3SubFolder"; +const std::string Configuration::cGeneralMp3TrackKey = "General.Mp3Track"; +const std::string Configuration::cGeneralMp3AutoPlayKey = "General.Mp3AutoPlay"; const std::string Configuration::cVideoFPSKey = "Video.FPS"; const std::string Configuration::cVideoResolutionKey = "Video.Resolution"; @@ -99,6 +101,8 @@ void Configuration::load() hideAlpha_ = iniConfig.get(cGeneralHideAlphaKey, false); mp3MasterPath_ = iniConfig.get(cGeneralMp3MasterPathKey, "/media/MYMEDIA"); mp3SubFolder_ = iniConfig.get(cGeneralMp3SubFolderKey, "/"); + mp3Track_ = iniConfig.get(cGeneralMp3TrackKey, 0); + mp3AutoPlay_ = iniConfig.get(cGeneralMp3AutoPlayKey, false); videoFPS_ = static_cast(iniConfig.get(cVideoFPSKey, aasdk::proto::enums::VideoFPS::_30)); @@ -141,6 +145,8 @@ void Configuration::reset() hideAlpha_ = false; mp3MasterPath_ = "/media/MYMEDIA"; mp3SubFolder_ = "/"; + mp3Track_ = 0; + mp3AutoPlay_ = false; videoFPS_ = aasdk::proto::enums::VideoFPS::_30; videoResolution_ = aasdk::proto::enums::VideoResolution::_480p; screenDPI_ = 140; @@ -168,6 +174,8 @@ void Configuration::save() iniConfig.put(cGeneralHideAlphaKey, hideAlpha_); iniConfig.put(cGeneralMp3MasterPathKey, mp3MasterPath_); iniConfig.put(cGeneralMp3SubFolderKey, mp3SubFolder_); + iniConfig.put(cGeneralMp3TrackKey, mp3Track_); + iniConfig.put(cGeneralMp3AutoPlayKey, mp3AutoPlay_); iniConfig.put(cVideoFPSKey, static_cast(videoFPS_)); iniConfig.put(cVideoResolutionKey, static_cast(videoResolution_)); @@ -292,11 +300,31 @@ std::string Configuration::getMp3SubFolder() const return mp3SubFolder_; } +void Configuration::setMp3Track(int32_t value) +{ + mp3Track_ = value; +} + void Configuration::setMp3SubFolder(const std::string& value) { mp3SubFolder_ = value; } +int32_t Configuration::getMp3Track() const +{ + return mp3Track_; +} + +void Configuration::mp3AutoPlay(bool value) +{ + mp3AutoPlay_ = value; +} + +bool Configuration::mp3AutoPlay() const +{ + return mp3AutoPlay_; +} + aasdk::proto::enums::VideoFPS::Enum Configuration::getVideoFPS() const { return videoFPS_; diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index c8a8f3a..3c9d021 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -539,6 +539,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi this->musicfolder = QString::fromStdString(configuration->getMp3MasterPath()); this->albumfolder = QString::fromStdString(configuration->getMp3SubFolder()); + ui_->labelFolderpath->setText(this->musicfolder); ui_->labelAlbumpath->setText(this->albumfolder); @@ -548,6 +549,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi MainWindow::scanFolders(); ui_->comboBoxAlbum->setCurrentText(QString::fromStdString(configuration->getMp3SubFolder())); MainWindow::scanFiles(); + ui_->mp3List->setCurrentRow(configuration->getMp3Track()); watcher = new QFileSystemWatcher(this); watcher->addPath("/media/USBDRIVES"); @@ -842,6 +844,7 @@ void f1x::openauto::autoapp::ui::MainWindow::cameraControlShow() void f1x::openauto::autoapp::ui::MainWindow::playerShow() { + this->setStyleSheet("QMainWindow { background: url(:/bg-equilizer.png); background-repeat: no-repeat; background-position: center; }"); if (!this->oldGUIStyle) { ui_->menuWidget->hide(); } else { @@ -866,6 +869,8 @@ void f1x::openauto::autoapp::ui::MainWindow::playerHide() ui_->VolumeSliderControlPlayer->hide(); ui_->BrightnessSliderControl->hide(); ui_->AlphaSliderControl->hide(); + f1x::openauto::autoapp::ui::MainWindow::updateBG(); + f1x::openauto::autoapp::ui::MainWindow::tmpChanged(); } void f1x::openauto::autoapp::ui::MainWindow::toggleExit() @@ -926,6 +931,12 @@ void f1x::openauto::autoapp::ui::MainWindow::toggleGUI() ui_->Digital_clock->show(); } } + f1x::openauto::autoapp::ui::MainWindow::updateBG(); + f1x::openauto::autoapp::ui::MainWindow::tmpChanged(); +} + +void f1x::openauto::autoapp::ui::MainWindow::updateBG() +{ if (!this->nightModeEnabled) { if (this->oldGUIStyle) { if (this->wallpaperClassicDayFileExists) { @@ -955,7 +966,6 @@ void f1x::openauto::autoapp::ui::MainWindow::toggleGUI() } } } - f1x::openauto::autoapp::ui::MainWindow::tmpChanged(); } void f1x::openauto::autoapp::ui::MainWindow::createDebuglog() @@ -1009,7 +1019,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonList_clicked() ui_->pushButtonList->hide(); ui_->pushButtonPlayerPlayList->show(); ui_->pushButtonBackToPlayer->show(); - //ui_->pushButtonUSB->show(); } void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked() @@ -1028,7 +1037,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked() ui_->playerPositionTime->setText("00:00 / 00:00"); ui_->labelCurrentPlaying->setText(""); ui_->labelTrack->setText(""); - //ui_->pushButtonUSB->show(); } void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPause_clicked() @@ -1137,6 +1145,11 @@ void f1x::openauto::autoapp::ui::MainWindow::metaDataChanged() } ui_->labelTrack->setText(QString::number(playlist->currentIndex()+1)); ui_->labelTrackCount->setText(QString::number(playlist->mediaCount())); + + // Here a write to config is needed to keep playlist index + // + //configuration->setMp3Track(ui_->mp3List->currentRow()); + // } void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPlayList_clicked() @@ -1154,7 +1167,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPlayList_clicked ui_->pushButtonPlayerPause->show(); int currentalbum = ui_->comboBoxAlbum->currentIndex(); ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1)); - //ui_->pushButtonUSB->hide(); } void f1x::openauto::autoapp::ui::MainWindow::on_comboBoxAlbum_currentIndexChanged(const QString &arg1) @@ -1170,10 +1182,6 @@ void f1x::openauto::autoapp::ui::MainWindow::setTrigger() ui_->SysinfoTopLeft->setText("Media changed - Scanning ..."); ui_->SysinfoTopLeft->show(); - //QTimer *timerscan=new QTimer(this); - //connect(timerscan, SIGNAL(timeout()),this,SLOT(scanFolders())); - //timerscan->start(10000); - // Start delayed folderscan after usb event QTimer::singleShot(10000, this, SLOT(scanFolders())); } @@ -1307,7 +1315,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBackToPlayer_clicked() ui_->pushButtonBackToPlayer->hide(); ui_->pushButtonPlayerPlayList->hide(); ui_->pushButtonList->show(); - //ui_->pushButtonUSB->hide(); } void f1x::openauto::autoapp::ui::MainWindow::on_StateChanged(QMediaPlayer::State state) @@ -1343,35 +1350,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() } } else { if (this->background_set == false) { - if (!this->nightModeEnabled) { - if (this->oldGUIStyle) { - if (this->wallpaperClassicDayFileExists) { - this->setStyleSheet("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }"); - } else { - this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); - } - } else { - if (this->wallpaperDayFileExists) { - this->setStyleSheet("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }"); - } else { - this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); - } - } - } else { - if (this->oldGUIStyle) { - if (this->wallpaperClassicNightFileExists) { - this->setStyleSheet("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }"); - } else { - this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); - } - } else { - if (this->wallpaperNightFileExists) { - this->setStyleSheet("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }"); - } else { - this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }"); - } - } - } + f1x::openauto::autoapp::ui::MainWindow::updateBG(); this->background_set = true; } } @@ -1578,5 +1557,4 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() ui_->pushButtonDummyClassic1->show(); ui_->pushButtonDummyClassic2->show(); } - //qDebug() << "/tmp changed"; } diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp index 1cdaada..695c72a 100644 --- a/src/autoapp/UI/SettingsWindow.cpp +++ b/src/autoapp/UI/SettingsWindow.cpp @@ -62,7 +62,6 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat connect(ui_->pushButtonHotspotStop, &QPushButton::clicked, this, &SettingsWindow::onStopHotspot); connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::setTime); connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::close); - //connect(ui_->pushButtonSetTime, &QPushButton::clicked, [&]() { &SettingsWindow::setTime; &SettingsWindow::close; }); connect(ui_->pushButtonNTP, &QPushButton::clicked, this, &SettingsWindow::close); // menu @@ -129,6 +128,7 @@ void SettingsWindow::onSave() configuration_->hideMenuToggle(ui_->checkBoxHideMenuToggle->isChecked()); configuration_->hideAlpha(ui_->checkBoxHideAlpha->isChecked()); configuration_->setMp3SubFolder(ui_->comboBoxSubFolder->currentText().toStdString()); + configuration_->mp3AutoPlay(ui_->checkBoxAutoPlay->isChecked()); configuration_->setVideoFPS(ui_->radioButton30FPS->isChecked() ? aasdk::proto::enums::VideoFPS::_30 : aasdk::proto::enums::VideoFPS::_60); @@ -271,12 +271,6 @@ void SettingsWindow::onSave() params.append("0"); } params.append("#"); - if (ui_->radioButtonUSBDetectEnabled->isChecked()) { - params.append("1"); - } else { - params.append("0"); - } - params.append("#"); params.append( std::string(ui_->comboBoxSDOC->currentText().split(" ")[0].toStdString()) ); params.append("#"); @@ -314,6 +308,8 @@ void SettingsWindow::load() ui_->checkBoxHideMenuToggle->setChecked(configuration_->hideMenuToggle()); ui_->checkBoxHideAlpha->setChecked(configuration_->hideAlpha()); ui_->comboBoxSubFolder->setCurrentText(QString::fromStdString(configuration_->getMp3SubFolder())); + ui_->mp3track->setText(QString::number(configuration_->getMp3Track())); + ui_->checkBoxAutoPlay->setChecked(configuration_->mp3AutoPlay()); ui_->radioButton30FPS->setChecked(configuration_->getVideoFPS() == aasdk::proto::enums::VideoFPS::_30); ui_->radioButton60FPS->setChecked(configuration_->getVideoFPS() == aasdk::proto::enums::VideoFPS::_60); @@ -720,14 +716,8 @@ void SettingsWindow::loadSystemValues() } // set bluetooth type ui_->comboBoxBluetooth->setCurrentText(getparams[38]); - // set usb detect - if (getparams[39] == "1") { - ui_->radioButtonUSBDetectEnabled->setChecked(true); - } else { - ui_->radioButtonUSBDetectDisabled->setChecked(true); - } // set sdoc - if (getparams[40] == "enabled") { + if (getparams[39] == "enabled") { ui_->comboBoxSDOC->setCurrentIndex(1); } else { ui_->comboBoxSDOC->setCurrentIndex(0); diff --git a/src/autoapp/UI/settingswindow.ui b/src/autoapp/UI/settingswindow.ui index 440bdf8..00b263e 100644 --- a/src/autoapp/UI/settingswindow.ui +++ b/src/autoapp/UI/settingswindow.ui @@ -7,7 +7,7 @@ 0 0 963 - 3125 + 3152 @@ -429,7 +429,7 @@ outline: none; 2 - + @@ -452,7 +452,7 @@ outline: none; - + @@ -480,7 +480,7 @@ outline: none; - + 9 @@ -527,7 +527,7 @@ outline: none; - If you select a subfolder the player will start with listing the files inside this folder (on system start). By default folders inside CSSTORAGE/Music are listed. You can mount removable devices inside player dialog! + If you select a subfolder the player will start with listing the files inside this folder (on system start). true @@ -536,6 +536,46 @@ outline: none; + + + + Last Played Index + + + + + + + + 0 + 0 + + + + + + + + + + + auto play + + + + + + + + 0 + 0 + + + + Auto playback last played song on startup if available + + + @@ -5143,93 +5183,6 @@ subcontrol-position: center left; - - - - - 0 - 0 - - - - Skip USB Detect during boot - - - - 2 - - - 2 - - - - - Disabled - - - - - - - Enabled - - - - - - - - 0 - 0 - - - - - 2 - - - 2 - - - - - - 0 - 0 - - - - <html><head/><body><p><img src=":/ico_info.png"/></p></body></html> - - - - - - - - 0 - 0 - - - - - true - - - - If enabled the checks for flash files (system updates), dev mode trigger file and debug mode trigger file will complete disabled. This allows a faster boot. - - - true - - - - - - - - -