Rework player usage
This commit is contained in:
parent
c7772617a3
commit
5ff5327f43
BIN
assets/home-hot.png
Normal file
BIN
assets/home-hot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
BIN
assets/list-hot.png
Normal file
BIN
assets/list-hot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
BIN
assets/player-hot.png
Normal file
BIN
assets/player-hot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
@ -33,6 +33,9 @@
|
||||
<file>pause-hot.png</file>
|
||||
<file>prevbig-hot.png</file>
|
||||
<file>nextbig-hot.png</file>
|
||||
<file>list-hot.png</file>
|
||||
<file>home-hot.png</file>
|
||||
<file>player-hot.png</file>
|
||||
<file>coverlogo.png</file>
|
||||
<file>black.png</file>
|
||||
<file>Roboto-Regular.ttf</file>
|
||||
|
@ -113,7 +113,7 @@ private slots:
|
||||
|
||||
void on_horizontalSliderProgressPlayer_sliderMoved(int position);
|
||||
void on_horizontalSliderVolumePlayer_sliderMoved(int position);
|
||||
void on_pushButtonPlayerPlay_clicked();
|
||||
void on_pushButtonList_clicked();
|
||||
void on_pushButtonPlayerStop_clicked();
|
||||
void on_pushButtonPlayerPause_clicked();
|
||||
void on_positionChanged(qint64 position);
|
||||
@ -125,12 +125,12 @@ private slots:
|
||||
void on_pushButtonPlayerPrevBig_clicked();
|
||||
void on_pushButtonPlayerPrevAlbum_clicked();
|
||||
void on_pushButtonPlayerNextAlbum_clicked();
|
||||
void on_pushButtonBackToPlayer_clicked();
|
||||
void on_comboBoxAlbum_currentIndexChanged(const QString &arg1);
|
||||
void on_mp3List_currentRowChanged(int currentRow);
|
||||
void scanFolders();
|
||||
void scanFiles();
|
||||
|
||||
|
||||
private:
|
||||
Ui::MainWindow* ui_;
|
||||
QString brightnessFilename = "/sys/class/backlight/rpi_backlight/brightness";
|
||||
|
@ -549,10 +549,11 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
||||
connect(player, &QMediaPlayer::durationChanged, this, &MainWindow::on_durationChanged);
|
||||
connect(player, &QMediaPlayer::metaDataAvailableChanged, this, &MainWindow::metaDataChanged);
|
||||
|
||||
//ui_->labelFolderpath->hide();
|
||||
ui_->pushButtonPlayerPlay->hide();
|
||||
ui_->pushButtonList->hide();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->PlayerPlayingWidget->hide();
|
||||
|
||||
ui_->pushButtonPlayerStop->hide();
|
||||
ui_->pushButtonPlayerPause->hide();
|
||||
//this->musicfolder = QString::fromStdString(configuration->getMp3MasterPath());
|
||||
//this->albumfolder = QString::fromStdString(configuration->getMp3SubFolder());
|
||||
//ui_->labelFolderpath->setText(this->musicfolder);
|
||||
@ -1204,15 +1205,13 @@ void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderVolumePlayer_sli
|
||||
ui_->volumeValueLabelPlayer->setText(QString::number(position) + "%");
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPlay_clicked()
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonList_clicked()
|
||||
{
|
||||
QString path = this->musicfolder + "/" + this->albumfolder + "/" + this->selectedMp3file;
|
||||
player->setMedia(QMediaContent(QUrl::fromLocalFile(path)));
|
||||
player->play();
|
||||
//qDebug() << player->errorString();
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
ui_->mp3selectWidget->hide();
|
||||
ui_->PlayerPlayingWidget->show();
|
||||
ui_->mp3selectWidget->show();
|
||||
ui_->PlayerPlayingWidget->hide();
|
||||
ui_->pushButtonList->hide();
|
||||
ui_->pushButtonPlayerPlayList->show();
|
||||
ui_->pushButtonBackToPlayer->show();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked()
|
||||
@ -1222,6 +1221,11 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked()
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
ui_->mp3selectWidget->show();
|
||||
ui_->PlayerPlayingWidget->hide();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->pushButtonPlayerPlayList->show();
|
||||
ui_->pushButtonPlayerStop->hide();
|
||||
ui_->pushButtonList->hide();
|
||||
ui_->pushButtonPlayerPause->hide();
|
||||
ui_->playerPositionTime->setText("00:00 / 00:00");
|
||||
ui_->labelCurrentPlaying->setText("");
|
||||
ui_->labelTrack->setText("");
|
||||
@ -1233,14 +1237,10 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPause_clicked()
|
||||
if(player->state() == QMediaPlayer::PlayingState){
|
||||
player->pause();
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(218, 143, 143); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
ui_->mp3selectWidget->show();
|
||||
ui_->PlayerPlayingWidget->hide();
|
||||
}else{
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
player->play();
|
||||
player->setPosition(player->position());
|
||||
ui_->mp3selectWidget->hide();
|
||||
ui_->PlayerPlayingWidget->show();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1333,7 +1333,12 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPlayList_clicked
|
||||
player->play();
|
||||
ui_->mp3selectWidget->hide();
|
||||
ui_->PlayerPlayingWidget->show();
|
||||
ui_->pushButtonPlayerPlayList->hide();
|
||||
ui_->pushButtonList->show();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->pushButtonPlayerStop->show();
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
ui_->pushButtonPlayerPause->show();
|
||||
int currentalbum = ui_->comboBoxAlbum->currentIndex();
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
}
|
||||
@ -1433,3 +1438,12 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerNextAlbum_clicke
|
||||
player->play();
|
||||
}
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBackToPlayer_clicked()
|
||||
{
|
||||
ui_->PlayerPlayingWidget->show();
|
||||
ui_->mp3selectWidget->hide();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->pushButtonPlayerPlayList->hide();
|
||||
ui_->pushButtonList->show();
|
||||
}
|
||||
|
@ -616,7 +616,10 @@ void SettingsWindow::loadSystemValues()
|
||||
dac = "Hifiberry - DAC Plus";
|
||||
}
|
||||
if (getparams[23] == "hifiberry-digi") {
|
||||
dac = "Hifiberry - DAC Digi";
|
||||
dac = "Hifiberry - Digi";
|
||||
}
|
||||
if (getparams[23] == "hifiberry-digi-pro") {
|
||||
dac = "Hifiberry - Digi Pro";
|
||||
}
|
||||
if (getparams[23] == "hifiberry-amp") {
|
||||
dac = "Hifiberry - DAC Amp";
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>956</width>
|
||||
<height>1296</height>
|
||||
<height>1295</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -3173,6 +3173,90 @@ QSlider::handle:horizontal { background: rgb(255, 255, 255); height: 52px; width
|
||||
<property name="bottomMargin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonBackToPlayer">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(114, 159, 207, 0.7);
|
||||
border-radius: 4px;
|
||||
border: 2px solid rgba(255,255,255,0.5);
|
||||
outline: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/player-hot.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonList">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(114, 159, 207, 0.7);
|
||||
border-radius: 4px;
|
||||
border: 2px solid rgba(255,255,255,0.5);
|
||||
outline: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/list-hot.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonPlayerStop">
|
||||
<property name="sizePolicy">
|
||||
@ -3190,7 +3274,7 @@ QSlider::handle:horizontal { background: rgb(255, 255, 255); height: 52px; width
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@ -3215,48 +3299,6 @@ outline: none;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonPlayerPlay">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(138, 226, 52, 0.7);
|
||||
border-radius: 4px;
|
||||
border: 2px solid rgba(255,255,255,0.5);
|
||||
outline: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/play-hot.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>32</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonPlayerPlayList">
|
||||
<property name="sizePolicy">
|
||||
@ -3274,7 +3316,7 @@ outline: none;</string>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@ -3316,7 +3358,7 @@ outline: none;</string>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@ -3362,7 +3404,7 @@ outline: none;
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
@ -3383,7 +3425,7 @@ outline: none;</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/back-hot.png</normalon>
|
||||
<normalon>:/home-hot.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
|
@ -5172,12 +5172,17 @@ outline: none;</string>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Hifiberry - DAC Digi</string>
|
||||
<string>Hifiberry - DAC Amp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Hifiberry - DAC Amp</string>
|
||||
<string>Hifiberry - Digi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Hifiberry - Digi Pro</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user