From 96a95de9e13fc5b02205c1707d6f7c656b08772c Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Mon, 24 Jul 2023 22:22:18 -0400 Subject: [PATCH] Audio: more design improvements --- src/widgets/dialogs/audio/audiodialog.cpp | 13 ++++++------ src/widgets/dialogs/audio/audiodialog.ui | 11 +++++++++- src/widgets/dialogs/audio/audiofile.cpp | 4 ++++ src/widgets/dialogs/audio/audiofile.ui | 10 +++++++++ src/widgets/dialogs/audio/audiofilequeue.cpp | 9 ++++++-- src/widgets/dialogs/audio/audiofilequeue.h | 2 +- src/widgets/dialogs/audio/audiofilequeue.ui | 22 +++++++++++++++++++- 7 files changed, 60 insertions(+), 11 deletions(-) diff --git a/src/widgets/dialogs/audio/audiodialog.cpp b/src/widgets/dialogs/audio/audiodialog.cpp index 4455014..982979b 100644 --- a/src/widgets/dialogs/audio/audiodialog.cpp +++ b/src/widgets/dialogs/audio/audiodialog.cpp @@ -16,6 +16,7 @@ audioDialog::audioDialog(QWidget *parent) : { ui->setupUi(this); audioDialog::setFont(QFont("u001")); + ui->fileNameLabel->setFont(QFont("u001")); progress = new QTimer(this); @@ -45,16 +46,16 @@ audioDialog::audioDialog(QWidget *parent) : int topButtonsSize = 55; int menuButtonsSize = 80; - int playButtonsSize = 50; + int playBtnsSize = 50; ui->minusBtn->setIconSize(QSize{topButtonsSize,topButtonsSize}); ui->plusBtn->setIconSize(QSize{topButtonsSize,topButtonsSize}); ui->exitBtn->setIconSize(QSize{topButtonsSize,topButtonsSize}); ui->refreshBtn->setIconSize(QSize{topButtonsSize,topButtonsSize}); - ui->nextBtn->setIconSize(QSize{playButtonsSize,playButtonsSize}); - ui->previousBtn->setIconSize(QSize{playButtonsSize,playButtonsSize}); - ui->playBtn->setIconSize(QSize{playButtonsSize,playButtonsSize}); + ui->nextBtn->setIconSize(QSize{playBtnsSize,playBtnsSize}); + ui->previousBtn->setIconSize(QSize{playBtnsSize,playBtnsSize}); + ui->playBtn->setIconSize(QSize{playBtnsSize,playBtnsSize}); ui->libraryBtn->setIconSize(QSize{menuButtonsSize,menuButtonsSize}); ui->queueBtn->setIconSize(QSize{menuButtonsSize,menuButtonsSize}); @@ -150,14 +151,14 @@ void audioDialog::refreshFileList() { writeFile(".config/e-2-audio/path", "/mnt/onboard/onboard/music/"); log("Music config file doesn't exist, creating it", className); } - // For example in this path: /mnt/onboard/onboard/music/ ( with / at the end ) + // For example in this path: '/mnt/onboard/onboard/music/' (with '/' at the end) QString path = readFile(".config/e-2-audio/path").replace("\n", ""); log("Path for audio files: '" + path + "'", className); QDir dir{path}; // Other file formats could be added, by building more libraries // https://github.com/arnavyc/sndfile-alsa-example/blob/main/src/sndfile-alsa.c // https://github.com/libsndfile/libsndfile - // Is it easy to do? Yes. Does it take more space? Yes. Do I care? No, i have this fancy command: + // Is it easy to do? Yes. Does it take more space? Yes. Do I care? No, I have this fancy command instead: // for i in *; do ffmpeg -i "$i" "${i%.*}.wav"; done // (Szybet) dir.setNameFilters(QStringList("*.wav")); diff --git a/src/widgets/dialogs/audio/audiodialog.ui b/src/widgets/dialogs/audio/audiodialog.ui index ecc5882..27ea7e4 100644 --- a/src/widgets/dialogs/audio/audiodialog.ui +++ b/src/widgets/dialogs/audio/audiodialog.ui @@ -160,13 +160,22 @@ 0 0 585 - 301 + 299 + + 0 + 0 + + 0 + + + 0 + diff --git a/src/widgets/dialogs/audio/audiofile.cpp b/src/widgets/dialogs/audio/audiofile.cpp index 98c6b0c..a86a299 100644 --- a/src/widgets/dialogs/audio/audiofile.cpp +++ b/src/widgets/dialogs/audio/audiofile.cpp @@ -8,6 +8,10 @@ audiofile::audiofile(QWidget *parent) : { ui->setupUi(this); audiofile::setFont(QFont("u001")); + ui->nameLabel->setFont(QFont("u001")); + ui->timeLabel->setFont(QFont("u001")); + + ui->addBtn->setProperty("type", "borderless"); ui->nameLabel->setWordWrap(true); } diff --git a/src/widgets/dialogs/audio/audiofile.ui b/src/widgets/dialogs/audio/audiofile.ui index e0265dd..f240a07 100644 --- a/src/widgets/dialogs/audio/audiofile.ui +++ b/src/widgets/dialogs/audio/audiofile.ui @@ -76,6 +76,16 @@ + + + + QFrame::Plain + + + Qt::Vertical + + + diff --git a/src/widgets/dialogs/audio/audiofilequeue.cpp b/src/widgets/dialogs/audio/audiofilequeue.cpp index 5a21144..d0dd920 100644 --- a/src/widgets/dialogs/audio/audiofilequeue.cpp +++ b/src/widgets/dialogs/audio/audiofilequeue.cpp @@ -7,6 +7,11 @@ audiofilequeue::audiofilequeue(QWidget *parent) : { ui->setupUi(this); audiofilequeue::setFont(QFont("u001")); + ui->nameLabel->setFont(QFont("u001")); + ui->timeLabel->setFont(QFont("u001")); + + ui->playBtn->setProperty("type", "borderless"); + ui->deleteBtn->setProperty("type", "borderless"); ui->nameLabel->setWordWrap(true); } @@ -23,7 +28,7 @@ void audiofilequeue::provideData(global::audio::musicFile fileProvided, bool gra if(gray == true) { log("Setting background gray", className); ui->deleteBtn->setStyleSheet("background: #aeadac;"); - ui->playButton->setStyleSheet("background: #aeadac;"); + ui->playBtn->setStyleSheet("background: #aeadac;"); isPlaying = true; } } @@ -69,7 +74,7 @@ void audiofilequeue::on_deleteBtn_clicked() global::audio::audioMutex.unlock(); } -void audiofilequeue::on_playButton_clicked() +void audiofilequeue::on_playBtn_clicked() { global::audio::audioMutex.lock(); for(int i = 0; i < global::audio::queue.size(); i++) { diff --git a/src/widgets/dialogs/audio/audiofilequeue.h b/src/widgets/dialogs/audio/audiofilequeue.h index 6087784..50d46c3 100644 --- a/src/widgets/dialogs/audio/audiofilequeue.h +++ b/src/widgets/dialogs/audio/audiofilequeue.h @@ -32,7 +32,7 @@ signals: private slots: void on_deleteBtn_clicked(); - void on_playButton_clicked(); + void on_playBtn_clicked(); }; #endif // AUDIOFILEQUEUE_H diff --git a/src/widgets/dialogs/audio/audiofilequeue.ui b/src/widgets/dialogs/audio/audiofilequeue.ui index 40344a2..8ebf3c9 100644 --- a/src/widgets/dialogs/audio/audiofilequeue.ui +++ b/src/widgets/dialogs/audio/audiofilequeue.ui @@ -76,6 +76,16 @@ + + + + QFrame::Plain + + + Qt::Vertical + + + @@ -94,7 +104,17 @@ - + + + QFrame::Plain + + + Qt::Vertical + + + + + 0