strawberry: update to 0.8.4.

This commit is contained in:
Andrew J. Hesford 2021-02-19 09:08:50 -05:00
parent 08b573d39e
commit ac373f40b3
2 changed files with 350 additions and 3 deletions

View file

@ -0,0 +1,347 @@
diff -ur ext/libstrawberry-tagreader/tagreader.cpp ext/libstrawberry-tagreader/tagreader.cpp
--- ext/libstrawberry-tagreader/tagreader.cpp 2020-11-09 17:12:40.431554880 -0500
+++ ext/libstrawberry-tagreader/tagreader.cpp 2021-02-19 14:36:37.195218302 -0500
@@ -146,34 +146,34 @@
}
-pb::tagreader::SongMetadata_FileType TagReader::GuessFileType(TagLib::FileRef *fileref) const {
+spb::tagreader::SongMetadata_FileType TagReader::GuessFileType(TagLib::FileRef *fileref) const {
- if (dynamic_cast<TagLib::RIFF::WAV::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_WAV;
- if (dynamic_cast<TagLib::FLAC::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_FLAC;
- if (dynamic_cast<TagLib::WavPack::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_WAVPACK;
- if (dynamic_cast<TagLib::Ogg::FLAC::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_OGGFLAC;
- if (dynamic_cast<TagLib::Ogg::Vorbis::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_OGGVORBIS;
- if (dynamic_cast<TagLib::Ogg::Opus::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_OGGOPUS;
- if (dynamic_cast<TagLib::Ogg::Speex::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_OGGSPEEX;
- if (dynamic_cast<TagLib::MPEG::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_MPEG;
- if (dynamic_cast<TagLib::MP4::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_MP4;
- if (dynamic_cast<TagLib::ASF::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_ASF;
- if (dynamic_cast<TagLib::RIFF::AIFF::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_AIFF;
- if (dynamic_cast<TagLib::MPC::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_MPC;
- if (dynamic_cast<TagLib::TrueAudio::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_TRUEAUDIO;
- if (dynamic_cast<TagLib::APE::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_APE;
+ if (dynamic_cast<TagLib::RIFF::WAV::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_WAV;
+ if (dynamic_cast<TagLib::FLAC::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_FLAC;
+ if (dynamic_cast<TagLib::WavPack::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_WAVPACK;
+ if (dynamic_cast<TagLib::Ogg::FLAC::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_OGGFLAC;
+ if (dynamic_cast<TagLib::Ogg::Vorbis::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_OGGVORBIS;
+ if (dynamic_cast<TagLib::Ogg::Opus::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_OGGOPUS;
+ if (dynamic_cast<TagLib::Ogg::Speex::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_OGGSPEEX;
+ if (dynamic_cast<TagLib::MPEG::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_MPEG;
+ if (dynamic_cast<TagLib::MP4::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_MP4;
+ if (dynamic_cast<TagLib::ASF::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_ASF;
+ if (dynamic_cast<TagLib::RIFF::AIFF::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_AIFF;
+ if (dynamic_cast<TagLib::MPC::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_MPC;
+ if (dynamic_cast<TagLib::TrueAudio::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_TRUEAUDIO;
+ if (dynamic_cast<TagLib::APE::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_APE;
#ifdef HAVE_TAGLIB_DSFFILE
- if (dynamic_cast<TagLib::DSF::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_DSF;
+ if (dynamic_cast<TagLib::DSF::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_DSF;
#endif
#ifdef HAVE_TAGLIB_DSDIFFFILE
- if (dynamic_cast<TagLib::DSDIFF::File*>(fileref->file())) return pb::tagreader::SongMetadata_FileType_DSDIFF;
+ if (dynamic_cast<TagLib::DSDIFF::File*>(fileref->file())) return spb::tagreader::SongMetadata_FileType_DSDIFF;
#endif
- return pb::tagreader::SongMetadata_FileType_UNKNOWN;
+ return spb::tagreader::SongMetadata_FileType_UNKNOWN;
}
-void TagReader::ReadFile(const QString &filename, pb::tagreader::SongMetadata *song) const {
+void TagReader::ReadFile(const QString &filename, spb::tagreader::SongMetadata *song) const {
const QByteArray url(QUrl::fromLocalFile(filename).toEncoded());
const QFileInfo info(filename);
@@ -435,7 +435,7 @@
}
-void TagReader::ParseOggTag(const TagLib::Ogg::FieldListMap &map, QString *disc, QString *compilation, pb::tagreader::SongMetadata *song) const {
+void TagReader::ParseOggTag(const TagLib::Ogg::FieldListMap &map, QString *disc, QString *compilation, spb::tagreader::SongMetadata *song) const {
if (!map["COMPOSER"].isEmpty()) Decode(map["COMPOSER"].front(), song->mutable_composer());
if (!map["PERFORMER"].isEmpty()) Decode(map["PERFORMER"].front(), song->mutable_performer());
@@ -459,7 +459,7 @@
}
-void TagReader::ParseAPETag(const TagLib::APE::ItemListMap &map, QString *disc, QString *compilation, pb::tagreader::SongMetadata *song) const {
+void TagReader::ParseAPETag(const TagLib::APE::ItemListMap &map, QString *disc, QString *compilation, spb::tagreader::SongMetadata *song) const {
TagLib::APE::ItemListMap::ConstIterator it = map.find("ALBUM ARTIST");
if (it != map.end()) {
@@ -503,7 +503,7 @@
}
-void TagReader::SetVorbisComments(TagLib::Ogg::XiphComment *vorbis_comments, const pb::tagreader::SongMetadata &song) const {
+void TagReader::SetVorbisComments(TagLib::Ogg::XiphComment *vorbis_comments, const spb::tagreader::SongMetadata &song) const {
vorbis_comments->addField("COMPOSER", StdStringToTaglibString(song.composer()), true);
vorbis_comments->addField("PERFORMER", StdStringToTaglibString(song.performer()), true);
@@ -521,7 +521,7 @@
}
-bool TagReader::SaveFile(const QString &filename, const pb::tagreader::SongMetadata &song) const {
+bool TagReader::SaveFile(const QString &filename, const spb::tagreader::SongMetadata &song) const {
if (filename.isEmpty()) return false;
@@ -608,7 +608,7 @@
return result;
}
-void TagReader::SaveAPETag(TagLib::APE::Tag *tag, const pb::tagreader::SongMetadata &song) const {
+void TagReader::SaveAPETag(TagLib::APE::Tag *tag, const spb::tagreader::SongMetadata &song) const {
tag->setItem("album artist", TagLib::APE::Item("album artist", TagLib::StringList(song.albumartist().c_str())));
tag->addValue("disc", QStringToTaglibString(song.disc() <= 0 ? QString() : QString::number(song.disc())), true);
diff -ur ext/libstrawberry-tagreader/tagreader.h ext/libstrawberry-tagreader/tagreader.h
--- ext/libstrawberry-tagreader/tagreader.h 2020-11-09 17:12:40.431554880 -0500
+++ ext/libstrawberry-tagreader/tagreader.h 2021-02-19 14:36:37.195218302 -0500
@@ -51,10 +51,10 @@
~TagReader();
bool IsMediaFile(const QString &filename) const;
- pb::tagreader::SongMetadata_FileType GuessFileType(TagLib::FileRef *fileref) const;
+ spb::tagreader::SongMetadata_FileType GuessFileType(TagLib::FileRef *fileref) const;
- void ReadFile(const QString &filename, pb::tagreader::SongMetadata *song) const;
- bool SaveFile(const QString &filename, const pb::tagreader::SongMetadata &song) const;
+ void ReadFile(const QString &filename, spb::tagreader::SongMetadata *song) const;
+ bool SaveFile(const QString &filename, const spb::tagreader::SongMetadata &song) const;
QByteArray LoadEmbeddedArt(const QString &filename) const;
QByteArray LoadEmbeddedAPEArt(const TagLib::APE::ItemListMap &map) const;
@@ -62,11 +62,11 @@
static void Decode(const TagLib::String &tag, std::string *output);
static void Decode(const QString &tag, std::string *output);
- void ParseOggTag(const TagLib::Ogg::FieldListMap &map, QString *disc, QString *compilation, pb::tagreader::SongMetadata *song) const;
- void ParseAPETag(const TagLib::APE::ItemListMap &map, QString *disc, QString *compilation, pb::tagreader::SongMetadata *song) const;
+ void ParseOggTag(const TagLib::Ogg::FieldListMap &map, QString *disc, QString *compilation, spb::tagreader::SongMetadata *song) const;
+ void ParseAPETag(const TagLib::APE::ItemListMap &map, QString *disc, QString *compilation, spb::tagreader::SongMetadata *song) const;
- void SetVorbisComments(TagLib::Ogg::XiphComment *vorbis_comments, const pb::tagreader::SongMetadata &song) const;
- void SaveAPETag(TagLib::APE::Tag *tag, const pb::tagreader::SongMetadata &song) const;
+ void SetVorbisComments(TagLib::Ogg::XiphComment *vorbis_comments, const spb::tagreader::SongMetadata &song) const;
+ void SaveAPETag(TagLib::APE::Tag *tag, const spb::tagreader::SongMetadata &song) const;
void SetTextFrame(const char *id, const QString &value, TagLib::ID3v2::Tag *tag) const;
void SetTextFrame(const char *id, const std::string &value, TagLib::ID3v2::Tag *tag) const;
diff -ur ext/libstrawberry-tagreader/tagreadermessages.proto ext/libstrawberry-tagreader/tagreadermessages.proto
--- ext/libstrawberry-tagreader/tagreadermessages.proto 2020-09-11 17:34:59.552108115 -0400
+++ ext/libstrawberry-tagreader/tagreadermessages.proto 2021-02-19 14:36:49.047230658 -0500
@@ -1,6 +1,6 @@
syntax = "proto2";
-package pb.tagreader;
+package spb.tagreader;
message SongMetadata {
diff -ur ext/strawberry-tagreader/tagreaderworker.cpp ext/strawberry-tagreader/tagreaderworker.cpp
--- ext/strawberry-tagreader/tagreaderworker.cpp 2020-09-11 17:34:59.552108115 -0400
+++ ext/strawberry-tagreader/tagreaderworker.cpp 2021-02-19 14:36:37.195218302 -0500
@@ -27,13 +27,13 @@
#include "tagreaderworker.h"
TagReaderWorker::TagReaderWorker(QIODevice *socket, QObject *parent)
- : AbstractMessageHandler<pb::tagreader::Message>(socket, parent)
+ : AbstractMessageHandler<spb::tagreader::Message>(socket, parent)
{
}
-void TagReaderWorker::MessageArrived(const pb::tagreader::Message& message) {
+void TagReaderWorker::MessageArrived(const spb::tagreader::Message& message) {
- pb::tagreader::Message reply;
+ spb::tagreader::Message reply;
if (message.has_read_file_request()) {
tag_reader_.ReadFile(QStringFromStdString(message.read_file_request().filename()), reply.mutable_read_file_response()->mutable_metadata());
@@ -55,7 +55,7 @@
void TagReaderWorker::DeviceClosed() {
- AbstractMessageHandler<pb::tagreader::Message>::DeviceClosed();
+ AbstractMessageHandler<spb::tagreader::Message>::DeviceClosed();
qApp->exit();
}
diff -ur ext/strawberry-tagreader/tagreaderworker.h ext/strawberry-tagreader/tagreaderworker.h
--- ext/strawberry-tagreader/tagreaderworker.h 2020-09-11 17:34:59.552108115 -0400
+++ ext/strawberry-tagreader/tagreaderworker.h 2021-02-19 14:36:37.195218302 -0500
@@ -28,12 +28,12 @@
class QIODevice;
-class TagReaderWorker : public AbstractMessageHandler<pb::tagreader::Message> {
+class TagReaderWorker : public AbstractMessageHandler<spb::tagreader::Message> {
public:
explicit TagReaderWorker(QIODevice *socket, QObject *parent = nullptr);
protected:
- void MessageArrived(const pb::tagreader::Message &message) override;
+ void MessageArrived(const spb::tagreader::Message &message) override;
void DeviceClosed() override;
private:
diff -ur src/core/song.cpp src/core/song.cpp
--- src/core/song.cpp 2020-11-09 17:12:40.431554880 -0500
+++ src/core/song.cpp 2021-02-19 14:36:37.196218302 -0500
@@ -744,7 +744,7 @@
set_genre(TStringToQString(TagLib::ID3v1::genre(id)));
}
-void Song::InitFromProtobuf(const pb::tagreader::SongMetadata &pb) {
+void Song::InitFromProtobuf(const spb::tagreader::SongMetadata &pb) {
if (d->source_ == Source_Unknown) d->source_ = Source_LocalFile;
@@ -791,7 +791,7 @@
}
-void Song::ToProtobuf(pb::tagreader::SongMetadata *pb) const {
+void Song::ToProtobuf(spb::tagreader::SongMetadata *pb) const {
const QByteArray url(d->url_.toEncoded());
const QByteArray art_automatic(d->art_automatic_.toEncoded());
@@ -826,7 +826,7 @@
pb->set_filesize(d->filesize_);
pb->set_suspicious_tags(d->suspicious_tags_);
pb->set_art_automatic(art_automatic.constData(), art_automatic.size());
- pb->set_filetype(static_cast<pb::tagreader::SongMetadata_FileType>(d->filetype_));
+ pb->set_filetype(static_cast<spb::tagreader::SongMetadata_FileType>(d->filetype_));
}
diff -ur src/core/song.h src/core/song.h
--- src/core/song.h 2020-11-09 17:12:40.431554880 -0500
+++ src/core/song.h 2021-02-19 14:37:05.177247472 -0500
@@ -44,11 +44,11 @@
struct SimpleMetaBundle;
} // namespace Engine
-namespace pb {
+namespace spb {
namespace tagreader {
class SongMetadata;
} // namespace tagreader
-} // namespace pb
+} // namespace spb
#ifdef HAVE_LIBGPOD
struct _Itdb_Track;
@@ -155,7 +155,7 @@
// Constructors
void Init(const QString &title, const QString &artist, const QString &album, qint64 length_nanosec);
void Init(const QString &title, const QString &artist, const QString &album, qint64 beginning, qint64 end);
- void InitFromProtobuf(const pb::tagreader::SongMetadata &pb);
+ void InitFromProtobuf(const spb::tagreader::SongMetadata &pb);
void InitFromQuery(const SqlRow &query, bool reliable_metadata, int col = 0);
void InitFromFilePartial(const QString &filename); // Just store the filename: incomplete but fast
void InitArtManual(); // Check if there is already a art in the cache and store the filename in art_manual
@@ -180,7 +180,7 @@
void BindToQuery(QSqlQuery *query) const;
void BindToFtsQuery(QSqlQuery *query) const;
void ToXesam(QVariantMap *map) const;
- void ToProtobuf(pb::tagreader::SongMetadata *pb) const;
+ void ToProtobuf(spb::tagreader::SongMetadata *pb) const;
// Simple accessors
bool is_valid() const;
diff -ur src/core/tagreaderclient.cpp src/core/tagreaderclient.cpp
--- src/core/tagreaderclient.cpp 2020-10-19 13:09:38.951139121 -0400
+++ src/core/tagreaderclient.cpp 2021-02-19 14:36:37.195218302 -0500
@@ -71,8 +71,8 @@
TagReaderReply *TagReaderClient::ReadFile(const QString &filename) {
- pb::tagreader::Message message;
- pb::tagreader::ReadFileRequest *req = message.mutable_read_file_request();
+ spb::tagreader::Message message;
+ spb::tagreader::ReadFileRequest *req = message.mutable_read_file_request();
req->set_filename(DataCommaSizeFromQString(filename));
@@ -82,8 +82,8 @@
TagReaderReply *TagReaderClient::SaveFile(const QString &filename, const Song &metadata) {
- pb::tagreader::Message message;
- pb::tagreader::SaveFileRequest *req = message.mutable_save_file_request();
+ spb::tagreader::Message message;
+ spb::tagreader::SaveFileRequest *req = message.mutable_save_file_request();
req->set_filename(DataCommaSizeFromQString(filename));
metadata.ToProtobuf(req->mutable_metadata());
@@ -96,8 +96,8 @@
TagReaderReply *TagReaderClient::IsMediaFile(const QString &filename) {
- pb::tagreader::Message message;
- pb::tagreader::IsMediaFileRequest *req = message.mutable_is_media_file_request();
+ spb::tagreader::Message message;
+ spb::tagreader::IsMediaFileRequest *req = message.mutable_is_media_file_request();
req->set_filename(DataCommaSizeFromQString(filename));
@@ -107,8 +107,8 @@
TagReaderReply *TagReaderClient::LoadEmbeddedArt(const QString &filename) {
- pb::tagreader::Message message;
- pb::tagreader::LoadEmbeddedArtRequest *req = message.mutable_load_embedded_art_request();
+ spb::tagreader::Message message;
+ spb::tagreader::LoadEmbeddedArtRequest *req = message.mutable_load_embedded_art_request();
req->set_filename(DataCommaSizeFromQString(filename));
diff -ur src/core/tagreaderclient.h src/core/tagreaderclient.h
--- src/core/tagreaderclient.h 2020-09-11 17:34:59.560108063 -0400
+++ src/core/tagreaderclient.h 2021-02-19 14:36:37.196218302 -0500
@@ -44,7 +44,7 @@
public:
explicit TagReaderClient(QObject *parent = nullptr);
- typedef AbstractMessageHandler<pb::tagreader::Message> HandlerType;
+ typedef AbstractMessageHandler<spb::tagreader::Message> HandlerType;
typedef HandlerType::ReplyType ReplyType;
static const char *kWorkerExecutableName;
@@ -78,7 +78,7 @@
static TagReaderClient *sInstance;
WorkerPool<HandlerType> *worker_pool_;
- QList<pb::tagreader::Message> message_queue_;
+ QList<spb::tagreader::Message> message_queue_;
QThread *original_thread_;
};
diff -ur tests/src/tagreader_test.cpp tests/src/tagreader_test.cpp
--- tests/src/tagreader_test.cpp 2020-09-11 17:34:59.596107832 -0400
+++ tests/src/tagreader_test.cpp 2021-02-19 14:36:37.194218300 -0500
@@ -44,7 +44,7 @@
static Song ReadSongFromFile(const QString& filename) {
TagReader tag_reader;
Song song;
- ::pb::tagreader::SongMetadata pb_song;
+ ::spb::tagreader::SongMetadata pb_song;
// We need to init protobuf object from a Song object, to have default values initialized correctly.
song.ToProtobuf(&pb_song);
@@ -55,7 +55,7 @@
static void WriteSongToFile(const Song& song, const QString& filename) {
TagReader tag_reader;
- ::pb::tagreader::SongMetadata pb_song;
+ ::spb::tagreader::SongMetadata pb_song;
song.ToProtobuf(&pb_song);
tag_reader.SaveFile(filename, pb_song);
}

View file

@ -1,7 +1,7 @@
# Template file for 'strawberry'
pkgname=strawberry
version=0.8.3
revision=2
version=0.8.4
revision=1
build_style=cmake
hostmakedepends="pkg-config qt5-host-tools qt5-devel protobuf gettext"
makedepends="alsa-lib-devel boost-devel gnutls-devel fftw-devel
@ -15,4 +15,4 @@ maintainer="q66 <daniel@octaforge.org>"
license="GPL-3.0-or-later"
homepage="https://www.strawberrymusicplayer.org/"
distfiles="https://files.strawberrymusicplayer.org/${pkgname}-${version}.tar.xz"
checksum=838238d43cdeaa63cf920e09b8d51507be75fa0ab0252c5e0a3a34eb18ba1c90
checksum=f93acf3217ae6b63c6ee469bf8b8a86317f724c018cf7e86c43d663c8066760b