Remove the <xiphcomment.h> include from song.h so that windows headers don't infect everything else. Also move other bits of song.h into song.cpp, and reduce the number of includes in song.h.

This commit is contained in:
David Sansome 2011-11-28 13:51:35 +00:00
parent 7542949e2b
commit b873209d39
36 changed files with 474 additions and 339 deletions

View File

@ -377,14 +377,12 @@ set(HEADERS
globalsearch/groovesharksearchprovider.h
globalsearch/searchprovider.h
globalsearch/simplesearchprovider.h
globalsearch/somafmsearchprovider.h
globalsearch/tooltipactionwidget.h
globalsearch/tooltipresultwidget.h
internet/digitallyimportedclient.h
internet/digitallyimportedservicebase.h
internet/digitallyimportedsettingspage.h
internet/groovesharksearchplaylisttype.h
internet/groovesharkservice.h
internet/groovesharksettingspage.h
internet/groovesharkurlhandler.h

View File

@ -22,6 +22,7 @@
#include <QStringList>
#include <QTimer>
#include <QThread>
#include <QUrl>
const int DeleteFiles::kBatchSize = 50;

View File

@ -20,6 +20,7 @@
#include <QDir>
#include <QFile>
#include <QUrl>
FilesystemMusicStorage::FilesystemMusicStorage(const QString& root)
: root_(root)

View File

@ -24,6 +24,7 @@
#include "core/mpris2_root.h"
#include "core/mpris2_tracklist.h"
#include "core/player.h"
#include "core/timeconstants.h"
#include "covers/artloader.h"
#include "engines/enginebase.h"
#include "playlist/playlist.h"

View File

@ -24,6 +24,7 @@
#include <QFileInfo>
#include <QTimer>
#include <QThread>
#include <QUrl>
#include <boost/bind.hpp>

View File

@ -16,9 +16,11 @@
*/
#include "organiseformat.h"
#include "core/timeconstants.h"
#include <QApplication>
#include <QPalette>
#include <QUrl>
const char* OrganiseFormat::kTagPattern = "\\%([a-zA-Z]*)";
const char* OrganiseFormat::kBlockPattern = "\\{([^{}]+)\\}";

View File

@ -16,9 +16,10 @@
*/
#include "fmpsparser.h"
#include "logging.h"
#include "mpris_common.h"
#include "song.h"
#include "core/logging.h"
#include "core/mpris_common.h"
#include "timeconstants.h"
#include <algorithm>
@ -54,17 +55,26 @@
#include <QFile>
#include <QFileInfo>
#include <QLatin1Literal>
#include <QSharedData>
#include <QSqlQuery>
#include <QtConcurrentRun>
#include <QTextCodec>
#include <QTime>
#include <QVariant>
#include <QtConcurrentRun>
#ifdef Q_OS_WIN32
# include <mswmdm.h>
# include <QUuid>
#endif // Q_OS_WIN32
#ifdef HAVE_LIBGPOD
# include <gpod/itdb.h>
#endif
#ifdef HAVE_LIBMTP
# include <libmtp.h>
#endif
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
using boost::scoped_ptr;
@ -83,20 +93,29 @@ using boost::scoped_ptr;
#endif
static QStringList Prepend(const QString& text, const QStringList& list) {
namespace {
QStringList Prepend(const QString& text, const QStringList& list) {
QStringList ret(list);
for (int i=0 ; i<ret.count() ; ++i)
ret[i].prepend(text);
return ret;
}
static QStringList Updateify(const QStringList& list) {
QStringList Updateify(const QStringList& list) {
QStringList ret(list);
for (int i=0 ; i<ret.count() ; ++i)
ret[i].prepend(ret[i] + " = :");
return ret;
}
TagLib::String QStringToTaglibString(const QString& s) {
return TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8);
}
} // namespace
const QStringList Song::kColumns = QStringList()
<< "title" << "album" << "artist" << "albumartist" << "composer" << "track"
<< "disc" << "bpm" << "year" << "genre" << "comment" << "compilation"
@ -123,39 +142,85 @@ const QString Song::kFtsUpdateSpec = Updateify(Song::kFtsColumns).join(", ");
const QString Song::kManuallyUnsetCover = "(unset)";
const QString Song::kEmbeddedCover = "(embedded)";
QString Song::JoinSpec(const QString& table) {
return Prepend(table + ".", kColumns).join(", ");
}
QString Song::TextForFiletype(FileType type) {
switch (type) {
case Song::Type_Asf: return QObject::tr("Windows Media audio");
case Song::Type_Flac: return QObject::tr("Flac");
case Song::Type_Mp4: return QObject::tr("MP4 AAC");
case Song::Type_Mpc: return QObject::tr("MPC");
case Song::Type_Mpeg: return QObject::tr("MP3"); // Not technically correct
case Song::Type_OggFlac: return QObject::tr("Ogg Flac");
case Song::Type_OggSpeex: return QObject::tr("Ogg Speex");
case Song::Type_OggVorbis: return QObject::tr("Ogg Vorbis");
case Song::Type_Aiff: return QObject::tr("AIFF");
case Song::Type_Wav: return QObject::tr("Wav");
case Song::Type_TrueAudio: return QObject::tr("TrueAudio");
case Song::Type_Cdda: return QObject::tr("CDDA");
case Song::Type_Stream: return QObject::tr("Stream");
case Song::Type_Unknown:
default:
return QObject::tr("Unknown");
}
}
static TagLib::String QStringToTaglibString(const QString& s);
TagLibFileRefFactory Song::kDefaultFactory;
QMutex Song::sTaglibMutex;
QMutex Song::taglib_mutex_;
struct Song::Private : public QSharedData {
Private();
// This is here and not in Song itself so we don't have to include
// <xiphcomment.h> in the main header.
void ParseOggTag(const TagLib::Ogg::FieldListMap& map, const QTextCodec* codec,
QString* disc, QString* compilation);
bool valid_;
int id_;
QString title_;
QString album_;
QString artist_;
QString albumartist_;
QString composer_;
int track_;
int disc_;
float bpm_;
int year_;
QString genre_;
QString comment_;
bool compilation_; // From the file tag
bool sampler_; // From the library scanner
bool forced_compilation_on_; // Set by the user
bool forced_compilation_off_; // Set by the user
float rating_;
int playcount_;
int skipcount_;
int lastplayed_;
int score_;
// The beginning of the song in seconds. In case of single-part media
// streams, this will equal to 0. In case of multi-part streams on the
// other hand, this will mark the beginning of a section represented by
// this Song object. This is always greater than 0.
qint64 beginning_;
// The end of the song in seconds. In case of single-part media
// streams, this will equal to the song's length. In case of multi-part
// streams on the other hand, this will mark the end of a section
// represented by this Song object.
// This may be negative indicating that the length of this song is
// unknown.
qint64 end_;
int bitrate_;
int samplerate_;
int directory_id_;
QUrl url_;
QString basefilename_;
int mtime_;
int ctime_;
int filesize_;
FileType filetype_;
// If the song has a CUE, this contains it's path.
QString cue_path_;
// Filenames to album art for this song.
QString art_automatic_; // Guessed by LibraryWatcher
QString art_manual_; // Set by the user - should take priority
QImage image_;
// Whether this song was loaded from a file using taglib.
bool init_from_file_;
// Whether our encoding guesser thinks these tags might be incorrectly encoded.
bool suspicious_tags_;
// Whether the song does not exist on the file system anymore, but is still
// stored in the database so as to remember the user's metadata.
bool unavailable_;
};
Song::Private::Private()
@ -214,6 +279,130 @@ Song::Song(FileRefFactory* factory)
factory_(factory) {
}
Song::~Song() {
}
Song& Song::operator =(const Song& other) {
d = other.d;
factory_ = other.factory_;
return *this;
}
bool Song::is_valid() const { return d->valid_; }
bool Song::is_unavailable() const { return d->unavailable_; }
int Song::id() const { return d->id_; }
const QString& Song::title() const { return d->title_; }
const QString& Song::album() const { return d->album_; }
const QString& Song::artist() const { return d->artist_; }
const QString& Song::albumartist() const { return d->albumartist_; }
const QString& Song::effective_albumartist() const { return d->albumartist_.isEmpty() ? d->artist_ : d->albumartist_; }
const QString& Song::playlist_albumartist() const { return is_compilation() ? d->albumartist_ : effective_albumartist(); }
const QString& Song::composer() const { return d->composer_; }
int Song::track() const { return d->track_; }
int Song::disc() const { return d->disc_; }
float Song::bpm() const { return d->bpm_; }
int Song::year() const { return d->year_; }
const QString& Song::genre() const { return d->genre_; }
const QString& Song::comment() const { return d->comment_; }
bool Song::is_compilation() const {
return (d->compilation_ || d->sampler_ || d->forced_compilation_on_)
&& ! d->forced_compilation_off_;
}
float Song::rating() const { return d->rating_; }
int Song::playcount() const { return d->playcount_; }
int Song::skipcount() const { return d->skipcount_; }
int Song::lastplayed() const { return d->lastplayed_; }
int Song::score() const { return d->score_; }
const QString& Song::cue_path() const { return d->cue_path_; }
bool Song::has_cue() const { return !d->cue_path_.isEmpty(); }
qint64 Song::beginning_nanosec() const { return d->beginning_; }
qint64 Song::end_nanosec() const { return d->end_; }
qint64 Song::length_nanosec() const { return d->end_ - d->beginning_; }
int Song::bitrate() const { return d->bitrate_; }
int Song::samplerate() const { return d->samplerate_; }
int Song::directory_id() const { return d->directory_id_; }
const QUrl& Song::url() const { return d->url_; }
const QString& Song::basefilename() const { return d->basefilename_; }
uint Song::mtime() const { return d->mtime_; }
uint Song::ctime() const { return d->ctime_; }
int Song::filesize() const { return d->filesize_; }
Song::FileType Song::filetype() const { return d->filetype_; }
bool Song::is_stream() const { return d->filetype_ == Type_Stream; }
bool Song::is_cdda() const { return d->filetype_ == Type_Cdda; }
const QString& Song::art_automatic() const { return d->art_automatic_; }
const QString& Song::art_manual() const { return d->art_manual_; }
bool Song::has_manually_unset_cover() const { return d->art_manual_ == kManuallyUnsetCover; }
void Song::manually_unset_cover() { d->art_manual_ = kManuallyUnsetCover; }
bool Song::has_embedded_cover() const { return d->art_automatic_ == kEmbeddedCover; }
void Song::set_embedded_cover() { d->art_automatic_ = kEmbeddedCover; }
const QImage& Song::image() const { return d->image_; }
void Song::set_id(int id) { d->id_ = id; }
void Song::set_valid(bool v) { d->valid_ = v; }
void Song::set_title(const QString& v) { d->title_ = v; }
void Song::set_album(const QString& v) { d->album_ = v; }
void Song::set_artist(const QString& v) { d->artist_ = v; }
void Song::set_albumartist(const QString& v) { d->albumartist_ = v; }
void Song::set_composer(const QString& v) { d->composer_ = v; }
void Song::set_track(int v) { d->track_ = v; }
void Song::set_disc(int v) { d->disc_ = v; }
void Song::set_bpm(float v) { d->bpm_ = v; }
void Song::set_year(int v) { d->year_ = v; }
void Song::set_genre(const QString& v) { d->genre_ = v; }
void Song::set_comment(const QString& v) { d->comment_ = v; }
void Song::set_compilation(bool v) { d->compilation_ = v; }
void Song::set_sampler(bool v) { d->sampler_ = v; }
void Song::set_beginning_nanosec(qint64 v) { d->beginning_ = qMax(0ll, v); }
void Song::set_end_nanosec(qint64 v) { d->end_ = v; }
void Song::set_length_nanosec(qint64 v) { d->end_ = d->beginning_ + v; }
void Song::set_bitrate(int v) { d->bitrate_ = v; }
void Song::set_samplerate(int v) { d->samplerate_ = v; }
void Song::set_mtime(int v) { d->mtime_ = v; }
void Song::set_ctime(int v) { d->ctime_ = v; }
void Song::set_filesize(int v) { d->filesize_ = v; }
void Song::set_filetype(FileType v) { d->filetype_ = v; }
void Song::set_art_automatic(const QString& v) { d->art_automatic_ = v; }
void Song::set_art_manual(const QString& v) { d->art_manual_ = v; }
void Song::set_image(const QImage& i) { d->image_ = i; }
void Song::set_forced_compilation_on(bool v) { d->forced_compilation_on_ = v; }
void Song::set_forced_compilation_off(bool v) { d->forced_compilation_off_ = v; }
void Song::set_rating(float v) { d->rating_ = v; }
void Song::set_playcount(int v) { d->playcount_ = v; }
void Song::set_skipcount(int v) { d->skipcount_ = v; }
void Song::set_lastplayed(int v) { d->lastplayed_ = v; }
void Song::set_score(int v) { d->score_ = qBound(0, v, 100); }
void Song::set_cue_path(const QString& v) { d->cue_path_ = v; }
void Song::set_unavailable(bool v) { d->unavailable_ = v; }
void Song::set_url(const QUrl& v) { d->url_ = v; }
void Song::set_basefilename(const QString& v) { d->basefilename_ = v; }
void Song::set_directory_id(int v) { d->directory_id_ = v; }
QString Song::JoinSpec(const QString& table) {
return Prepend(table + ".", kColumns).join(", ");
}
QString Song::TextForFiletype(FileType type) {
switch (type) {
case Song::Type_Asf: return QObject::tr("Windows Media audio");
case Song::Type_Flac: return QObject::tr("Flac");
case Song::Type_Mp4: return QObject::tr("MP4 AAC");
case Song::Type_Mpc: return QObject::tr("MPC");
case Song::Type_Mpeg: return QObject::tr("MP3"); // Not technically correct
case Song::Type_OggFlac: return QObject::tr("Ogg Flac");
case Song::Type_OggSpeex: return QObject::tr("Ogg Speex");
case Song::Type_OggVorbis: return QObject::tr("Ogg Vorbis");
case Song::Type_Aiff: return QObject::tr("AIFF");
case Song::Type_Wav: return QObject::tr("Wav");
case Song::Type_TrueAudio: return QObject::tr("TrueAudio");
case Song::Type_Cdda: return QObject::tr("CDDA");
case Song::Type_Stream: return QObject::tr("Stream");
case Song::Type_Unknown:
default:
return QObject::tr("Unknown");
}
}
void Song::Init(const QString& title, const QString& artist,
const QString& album, qint64 length_nanosec) {
d->valid_ = true;
@ -264,7 +453,7 @@ bool Song::HasProperMediaFile() const {
qLog(Warning) << "HasProperMediaFile() on GUI thread!";
#endif
QMutexLocker l(&taglib_mutex_);
QMutexLocker l(&sTaglibMutex);
scoped_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(d->url_.toLocalFile()));
return !fileref->isNull() && fileref->tag();
@ -284,7 +473,7 @@ void Song::InitFromFile(const QString& filename, int directory_id) {
QFileInfo info(filename);
d->basefilename_ = info.fileName();
QMutexLocker l(&taglib_mutex_);
QMutexLocker l(&sTaglibMutex);
scoped_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
if(fileref->isNull()) {
@ -371,12 +560,12 @@ void Song::InitFromFile(const QString& filename, int directory_id) {
}
} else if (TagLib::Ogg::Vorbis::File* file = dynamic_cast<TagLib::Ogg::Vorbis::File*>(fileref->file())) {
if (file->tag()) {
ParseOggTag(file->tag()->fieldListMap(), NULL, &disc, &compilation);
d->ParseOggTag(file->tag()->fieldListMap(), NULL, &disc, &compilation);
}
d->comment_ = Decode(tag->comment());
} else if (TagLib::FLAC::File* file = dynamic_cast<TagLib::FLAC::File*>(fileref->file())) {
if ( file->xiphComment() ) {
ParseOggTag(file->xiphComment()->fieldListMap(), NULL, &disc, &compilation);
d->ParseOggTag(file->xiphComment()->fieldListMap(), NULL, &disc, &compilation);
#ifdef TAGLIB_HAS_FLAC_PICTURELIST
if (!file->pictureList().isEmpty()) {
set_embedded_cover();
@ -475,19 +664,20 @@ void Song::ParseFMPSFrame(const QString& name, const QString& value) {
}
}
void Song::ParseOggTag(const TagLib::Ogg::FieldListMap& map, const QTextCodec* codec,
QString* disc, QString* compilation) {
void Song::Private::ParseOggTag(const TagLib::Ogg::FieldListMap& map,
const QTextCodec* codec,
QString* disc, QString* compilation) {
if (!map["COMPOSER"].isEmpty())
d->composer_ = Decode(map["COMPOSER"].front(), codec);
composer_ = Decode(map["COMPOSER"].front(), codec);
if (!map["ALBUMARTIST"].isEmpty()) {
d->albumartist_ = Decode(map["ALBUMARTIST"].front(), codec);
albumartist_ = Decode(map["ALBUMARTIST"].front(), codec);
} else if (!map["ALBUM ARTIST"].isEmpty()) {
d->albumartist_ = Decode(map["ALBUM ARTIST"].front(), codec);
albumartist_ = Decode(map["ALBUM ARTIST"].front(), codec);
}
if (!map["BPM"].isEmpty() )
d->bpm_ = TStringToQString( map["BPM"].front() ).trimmed().toFloat();
bpm_ = TStringToQString( map["BPM"].front() ).trimmed().toFloat();
if (!map["DISCNUMBER"].isEmpty() )
*disc = TStringToQString( map["DISCNUMBER"].front() ).trimmed();
@ -496,7 +686,7 @@ void Song::ParseOggTag(const TagLib::Ogg::FieldListMap& map, const QTextCodec* c
*compilation = TStringToQString( map["COMPILATION"].front() ).trimmed();
if (!map["COVERART"].isEmpty())
set_embedded_cover();
art_automatic_ = kEmbeddedCover;
}
void Song::GuessFileType(TagLib::FileRef* fileref) {
@ -1194,10 +1384,6 @@ void Song::SetTextFrame(const QString& id, const QString& value,
tag->addFrame(frame);
}
TagLib::String QStringToTaglibString(const QString& s) {
return TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8);
}
bool Song::IsEditable() const {
return d->valid_ && !d->url_.isEmpty() && !is_stream() &&
d->filetype_ != Type_Unknown && !has_cue();
@ -1208,7 +1394,7 @@ bool Song::Save() const {
if (filename.isNull())
return false;
QMutexLocker l(&taglib_mutex_);
QMutexLocker l(&sTaglibMutex);
scoped_ptr<TagLib::FileRef> fileref(factory_->GetFileRef(filename));
if (!fileref || fileref->isNull()) // The file probably doesn't exist
@ -1282,7 +1468,7 @@ QImage Song::LoadEmbeddedArt(const QString& filename) {
if (filename.isEmpty())
return ret;
QMutexLocker l(&taglib_mutex_);
QMutexLocker l(&sTaglibMutex);
#ifdef Q_OS_WIN32
TagLib::FileRef ref(filename.toStdWString().c_str());

View File

@ -20,48 +20,28 @@
#include <QFuture>
#include <QImage>
#include <QList>
#include <QMetaType>
#include <QSharedData>
#include <QSharedDataPointer>
#include <QSqlQuery>
#include <QString>
#include <QUrl>
#include <QVariantMap>
#include <xiphcomment.h>
#include "config.h"
#include "timeconstants.h"
#include "engines/engine_fwd.h"
class QSqlQuery;
class QUrl;
#ifdef HAVE_LIBGPOD
# include <gpod/itdb.h>
struct _Itdb_Track;
#endif
#ifdef HAVE_LIBMTP
# include <libmtp.h>
struct LIBMTP_track_struct;
#endif
#ifdef Q_OS_WIN32
struct IWMDMMetaData;
struct IWMDMMetaData;
#endif
// Taglib pulls in some windows headers that #define all sorts of nasties.
// Undef those here.
#ifdef RemoveDirectory
# undef RemoveDirectory
#endif
#ifdef AddJob
# undef AddJob
#endif
#ifdef LoadIcon
# undef LoadIcon
#endif
class SqlRow;
#ifdef HAVE_LIBLASTFM
namespace lastfm {
class Track;
@ -77,6 +57,8 @@ namespace TagLib {
}
}
class SqlRow;
class FileRefFactory {
public:
@ -95,6 +77,7 @@ class Song {
Song();
Song(const Song& other);
Song(FileRefFactory* factory);
~Song();
static const QStringList kColumns;
static const QString kColumnSpec;
@ -153,13 +136,13 @@ class Song {
void MergeFromSimpleMetaBundle(const Engine::SimpleMetaBundle& bundle);
#ifdef HAVE_LIBGPOD
void InitFromItdb(const Itdb_Track* track, const QString& prefix);
void ToItdb(Itdb_Track* track) const;
void InitFromItdb(const _Itdb_Track* track, const QString& prefix);
void ToItdb(_Itdb_Track* track) const;
#endif
#ifdef HAVE_LIBMTP
void InitFromMTP(const LIBMTP_track_t* track, const QString& host);
void ToMTP(LIBMTP_track_t* track) const;
void InitFromMTP(const LIBMTP_track_struct* track, const QString& host);
void ToMTP(LIBMTP_track_struct* track) const;
#endif
#ifdef Q_OS_WIN32
@ -179,72 +162,69 @@ class Song {
void ToXesam(QVariantMap* map) const;
// Simple accessors
bool is_valid() const { return d->valid_; }
bool is_unavailable() const { return d->unavailable_; }
int id() const { return d->id_; }
bool is_valid() const;
bool is_unavailable() const;
int id() const;
const QString& title() const { return d->title_; }
const QString& album() const { return d->album_; }
const QString& artist() const { return d->artist_; }
const QString& albumartist() const { return d->albumartist_; }
const QString& effective_albumartist() const { return d->albumartist_.isEmpty() ? d->artist_ : d->albumartist_; }
const QString& title() const;
const QString& album() const;
const QString& artist() const;
const QString& albumartist() const;
const QString& effective_albumartist() const;
// Playlist views are special because you don't want to fill in album artists automatically for
// compilations, but you do for normal albums:
const QString& playlist_albumartist() const { return is_compilation() ? d->albumartist_ : effective_albumartist(); }
const QString& composer() const { return d->composer_; }
int track() const { return d->track_; }
int disc() const { return d->disc_; }
float bpm() const { return d->bpm_; }
int year() const { return d->year_; }
const QString& genre() const { return d->genre_; }
const QString& comment() const { return d->comment_; }
bool is_compilation() const {
return (d->compilation_ || d->sampler_ || d->forced_compilation_on_)
&& ! d->forced_compilation_off_;
}
float rating() const { return d->rating_; }
int playcount() const { return d->playcount_; }
int skipcount() const { return d->skipcount_; }
int lastplayed() const { return d->lastplayed_; }
int score() const { return d->score_; }
const QString& playlist_albumartist() const;
const QString& composer() const;
int track() const;
int disc() const;
float bpm() const;
int year() const;
const QString& genre() const;
const QString& comment() const;
bool is_compilation() const;
float rating() const;
int playcount() const;
int skipcount() const;
int lastplayed() const;
int score() const;
const QString& cue_path() const { return d->cue_path_; }
bool has_cue() const { return !d->cue_path_.isEmpty(); }
const QString& cue_path() const;
bool has_cue() const;
qint64 beginning_nanosec() const { return d->beginning_; }
qint64 end_nanosec() const { return d->end_; }
qint64 beginning_nanosec() const;
qint64 end_nanosec() const;
qint64 length_nanosec() const { return d->end_ - d->beginning_; }
qint64 length_nanosec() const;
int bitrate() const { return d->bitrate_; }
int samplerate() const { return d->samplerate_; }
int bitrate() const;
int samplerate() const;
int directory_id() const { return d->directory_id_; }
const QUrl& url() const { return d->url_; }
const QString& basefilename() const { return d->basefilename_; }
uint mtime() const { return d->mtime_; }
uint ctime() const { return d->ctime_; }
int filesize() const { return d->filesize_; }
FileType filetype() const { return d->filetype_; }
bool is_stream() const { return d->filetype_ == Type_Stream; }
bool is_cdda() const { return d->filetype_ == Type_Cdda; }
int directory_id() const;
const QUrl& url() const;
const QString& basefilename() const;
uint mtime() const;
uint ctime() const;
int filesize() const;
FileType filetype() const;
bool is_stream() const;
bool is_cdda() const;
const QString& art_automatic() const { return d->art_automatic_; }
const QString& art_manual() const { return d->art_manual_; }
const QString& art_automatic() const;
const QString& art_manual() const;
// Returns true if this Song had it's cover manually unset by user.
bool has_manually_unset_cover() const { return d->art_manual_ == kManuallyUnsetCover; }
bool has_manually_unset_cover() const;
// This method represents an explicit request to unset this song's
// cover.
void manually_unset_cover() { d->art_manual_ = kManuallyUnsetCover; }
void manually_unset_cover();
// Returns true if this song (it's media file) has an embedded cover.
bool has_embedded_cover() const { return d->art_automatic_ == kEmbeddedCover; }
bool has_embedded_cover() const;
// Sets a flag saying that this song (it's media file) has an embedded
// cover.
void set_embedded_cover() { d->art_automatic_ = kEmbeddedCover; }
void set_embedded_cover();
const QImage& image() const { return d->image_; }
const QImage& image() const;
// Pretty accessors
QString PrettyTitle() const;
@ -259,49 +239,49 @@ class Song {
bool Save() const;
QFuture<bool> BackgroundSave() const;
void set_id(int id) { d->id_ = id; }
void set_valid(bool v) { d->valid_ = v; }
void set_title(const QString& v) { d->title_ = v; }
void set_id(int id);
void set_valid(bool v);
void set_title(const QString& v);
void set_album(const QString& v) { d->album_ = v; }
void set_artist(const QString& v) { d->artist_ = v; }
void set_albumartist(const QString& v) { d->albumartist_ = v; }
void set_composer(const QString& v) { d->composer_ = v; }
void set_track(int v) { d->track_ = v; }
void set_disc(int v) { d->disc_ = v; }
void set_bpm(float v) { d->bpm_ = v; }
void set_year(int v) { d->year_ = v; }
void set_genre(const QString& v) { d->genre_ = v; }
void set_album(const QString& v);
void set_artist(const QString& v);
void set_albumartist(const QString& v);
void set_composer(const QString& v);
void set_track(int v);
void set_disc(int v);
void set_bpm(float v);
void set_year(int v);
void set_genre(const QString& v);
void set_genre_id3(int id);
void set_comment(const QString& v) { d->comment_ = v; }
void set_compilation(bool v) { d->compilation_ = v; }
void set_sampler(bool v) { d->sampler_ = v; }
void set_beginning_nanosec(qint64 v) { d->beginning_ = qMax(0ll, v); }
void set_end_nanosec(qint64 v) { d->end_ = v; }
void set_length_nanosec(qint64 v) { d->end_ = d->beginning_ + v; }
void set_bitrate(int v) { d->bitrate_ = v; }
void set_samplerate(int v) { d->samplerate_ = v; }
void set_mtime(int v) { d->mtime_ = v; }
void set_ctime(int v) { d->ctime_ = v; }
void set_filesize(int v) { d->filesize_ = v; }
void set_filetype(FileType v) { d->filetype_ = v; }
void set_art_automatic(const QString& v) { d->art_automatic_ = v; }
void set_art_manual(const QString& v) { d->art_manual_ = v; }
void set_image(const QImage& i) { d->image_ = i; }
void set_forced_compilation_on(bool v) { d->forced_compilation_on_ = v; }
void set_forced_compilation_off(bool v) { d->forced_compilation_off_ = v; }
void set_rating(float v) { d->rating_ = v; }
void set_playcount(int v) { d->playcount_ = v; }
void set_skipcount(int v) { d->skipcount_ = v; }
void set_lastplayed(int v) { d->lastplayed_ = v; }
void set_score(int v) { d->score_ = qBound(0, v, 100); }
void set_cue_path(const QString& v) { d->cue_path_ = v; }
void set_unavailable(bool v) { d->unavailable_ = v; }
void set_comment(const QString& v);
void set_compilation(bool v);
void set_sampler(bool v);
void set_beginning_nanosec(qint64 v);
void set_end_nanosec(qint64 v);
void set_length_nanosec(qint64 v);
void set_bitrate(int v);
void set_samplerate(int v);
void set_mtime(int v);
void set_ctime(int v);
void set_filesize(int v);
void set_filetype(FileType v);
void set_art_automatic(const QString& v);
void set_art_manual(const QString& v);
void set_image(const QImage& i);
void set_forced_compilation_on(bool v);
void set_forced_compilation_off(bool v);
void set_rating(float v);
void set_playcount(int v);
void set_skipcount(int v);
void set_lastplayed(int v);
void set_score(int v);
void set_cue_path(const QString& v);
void set_unavailable(bool v);
// Setters that should only be used by tests
void set_url(const QUrl& v) { d->url_ = v; }
void set_basefilename(const QString& v) { d->basefilename_ = v; }
void set_directory_id(int v) { d->directory_id_ = v; }
void set_url(const QUrl& v);
void set_basefilename(const QString& v);
void set_directory_id(int v);
// Comparison functions
bool IsMetadataEqual(const Song& other) const;
@ -314,6 +294,8 @@ class Song {
// you need to hash the key to do fast lookups.
QString AlbumKey() const;
Song& operator=(const Song& other);
private:
void GuessFileType(TagLib::FileRef* fileref);
static bool Save(const Song& song);
@ -324,86 +306,14 @@ class Song {
void ParseFMPSFrame(const QString& name, const QString& value);
private:
struct Private : public QSharedData {
Private();
bool valid_;
int id_;
QString title_;
QString album_;
QString artist_;
QString albumartist_;
QString composer_;
int track_;
int disc_;
float bpm_;
int year_;
QString genre_;
QString comment_;
bool compilation_; // From the file tag
bool sampler_; // From the library scanner
bool forced_compilation_on_; // Set by the user
bool forced_compilation_off_; // Set by the user
float rating_;
int playcount_;
int skipcount_;
int lastplayed_;
int score_;
// The beginning of the song in seconds. In case of single-part media
// streams, this will equal to 0. In case of multi-part streams on the
// other hand, this will mark the beginning of a section represented by
// this Song object. This is always greater than 0.
qint64 beginning_;
// The end of the song in seconds. In case of single-part media
// streams, this will equal to the song's length. In case of multi-part
// streams on the other hand, this will mark the end of a section
// represented by this Song object.
// This may be negative indicating that the length of this song is
// unknown.
qint64 end_;
int bitrate_;
int samplerate_;
int directory_id_;
QUrl url_;
QString basefilename_;
int mtime_;
int ctime_;
int filesize_;
FileType filetype_;
// If the song has a CUE, this contains it's path.
QString cue_path_;
// Filenames to album art for this song.
QString art_automatic_; // Guessed by LibraryWatcher
QString art_manual_; // Set by the user - should take priority
QImage image_;
// Whether this song was loaded from a file using taglib.
bool init_from_file_;
// Whether our encoding guesser thinks these tags might be incorrectly encoded.
bool suspicious_tags_;
// Whether the song does not exist on the file system anymore, but is still
// stored in the database so as to remember the user's metadata.
bool unavailable_;
};
void ParseOggTag(const TagLib::Ogg::FieldListMap& map, const QTextCodec* codec, QString* disc, QString* compilation);
private:
struct Private;
QSharedDataPointer<Private> d;
FileRefFactory* factory_;
static TagLibFileRefFactory kDefaultFactory;
static QMutex taglib_mutex_;
static QMutex sTaglibMutex;
};
Q_DECLARE_METATYPE(Song);

View File

@ -19,6 +19,7 @@
#include "songloader.h"
#include "core/logging.h"
#include "core/song.h"
#include "core/timeconstants.h"
#include "library/librarybackend.h"
#include "library/sqlrow.h"
#include "playlistparsers/parserbase.h"

View File

@ -21,10 +21,11 @@
#include "core/backgroundthread.h"
#include "core/song.h"
#include <QObject>
#include <QImage>
#include <QMutex>
#include <QObject>
#include <QQueue>
#include <QUrl>
class NetworkAccessManager;
class QNetworkReply;

View File

@ -20,6 +20,7 @@
#include <QDir>
#include <QTemporaryFile>
#include <QUrl>
ArtLoader::ArtLoader(QObject* parent)
: QObject(parent),

View File

@ -15,10 +15,10 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QMutexLocker>
#include "core/logging.h"
#include "core/timeconstants.h"
#include "library/librarybackend.h"
#include "library/librarymodel.h"

View File

@ -21,6 +21,7 @@
#include <plist/plist.h>
#include <QCoreApplication>
#include <QUrl>
#include <QtDebug>
iMobileDeviceConnection::iMobileDeviceConnection(const QString& uuid)

View File

@ -25,6 +25,8 @@
#include <boost/scoped_ptr.hpp>
struct LIBMTP_mtpdevice_struct;
class MtpConnection;
class MtpLoader;
@ -57,9 +59,9 @@ private slots:
void LoadFinished();
private:
bool GetSupportedFiletypes(QList<Song::FileType>* ret, LIBMTP_mtpdevice_t* device);
int GetFreeSpace(LIBMTP_mtpdevice_t* device);
int GetCapacity(LIBMTP_mtpdevice_t* device);
bool GetSupportedFiletypes(QList<Song::FileType>* ret, LIBMTP_mtpdevice_struct* device);
int GetFreeSpace(LIBMTP_mtpdevice_struct* device);
int GetCapacity(LIBMTP_mtpdevice_struct* device);
private:
static bool sInitialisedLibMTP;

View File

@ -20,6 +20,7 @@
#include "ui/iconloader.h"
#include <QIcon>
#include <QUrl>
const char* UrlSearchProvider::kUrlRegex = "^[a-zA-Z][a-zA-Z0-9+-.]*://";

View File

@ -26,6 +26,7 @@
#include "core/network.h"
#include "core/scopedtransaction.h"
#include "core/taskmanager.h"
#include "core/timeconstants.h"
#include "globalsearch/globalsearch.h"
#include "globalsearch/librarysearchprovider.h"
#include "library/librarybackend.h"

View File

@ -26,6 +26,7 @@
#include "core/player.h"
#include "core/song.h"
#include "core/taskmanager.h"
#include "core/timeconstants.h"
#include "globalsearch/globalsearch.h"
#include "globalsearch/librarysearchprovider.h"
#include "library/librarymodel.h"

View File

@ -8,6 +8,7 @@
#include "core/logging.h"
#include "core/player.h"
#include "core/taskmanager.h"
#include "core/timeconstants.h"
#include "core/utilities.h"
#include "globalsearch/globalsearch.h"
#include "globalsearch/spotifysearchprovider.h"

View File

@ -20,6 +20,7 @@
#include <QObject>
#include <QSet>
#include <QUrl>
#include "directory.h"
#include "libraryquery.h"

View File

@ -19,9 +19,11 @@
#include "musicbrainzclient.h"
#include "musicdnsclient.h"
#include "tagfetcher.h"
#include "core/timeconstants.h"
#include <QFuture>
#include <QFutureWatcher>
#include <QUrl>
#include <QtConcurrentMap>
TagFetcher::TagFetcher(QObject* parent)

View File

@ -27,6 +27,7 @@
#include "songplaylistitem.h"
#include "core/logging.h"
#include "core/modelfuturewatcher.h"
#include "core/timeconstants.h"
#include "internet/jamendoplaylistitem.h"
#include "internet/jamendoservice.h"
#include "internet/magnatuneplaylistitem.h"

View File

@ -27,7 +27,7 @@
#include "library/library.h"
#include "library/libraryplaylistitem.h"
#include <QSqlQuery>
#include <QtConcurrentRun>
#include <QtDebug>

View File

@ -17,6 +17,7 @@
#include "cueparser.h"
#include "core/logging.h"
#include "core/timeconstants.h"
#include <QBuffer>
#include <QDateTime>

View File

@ -17,6 +17,7 @@
#include "m3uparser.h"
#include "core/logging.h"
#include "core/timeconstants.h"
#include <QBuffer>
#include <QtDebug>

View File

@ -17,6 +17,7 @@
#include "plsparser.h"
#include "core/logging.h"
#include "core/timeconstants.h"
#include <QTextStream>
#include <QtDebug>

View File

@ -16,6 +16,7 @@
*/
#include "xspfparser.h"
#include "core/timeconstants.h"
#include <QDomDocument>
#include <QFile>

View File

@ -279,7 +279,7 @@ msgstr ""
msgid "AAC 64k"
msgstr ""
#: core/song.cpp:140
#: core/song.cpp:393
msgid "AIFF"
msgstr ""
@ -486,7 +486,7 @@ msgstr ""
msgid "After copying..."
msgstr ""
#: playlist/playlist.cpp:1103 ui/organisedialog.cpp:52
#: playlist/playlist.cpp:1104 ui/organisedialog.cpp:52
#: ui/qtsystemtrayicon.cpp:252 ../bin/src/ui_groupbydialog.h:129
#: ../bin/src/ui_groupbydialog.h:142 ../bin/src/ui_groupbydialog.h:155
#: ../bin/src/ui_albumcoversearcher.h:110
@ -499,12 +499,12 @@ msgstr ""
msgid "Album (ideal loudness for all tracks)"
msgstr ""
#: playlist/playlist.cpp:1109 ui/organisedialog.cpp:55
#: playlist/playlist.cpp:1110 ui/organisedialog.cpp:55
#: ../bin/src/ui_edittagdialog.h:658
msgid "Album artist"
msgstr ""
#: internet/jamendoservice.cpp:410
#: internet/jamendoservice.cpp:411
msgid "Album info on jamendo.com..."
msgstr ""
@ -641,7 +641,7 @@ msgstr ""
msgid "Are you sure you want to reset this song's statistics?"
msgstr ""
#: playlist/playlist.cpp:1102 ui/organisedialog.cpp:53
#: playlist/playlist.cpp:1103 ui/organisedialog.cpp:53
#: ui/qtsystemtrayicon.cpp:250 ../bin/src/ui_groupbydialog.h:130
#: ../bin/src/ui_groupbydialog.h:143 ../bin/src/ui_groupbydialog.h:156
#: ../bin/src/ui_albumcoversearcher.h:106
@ -709,7 +709,7 @@ msgstr ""
msgid "Average image size"
msgstr ""
#: playlist/playlist.cpp:1118 ui/organisedialog.cpp:59
#: playlist/playlist.cpp:1119 ui/organisedialog.cpp:59
#: ../bin/src/ui_edittagdialog.h:638
msgid "BPM"
msgstr ""
@ -755,7 +755,7 @@ msgstr ""
msgid "Biography from %1"
msgstr ""
#: playlist/playlist.cpp:1119 ../bin/src/ui_edittagdialog.h:640
#: playlist/playlist.cpp:1120 ../bin/src/ui_edittagdialog.h:640
msgid "Bit rate"
msgstr ""
@ -798,7 +798,7 @@ msgstr ""
msgid "Buttons"
msgstr ""
#: core/song.cpp:143
#: core/song.cpp:396
msgid "CDDA"
msgstr ""
@ -973,7 +973,7 @@ msgstr ""
msgid "Comma separated list of class:level, level is 0-3"
msgstr ""
#: playlist/playlist.cpp:1128 smartplaylists/searchterm.cpp:279
#: playlist/playlist.cpp:1129 smartplaylists/searchterm.cpp:279
#: ui/organisedialog.cpp:62 ../bin/src/ui_edittagdialog.h:661
msgid "Comment"
msgstr ""
@ -986,7 +986,7 @@ msgstr ""
msgid "Complete tags automatically..."
msgstr ""
#: playlist/playlist.cpp:1110 ui/organisedialog.cpp:56
#: playlist/playlist.cpp:1111 ui/organisedialog.cpp:56
#: ../bin/src/ui_groupbydialog.h:132 ../bin/src/ui_groupbydialog.h:145
#: ../bin/src/ui_groupbydialog.h:158 ../bin/src/ui_edittagdialog.h:659
msgid "Composer"
@ -1000,7 +1000,7 @@ msgstr ""
msgid "Configure Last.fm..."
msgstr ""
#: internet/magnatuneservice.cpp:273
#: internet/magnatuneservice.cpp:274
msgid "Configure Magnatune..."
msgstr ""
@ -1008,7 +1008,7 @@ msgstr ""
msgid "Configure Shortcuts"
msgstr ""
#: internet/spotifyservice.cpp:490
#: internet/spotifyservice.cpp:491
msgid "Configure Spotify..."
msgstr ""
@ -1029,7 +1029,7 @@ msgstr ""
msgid "Connect device"
msgstr ""
#: internet/spotifyservice.cpp:245
#: internet/spotifyservice.cpp:246
msgid "Connecting to Spotify"
msgstr ""
@ -1233,11 +1233,11 @@ msgstr ""
msgid "Dance"
msgstr ""
#: playlist/playlist.cpp:1126 ../bin/src/ui_edittagdialog.h:649
#: playlist/playlist.cpp:1127 ../bin/src/ui_edittagdialog.h:649
msgid "Date created"
msgstr ""
#: playlist/playlist.cpp:1125 ../bin/src/ui_edittagdialog.h:648
#: playlist/playlist.cpp:1126 ../bin/src/ui_edittagdialog.h:648
msgid "Date modified"
msgstr ""
@ -1295,7 +1295,7 @@ msgstr ""
msgid "Delete the original files"
msgstr ""
#: core/deletefiles.cpp:49
#: core/deletefiles.cpp:50
msgid "Deleting files"
msgstr ""
@ -1372,7 +1372,7 @@ msgstr ""
msgid "Disabled"
msgstr ""
#: playlist/playlist.cpp:1106 ui/organisedialog.cpp:58
#: playlist/playlist.cpp:1107 ui/organisedialog.cpp:58
#: ../bin/src/ui_edittagdialog.h:655
msgid "Disc"
msgstr ""
@ -1434,11 +1434,11 @@ msgstr ""
msgid "Download membership"
msgstr ""
#: internet/magnatuneservice.cpp:269
#: internet/magnatuneservice.cpp:270
msgid "Download this album"
msgstr ""
#: internet/jamendoservice.cpp:412
#: internet/jamendoservice.cpp:413
msgid "Download this album..."
msgstr ""
@ -1450,11 +1450,11 @@ msgstr ""
msgid "Downloading Icecast directory"
msgstr ""
#: internet/jamendoservice.cpp:182
#: internet/jamendoservice.cpp:183
msgid "Downloading Jamendo catalogue"
msgstr ""
#: internet/magnatuneservice.cpp:154
#: internet/magnatuneservice.cpp:155
msgid "Downloading Magnatune catalogue"
msgstr ""
@ -1462,7 +1462,7 @@ msgstr ""
msgid "Downloading Spotify plugin"
msgstr ""
#: musicbrainz/tagfetcher.cpp:99
#: musicbrainz/tagfetcher.cpp:101
msgid "Downloading metadata"
msgstr ""
@ -1478,7 +1478,7 @@ msgstr ""
msgid "Dynamic mode is on"
msgstr ""
#: internet/jamendoservice.cpp:110 library/library.cpp:88
#: internet/jamendoservice.cpp:111 library/library.cpp:88
msgid "Dynamic random mix"
msgstr ""
@ -1602,11 +1602,11 @@ msgstr ""
msgid "Error connecting MTP device"
msgstr ""
#: ui/organiseerrordialog.cpp:53
#: ui/organiseerrordialog.cpp:55
msgid "Error copying songs"
msgstr ""
#: ui/organiseerrordialog.cpp:58
#: ui/organiseerrordialog.cpp:60
msgid "Error deleting songs"
msgstr ""
@ -1729,19 +1729,19 @@ msgstr ""
msgid "File formats"
msgstr ""
#: playlist/playlist.cpp:1121 ../bin/src/ui_edittagdialog.h:650
#: playlist/playlist.cpp:1122 ../bin/src/ui_edittagdialog.h:650
msgid "File name"
msgstr ""
#: playlist/playlist.cpp:1122
#: playlist/playlist.cpp:1123
msgid "File name (without path)"
msgstr ""
#: playlist/playlist.cpp:1123 ../bin/src/ui_edittagdialog.h:644
#: playlist/playlist.cpp:1124 ../bin/src/ui_edittagdialog.h:644
msgid "File size"
msgstr ""
#: playlist/playlist.cpp:1124 ../bin/src/ui_groupbydialog.h:133
#: playlist/playlist.cpp:1125 ../bin/src/ui_groupbydialog.h:133
#: ../bin/src/ui_groupbydialog.h:146 ../bin/src/ui_groupbydialog.h:159
#: ../bin/src/ui_edittagdialog.h:646
msgid "File type"
@ -1775,7 +1775,7 @@ msgstr ""
msgid "Find songs in your library that match the criteria you specify."
msgstr ""
#: musicbrainz/tagfetcher.cpp:52
#: musicbrainz/tagfetcher.cpp:54
msgid "Fingerprinting song"
msgstr ""
@ -1787,7 +1787,7 @@ msgstr ""
msgid "First level"
msgstr ""
#: core/song.cpp:133
#: core/song.cpp:386
msgid "Flac"
msgstr ""
@ -1874,7 +1874,7 @@ msgstr ""
msgid "General settings"
msgstr ""
#: playlist/playlist.cpp:1108 ui/organisedialog.cpp:61
#: playlist/playlist.cpp:1109 ui/organisedialog.cpp:61
#: ../bin/src/ui_groupbydialog.h:134 ../bin/src/ui_groupbydialog.h:147
#: ../bin/src/ui_groupbydialog.h:160 ../bin/src/ui_edittagdialog.h:660
msgid "Genre"
@ -2023,7 +2023,7 @@ msgstr ""
msgid "Icons on top"
msgstr ""
#: musicbrainz/tagfetcher.cpp:83
#: musicbrainz/tagfetcher.cpp:85
msgid "Identifying song"
msgstr ""
@ -2057,7 +2057,7 @@ msgid ""
"time a song finishes."
msgstr ""
#: internet/spotifyservice.cpp:346
#: internet/spotifyservice.cpp:347
msgid "Inbox"
msgstr ""
@ -2133,27 +2133,27 @@ msgstr ""
msgid "Invalid username and/or password"
msgstr ""
#: internet/jamendoservice.cpp:123
#: internet/jamendoservice.cpp:124
msgid "Jamendo"
msgstr ""
#: internet/jamendoservice.cpp:106
#: internet/jamendoservice.cpp:107
msgid "Jamendo Most Listened Tracks"
msgstr ""
#: internet/jamendoservice.cpp:104
#: internet/jamendoservice.cpp:105
msgid "Jamendo Top Tracks"
msgstr ""
#: internet/jamendoservice.cpp:100
#: internet/jamendoservice.cpp:101
msgid "Jamendo Top Tracks of the Month"
msgstr ""
#: internet/jamendoservice.cpp:102
#: internet/jamendoservice.cpp:103
msgid "Jamendo Top Tracks of the Week"
msgstr ""
#: internet/jamendoservice.cpp:166
#: internet/jamendoservice.cpp:167
msgid "Jamendo database"
msgstr ""
@ -2205,7 +2205,7 @@ msgstr ""
msgid "Large sidebar"
msgstr ""
#: library/library.cpp:66 playlist/playlist.cpp:1115
#: library/library.cpp:66 playlist/playlist.cpp:1116
#: ../bin/src/ui_edittagdialog.h:641
msgid "Last played"
msgstr ""
@ -2284,7 +2284,7 @@ msgstr ""
msgid "Leave blank for the default. Examples: \"/dev/dsp\", \"front\", etc."
msgstr ""
#: playlist/playlist.cpp:1104 ui/organisedialog.cpp:63
#: playlist/playlist.cpp:1105 ui/organisedialog.cpp:63
#: ui/qtsystemtrayicon.cpp:255 ../bin/src/ui_edittagdialog.h:636
msgid "Length"
msgstr ""
@ -2430,7 +2430,7 @@ msgstr ""
msgid "Lyrics from %1"
msgstr ""
#: core/song.cpp:136 ../bin/src/ui_transcodersettingspage.h:159
#: core/song.cpp:389 ../bin/src/ui_transcodersettingspage.h:159
msgid "MP3"
msgstr ""
@ -2442,15 +2442,15 @@ msgstr ""
msgid "MP3 96k"
msgstr ""
#: core/song.cpp:134
#: core/song.cpp:387
msgid "MP4 AAC"
msgstr ""
#: core/song.cpp:135
#: core/song.cpp:388
msgid "MPC"
msgstr ""
#: internet/magnatuneservice.cpp:99 ../bin/src/ui_magnatunesettingspage.h:154
#: internet/magnatuneservice.cpp:100 ../bin/src/ui_magnatunesettingspage.h:154
msgid "Magnatune"
msgstr ""
@ -2466,7 +2466,7 @@ msgstr ""
msgid "Main profile (MAIN)"
msgstr ""
#: internet/spotifyservice.cpp:495
#: internet/spotifyservice.cpp:496
msgid "Make playlist available offline"
msgstr ""
@ -2663,7 +2663,7 @@ msgstr ""
msgid "Newest tracks"
msgstr ""
#: ui/edittagdialog.cpp:158 ui/trackselectiondialog.cpp:47
#: ui/edittagdialog.cpp:158 ui/trackselectiondialog.cpp:48
msgid "Next"
msgstr ""
@ -2754,15 +2754,15 @@ msgstr ""
msgid "OSD Preview"
msgstr ""
#: core/song.cpp:137
#: core/song.cpp:390
msgid "Ogg Flac"
msgstr ""
#: core/song.cpp:138
#: core/song.cpp:391
msgid "Ogg Speex"
msgstr ""
#: core/song.cpp:139 ../bin/src/ui_magnatunedownloaddialog.h:139
#: core/song.cpp:392 ../bin/src/ui_magnatunedownloaddialog.h:139
#: ../bin/src/ui_magnatunesettingspage.h:170
msgid "Ogg Vorbis"
msgstr ""
@ -2773,7 +2773,7 @@ msgstr ""
#: internet/digitallyimportedservicebase.cpp:178
#: internet/groovesharkservice.cpp:503 internet/icecastservice.cpp:300
#: internet/jamendoservice.cpp:414 internet/magnatuneservice.cpp:271
#: internet/jamendoservice.cpp:415 internet/magnatuneservice.cpp:272
#: internet/somafmservice.cpp:84
#, qt-format
msgid "Open %1 in browser"
@ -2826,11 +2826,11 @@ msgstr ""
msgid "Organise files..."
msgstr ""
#: core/organise.cpp:63
#: core/organise.cpp:64
msgid "Organising files"
msgstr ""
#: ui/trackselectiondialog.cpp:164
#: ui/trackselectiondialog.cpp:165
msgid "Original tags"
msgstr ""
@ -2854,7 +2854,7 @@ msgstr ""
msgid "Overwrite existing files"
msgstr ""
#: internet/jamendoservice.cpp:209
#: internet/jamendoservice.cpp:210
msgid "Parsing Jamendo catalogue"
msgstr ""
@ -2905,7 +2905,7 @@ msgstr ""
msgid "Play artist radio..."
msgstr ""
#: playlist/playlist.cpp:1113 ../bin/src/ui_edittagdialog.h:637
#: playlist/playlist.cpp:1114 ../bin/src/ui_edittagdialog.h:637
msgid "Play count"
msgstr ""
@ -3061,7 +3061,7 @@ msgstr ""
msgid "Preview"
msgstr ""
#: ui/edittagdialog.cpp:157 ui/trackselectiondialog.cpp:46
#: ui/edittagdialog.cpp:157 ui/trackselectiondialog.cpp:47
msgid "Previous"
msgstr ""
@ -3153,7 +3153,7 @@ msgstr ""
msgid "Rate the current song 5 stars"
msgstr ""
#: playlist/playlist.cpp:1112 ../bin/src/ui_edittagdialog.h:645
#: playlist/playlist.cpp:1113 ../bin/src/ui_edittagdialog.h:645
msgid "Rating"
msgstr ""
@ -3161,7 +3161,7 @@ msgstr ""
msgid "Really cancel?"
msgstr ""
#: internet/jamendoservice.cpp:415 internet/magnatuneservice.cpp:272
#: internet/jamendoservice.cpp:416 internet/magnatuneservice.cpp:273
msgid "Refresh catalogue"
msgstr ""
@ -3325,7 +3325,7 @@ msgstr ""
msgid "Safely remove the device after copying"
msgstr ""
#: playlist/playlist.cpp:1120 ../bin/src/ui_edittagdialog.h:642
#: playlist/playlist.cpp:1121 ../bin/src/ui_edittagdialog.h:642
msgid "Sample rate"
msgstr ""
@ -3361,7 +3361,7 @@ msgstr ""
msgid "Save this stream in the Internet tab"
msgstr ""
#: ui/edittagdialog.cpp:618 ui/trackselectiondialog.cpp:249
#: ui/edittagdialog.cpp:618 ui/trackselectiondialog.cpp:250
msgid "Saving tracks"
msgstr ""
@ -3369,7 +3369,7 @@ msgstr ""
msgid "Scalable sampling rate profile (SSR)"
msgstr ""
#: playlist/playlist.cpp:1116 ../bin/src/ui_edittagdialog.h:643
#: playlist/playlist.cpp:1117 ../bin/src/ui_edittagdialog.h:643
msgid "Score"
msgstr ""
@ -3395,23 +3395,23 @@ msgstr ""
msgid "Search Icecast stations"
msgstr ""
#: internet/jamendoservice.cpp:421
#: internet/jamendoservice.cpp:422
msgid "Search Jamendo"
msgstr ""
#: internet/magnatuneservice.cpp:278
#: internet/magnatuneservice.cpp:279
msgid "Search Magnatune"
msgstr ""
#: internet/spotifysearchplaylisttype.cpp:32 internet/spotifyservice.cpp:603
#: internet/spotifysearchplaylisttype.cpp:32 internet/spotifyservice.cpp:604
msgid "Search Spotify"
msgstr ""
#: internet/spotifyservice.cpp:337
#: internet/spotifyservice.cpp:338
msgid "Search Spotify (opens a new tab)"
msgstr ""
#: internet/spotifyservice.cpp:488
#: internet/spotifyservice.cpp:489
msgid "Search Spotify (opens a new tab)..."
msgstr ""
@ -3663,7 +3663,7 @@ msgstr ""
msgid "Skip backwards in playlist"
msgstr ""
#: playlist/playlist.cpp:1114 ../bin/src/ui_edittagdialog.h:639
#: playlist/playlist.cpp:1115 ../bin/src/ui_edittagdialog.h:639
msgid "Skip count"
msgstr ""
@ -3743,7 +3743,7 @@ msgstr ""
msgid "Spotify"
msgstr ""
#: internet/spotifyservice.cpp:178
#: internet/spotifyservice.cpp:179
msgid "Spotify login error"
msgstr ""
@ -3759,7 +3759,7 @@ msgstr ""
msgid "Standard"
msgstr ""
#: internet/spotifyservice.cpp:342
#: internet/spotifyservice.cpp:343
msgid "Starred"
msgstr ""
@ -3811,7 +3811,7 @@ msgstr ""
msgid "Stopped"
msgstr ""
#: core/song.cpp:145
#: core/song.cpp:398
msgid "Stream"
msgstr ""
@ -3828,7 +3828,7 @@ msgstr ""
msgid "Successfully written %1"
msgstr ""
#: ui/trackselectiondialog.cpp:168
#: ui/trackselectiondialog.cpp:169
msgid "Suggested tags"
msgstr ""
@ -3854,15 +3854,15 @@ msgstr ""
msgid "Switch provider"
msgstr ""
#: internet/spotifyservice.cpp:514
#: internet/spotifyservice.cpp:515
msgid "Syncing Spotify inbox"
msgstr ""
#: internet/spotifyservice.cpp:509
#: internet/spotifyservice.cpp:510
msgid "Syncing Spotify playlist"
msgstr ""
#: internet/spotifyservice.cpp:518
#: internet/spotifyservice.cpp:519
msgid "Syncing Spotify starred tracks"
msgstr ""
@ -3935,13 +3935,13 @@ msgstr ""
msgid "There was a problem fetching the metadata from Magnatune"
msgstr ""
#: ui/organiseerrordialog.cpp:54
#: ui/organiseerrordialog.cpp:56
msgid ""
"There were problems copying some songs. The following files could not be "
"copied:"
msgstr ""
#: ui/organiseerrordialog.cpp:59
#: ui/organiseerrordialog.cpp:61
msgid ""
"There were problems deleting some songs. The following files could not be "
"deleted:"
@ -3972,7 +3972,7 @@ msgstr ""
msgid "Third level"
msgstr ""
#: internet/jamendoservice.cpp:166
#: internet/jamendoservice.cpp:167
msgid ""
"This action will create a database which could be as big as 150 MB.\n"
"Do you want to continue anyway?"
@ -4034,7 +4034,7 @@ msgstr ""
msgid "Timezone"
msgstr ""
#: playlist/playlist.cpp:1101 ui/organisedialog.cpp:51
#: playlist/playlist.cpp:1102 ui/organisedialog.cpp:51
#: ui/qtsystemtrayicon.cpp:248 ../bin/src/ui_about.h:142
#: ../bin/src/ui_edittagdialog.h:652 ../bin/src/ui_trackselectiondialog.h:211
msgid "Title"
@ -4072,7 +4072,7 @@ msgstr ""
msgid "Total network requests made"
msgstr ""
#: playlist/playlist.cpp:1105 ui/organisedialog.cpp:57
#: playlist/playlist.cpp:1106 ui/organisedialog.cpp:57
#: ../bin/src/ui_edittagdialog.h:653 ../bin/src/ui_trackselectiondialog.h:212
msgid "Track"
msgstr ""
@ -4098,7 +4098,7 @@ msgstr ""
msgid "Transcoding options"
msgstr ""
#: core/song.cpp:142
#: core/song.cpp:395
msgid "TrueAudio"
msgstr ""
@ -4127,7 +4127,7 @@ msgstr ""
msgid "Unable to download %1 (%2)"
msgstr ""
#: core/song.cpp:149 globalsearch/globalsearchitemdelegate.cpp:166
#: core/song.cpp:402 globalsearch/globalsearchitemdelegate.cpp:166
#: globalsearch/globalsearchitemdelegate.cpp:173 library/librarymodel.cpp:297
#: library/librarymodel.cpp:302 library/librarymodel.cpp:926
#: playlist/playlistdelegates.cpp:306 playlist/playlistmanager.cpp:381
@ -4306,7 +4306,7 @@ msgstr ""
msgid "WMA"
msgstr ""
#: core/song.cpp:141
#: core/song.cpp:394
msgid "Wav"
msgstr ""
@ -4379,7 +4379,7 @@ msgstr ""
msgid "Windows Media 64k"
msgstr ""
#: core/song.cpp:132
#: core/song.cpp:385
msgid "Windows Media audio"
msgstr ""
@ -4387,7 +4387,7 @@ msgstr ""
msgid "Would you like to run a full rescan right now?"
msgstr ""
#: playlist/playlist.cpp:1107 ui/organisedialog.cpp:60
#: playlist/playlist.cpp:1108 ui/organisedialog.cpp:60
#: ../bin/src/ui_groupbydialog.h:135 ../bin/src/ui_groupbydialog.h:148
#: ../bin/src/ui_groupbydialog.h:161 ../bin/src/ui_edittagdialog.h:657
msgid "Year"
@ -4464,7 +4464,7 @@ msgstr ""
msgid "You do not have a Spotify Premium account."
msgstr ""
#: internet/spotifyservice.cpp:164
#: internet/spotifyservice.cpp:165
msgid ""
"You have been logged out of Spotify, please re-enter your password in the "
"Settings dialog."

View File

@ -18,6 +18,8 @@
#include "organiseerrordialog.h"
#include "ui_organiseerrordialog.h"
#include <QUrl>
OrganiseErrorDialog::OrganiseErrorDialog(QWidget *parent)
: QDialog(parent),
ui_(new Ui_OrganiseErrorDialog)

View File

@ -24,6 +24,7 @@
#include <QPushButton>
#include <QShortcut>
#include <QTreeWidget>
#include <QUrl>
#include <QtConcurrentRun>
#include <QtDebug>

View File

@ -23,6 +23,7 @@
#include "playlistparsers/playlistparser.h"
#include <QBuffer>
#include <QUrl>
class AsxIniParserTest : public ::testing::Test {
protected:

View File

@ -19,9 +19,11 @@
#include "gmock/gmock-matchers.h"
#include "gtest/gtest.h"
#include "core/timeconstants.h"
#include "playlistparsers/asxparser.h"
#include <QBuffer>
#include <QUrl>
using ::testing::HasSubstr;

View File

@ -21,8 +21,11 @@
#include "test_utils.h"
#include "mock_taglib.h"
#include "core/timeconstants.h"
#include "playlistparsers/cueparser.h"
#include <QUrl>
class CueParserTest : public ::testing::Test {
protected:
static void SetUpTestCase() {

View File

@ -20,6 +20,7 @@
#include "test_utils.h"
#include "mock_taglib.h"
#include "core/timeconstants.h"
#include "playlistparsers/m3uparser.h"
#include <QBuffer>

View File

@ -19,6 +19,9 @@
#include "test_utils.h"
#include "core/organiseformat.h"
#include "core/timeconstants.h"
#include <QUrl>
class OrganiseFormatTest : public ::testing::Test {
protected:

View File

@ -18,11 +18,13 @@
#include "test_utils.h"
#include "gtest/gtest.h"
#include "core/timeconstants.h"
#include "playlistparsers/plsparser.h"
#include <QBuffer>
#include <QFile>
#include <QTemporaryFile>
#include <QUrl>
#include <QtDebug>
#include <boost/shared_ptr.hpp>

View File

@ -19,9 +19,11 @@
#include "gmock/gmock-matchers.h"
#include "gtest/gtest.h"
#include "core/timeconstants.h"
#include "playlistparsers/xspfparser.h"
#include <QBuffer>
#include <QUrl>
using ::testing::HasSubstr;