mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
Audio: small design improvements
This commit is contained in:
parent
dad0a8468d
commit
e872cedf3f
4 changed files with 14 additions and 14 deletions
|
@ -220,7 +220,7 @@ namespace global {
|
|||
inline QVector<Action> currentAction;
|
||||
inline QVector<musicFile> queue;
|
||||
inline QVector<musicFile> fileList;
|
||||
inline int itemCurrentlyPlaying = -1; // Also indicates in the queue menu which a grey color which is playing
|
||||
inline int itemCurrentlyPlaying = -1; // Also indicates in the queue menu which a gray color which is playing
|
||||
inline QMutex audioMutex; // These variables will be shared between threads, so here, it's to protect it
|
||||
inline int progressSeconds = -5; // -5 at default to avoid cutting song too early... yea
|
||||
inline bool paused = false;
|
||||
|
|
|
@ -62,7 +62,7 @@ audioDialog::audioDialog(QWidget *parent) :
|
|||
ui->fileNameLabel->setWordWrap(true);
|
||||
|
||||
// Default "page"
|
||||
ui->libraryBtn->setStyleSheet("background: grey;");
|
||||
ui->libraryBtn->setStyleSheet("background: #aeadac;");
|
||||
ui->refreshBtn->setIcon(QIcon(":/resources/refresh-small.png"));
|
||||
ui->refreshBtn->hide();
|
||||
ui->lineRefresh->hide();
|
||||
|
@ -114,7 +114,7 @@ void audioDialog::changeMenu() {
|
|||
ui->lineRefresh->show();
|
||||
ui->refreshBtn->setIcon(QIcon(":/resources/clean.png"));
|
||||
ui->libraryBtn->setStyleSheet("background: white;");
|
||||
ui->queueBtn->setStyleSheet("background: grey;");
|
||||
ui->queueBtn->setStyleSheet("background: #aeadac;");
|
||||
refreshAudioFileWidgetsQueue();
|
||||
}
|
||||
else if(currentMenu != Library){
|
||||
|
@ -122,7 +122,7 @@ void audioDialog::changeMenu() {
|
|||
emit deleteItself();
|
||||
ui->refreshBtn->hide();
|
||||
ui->lineRefresh->hide();
|
||||
ui->libraryBtn->setStyleSheet("background: grey;");
|
||||
ui->libraryBtn->setStyleSheet("background: #aeadac;");
|
||||
ui->queueBtn->setStyleSheet("background: white;");
|
||||
refreshAudioFileWidgets();
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ void audioDialog::refreshFileList() {
|
|||
}
|
||||
// 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);
|
||||
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
|
||||
|
@ -248,12 +248,12 @@ void audioDialog::refreshAudioFileWidgetsQueue() {
|
|||
for(int i = 0; i < global::audio::queue.size(); i++) {
|
||||
log("Adding new item: " + QString::number(i), className);
|
||||
audiofilequeue* newAudioFileQueue = new audiofilequeue(this);
|
||||
bool grey = false;
|
||||
bool gray = false;
|
||||
if(global::audio::isSomethingCurrentlyPlaying == true && global::audio::itemCurrentlyPlaying == i) {
|
||||
grey = true;
|
||||
gray = true;
|
||||
}
|
||||
global::audio::queue[i].id = i; // Give them invidual ID once more, because files can repeat
|
||||
newAudioFileQueue->provideData(global::audio::queue[i], grey);
|
||||
newAudioFileQueue->provideData(global::audio::queue[i], gray);
|
||||
QObject::connect(this, &audioDialog::deleteItself, newAudioFileQueue, &audiofilequeue::die);
|
||||
QObject::connect(newAudioFileQueue, &audiofilequeue::playFileChild, this, &audioDialog::playFile);
|
||||
ui->verticalLayout->addWidget(newAudioFileQueue, Qt::AlignTop);
|
||||
|
|
|
@ -16,14 +16,14 @@ audiofilequeue::~audiofilequeue()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void audiofilequeue::provideData(global::audio::musicFile fileProvided, bool grey) {
|
||||
void audiofilequeue::provideData(global::audio::musicFile fileProvided, bool gray) {
|
||||
file = fileProvided;
|
||||
ui->nameLabel->setText(file.name);
|
||||
ui->timeLabel->setText(file.length);
|
||||
if(grey == true) {
|
||||
log("Setting background grey", className);
|
||||
ui->deleteBtn->setStyleSheet("background: grey;");
|
||||
ui->playButton->setStyleSheet("background: grey;");
|
||||
if(gray == true) {
|
||||
log("Setting background gray", className);
|
||||
ui->deleteBtn->setStyleSheet("background: #aeadac;");
|
||||
ui->playButton->setStyleSheet("background: #aeadac;");
|
||||
isPlaying = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public:
|
|||
QString className = this->metaObject()->className();
|
||||
bool isPlaying = false;
|
||||
|
||||
void provideData(global::audio::musicFile fileProvided, bool grey);
|
||||
void provideData(global::audio::musicFile fileProvided, bool gray);
|
||||
global::audio::musicFile file;
|
||||
|
||||
public slots:
|
||||
|
|
Loading…
Reference in a new issue