Skip to content

Commit

Permalink
Try and implement Opus
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Feb 24, 2024
1 parent a94a73d commit f602451
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion qml/flowplayer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ ApplicationWindow
// Hard coded. FIXME: JB#22001.
desktopEntry: "jolla-mediaplayer"
supportedUriSchemes: ["file", "http", "https"]
supportedMimeTypes: ["audio/x-wav", "audio/mp4", "audio/mpeg", "audio/x-vorbis+ogg"]
supportedMimeTypes: ["audio/x-wav", "audio/mp4", "audio/mpeg", "audio/x-vorbis+ogg", "audio/ogg", "audio/opus"]

// Mpris2 Player Interface
canControl: currentSongInfo !== []
Expand Down
3 changes: 3 additions & 0 deletions src/datareader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <flacfile.h>
#include <tlist.h>
#include <vorbisfile.h>
#include <opusfile.h>
#include <mp4file.h>
#include <wavfile.h>
#include <speexfile.h>
Expand Down Expand Up @@ -165,6 +166,8 @@ TagLib::File* DataReader::getFileByMimeType(QString file)
return new TagLib::FLAC::File(file.toUtf8());
} else if(str.endsWith(".ogg")) {
return new TagLib::Ogg::Vorbis::File(file.toUtf8());
} else if(str.endsWith(".opus")) {
return new TagLib::Ogg::Opus::File(file.toUtf8());
} else if(str.endsWith(".wav")) {
return new TagLib::RIFF::WAV::File(file.toUtf8());
} else if(str.endsWith(".m4a")) {
Expand Down
3 changes: 3 additions & 0 deletions src/meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <flacfile.h>
#include <tlist.h>
#include <vorbisfile.h>
#include <opusfile.h>
#include <mp4file.h>
#include <wavfile.h>
#include <speexfile.h>
Expand Down Expand Up @@ -137,6 +138,8 @@ TagLib::File* Meta::getFileByMimeType(QString file)
return new TagLib::FLAC::File(file.toUtf8());
} else if(str.endsWith(".ogg")) {
return new TagLib::Ogg::Vorbis::File(file.toUtf8());
} else if(str.endsWith(".opus")) {
return new TagLib::Ogg::Opus::File(file.toUtf8());
} else if(str.endsWith(".wav")) {
return new TagLib::RIFF::WAV::File(file.toUtf8());
} else if(str.endsWith(".m4a")) {
Expand Down
1 change: 1 addition & 0 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ void Utils::getFolderItems(QString path)
emit appendFile(fileInfo.fileName(), fileInfo.absoluteFilePath(), "folder");
else if (fileInfo.fileName().endsWith(".mp3") || fileInfo.fileName().endsWith(".m4a") ||
fileInfo.fileName().endsWith(".wma") || fileInfo.fileName().endsWith(".ogg") ||
fileInfo.fileName().endsWith(".opus") ||
fileInfo.fileName().endsWith(".flac") || fileInfo.fileName().endsWith(".wav") ||
fileInfo.fileName().endsWith(".asf"))
emit appendFile(fileInfo.fileName(), fileInfo.absoluteFilePath(), "sounds");
Expand Down

0 comments on commit f602451

Please sign in to comment.