Fix playback of WavPack
This commit is contained in:
parent
210601ffe4
commit
ad2b567216
@ -49,6 +49,7 @@
|
|||||||
#include <taglib/vorbisfile.h>
|
#include <taglib/vorbisfile.h>
|
||||||
#include <taglib/speexfile.h>
|
#include <taglib/speexfile.h>
|
||||||
#include <taglib/wavfile.h>
|
#include <taglib/wavfile.h>
|
||||||
|
#include <taglib/wavpackfile.h>
|
||||||
#include <taglib/aifffile.h>
|
#include <taglib/aifffile.h>
|
||||||
#include <taglib/asffile.h>
|
#include <taglib/asffile.h>
|
||||||
#include "taglib/asftag.h"
|
#include "taglib/asftag.h"
|
||||||
@ -467,23 +468,24 @@ void TagReader::SetVorbisComments(TagLib::Ogg::XiphComment *vorbis_comments, con
|
|||||||
|
|
||||||
pb::tagreader::SongMetadata_Type TagReader::GuessFileType(TagLib::FileRef *fileref) const {
|
pb::tagreader::SongMetadata_Type TagReader::GuessFileType(TagLib::FileRef *fileref) const {
|
||||||
|
|
||||||
#ifdef TAGLIB_WITH_ASF
|
if (dynamic_cast<TagLib::RIFF::WAV::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_WAV;
|
||||||
if (dynamic_cast<TagLib::ASF::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_ASF;
|
|
||||||
#endif
|
|
||||||
if (dynamic_cast<TagLib::FLAC::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_FLAC;
|
if (dynamic_cast<TagLib::FLAC::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_FLAC;
|
||||||
#ifdef TAGLIB_WITH_MP4
|
if (dynamic_cast<TagLib::WavPack::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_WAVPACK;
|
||||||
if (dynamic_cast<TagLib::MP4::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_MP4;
|
|
||||||
#endif
|
|
||||||
if (dynamic_cast<TagLib::MPC::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_MPC;
|
|
||||||
if (dynamic_cast<TagLib::MPEG::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_MPEG;
|
|
||||||
if (dynamic_cast<TagLib::Ogg::FLAC::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_OGGFLAC;
|
if (dynamic_cast<TagLib::Ogg::FLAC::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_OGGFLAC;
|
||||||
if (dynamic_cast<TagLib::Ogg::Speex::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_OGGSPEEX;
|
|
||||||
if (dynamic_cast<TagLib::Ogg::Vorbis::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_OGGVORBIS;
|
if (dynamic_cast<TagLib::Ogg::Vorbis::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_OGGVORBIS;
|
||||||
#ifdef TAGLIB_HAS_OPUS
|
#ifdef TAGLIB_HAS_OPUS
|
||||||
if (dynamic_cast<TagLib::Ogg::Opus::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_OGGOPUS;
|
if (dynamic_cast<TagLib::Ogg::Opus::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_OGGOPUS;
|
||||||
|
#endif
|
||||||
|
if (dynamic_cast<TagLib::Ogg::Speex::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_OGGSPEEX;
|
||||||
|
if (dynamic_cast<TagLib::MPEG::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_MPEG;
|
||||||
|
#ifdef TAGLIB_WITH_MP4
|
||||||
|
if (dynamic_cast<TagLib::MP4::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_MP4;
|
||||||
|
#endif
|
||||||
|
#ifdef TAGLIB_WITH_ASF
|
||||||
|
if (dynamic_cast<TagLib::ASF::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_ASF;
|
||||||
#endif
|
#endif
|
||||||
if (dynamic_cast<TagLib::RIFF::AIFF::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_AIFF;
|
if (dynamic_cast<TagLib::RIFF::AIFF::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_AIFF;
|
||||||
if (dynamic_cast<TagLib::RIFF::WAV::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_WAV;
|
if (dynamic_cast<TagLib::MPC::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_MPC;
|
||||||
if (dynamic_cast<TagLib::TrueAudio::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_TRUEAUDIO;
|
if (dynamic_cast<TagLib::TrueAudio::File*>(fileref->file())) return pb::tagreader::SongMetadata_Type_TRUEAUDIO;
|
||||||
|
|
||||||
return pb::tagreader::SongMetadata_Type_UNKNOWN;
|
return pb::tagreader::SongMetadata_Type_UNKNOWN;
|
||||||
|
@ -6,20 +6,21 @@ message SongMetadata {
|
|||||||
|
|
||||||
enum Type {
|
enum Type {
|
||||||
UNKNOWN = 0;
|
UNKNOWN = 0;
|
||||||
ASF = 1;
|
WAV = 1;
|
||||||
FLAC = 2;
|
FLAC = 2;
|
||||||
MP4 = 3;
|
WAVPACK = 3;
|
||||||
MPC = 4;
|
OGGFLAC = 4;
|
||||||
MPEG = 5;
|
OGGVORBIS = 5;
|
||||||
OGGFLAC = 6;
|
OGGOPUS = 6;
|
||||||
OGGSPEEX = 7;
|
OGGSPEEX = 7;
|
||||||
OGGVORBIS = 8;
|
MPEG = 8;
|
||||||
AIFF = 9;
|
MP4 = 9;
|
||||||
WAV = 10;
|
ASF = 10;
|
||||||
TRUEAUDIO = 11;
|
AIFF = 11;
|
||||||
CDDA = 12;
|
MPC = 12;
|
||||||
OGGOPUS = 13;
|
TRUEAUDIO = 13;
|
||||||
//STREAM = 99;
|
CDDA = 90;
|
||||||
|
STREAM = 91;
|
||||||
}
|
}
|
||||||
|
|
||||||
optional bool valid = 1;
|
optional bool valid = 1;
|
||||||
|
@ -365,17 +365,18 @@ QString Song::JoinSpec(const QString &table) {
|
|||||||
QString Song::TextForFiletype(FileType type) {
|
QString Song::TextForFiletype(FileType type) {
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Song::Type_Asf: return QObject::tr("Windows Media audio");
|
case Song::Type_Wav: return QObject::tr("Wav");
|
||||||
case Song::Type_Flac: return QObject::tr("Flac");
|
case Song::Type_Flac: return QObject::tr("Flac");
|
||||||
case Song::Type_Mp4: return QObject::tr("MP4 AAC");
|
case Song::Type_WavPack: return QObject::tr("WavPack");
|
||||||
case Song::Type_Mpc: return QObject::tr("MPC");
|
|
||||||
case Song::Type_Mpeg: return QObject::tr("MP3");
|
|
||||||
case Song::Type_OggFlac: return QObject::tr("Ogg Flac");
|
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_OggVorbis: return QObject::tr("Ogg Vorbis");
|
||||||
case Song::Type_OggOpus: return QObject::tr("Ogg Opus");
|
case Song::Type_OggOpus: return QObject::tr("Ogg Opus");
|
||||||
|
case Song::Type_OggSpeex: return QObject::tr("Ogg Speex");
|
||||||
|
case Song::Type_Mpeg: return QObject::tr("MP3");
|
||||||
|
case Song::Type_Mp4: return QObject::tr("MP4 AAC");
|
||||||
|
case Song::Type_Asf: return QObject::tr("Windows Media audio");
|
||||||
case Song::Type_Aiff: return QObject::tr("AIFF");
|
case Song::Type_Aiff: return QObject::tr("AIFF");
|
||||||
case Song::Type_Wav: return QObject::tr("Wav");
|
case Song::Type_Mpc: return QObject::tr("MPC");
|
||||||
case Song::Type_TrueAudio: return QObject::tr("TrueAudio");
|
case Song::Type_TrueAudio: return QObject::tr("TrueAudio");
|
||||||
case Song::Type_Cdda: return QObject::tr("CDDA");
|
case Song::Type_Cdda: return QObject::tr("CDDA");
|
||||||
|
|
||||||
@ -389,10 +390,11 @@ QString Song::TextForFiletype(FileType type) {
|
|||||||
|
|
||||||
bool Song::IsFileLossless() const {
|
bool Song::IsFileLossless() const {
|
||||||
switch (filetype()) {
|
switch (filetype()) {
|
||||||
case Song::Type_Aiff:
|
case Song::Type_Wav:
|
||||||
case Song::Type_Flac:
|
case Song::Type_Flac:
|
||||||
case Song::Type_OggFlac:
|
case Song::Type_OggFlac:
|
||||||
case Song::Type_Wav:
|
case Song::Type_WavPack:
|
||||||
|
case Song::Type_Aiff:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@ -692,10 +694,21 @@ void Song::InitFromFilePartial(const QString &filename) {
|
|||||||
QFileInfo info(filename);
|
QFileInfo info(filename);
|
||||||
d->basefilename_ = info.fileName();
|
d->basefilename_ = info.fileName();
|
||||||
QString suffix = info.suffix().toLower();
|
QString suffix = info.suffix().toLower();
|
||||||
if (suffix == "mp3" || suffix == "ogg" || suffix == "flac" ||
|
if (suffix == "wav" ||
|
||||||
suffix == "mpc" || suffix == "m4a" || suffix == "aac" ||
|
suffix == "flac" ||
|
||||||
suffix == "wma" || suffix == "mp4" || suffix == "spx" ||
|
suffix == "ogg" ||
|
||||||
suffix == "wav" || suffix == "opus" || suffix == "m4b") {
|
suffix == "oga" ||
|
||||||
|
suffix == "wv" ||
|
||||||
|
suffix == "aac" ||
|
||||||
|
suffix == "m4a" ||
|
||||||
|
suffix == "m4b" ||
|
||||||
|
suffix == "mp4" ||
|
||||||
|
suffix == "wma" ||
|
||||||
|
suffix == "mp3" ||
|
||||||
|
suffix == "mpc" ||
|
||||||
|
suffix == "tta" ||
|
||||||
|
suffix == "spx" ||
|
||||||
|
suffix == "opus") {
|
||||||
d->valid_ = true;
|
d->valid_ = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -95,19 +95,21 @@ class Song {
|
|||||||
// If a new lossless file is added, also add it to IsFileLossless().
|
// If a new lossless file is added, also add it to IsFileLossless().
|
||||||
enum FileType {
|
enum FileType {
|
||||||
Type_Unknown = 0,
|
Type_Unknown = 0,
|
||||||
Type_Asf = 1,
|
Type_Wav = 1,
|
||||||
Type_Flac = 2,
|
Type_Flac = 2,
|
||||||
Type_Mp4 = 3,
|
Type_WavPack = 3,
|
||||||
Type_Mpc = 4,
|
Type_OggFlac = 4,
|
||||||
Type_Mpeg = 5,
|
Type_OggVorbis = 5,
|
||||||
Type_OggFlac = 6,
|
Type_OggOpus = 6,
|
||||||
Type_OggSpeex = 7,
|
Type_OggSpeex = 7,
|
||||||
Type_OggVorbis = 8,
|
Type_Mpeg = 8,
|
||||||
Type_Aiff = 9,
|
Type_Mp4 = 9,
|
||||||
Type_Wav = 10,
|
Type_Asf = 10,
|
||||||
Type_TrueAudio = 11,
|
Type_Aiff = 11,
|
||||||
Type_Cdda = 12,
|
Type_Mpc = 12,
|
||||||
Type_OggOpus = 13,
|
Type_TrueAudio = 13,
|
||||||
|
Type_Cdda = 90,
|
||||||
|
Type_Stream = 91,
|
||||||
};
|
};
|
||||||
|
|
||||||
static QString TextForFiletype(FileType type);
|
static QString TextForFiletype(FileType type);
|
||||||
|
@ -229,10 +229,8 @@ void SongLoader::LoadLocalAsync(const QString &filename) {
|
|||||||
parser = playlist_parser_->ParserForExtension(QFileInfo(filename).suffix().toLower());
|
parser = playlist_parser_->ParserForExtension(QFileInfo(filename).suffix().toLower());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parser) {
|
if (parser) { // It's a playlist!
|
||||||
qLog(Debug) << "Parsing using" << parser->name();
|
qLog(Debug) << "Parsing using" << parser->name();
|
||||||
|
|
||||||
// It's a playlist!
|
|
||||||
LoadPlaylist(parser, filename);
|
LoadPlaylist(parser, filename);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -244,8 +242,7 @@ void SongLoader::LoadLocalAsync(const QString &filename) {
|
|||||||
QFile cue(matching_cue);
|
QFile cue(matching_cue);
|
||||||
cue.open(QIODevice::ReadOnly);
|
cue.open(QIODevice::ReadOnly);
|
||||||
|
|
||||||
SongList song_list = cue_parser_->Load(&cue, matching_cue,
|
SongList song_list = cue_parser_->Load(&cue, matching_cue, QDir(filename.section('/', 0, -2)));
|
||||||
QDir(filename.section('/', 0, -2)));
|
|
||||||
for (Song song: song_list){
|
for (Song song: song_list){
|
||||||
if (song.is_valid()) songs_ << song;
|
if (song.is_valid()) songs_ << song;
|
||||||
}
|
}
|
||||||
|
@ -769,7 +769,8 @@ GstElement *GstEngine::CreateElement(const QString &factoryName, GstElement *bin
|
|||||||
if (!element) {
|
if (!element) {
|
||||||
if (showerror)
|
if (showerror)
|
||||||
emit Error(QString("GStreamer could not create the element: %1. Please make sure that you have installed all necessary GStreamer plugins").arg(factoryName));
|
emit Error(QString("GStreamer could not create the element: %1. Please make sure that you have installed all necessary GStreamer plugins").arg(factoryName));
|
||||||
if (fatal) gst_object_unref(GST_OBJECT(bin));
|
else qLog(Error) << "GStreamer could not create the element:" << factoryName;
|
||||||
|
//if (fatal) gst_object_unref(GST_OBJECT(bin));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,8 +247,8 @@ bool GstEnginePipeline::InitAudioBin() {
|
|||||||
GstElement *convert_sink = tee;
|
GstElement *convert_sink = tee;
|
||||||
|
|
||||||
if (rg_enabled_) {
|
if (rg_enabled_) {
|
||||||
rgvolume_ = engine_->CreateElement("rgvolume", audiobin_);
|
rgvolume_ = engine_->CreateElement("rgvolume", audiobin_, false, true);
|
||||||
rglimiter_ = engine_->CreateElement("rglimiter", audiobin_);
|
rglimiter_ = engine_->CreateElement("rglimiter", audiobin_, false, true);
|
||||||
audioconvert2_ = engine_->CreateElement("audioconvert", audiobin_);
|
audioconvert2_ = engine_->CreateElement("audioconvert", audiobin_);
|
||||||
if (rgvolume_ && rglimiter_ && audioconvert2_) {
|
if (rgvolume_ && rglimiter_ && audioconvert2_) {
|
||||||
event_probe = audioconvert2_;
|
event_probe = audioconvert2_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user