From c11461d9c46351afa9f479fc05d4f97901ba09ab Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 26 Jul 2020 23:54:10 -0400 Subject: New icon, taglib, name change --- AAP.svg | 248 ++++++++++++++++++++++++++++++++++++++++++++++ ALP.svg | 131 ------------------------ Alee Audio Player.desktop | 7 ++ Alee Audio Player.pro | 59 +++++++++++ AleePlayer.desktop | 7 -- AleePlayer.pro | 58 ----------- README.md | 2 +- about.cpp | 2 +- about.h | 2 +- about.ui | 6 +- library.cpp | 2 +- library.h | 2 +- main.cpp | 6 +- player.cpp | 24 +++-- player.h | 3 +- player.ui | 10 +- 16 files changed, 351 insertions(+), 218 deletions(-) create mode 100755 AAP.svg delete mode 100644 ALP.svg create mode 100644 Alee Audio Player.desktop create mode 100644 Alee Audio Player.pro delete mode 100644 AleePlayer.desktop delete mode 100644 AleePlayer.pro diff --git a/AAP.svg b/AAP.svg new file mode 100755 index 0000000..0662b78 --- /dev/null +++ b/AAP.svg @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ALP.svg b/ALP.svg deleted file mode 100644 index 11a8a9d..0000000 --- a/ALP.svg +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - diff --git a/Alee Audio Player.desktop b/Alee Audio Player.desktop new file mode 100644 index 0000000..17a1a4b --- /dev/null +++ b/Alee Audio Player.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=Alee Audio Player +Comment=Audio Player +Exec=AleeAudioPlayer +Icon=AAP +Categories=Audio; diff --git a/Alee Audio Player.pro b/Alee Audio Player.pro new file mode 100644 index 0000000..3c4e2fa --- /dev/null +++ b/Alee Audio Player.pro @@ -0,0 +1,59 @@ +QT += core gui multimedia + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + about.cpp \ + library.cpp \ + main.cpp \ + player.cpp + +HEADERS += \ + about.h \ + library.h \ + player.h + +FORMS += \ + about.ui \ + player.ui + +TRANSLATIONS += \ + translations/en_CA.ts \ + translations/fr_CA.ts \ + translations/vi_VN.ts + + +unix:!macx:!android { + + TARGET = AleeAudioPlayer + + target.path = /usr/bin + + desktop.path = /usr/share/applications + desktop.files = Alee Audio Player.desktop + + icon.path = /usr/share/icons/hicolor/scalable/apps/ + icon.files = AAP.svg + + LIBS += -ltag + + INSTALLS += target desktop icon +} + + +# Default rules for deployment. +#qnx: target.path = /tmp/$${TARGET}/bin +#!isEmpty(target.path): INSTALLS += target diff --git a/AleePlayer.desktop b/AleePlayer.desktop deleted file mode 100644 index da6d3a5..0000000 --- a/AleePlayer.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Alee Music Player -Comment=Music Player -Exec=AleePlayer -Icon=ALP -Categories=Audio; diff --git a/AleePlayer.pro b/AleePlayer.pro deleted file mode 100644 index ecb90de..0000000 --- a/AleePlayer.pro +++ /dev/null @@ -1,58 +0,0 @@ -QT += core gui multimedia - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -CONFIG += c++11 - -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -SOURCES += \ - about.cpp \ - library.cpp \ - main.cpp \ - player.cpp - -HEADERS += \ - about.h \ - library.h \ - player.h - -FORMS += \ - about.ui \ - player.ui - -TRANSLATIONS += \ - translations/en_CA.ts \ - translations/fr_CA.ts \ - translations/vi_VN.ts - - -unix:!macx:!android { - - TARGET = AleePlayer - - target.path = /usr/bin - - desktop.path = /usr/share/applications - desktop.files = AleePlayer.desktop - - icon.path = /usr/share/icons/hicolor/scalable/apps/ - icon.files = ALP.svg - - - INSTALLS += target desktop icon -} - - -# Default rules for deployment. -#qnx: target.path = /tmp/$${TARGET}/bin -#!isEmpty(target.path): INSTALLS += target diff --git a/README.md b/README.md index f974ac9..243a713 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# AleePlayer +# Alee Audio Player An audio player written in Qt [![Build status](https://ci.appveyor.com/api/projects/status/6ifpgxms79l4q0u2?svg=true)](https://ci.appveyor.com/project/Alee14/aleeplayer) [![Build Status](https://travis-ci.org/aleeproductions/AleePlayer.svg?branch=master)](https://travis-ci.org/aleeproductions/AleePlayer) diff --git a/about.cpp b/about.cpp index 250945d..e5ebef7 100644 --- a/about.cpp +++ b/about.cpp @@ -1,5 +1,5 @@ /* - AleePlayer: Music player in Qt + Alee Audio Player: Audio player in Qt Copyright (C) 2020 Alee Productions This program is free software: you can redistribute it and/or modify diff --git a/about.h b/about.h index 595f3f5..f2c91ff 100644 --- a/about.h +++ b/about.h @@ -1,5 +1,5 @@ /* - AleePlayer: Music player in Qt + Alee Audio Player: Audio player in Qt Copyright (C) 2020 Alee Productions This program is free software: you can redistribute it and/or modify diff --git a/about.ui b/about.ui index cc3cad9..2bd6eab 100644 --- a/about.ui +++ b/about.ui @@ -64,14 +64,14 @@ - + 16 - Licensed with GPL-3.0 + Written in C++ and Qt, Licensed with GPL-3.0 Qt::AlignCenter @@ -112,7 +112,7 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Alee Music Player: An audio player written in Qt</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Alee Audio Player: An audio player written in Qt</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> Copyright (C) 2020 Alee Productions</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"> This program is free software: you can redistribute it and/or modify</p> diff --git a/library.cpp b/library.cpp index aa3e8c1..ffba966 100644 --- a/library.cpp +++ b/library.cpp @@ -1,5 +1,5 @@ /* - AleePlayer: Music player in Qt + Alee Audio Player: Audio player in Qt Copyright (C) 2020 Alee Productions This program is free software: you can redistribute it and/or modify diff --git a/library.h b/library.h index 9858d9f..c88f49d 100644 --- a/library.h +++ b/library.h @@ -1,5 +1,5 @@ /* - AleePlayer: Music player in Qt + Alee Audio Player: Audio player in Qt Copyright (C) 2020 Alee Productions This program is free software: you can redistribute it and/or modify diff --git a/main.cpp b/main.cpp index e9f00e6..d255601 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,5 @@ /* - AleePlayer: Music player in Qt + Alee Audio Player: Audio player in Qt Copyright (C) 2020 Alee Productions This program is free software: you can redistribute it and/or modify @@ -26,7 +26,7 @@ int main(int argc, char *argv[]) { - qInfo() << "AleePlayer: A music player by Alee Productions. Licensed with GPL-3.0.\n"; + qInfo() << "Alee Audio Player: A music player by Alee Productions. Licensed with GPL-3.0.\n"; qDebug() << "Creating files..."; @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); QTranslator translator; - translator.load(QLocale(), "/home/andrew/Documents/GitHub/AleePlayer/translations/"); + translator.load(QLocale(), "/home/andrew/Documents/GitHub/Alee Audio Player/translations/"); a.installTranslator(&translator); Player musicPlayer; diff --git a/player.cpp b/player.cpp index fdc41c7..9ff8591 100644 --- a/player.cpp +++ b/player.cpp @@ -1,5 +1,5 @@ /* - AleePlayer: Music player in Qt + Alee Audio Player: Audio player in Qt Copyright (C) 2020 Alee Productions This program is free software: you can redistribute it and/or modify @@ -23,7 +23,8 @@ void Player::loadFile() { QMessageBox msgbox; - mFile = QFileDialog::getOpenFileName(this, tr("Open any audio file"), QDir::homePath(), tr("Audio Files (*.mp3 *.wav *.ogg *.flac *.mp4)")); + + mFile = QFileDialog::getOpenFileName(this, tr("Open any audio file"), QDir::homePath(), tr("Audio Files (*.mp3 *.wav *.ogg *.flac)")); if (mFile == NULL) { qDebug() << tr("File cannot be found"); msgbox.setWindowTitle(tr("Uh oh! An error has occured!")); @@ -39,7 +40,18 @@ void Player::loadFile() msgbox.setIcon(QMessageBox::Information); msgbox.exec(); ui->volumeSlider->setValue(100); - ui->playButton->setText(tr("Play")); + ui->playbackSlider->setEnabled(true); + + char* fn = new char [mFile.toStdString().size()+1]; + strcpy( fn, mFile.toStdString().c_str() ); + TagLib::FileRef* fileref = new TagLib::FileRef(fn); + + if (fileref->tag() != nullptr) { + TagLib::String title = fileref->tag()->title(); + const char* title_ = title.to8Bit(true).c_str(); + ui->labelTitle->setText(title_); + } + return; } } @@ -51,7 +63,6 @@ Player::Player(QWidget *parent) , ui(new Ui::Player) { ui->setupUi(this); - ui->library->setModel(new Library()); connect(mPlayer, &QMediaPlayer::positionChanged, this, &Player::on_positionChanged); @@ -61,7 +72,7 @@ Player::Player(QWidget *parent) Player::~Player() { - qInfo() << tr("Closing AleePlayer..."); + qInfo() << tr("Closing Alee Audio Player..."); mPlayer->deleteLater(); delete ui; } @@ -84,8 +95,6 @@ void Player::on_playButton_pressed() qDebug() << tr("Playing music..."); mPlayer->play(); ui->playButton->setText(tr("Pause")); - amount++; - //qDebug() << "You have pressed play for" << amount << "time(s)."; } } @@ -94,7 +103,6 @@ void Player::on_stopButton_pressed() { qInfo() << tr("Stopping music..."); mPlayer->stop(); - ui->volumeSlider->setEnabled(false); ui->volumeSlider->setValue(100); ui->playbackSlider->setEnabled(false); ui->playbackSlider->setValue(0); diff --git a/player.h b/player.h index f0cb0b9..c1fbc78 100644 --- a/player.h +++ b/player.h @@ -1,5 +1,5 @@ /* - AleePlayer: Music player in Qt + Alee Audio Player: Audio player in Qt Copyright (C) 2020 Alee Productions This program is free software: you can redistribute it and/or modify @@ -23,6 +23,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE namespace Ui { class Player; } diff --git a/player.ui b/player.ui index 86e9834..ac85d61 100644 --- a/player.ui +++ b/player.ui @@ -127,7 +127,7 @@ - false + true 99 @@ -179,7 +179,6 @@ - @@ -187,8 +186,15 @@ View + + + Help + + + + -- cgit v1.2.3