diff --git a/assets/album.svg b/assets/album.svg new file mode 100644 index 0000000..83af47d --- /dev/null +++ b/assets/album.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/artist.svg b/assets/artist.svg new file mode 100644 index 0000000..ada642a --- /dev/null +++ b/assets/artist.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/bluetooth.svg b/assets/bluetooth.svg new file mode 100644 index 0000000..c4524ac --- /dev/null +++ b/assets/bluetooth.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/radio.svg b/assets/radio.svg new file mode 100644 index 0000000..4b004a9 --- /dev/null +++ b/assets/radio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/resources.qrc b/assets/resources.qrc index a52ab34..de4edab 100644 --- a/assets/resources.qrc +++ b/assets/resources.qrc @@ -1,43 +1,48 @@ - - ico_warning.png - ico_info.png - aausb-hot.png - aawifi-hot.png - cursor-hot.png - power-hot.png - settings-hot.png - sleep-hot.png - wifi-hot.png - brightness-hot.png - camera-hot.png - day-hot.png - night-hot.png - record-hot.png - stop-hot.png - save-hot.png - reboot-hot.png - back-hot.png - rearcam-hot.png - recordactive-hot.png - lock-hot.png - volume-hot.png - bug-hot.png - eye-hot.png - skin-hot.png - mp3-hot.png - play-hot.png - prev-hot.png - next-hot.png - pause-hot.png - prevbig-hot.png - nextbig-hot.png - list-hot.png - home-hot.png - player-hot.png - coverlogo.png - black.png - album-hot.png - Roboto-Regular.ttf - + + radio.svg + ico_warning.png + ico_info.png + artist.svg + album.svg + song.svg + bluetooth.svg + aausb-hot.png + aawifi-hot.png + cursor-hot.png + power-hot.png + settings-hot.png + sleep-hot.png + wifi-hot.png + brightness-hot.png + camera-hot.png + day-hot.png + night-hot.png + record-hot.png + stop-hot.png + save-hot.png + reboot-hot.png + back-hot.png + rearcam-hot.png + recordactive-hot.png + lock-hot.png + volume-hot.png + bug-hot.png + eye-hot.png + skin-hot.png + mp3-hot.png + play-hot.png + prev-hot.png + next-hot.png + pause-hot.png + prevbig-hot.png + nextbig-hot.png + list-hot.png + home-hot.png + player-hot.png + coverlogo.png + black.png + album-hot.png + Roboto-Regular.ttf + diff --git a/assets/song.svg b/assets/song.svg new file mode 100644 index 0000000..0aa280e --- /dev/null +++ b/assets/song.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index 77c9e70..7de02e3 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -108,8 +108,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi connect(ui_->pushButtonNight2, &QPushButton::clicked, this, &MainWindow::switchGuiToNight); connect(ui_->pushButtonBrightness, &QPushButton::clicked, this, &MainWindow::showBrightnessSlider); connect(ui_->pushButtonBrightness2, &QPushButton::clicked, this, &MainWindow::showBrightnessSlider); - connect(ui_->pushButtonVolume, &QPushButton::clicked, this, &MainWindow::showVolumeSlider); - connect(ui_->pushButtonVolume2, &QPushButton::clicked, this, &MainWindow::showVolumeSlider); connect(ui_->pushButtonDebug, &QPushButton::clicked, this, &MainWindow::createDebuglog); connect(ui_->pushButtonDebug2, &QPushButton::clicked, this, &MainWindow::createDebuglog); connect(ui_->pushButtonBluetooth, &QPushButton::clicked, this, &MainWindow::setPairable); @@ -130,6 +128,8 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi connect(ui_->pushButtonAndroidAuto2, &QPushButton::clicked, this, &MainWindow::TriggerAppStart); connect(ui_->pushButtonAndroidAuto2, &QPushButton::clicked, this, &MainWindow::setRetryUSBConnect); + ui_->radioView->hide(); + ui_->clockOnlyWidget->hide(); ui_->pushButtonBluetooth->hide(); @@ -159,6 +159,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi ui_->labelLockDummy->hide(); } + if (std::ifstream("/etc/crankshaft.branch")) { QString branch = configuration_->readFileContent("/etc/crankshaft.branch"); if (branch != "crankshaft-ng") { @@ -230,9 +231,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi // as default hide brightness slider ui_->BrightnessSliderControl->hide(); - // as default hide volume slider player - ui_->VolumeSliderControlPlayer->hide(); - // as default hide power buttons ui_->exitWidget->hide(); ui_->horizontalWidgetPower->hide(); @@ -485,9 +483,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi ui_->pushButtonBrightness->hide(); ui_->pushButtonBrightness2->hide(); ui_->BrightnessSliderControl->hide(); - // also hide volume button cause not needed if brightness not visible - ui_->pushButtonVolume->hide(); - ui_->pushButtonVolume2->hide(); } // init alpha values @@ -501,9 +496,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi ui_->pushButtonNight2->hide(); ui_->pushButtonBrightness->hide(); ui_->pushButtonBrightness2->hide(); - // hide also volume cause not needed without brightness - ui_->pushButtonVolume->hide(); - ui_->pushButtonVolume2->hide(); } // Hide recordings button @@ -680,7 +672,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBrightness_clicked() } } ui_->BrightnessSliderControl->show(); - ui_->VolumeSliderControl->hide(); } void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBrightness2_clicked() @@ -711,33 +702,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBrightness2_clicked() } } ui_->BrightnessSliderControl->show(); - ui_->VolumeSliderControl->hide(); -} - -void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonVolume_clicked() -{ - ui_->horizontalSliderVolume->show(); - ui_->volumeValueLabel->show(); - if (this->toggleMute) { - ui_->pushButtonUnMute->show(); - } else { - ui_->pushButtonMute->show(); - } - ui_->VolumeSliderControl->show(); - ui_->BrightnessSliderControl->hide(); -} - -void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonVolume2_clicked() -{ - ui_->horizontalSliderVolume->show(); - ui_->volumeValueLabel->show(); - if (this->toggleMute) { - ui_->pushButtonUnMute->show(); - } else { - ui_->pushButtonMute->show(); - } - ui_->VolumeSliderControl->show(); - ui_->BrightnessSliderControl->hide(); } void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderBrightness_valueChanged(int value) @@ -786,7 +750,6 @@ void f1x::openauto::autoapp::ui::MainWindow::updateAlpha() ui_->pushButtonReboot->setStyleSheet( "QPushButton{background-color: rgba(252, 175, 62, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}"); ui_->pushButtonCancel->setStyleSheet( "QPushButton{background-color: rgba(32, 74, 135, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}"); ui_->pushButtonBrightness->setStyleSheet( "QPushButton{background-color: rgba(245, 121, 0, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}"); - ui_->pushButtonVolume->setStyleSheet( "QPushButton{background-color: rgba(64, 191, 191, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}"); ui_->pushButtonLock->setStyleSheet( "QPushButton{background-color: rgba(15, 54, 5, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}"); ui_->pushButtonSettings->setStyleSheet( "QPushButton{background-color: rgba(138, 226, 52, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}"); ui_->pushButtonDay->setStyleSheet( "QPushButton{background: rgba(252, 233, 79, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}"); @@ -827,37 +790,28 @@ void f1x::openauto::autoapp::ui::MainWindow::updateAlpha() ui_->pushButtonDay2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);"); ui_->pushButtonNight2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);"); ui_->pushButtonCameraShow2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);"); - ui_->pushButtonVolume2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);"); ui_->pushButtonDebug2->setStyleSheet( "background-color: rgba(136, 138, 133, " + alp + " ); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);"); } } void f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight() { - //MainWindow::on_pushButtonVolume_clicked(); f1x::openauto::autoapp::ui::MainWindow::updateBG(); ui_->pushButtonDay->show(); ui_->pushButtonDay2->show(); ui_->pushButtonNight->hide(); ui_->pushButtonNight2->hide(); ui_->BrightnessSliderControl->hide(); - if (ui_->mediaWidget->isVisible() == true) { - ui_->VolumeSliderControl->hide(); - } } void f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay() { - //MainWindow::on_pushButtonVolume_clicked(); f1x::openauto::autoapp::ui::MainWindow::updateBG(); ui_->pushButtonNight->show(); ui_->pushButtonNight2->show(); ui_->pushButtonDay->hide(); ui_->pushButtonDay2->hide(); ui_->BrightnessSliderControl->hide(); - if (ui_->mediaWidget->isVisible() == true) { - ui_->VolumeSliderControl->hide(); - } } void f1x::openauto::autoapp::ui::MainWindow::cameraControlHide() @@ -911,18 +865,14 @@ void f1x::openauto::autoapp::ui::MainWindow::playerShow() ui_->oldmenuWidget->hide(); } ui_->mediaWidget->show(); - ui_->VolumeSliderControlPlayer->show(); - ui_->VolumeSliderControl->hide(); ui_->BrightnessSliderControl->hide(); ui_->networkInfo->hide(); ui_->Info->hide(); ui_->horizontalSliderProgressPlayer->hide(); - ui_->VolumeSliderControlPlayer->hide(); if (player->state() == QMediaPlayer::PlayingState) { on_pushButtonBackToPlayer_clicked(); ui_->Info->show(); ui_->horizontalSliderProgressPlayer->show(); - ui_->VolumeSliderControlPlayer->show(); ui_->pushButtonPlayerPlayList->hide(); } if (ui_->mp3List->isVisible() == true) { @@ -940,8 +890,6 @@ void f1x::openauto::autoapp::ui::MainWindow::playerHide() ui_->oldmenuWidget->show(); } ui_->mediaWidget->hide(); - ui_->VolumeSliderControl->show(); - ui_->VolumeSliderControlPlayer->hide(); ui_->BrightnessSliderControl->hide(); if (configuration_->showNetworkinfo()) { ui_->networkInfo->hide(); @@ -995,7 +943,6 @@ void f1x::openauto::autoapp::ui::MainWindow::toggleGUI() ui_->bigClock->hide(); } } - MainWindow::on_pushButtonVolume_clicked(); } else { ui_->menuWidget->show(); ui_->oldmenuWidget->hide(); @@ -1089,14 +1036,9 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime() { QTime time=QTime::currentTime(); QDate date=QDate::currentDate(); - QString time_text=time.toString("hh : mm : ss"); + QString time_text=time.toString("hh : mm"); this->date_text=date.toString("MM/dd"); - if ((time.second() % 2) == 0) { - time_text[3] = ' '; - time_text[8] = ' '; - } - ui_->Digital_clock->setText(time_text); ui_->bigClock->setText(time_text); ui_->bigClock2->setText(time_text); @@ -1125,6 +1067,27 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime() if (ui_->btDevice->isVisible() == false) { ui_->btDevice->show(); } + if (std::ifstream("/tmp/btnowplaying")) { + ui_->btNowPlaying->show(); + using namespace std; + ifstream inFile; + string line; + inFile.open("/tmp/btnowplaying"); + if(inFile) { + getline(inFile, line); + ui_->btSongName->setText(QString::fromStdString(line)); + getline(inFile, line); + ui_->btArtistName->setText(QString::fromStdString(line)); + getline(inFile, line); + ui_->btAlbumName->setText(QString::fromStdString(line)); + } + } + else { + ui_->btNowPlaying->hide(); + ui_->btSongName->setText(""); + ui_->btArtistName->setText(""); + ui_->btAlbumName->setText(""); + } if (std::ifstream("/tmp/btdevice")) { ui_->btDevice->setText(configuration_->readFileContent("/tmp/btdevice")); } @@ -1191,7 +1154,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked() ui_->mp3List->show(); ui_->AlbumCoverListView->hide(); ui_->pushButtonAlbum->show(); - ui_->VolumeSliderControlPlayer->hide(); } void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPause_clicked() @@ -1769,12 +1731,6 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() if (ui_->cameraWidget->isVisible() == true) { ui_->cameraWidget->hide(); } - if (ui_->VolumeSliderControlPlayer->isVisible() == true) { - ui_->VolumeSliderControlPlayer->hide(); - } - if (ui_->VolumeSliderControl->isVisible() == true) { - ui_->VolumeSliderControl->hide(); - } if (ui_->BrightnessSliderControl->isVisible() == true) { ui_->BrightnessSliderControl->hide(); } @@ -1786,11 +1742,6 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() if (ui_->headerWidget->isVisible() == false) { ui_->headerWidget->show(); } - if (ui_->VolumeSliderControl->isVisible() == false) { - if (ui_->mediaWidget->isVisible() == false) { - ui_->VolumeSliderControl->show(); - } - } if (ui_->clockOnlyWidget->isVisible() == true) { ui_->clockOnlyWidget->hide(); toggleGUI(); @@ -2030,9 +1981,6 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() if (ui_->pushButtonDebug2->isVisible() == true) { button_count = button_count + 1; } - if (ui_->pushButtonVolume2->isVisible() == true) { - button_count = button_count + 1; - } // Hide auto day/night if needed if (this->lightsensor || std::ifstream("/tmp/daynight_gpio")) { @@ -2100,11 +2048,6 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() ui_->pushButtonBrightness2->hide(); ui_->BrightnessSliderControl->hide(); // also hide volume button if brightness hidden - ui_->pushButtonVolume->hide(); - ui_->pushButtonVolume2->hide(); - if (ui_->mediaWidget->isVisible() == false) { - ui_->VolumeSliderControl->show(); - } } } else { if (!this->lightsensor) { @@ -2112,8 +2055,6 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() ui_->pushButtonBrightness->show(); ui_->pushButtonBrightness2->show(); // also show volume button if brightness visible - ui_->pushButtonVolume->show(); - ui_->pushButtonVolume2->show(); ui_->BrightnessSliderControl->hide(); } } diff --git a/src/autoapp/UI/mainwindow.ui b/src/autoapp/UI/mainwindow.ui index 503c8e0..ab40e22 100644 --- a/src/autoapp/UI/mainwindow.ui +++ b/src/autoapp/UI/mainwindow.ui @@ -47,21 +47,6 @@ false - - 4 - - - 0 - - - 0 - - - 0 - - - 0 - @@ -1595,6 +1580,9 @@ border-top: 0px; true + + Qt::NoFocus + background-color: rgba(48, 140, 198, 0.5); color: rgb(255, 255, 255); @@ -1606,9 +1594,6 @@ outline: none; No USB Device - - Qt::NoFocus - @@ -1680,6 +1665,9 @@ color: rgb(255, 255, 255); true + + Qt::NoFocus + background-color: rgba(252, 175, 62, 0.5); border-radius: 4px; @@ -1691,9 +1679,6 @@ outline: none; No WiFi Clients - - Qt::NoFocus - @@ -2908,6 +2893,470 @@ outline: none; + + + true + + + + 0 + 0 + + + + + 800 + 400 + + + + + 800 + 400 + + + + + 0 + 0 + + + + + 22 + + + + + + + + 200 + 200 + + + + + 200 + 200 + + + + + + + :/bluetooth.svg + + + true + + + + + + + + 500 + 250 + + + + + 500 + 250 + + + + + 7 + + + 1 + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + + 400 + 0 + + + + + 10 + + + + + 1 + + + 1 + + + + + + 50 + 50 + + + + + 50 + 50 + + + + + 5 + + + + + + + :/song.svg + + + true + + + false + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 20 + + + + SONG NAME + + + + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 1 + + + 1 + + + + + + 50 + 50 + + + + + + + :/artist.svg + + + true + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 13 + + + + ARTIST NAME + + + + + + + + + + + 0 + 0 + + + + + 200 + 0 + + + + + 1 + + + 1 + + + + + + 50 + 50 + + + + + + + :/album.svg + + + true + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 13 + + + + ALBUM NAME + + + + + + + + + + + + + + + + + 0 + 0 + + + + + 600 + 210 + + + + + 0 + 200 + + + + Qt::LeftToRight + + + + + + + 150 + 150 + + + + + 150 + 150 + + + + + + + :/radio.svg + + + true + + + + + + + + 0 + 100 + + + + + 16777215 + 150 + + + + + + + + 100 + 100 + + + + + + + + 0 + 50 + + + + + 500 + 100 + + + + + 32 + + + + ABCD,EFGH + + + + + + + + 16777215 + 50 + + + + + 16 + + + + 0 + + + + + + + + + + + 0 + 50 + + + + + 16777215 + 50 + + + + + 13 + + + + Tuner List + + + + + + + + + + @@ -2915,9 +3364,21 @@ outline: none; 0 + + + 200 + 100 + + + + + 100 + 50 + + - 80 + 32 50 false @@ -2926,26 +3387,13 @@ outline: none; color: rgb(255, 255, 255); - 12:00:00 + 12:00 Qt::AlignCenter - - - - - 0 - 0 - - - - - - - @@ -5465,270 +5913,6 @@ outline: none; - - - - - 0 - 0 - - - - - 0 - 30 - - - - - 16777215 - 30 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 80 - 30 - - - - - 80 - 30 - - - - color: rgb(255, 255, 255); -background-color: rgb(164, 0, 0); - - - - Muted - - - - - - - - 0 - 0 - - - - - 80 - 30 - - - - - 80 - 30 - - - - color: rgb(255, 255, 255); -background-color: #6d6d6d; - - - Mute - - - false - - - - - - - - 0 - 0 - - - - - 0 - 30 - - - - QSlider::groove:horizontal { background: #6d6d6d; height: 32px;} -QSlider::handle:horizontal { background: rgb(64, 191, 191); height: 52px; width: 52px; margin: 0 0;}; -outline: none; - - - 100 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 40 - 30 - - - - - 40 - 16777215 - - - - - 75 - true - - - - color: rgb(255, 255, 255); -background-color: #6d6d6d; - - - - - - - Qt::AlignCenter - - - - - - - - - - - 0 - 0 - - - - - 0 - 30 - - - - - 16777215 - 30 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 30 - - - - Qt::LeftToRight - - - QSlider::groove:horizontal { background: #6d6d6d; height: 32px;} -QSlider::handle:horizontal { background: rgb(64, 191, 191); height: 52px; width: 52px; margin: 0 0;}; -outline: none; - - - 100 - - - 100 - - - Qt::Horizontal - - - - - - - - 0 - 0 - - - - - 40 - 30 - - - - - 40 - 16777215 - - - - - 75 - true - - - - color: rgb(255, 255, 255); -background-color: #6d6d6d; - - - 100% - - - Qt::AlignCenter - - - - - - @@ -5852,6 +6036,8 @@ background-color: #6d6d6d; - + + +