parent
59bffed47f
commit
6b6117653a
@ -152,6 +152,8 @@ const QString Song::kVariousArtists("various artists");
|
|||||||
|
|
||||||
const QStringList Song::kArticles = QStringList() << "the " << "a " << "an ";
|
const QStringList Song::kArticles = QStringList() << "the " << "a " << "an ";
|
||||||
|
|
||||||
|
const QStringList Song::kAcceptedExtensions = QStringList() << "aac" << "ac3" << "dts";
|
||||||
|
|
||||||
struct Song::Private : public QSharedData {
|
struct Song::Private : public QSharedData {
|
||||||
|
|
||||||
explicit Private(Source source = Source_Unknown);
|
explicit Private(Source source = Source_Unknown);
|
||||||
@ -1045,6 +1047,13 @@ void Song::InitFromFilePartial(const QString &filename) {
|
|||||||
d->source_ = Source_LocalFile;
|
d->source_ = Source_LocalFile;
|
||||||
if (d->art_manual_.isEmpty()) InitArtManual();
|
if (d->art_manual_.isEmpty()) InitArtManual();
|
||||||
}
|
}
|
||||||
|
else if (kAcceptedExtensions.contains(info.suffix(), Qt::CaseInsensitive)) {
|
||||||
|
d->valid_ = true;
|
||||||
|
d->source_ = Source_LocalFile;
|
||||||
|
d->filetype_ = FiletypeByExtension(info.suffix());
|
||||||
|
d->title_ = info.fileName();
|
||||||
|
if (d->art_manual_.isEmpty()) InitArtManual();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
d->valid_ = false;
|
d->valid_ = false;
|
||||||
d->error_ = QObject::tr("File %1 is not recognized as a valid audio file.").arg(filename);
|
d->error_ = QObject::tr("File %1 is not recognized as a valid audio file.").arg(filename);
|
||||||
|
@ -127,6 +127,8 @@ class Song {
|
|||||||
|
|
||||||
static const QStringList kArticles;
|
static const QStringList kArticles;
|
||||||
|
|
||||||
|
static const QStringList kAcceptedExtensions;
|
||||||
|
|
||||||
static QString JoinSpec(const QString &table);
|
static QString JoinSpec(const QString &table);
|
||||||
|
|
||||||
static Source SourceFromURL(const QUrl &url);
|
static Source SourceFromURL(const QUrl &url);
|
||||||
|
@ -50,7 +50,8 @@ const char *FileView::kFileFilter =
|
|||||||
"*.wav *.flac *.wv *.ogg *.oga *.opus *.spx *.ape *.mpc "
|
"*.wav *.flac *.wv *.ogg *.oga *.opus *.spx *.ape *.mpc "
|
||||||
"*.mp2 *.mp3 *.m4a *.mp4 *.aac *.asf *.asx *.wma "
|
"*.mp2 *.mp3 *.m4a *.mp4 *.aac *.asf *.asx *.wma "
|
||||||
"*.aif *.aiff *.mka *.tta *.dsf *.dsd "
|
"*.aif *.aiff *.mka *.tta *.dsf *.dsd "
|
||||||
"*.cue *.m3u *.m3u8 *.pls *.xspf *.asxini ";
|
"*.cue *.m3u *.m3u8 *.pls *.xspf *.asxini "
|
||||||
|
".ac3 .dts";
|
||||||
|
|
||||||
FileView::FileView(QWidget *parent)
|
FileView::FileView(QWidget *parent)
|
||||||
: QWidget(parent),
|
: QWidget(parent),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user