diff --git a/services/local/taginfo.cpp b/services/local/taginfo.cpp index 2c607be..34689ae 100644 --- a/services/local/taginfo.cpp +++ b/services/local/taginfo.cpp @@ -1,152 +1,152 @@ /* Babe - tiny music player Copyright (C) 2017 Camilo Higuita This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "taginfo.h" #include "../../utils/bae.h" using namespace BAE; TagInfo::TagInfo(const QString &url, QObject *parent) : QObject(parent) { this->path = url; QFileInfo _file(this->path); if(_file.isReadable()) { qDebug()<< "is readble"; - this->file = new TagLib::FileRef(path.toUtf8()); + this->file = new TagLib::FileRef(TagLib::FileName(path.toUtf8())); } else this->file = new TagLib::FileRef(); } TagInfo::~TagInfo() { qDebug()<< "DELETING TAGINFO"; delete this->file; } bool TagInfo::isNull() { return this->file->isNull(); } QString TagInfo::getAlbum() const { const auto value = QString::fromStdWString(file->tag()->album().toWString()); return !value.isEmpty() ? value : SLANG[W::UNKNOWN]; } QString TagInfo::getTitle() const { const auto value = QString::fromStdWString(file->tag()->title().toWString()); return !value.isEmpty() ? value : fileName(); } QString TagInfo::getArtist() const { const auto value = QString::fromStdWString(file->tag()->artist().toWString()); return !value.isEmpty() ? value : SLANG[W::UNKNOWN]; } int TagInfo::getTrack() const { return static_cast(file->tag()->track()); } QString TagInfo::getGenre() const { const auto value = QString::fromStdWString(file->tag()->genre().toWString()); return !value.isEmpty() ? value : SLANG[W::UNKNOWN]; } QString TagInfo::fileName() const { return BAE::getNameFromLocation(path); } uint TagInfo::getYear() const { return file->tag()->year(); } int TagInfo::getDuration() const { return file->audioProperties()->length(); } QString TagInfo::getComment() const { const auto value = QString::fromStdWString(file->tag()->comment().toWString()); return !value.isEmpty() ?value : SLANG[W::UNKNOWN]; } QByteArray TagInfo::getCover() const { QByteArray array; return array; } void TagInfo::setCover(const QByteArray &array) { Q_UNUSED(array); } void TagInfo::setComment(const QString &comment) { this->file->tag()->setComment(comment.toStdString()); this->file->save(); } void TagInfo::setAlbum(const QString &album) { this->file->tag()->setAlbum(album.toStdString()); this->file->save(); } void TagInfo::setTitle(const QString &title) { this->file->tag()->setTitle(title.toStdString()); this->file->save(); } void TagInfo::setTrack(const int &track) { this->file->tag()->setTrack(static_cast(track)); this->file->save(); } void TagInfo::setArtist(const QString &artist) { this->file->tag()->setArtist(artist.toStdString()); this->file->save(); } void TagInfo::setGenre(const QString &genre) { this->file->tag()->setGenre(genre.toStdString()); this->file->save(); } diff --git a/vvave.pro b/vvave.pro index 7fa8ada..362af70 100644 --- a/vvave.pro +++ b/vvave.pro @@ -1,132 +1,127 @@ QT *= quick \ multimedia \ sql \ websockets \ network \ xml \ qml \ widgets \ quickcontrols2 \ concurrent \ network TARGET = vvave TEMPLATE = app CONFIG += ordered CONFIG += c++17 CONFIG += static linux:unix:!android { message(Building for Linux KDE) include($$PWD/kde/kde.pri) LIBS += -lMauiKit } else:android|win32 { message(Building helpers for Android) android { QMAKE_LINK += -nostdlib++ QT *= androidextras webview ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android_files include($$PWD/3rdparty/taglib.pri) }else:win32 { - message("Using Tablib binaries for Windows") - LIBS += -L$$PWD/../../../../CraftRoot/lib/ -ltag + LIBS += -L$$PWD/'../../../../Program Files (x86)/taglib/lib/' -ltag - INCLUDEPATH += $$PWD/../../../../CraftRoot/include - DEPENDPATH += $$PWD/../../../../CraftRoot/include +INCLUDEPATH += $$PWD/'../../../../Program Files (x86)/taglib/include' +DEPENDPATH += $$PWD/'../../../../Program Files (x86)/taglib/include' - win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../CraftRoot/lib/libtag.a - else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../CraftRoot/lib/libtagd.a - else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../../CraftRoot/lib/tag.lib - else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../../CraftRoot/lib/tagd.lib - - } + } #DEFAULT COMPONENTS DEFINITIONS DEFINES *= \ # COMPONENT_EDITOR \ COMPONENT_ACCOUNTS \ COMPONENT_FM \ # COMPONENT_TERMINAL \ COMPONENT_TAGGING \ # COMPONENT_SYNCING \ MAUIKIT_STYLE include($$PWD/3rdparty/kirigami/kirigami.pri) include($$PWD/3rdparty/mauikit/mauikit.pri) DEFINES += STATIC_KIRIGAMI } else { message("Unknown configuration") } include(pulpo/pulpo.pri) # The following define makes your compiler emit warnings if you use # any feature of Qt which as 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 you use 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 += main.cpp \ db/collectionDB.cpp \ services/local/taginfo.cpp \ services/local/player.cpp \ # utils/brain.cpp \ # services/local/socket.cpp \ services/web/youtube.cpp \ vvave.cpp \ services/local/youtubedl.cpp \ # services/local/linking.cpp \ # services/web/Spotify/spotify.cpp \ models/tracks/tracksmodel.cpp \ models/playlists/playlistsmodel.cpp \ models/albums/albumsmodel.cpp \ services/web/NextCloud/nextmusic.cpp \ services/web/abstractmusicprovider.cpp \ models/cloud/cloud.cpp RESOURCES += qml.qrc \ # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Additional import path used to resolve QML modules just for Qt Quick Designer QML_DESIGNER_IMPORT_PATH = HEADERS += \ db/collectionDB.h \ utils/bae.h \ services/local/fileloader.h \ services/local/taginfo.h \ services/local/player.h \ # utils/brain.h \ # services/local/socket.h \ services/web/youtube.h \ vvave.h \ services/local/youtubedl.h \ # services/local/linking.h \ # services/web/Spotify/spotify.h \ models/tracks/tracksmodel.h \ models/playlists/playlistsmodel.h \ models/albums/albumsmodel.h \ services/web/NextCloud/nextmusic.h \ services/web/abstractmusicprovider.h \ models/cloud/cloud.h INCLUDEPATH += \ $$PWD/services/web \ $$PWD/services/web/NextCloud include(install.pri) +