commit qmmp for openSUSE:Factory
Hello community, here is the log from the commit of package qmmp for openSUSE:Factory checked in at 2016-05-04 08:20:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qmmp (Old) and /work/SRC/openSUSE:Factory/.qmmp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "qmmp" Changes: -------- --- /work/SRC/openSUSE:Factory/qmmp/qmmp.changes 2016-04-06 11:52:04.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.qmmp.new/qmmp.changes 2016-05-04 08:20:24.000000000 +0200 @@ -1,0 +2,10 @@ +Tue May 3 10:34:12 UTC 2016 - sor.alexei@meowr.ru + +- Update to version 1.0.9 (changes since 1.0.7): + * Fix session check in the scrobbler plugin. + * Fix working with both libre.fm and last.fm. + * Fix cell height in the stream browser. + * Remove borders from statusbar in the qsui plugin. + * Fix taglib-1.9 support. + +------------------------------------------------------------------- Old: ---- qmmp-1.0.7.tar.bz2 New: ---- qmmp-1.0.9.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qmmp.spec ++++++ --- /var/tmp/diff_new_pack.ZdkS3B/_old 2016-05-04 08:20:25.000000000 +0200 +++ /var/tmp/diff_new_pack.ZdkS3B/_new 2016-05-04 08:20:25.000000000 +0200 @@ -19,7 +19,7 @@ %define sover 1 %bcond_with restricted Name: qmmp -Version: 1.0.7 +Version: 1.0.9 Release: 0 Summary: Qt-based Multimedia Player License: GPL-2.0+ @@ -37,6 +37,7 @@ BuildRequires: hicolor-icon-theme BuildRequires: libmpcdec-devel BuildRequires: libqt5-qttools-devel >= 5.4 +BuildRequires: pkg-config BuildRequires: pkgconfig(Qt5Core) >= 5.4 BuildRequires: pkgconfig(Qt5DBus) >= 5.4 BuildRequires: pkgconfig(Qt5Network) >= 5.4 ++++++ qmmp-1.0.7.tar.bz2 -> qmmp-1.0.9.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/CMakeLists.txt new/qmmp-1.0.9/CMakeLists.txt --- old/qmmp-1.0.7/CMakeLists.txt 2016-04-03 14:15:58.000000000 +0200 +++ new/qmmp-1.0.9/CMakeLists.txt 2016-05-02 14:23:19.000000000 +0200 @@ -5,7 +5,7 @@ SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} /usr/local/include) #Qt5 modules -SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /opt/qt55/lib/cmake) +SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /opt/qt56/lib/cmake) #extract version from qmmp.h FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/src/qmmp/qmmp.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/ChangeLog new/qmmp-1.0.9/ChangeLog --- old/qmmp-1.0.7/ChangeLog 2016-04-03 14:15:58.000000000 +0200 +++ new/qmmp-1.0.9/ChangeLog 2016-05-02 14:23:19.000000000 +0200 @@ -1109,3 +1109,14 @@ * fixed sendig multiple play commands when opening several files for playback * fixed memory leaks * fixed qt5.6 support + +Version 1.0.8 +* fixed session check in the scrobbler plugin +* fixed working with both libre.fm and last.fm +* fixed cell height in the stream browser +* fixed unicode support under windows +* fixed problem with file access under windows +* removed borders from statusbar in the qsui plugin + +Version 1.0.9 +* fixed taglib-1.9 support diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/ChangeLog.rus new/qmmp-1.0.9/ChangeLog.rus --- old/qmmp-1.0.7/ChangeLog.rus 2016-04-03 14:15:58.000000000 +0200 +++ new/qmmp-1.0.9/ChangeLog.rus 2016-05-02 14:23:19.000000000 +0200 @@ -1111,3 +1111,14 @@ * устранена отправка множества команд "воспроизвести" при открытии нескольких файлов для воспроизведения * устранены утечки памяти * исправлена поддержка qt5.6 + +Версия 1.0.8 +* исправлена проверка сессии в модуле scrobbler +* исправлена одновременная работа с last.fm и libre.fm +* исправлен размер ячеек в списке интернет-радиостанций +* исправлена поддержка юникода под windows +* исправлена проблема доступа к файлам под windows +* отключены отсупы в строке состояния интерфейса qsui + +Версия 1.0.9 +* исправлена поддержка taglib-1.9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/ChangeLog.svn new/qmmp-1.0.9/ChangeLog.svn --- old/qmmp-1.0.7/ChangeLog.svn 2016-04-03 14:15:58.000000000 +0200 +++ new/qmmp-1.0.9/ChangeLog.svn 2016-05-02 14:23:19.000000000 +0200 @@ -1,4 +1,44 @@ ------------------------------------------------------------------------ +r6316 | trialuser02 | 2016-05-02 15:22:28 +0300 (Пн., 02 мая 2016) | 1 line + +updated changelogs +------------------------------------------------------------------------ +r6315 | trialuser02 | 2016-05-02 14:36:43 +0300 (Пн., 02 мая 2016) | 1 line + +fixed taglib-1.9 support +------------------------------------------------------------------------ +r6314 | trialuser02 | 2016-05-02 14:25:06 +0300 (Пн., 02 мая 2016) | 1 line + +version bump +------------------------------------------------------------------------ +r6298 | trialuser02 | 2016-05-02 11:50:06 +0300 (Пн., 02 мая 2016) | 1 line + +qsui: removed borders from statusbar +------------------------------------------------------------------------ +r6297 | trialuser02 | 2016-05-02 11:48:41 +0300 (Пн., 02 мая 2016) | 1 line + +fixed problems with metadata reading +------------------------------------------------------------------------ +r6289 | trialuser02 | 2016-05-01 17:33:32 +0300 (Вс., 01 мая 2016) | 1 line + +updated changelog +------------------------------------------------------------------------ +r6256 | trialuser02 | 2016-04-22 08:43:03 +0300 (Пт., 22 апр. 2016) | 1 line + +stream browser: fixed cell height +------------------------------------------------------------------------ +r6253 | trialuser02 | 2016-04-19 09:00:03 +0300 (Вт., 19 апр. 2016) | 1 line + +fixed multiscrobbling +------------------------------------------------------------------------ +r6248 | trialuser02 | 2016-04-17 14:27:52 +0300 (Вс., 17 апр. 2016) | 1 line + +scrobbler: fixed session check +------------------------------------------------------------------------ +r6224 | trialuser02 | 2016-04-03 18:25:50 +0300 (Вс., 03 апр. 2016) | 1 line + +version bump +------------------------------------------------------------------------ r6197 | trialuser02 | 2016-03-25 09:57:21 +0300 (Пт., 25 марта 2016) | 1 line updated changelogs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/bin/qmmp_launcher new/qmmp-1.0.9/bin/qmmp_launcher --- old/qmmp-1.0.7/bin/qmmp_launcher 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/bin/qmmp_launcher 2016-05-02 14:23:19.000000000 +0200 @@ -1,7 +1,7 @@ #!/bin/sh MYDIR=$(dirname $0) #QT_LIB_DIR=$(dirname $(which qmake))/../lib -QT_LIB_DIR=/opt/qt55/lib +QT_LIB_DIR=/opt/qt56/lib QMMP_LIB_DIRS=$MYDIR/../lib:$MYDIR/../src/qmmpui if [ -z ${LD_LIBRARY_PATH} ]; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/qmmp.pri new/qmmp-1.0.9/qmmp.pri --- old/qmmp-1.0.7/qmmp.pri 2016-04-03 14:15:58.000000000 +0200 +++ new/qmmp-1.0.9/qmmp.pri 2016-05-02 14:23:19.000000000 +0200 @@ -13,7 +13,7 @@ #Version -QMMP_VERSION = 1.0.7 +QMMP_VERSION = 1.0.9 #Comment/uncomment this if you want to change plugins list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/app/qmmp.rc new/qmmp-1.0.9/src/app/qmmp.rc --- old/qmmp-1.0.7/src/app/qmmp.rc 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/app/qmmp.rc 2016-05-02 14:23:19.000000000 +0200 @@ -1,7 +1,7 @@ #include <winver.h> -#define QMMP_FILEVERSION 1,0,7,0 -#define QMMP_PRODUCTVERSION "1.0.7.0" +#define QMMP_FILEVERSION 1,0,9,0 +#define QMMP_PRODUCTVERSION "1.0.9.0" IDI_ICON1 ICON DISCARDABLE "images\\ico\\qmmp.ico" IDI_ICON2 ICON DISCARDABLE "images\\ico\\qmmp_file.ico" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/General/rgscan/rgscandialog.cpp new/qmmp-1.0.9/src/plugins/General/rgscan/rgscandialog.cpp --- old/qmmp-1.0.7/src/plugins/General/rgscan/rgscandialog.cpp 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/General/rgscan/rgscandialog.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -39,9 +39,13 @@ #include "gain_analysis.h" #include "rgscandialog.h" -#define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) #define FILE_SKIPPED (Qt::UserRole + 1) +#if ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION <= 9)) +#undef QStringToTString +#define QStringToTString(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) +#endif + struct ReplayGainInfoItem { QMap<Qmmp::ReplayGainKey, double> info; @@ -283,12 +287,12 @@ TagLib::String RGScanDialog::gainToString(double value) { - return QStringToTString_qt4(QString("%1 dB").arg(value, 0, 'f', 2)); + return QStringToTString(QString("%1 dB").arg(value, 0, 'f', 2)); } TagLib::String RGScanDialog::peakToString(double value) { - return QStringToTString_qt4(QString("%1").arg(value, 0, 'f', 6)); + return QStringToTString(QString("%1").arg(value, 0, 'f', 6)); } void RGScanDialog::writeAPETag(TagLib::APE::Tag *tag, ReplayGainInfoItem *item) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/General/scrobbler/scrobbler.cpp new/qmmp-1.0.9/src/plugins/General/scrobbler/scrobbler.cpp --- old/qmmp-1.0.7/src/plugins/General/scrobbler/scrobbler.cpp 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/General/scrobbler/scrobbler.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010-2015 by Ilya Kotov * + * Copyright (C) 2010-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -87,7 +87,8 @@ m_submitReply = 0; m_scrobblerUrl = scrobblerUrl; m_name = name; - m_state = Qmmp::Stopped; + m_previousState = Qmmp::Stopped; + m_elapsed = 0; m_time = new QTime(); m_cache = new ScrobblerCache(Qmmp::configDir() +"scrobbler_"+name+".cache"); m_ua = QString("qmmp-plugins/%1").arg(Qmmp::strVersion().toLower()).toLatin1(); @@ -125,29 +126,26 @@ void Scrobbler::setState(Qmmp::State state) { - static Qmmp::State previousState = state; - static int elapsed = 0; - m_state = state; switch ((uint) state) { case Qmmp::Playing: - if (previousState != Qmmp::Paused) + if (m_previousState != Qmmp::Paused) { qDebug("Scrobbler[%s]: new song started", qPrintable(m_name)); m_start_ts = QDateTime::currentDateTime().toTime_t(); - elapsed = 0; + m_elapsed = 0; } else { - qDebug("Scrobbler[%s]: resuming from %d seconds played", qPrintable(m_name), elapsed / 1000); + qDebug("Scrobbler[%s]: resuming from %d seconds played", qPrintable(m_name), m_elapsed / 1000); } m_time->restart(); break; case Qmmp::Stopped: - if (previousState != Qmmp::Paused) - elapsed += m_time->elapsed(); + if (m_previousState != Qmmp::Paused) + m_elapsed += m_time->elapsed(); if (!m_song.metaData().isEmpty() - && ((elapsed / 1000 > 240) || (elapsed / 1000 > int(m_song.length()/2))) + && ((m_elapsed / 1000 > 240) || (m_elapsed / 1000 > int(m_song.length()/2))) && (m_song.length() > MIN_SONG_LENGTH)) { m_song.setTimeStamp(m_start_ts); @@ -163,19 +161,19 @@ submit(); break; case Qmmp::Paused: - elapsed += m_time->elapsed(); - qDebug("Scrobbler[%s]: pausing after %d seconds played", qPrintable(m_name), elapsed / 1000); + m_elapsed += m_time->elapsed(); + qDebug("Scrobbler[%s]: pausing after %d seconds played", qPrintable(m_name), m_elapsed / 1000); break; default: ; } - previousState = state; + m_previousState = state; } void Scrobbler::updateMetaData() { QMap <Qmmp::MetaData, QString> metadata = m_core->metaData(); - if(m_state != Qmmp::Playing || m_core->totalTime() <= 0) //skip stream + if(m_core->state() != Qmmp::Playing || m_core->totalTime() <= 0) //skip stream return; if(metadata.value(Qmmp::TITLE).isEmpty() || metadata.value(Qmmp::ARTIST).isEmpty()) //skip empty tags return; @@ -464,8 +462,7 @@ QMap <QString, QString> params; params.insert("api_key", API_KEY); params.insert("sk", session); - params.insert("method", "user.getRecommendedArtists"); - params.insert("limit", "1"); + params.insert("method", "user.getInfo"); QUrl url(m_scrobblerUrl); url.setPort(m_scrobblerUrl.startsWith("https") ? 443 : 80); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/General/scrobbler/scrobbler.h new/qmmp-1.0.9/src/plugins/General/scrobbler/scrobbler.h --- old/qmmp-1.0.7/src/plugins/General/scrobbler/scrobbler.h 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/General/scrobbler/scrobbler.h 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2010-2015 by Ilya Kotov * + * Copyright (C) 2010-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -83,6 +83,8 @@ QTime *m_time; ScrobblerCache *m_cache; QString m_scrobblerUrl, m_name; + Qmmp::State m_previousState; + int m_elapsed; }; /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/General/streambrowser/streamwindow.cpp new/qmmp-1.0.9/src/plugins/General/streambrowser/streamwindow.cpp --- old/qmmp-1.0.7/src/plugins/General/streambrowser/streamwindow.cpp 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/General/streambrowser/streamwindow.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2012-2015 by Ilya Kotov * + * Copyright (C) 2012-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -59,7 +59,7 @@ m_iceCastFilterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); //icecast table ui.icecastTableView->setModel(m_iceCastFilterModel); - ui.icecastTableView->verticalHeader()->setDefaultSectionSize(fontMetrics().height()); + ui.icecastTableView->verticalHeader()->setDefaultSectionSize(fontMetrics().height() + 3); ui.icecastTableView->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); ui.icecastTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui.icecastTableView->setContextMenuPolicy(Qt::CustomContextMenu); @@ -77,7 +77,7 @@ m_favoritesFilterModel->setFilterCaseSensitivity(Qt::CaseInsensitive); //favorites table ui.favoritesTableView->setModel(m_favoritesFilterModel); - ui.favoritesTableView->verticalHeader()->setDefaultSectionSize(fontMetrics().height()); + ui.favoritesTableView->verticalHeader()->setDefaultSectionSize(fontMetrics().height() + 3); ui.favoritesTableView->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); ui.favoritesTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); ui.favoritesTableView->setContextMenuPolicy(Qt::CustomContextMenu); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp new/qmmp-1.0.9/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp --- old/qmmp-1.0.7/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -190,7 +190,11 @@ QList <FileInfo*> list; AVFormatContext *in = 0; +#ifdef Q_OS_WIN + if (avformat_open_input(&in,fileName.toUtf8().constData(), 0, 0) < 0) +#else if (avformat_open_input(&in,fileName.toLocal8Bit().constData(), 0, 0) < 0) +#endif { qDebug("DecoderFFmpegFactory: unable to open file"); return list; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp new/qmmp-1.0.9/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp --- old/qmmp-1.0.7/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/ffmpeg/ffmpegmetadatamodel.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -23,7 +23,11 @@ FFmpegMetaDataModel::FFmpegMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_in = 0; +#ifdef Q_OS_WIN + if (avformat_open_input(&m_in, path.toUtf8().constData(), 0, 0) < 0) +#else if (avformat_open_input(&m_in, path.toLocal8Bit().constData(), 0, 0) < 0) +#endif return; avformat_find_stream_info(m_in, 0); av_read_play(m_in); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/flac/decoder_flac.cpp new/qmmp-1.0.9/src/plugins/Input/flac/decoder_flac.cpp --- old/qmmp-1.0.7/src/plugins/Input/flac/decoder_flac.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/flac/decoder_flac.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -268,7 +268,7 @@ QString p = m_path; p.remove("flac://"); p.remove(QRegExp("#\\d+$")); - TagLib::FLAC::File fileRef(p.toLocal8Bit().constData()); + TagLib::FLAC::File fileRef(QStringToFileName(p)); //looking for cuesheet comment TagLib::Ogg::XiphComment *xiph_comment = fileRef.xiphComment(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/flac/decoderflacfactory.cpp new/qmmp-1.0.9/src/plugins/Input/flac/decoderflacfactory.cpp --- old/qmmp-1.0.7/src/plugins/Input/flac/decoderflacfactory.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/flac/decoderflacfactory.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2015 by Ilya Kotov * + * Copyright (C) 2008-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -26,16 +26,13 @@ #include <taglib/oggflacfile.h> #include <taglib/xiphcomment.h> #include <taglib/tmap.h> -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) #include <taglib/tfilestream.h> #include <taglib/id3v2framefactory.h> -#endif #include "cueparser.h" #include "decoder_flac.h" #include "flacmetadatamodel.h" #include "decoderflacfactory.h" - // DecoderFLACFactory bool DecoderFLACFactory::supports(const QString &source) const @@ -102,27 +99,18 @@ return QList<FileInfo *>() << info; } -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) - TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); -#endif + TagLib::FileStream stream(QStringToFileName(fileName), true); + if(fileName.endsWith(".flac", Qt::CaseInsensitive)) { -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) flacFile = new TagLib::FLAC::File(&stream, TagLib::ID3v2::FrameFactory::instance()); -#else - flacFile = new TagLib::FLAC::File(fileName.toLocal8Bit().constData()); -#endif tag = useMetaData ? flacFile->xiphComment() : 0; ap = flacFile->audioProperties(); } else if(fileName.endsWith(".oga", Qt::CaseInsensitive)) { -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) oggFlacFile = new TagLib::Ogg::FLAC::File(&stream); -#else - oggFlacFile = new TagLib::Ogg::FLAC::File(fileName.toLocal8Bit().constData()); -#endif tag = useMetaData ? oggFlacFile->tag() : 0; ap = oggFlacFile->audioProperties(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/flac/flacmetadatamodel.cpp new/qmmp-1.0.9/src/plugins/Input/flac/flacmetadatamodel.cpp --- old/qmmp-1.0.7/src/plugins/Input/flac/flacmetadatamodel.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/flac/flacmetadatamodel.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2012 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -26,11 +26,15 @@ #include <qmmp/metadatamanager.h> #include "flacmetadatamodel.h" -#define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) -#define TStringToQString_qt4(s) QString::fromUtf8(s.toCString(true)).trimmed() +#if ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION <= 9)) +#undef QStringToTString +#define QStringToTString(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) +#endif FLACMetaDataModel::FLACMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { + m_file = 0; + if(path.startsWith("flac://")) { QString p = path; @@ -39,39 +43,49 @@ m_path = p; } else - { m_path = path; - m_tags << new VorbisCommentModel(path); + + TagLib::Ogg::XiphComment *tag = 0; + + if(m_path.endsWith(".flac", Qt::CaseInsensitive)) + { + TagLib::FLAC::File *f = new TagLib::FLAC::File(QStringToFileName(m_path)); + tag = f->xiphComment(); + m_file = f; } + else if(m_path.endsWith(".oga", Qt::CaseInsensitive)) + { + TagLib::Ogg::FLAC::File *f = new TagLib::Ogg::FLAC::File(QStringToFileName(m_path)); + tag = f->tag(); + m_file = f; + } + + if(m_file && m_file->isValid() && !path.startsWith("flac://")) + m_tags << new VorbisCommentModel(tag, m_file); } FLACMetaDataModel::~FLACMetaDataModel() { while(!m_tags.isEmpty()) delete m_tags.takeFirst(); + if(m_file) + { + delete m_file; + m_file = 0; + } } QHash<QString, QString> FLACMetaDataModel::audioProperties() { QHash<QString, QString> ap; - TagLib::FLAC::File *flacFile = 0; - TagLib::Ogg::FLAC::File *oggFlacFile = 0; - TagLib::FLAC::Properties *taglib_ap = 0; + TagLib::AudioProperties *taglib_ap = 0; qint64 size = 0; - if(m_path.endsWith(".flac", Qt::CaseInsensitive)) - { - flacFile = new TagLib::FLAC::File(m_path.toLocal8Bit().constData()); - taglib_ap = flacFile->audioProperties(); - size = flacFile->length(); - } - else if(m_path.endsWith(".oga", Qt::CaseInsensitive)) + + if(m_file && m_file->isValid()) { - oggFlacFile = new TagLib::Ogg::FLAC::File(m_path.toLocal8Bit().constData()); - taglib_ap = oggFlacFile->audioProperties(); - size = oggFlacFile->length(); + taglib_ap = m_file->audioProperties(); + size = m_file->length(); } - else - return ap; if(taglib_ap) { @@ -81,12 +95,8 @@ ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(taglib_ap->sampleRate())); ap.insert(tr("Channels"), QString("%1").arg(taglib_ap->channels())); ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(taglib_ap->bitrate())); + ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(size/1000)); } - ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(size/1024)); - if(flacFile) - delete flacFile; - if(oggFlacFile) - delete oggFlacFile; return ap; } @@ -120,30 +130,14 @@ return MetaDataManager::instance()->getCoverPath(m_path); } -VorbisCommentModel::VorbisCommentModel(const QString &path) : TagModel(TagModel::Save) +VorbisCommentModel::VorbisCommentModel(TagLib::Ogg::XiphComment *tag, TagLib::File *file) : TagModel(TagModel::Save) { - m_file = 0; - m_ogg_file = 0; - m_tag = 0; - if(path.endsWith(".flac")) - { - m_file = new TagLib::FLAC::File (path.toLocal8Bit().constData()); - m_tag = m_file->xiphComment(); - } - else if (path.endsWith(".oga")) - { - m_ogg_file = new TagLib::Ogg::FLAC::File(path.toLocal8Bit().constData()); - m_tag = m_ogg_file->tag(); - } + m_file = file; + m_tag = tag; } VorbisCommentModel::~VorbisCommentModel() -{ - if(m_file) - delete m_file; - if(m_ogg_file) - delete m_ogg_file; -} +{} const QString VorbisCommentModel::name() { @@ -157,25 +151,25 @@ switch((int) key) { case Qmmp::TITLE: - return TStringToQString_qt4(m_tag->title()); + return TStringToQString(m_tag->title()); case Qmmp::ARTIST: - return TStringToQString_qt4(m_tag->artist()); + return TStringToQString(m_tag->artist()); case Qmmp::ALBUMARTIST: if(m_tag->fieldListMap()["ALBUMARTIST"].isEmpty()) return QString(); else - return TStringToQString_qt4(m_tag->fieldListMap()["ALBUMARTIST"].front()); + return TStringToQString(m_tag->fieldListMap()["ALBUMARTIST"].front()); case Qmmp::ALBUM: - return TStringToQString_qt4(m_tag->album()); + return TStringToQString(m_tag->album()); case Qmmp::COMMENT: - return TStringToQString_qt4(m_tag->comment()); + return TStringToQString(m_tag->comment()); case Qmmp::GENRE: - return TStringToQString_qt4(m_tag->genre()); + return TStringToQString(m_tag->genre()); case Qmmp::COMPOSER: if(m_tag->fieldListMap()["COMPOSER"].isEmpty()) return QString(); else - return TStringToQString_qt4(m_tag->fieldListMap()["COMPOSER"].front()); + return TStringToQString(m_tag->fieldListMap()["COMPOSER"].front()); case Qmmp::YEAR: return QString::number(m_tag->year()); case Qmmp::TRACK: @@ -184,7 +178,7 @@ if(m_tag->fieldListMap()["DISCNUMBER"].isEmpty()) return QString(); else - return TStringToQString_qt4(m_tag->fieldListMap()["DISCNUMBER"].front()); + return TStringToQString(m_tag->fieldListMap()["DISCNUMBER"].front()); } return QString(); } @@ -194,7 +188,7 @@ if(!m_tag) return; - TagLib::String str = QStringToTString_qt4(value); + TagLib::String str = QStringToTString(value); switch((int) key) { @@ -236,6 +230,4 @@ { if(m_file) m_file->save(); - else if(m_ogg_file) - m_ogg_file->save(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/flac/flacmetadatamodel.h new/qmmp-1.0.9/src/plugins/Input/flac/flacmetadatamodel.h --- old/qmmp-1.0.7/src/plugins/Input/flac/flacmetadatamodel.h 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/flac/flacmetadatamodel.h 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2012 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -40,12 +40,13 @@ private: QString m_path; QList<TagModel* > m_tags; + TagLib::File *m_file; }; class VorbisCommentModel : public TagModel { public: - VorbisCommentModel(const QString &path); + VorbisCommentModel(TagLib::Ogg::XiphComment *tag, TagLib::File *file); ~VorbisCommentModel(); const QString name(); const QString value(Qmmp::MetaData key); @@ -53,8 +54,7 @@ void save(); private: - TagLib::FLAC::File *m_file; - TagLib::Ogg::FLAC::File *m_ogg_file; + TagLib::File *m_file; TagLib::Ogg::XiphComment *m_tag; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/flac/replaygainreader.cpp new/qmmp-1.0.9/src/plugins/Input/flac/replaygainreader.cpp --- old/qmmp-1.0.7/src/plugins/Input/flac/replaygainreader.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/flac/replaygainreader.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2013 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -23,19 +23,22 @@ #include <taglib/fileref.h> #include <taglib/flacfile.h> #include <taglib/oggflacfile.h> +#include <taglib/tfilestream.h> +#include <taglib/id3v2framefactory.h> #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { + TagLib::FileStream stream(QStringToFileName(path), true); if(path.endsWith(".flac", Qt::CaseInsensitive)) { - TagLib::FLAC::File fileRef(path.toLocal8Bit ().constData()); + TagLib::FLAC::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance()); if(fileRef.xiphComment()) readVorbisComment(fileRef.xiphComment()); } else if(path.endsWith(".oga", Qt::CaseInsensitive)) { - TagLib::Ogg::FLAC::File fileRef(path.toLocal8Bit ().constData()); + TagLib::Ogg::FLAC::File fileRef(&stream); if(fileRef.tag()) readVorbisComment(fileRef.tag()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/mad/decodermadfactory.cpp new/qmmp-1.0.9/src/plugins/Input/mad/decodermadfactory.cpp --- old/qmmp-1.0.7/src/plugins/Input/mad/decodermadfactory.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/mad/decodermadfactory.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2015 by Ilya Kotov * + * Copyright (C) 2008-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -32,9 +32,7 @@ #include <taglib/apetag.h> #include <taglib/tfile.h> #include <taglib/mpegfile.h> -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) #include <taglib/tfilestream.h> -#endif #include "mpegmetadatamodel.h" #include "replaygainreader.h" #include "settingsdialog.h" @@ -129,12 +127,8 @@ FileInfo *info = new FileInfo(fileName); TagLib::Tag *tag = 0; -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) - TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); + TagLib::FileStream stream(QStringToFileName(fileName), true); TagLib::MPEG::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance()); -#else - TagLib::MPEG::File fileRef(fileName.toLocal8Bit ().constData()); -#endif if (useMetaData) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/mad/mpegmetadatamodel.cpp new/qmmp-1.0.9/src/plugins/Input/mad/mpegmetadatamodel.cpp --- old/qmmp-1.0.7/src/plugins/Input/mad/mpegmetadatamodel.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/mad/mpegmetadatamodel.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2015 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -37,7 +37,7 @@ MPEGMetaDataModel::MPEGMetaDataModel(bool using_rusxmms, const QString &path, QObject *parent) : MetaDataModel(parent) { - m_file = new TagLib::MPEG::File(path.toLocal8Bit().constData()); + m_file = new TagLib::MPEG::File(QStringToFileName(path)); m_tags << new MpegFileTagModel(using_rusxmms, m_file, TagLib::MPEG::File::ID3v1); m_tags << new MpegFileTagModel(using_rusxmms, m_file, TagLib::MPEG::File::ID3v2); m_tags << new MpegFileTagModel(using_rusxmms, m_file, TagLib::MPEG::File::APE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/mad/replaygainreader.cpp new/qmmp-1.0.9/src/plugins/Input/mad/replaygainreader.cpp --- old/qmmp-1.0.7/src/plugins/Input/mad/replaygainreader.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/mad/replaygainreader.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2014 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -25,11 +25,14 @@ #include <taglib/id3v1tag.h> #include <taglib/id3v2header.h> #include <taglib/textidentificationframe.h> +#include <taglib/tfilestream.h> +#include <taglib/id3v2framefactory.h> #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { - TagLib::MPEG::File fileRef(path.toLocal8Bit().constData()); + TagLib::FileStream stream(QStringToFileName(path), true); + TagLib::MPEG::File fileRef(&stream, TagLib::ID3v2::FrameFactory::instance()); if(fileRef.ID3v2Tag()) readID3v2(fileRef.ID3v2Tag()); if(m_values.isEmpty() && fileRef.APETag()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/mpc/decodermpcfactory.cpp new/qmmp-1.0.9/src/plugins/Input/mpc/decodermpcfactory.cpp --- old/qmmp-1.0.7/src/plugins/Input/mpc/decodermpcfactory.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/mpc/decodermpcfactory.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2015 by Ilya Kotov * + * Copyright (C) 2008-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -24,19 +24,15 @@ #include <taglib/fileref.h> #include <taglib/mpcfile.h> #include <taglib/apetag.h> -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) #include <taglib/tfilestream.h> -#endif #include "mpcmetadatamodel.h" #include "decoder_mpc.h" #include "decodermpcfactory.h" - // DecoderMPCFactory bool DecoderMPCFactory::supports(const QString &source) const { - return (source.right(4).toLower() == ".mpc"); } @@ -79,12 +75,8 @@ { FileInfo *info = new FileInfo(fileName); -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) - TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); + TagLib::FileStream stream(QStringToFileName(fileName), true); TagLib::MPC::File fileRef(&stream); -#else - TagLib::MPC::File fileRef(fileName.toLocal8Bit().constData()); -#endif TagLib::APE::Tag *tag = useMetaData ? fileRef.APETag() : 0; if (tag && !tag->isEmpty()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/mpc/mpcmetadatamodel.cpp new/qmmp-1.0.9/src/plugins/Input/mpc/mpcmetadatamodel.cpp --- old/qmmp-1.0.7/src/plugins/Input/mpc/mpcmetadatamodel.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/mpc/mpcmetadatamodel.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2015 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -26,7 +26,7 @@ MPCMetaDataModel::MPCMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { - m_file = new TagLib::MPC::File (path.toLocal8Bit().constData()); + m_file = new TagLib::MPC::File (QStringToFileName(path)); m_tags << new MPCFileTagModel(m_file, TagLib::MPC::File::ID3v1); m_tags << new MPCFileTagModel(m_file, TagLib::MPC::File::APE); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/opus/decoderopusfactory.cpp new/qmmp-1.0.9/src/plugins/Input/opus/decoderopusfactory.cpp --- old/qmmp-1.0.7/src/plugins/Input/opus/decoderopusfactory.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/opus/decoderopusfactory.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2013-2015 by Ilya Kotov * + * Copyright (C) 2013-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -28,7 +28,6 @@ #include "opusmetadatamodel.h" #include "decoderopusfactory.h" - // DecoderOpusFactory bool DecoderOpusFactory::supports(const QString &source) const { @@ -78,7 +77,7 @@ { FileInfo *info = new FileInfo(fileName); - TagLib::Ogg::Opus::File fileRef(fileName.toLocal8Bit().constData()); + TagLib::Ogg::Opus::File fileRef(QStringToFileName(fileName)); TagLib::Ogg::XiphComment *tag = useMetaData ? fileRef.tag() : 0; if (tag && !tag->isEmpty()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/opus/opusmetadatamodel.cpp new/qmmp-1.0.9/src/plugins/Input/opus/opusmetadatamodel.cpp --- old/qmmp-1.0.7/src/plugins/Input/opus/opusmetadatamodel.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/opus/opusmetadatamodel.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2013-2015 by Ilya Kotov * + * Copyright (C) 2013-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -18,6 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ +#include <QtGlobal> #include <taglib/tag.h> #include <taglib/fileref.h> #include <taglib/opusfile.h> @@ -25,34 +26,42 @@ #include <taglib/tmap.h> #include "opusmetadatamodel.h" -#define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) -#define TStringToQString_qt4(s) QString::fromUtf8(s.toCString(true)).trimmed() +#if ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION <= 9)) +#undef QStringToTString +#define QStringToTString(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) +#endif OpusMetaDataModel::OpusMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_path = path; - m_tags << new VorbisCommentModel(path); + m_file = new TagLib::Ogg::Opus::File(QStringToFileName(m_path)); + m_tags << new VorbisCommentModel(m_file); } OpusMetaDataModel::~OpusMetaDataModel() { while(!m_tags.isEmpty()) delete m_tags.takeFirst(); + if(m_file) + { + delete m_file; + m_file = 0; + } } QHash<QString, QString> OpusMetaDataModel::audioProperties() { QHash<QString, QString> ap; - TagLib::Ogg::Opus::File f (m_path.toLocal8Bit().constData()); - if(f.audioProperties()) + TagLib::Ogg::Opus::File f (QStringToFileName(m_path)); + if(m_file && m_file->isValid()) { - QString text = QString("%1").arg(f.audioProperties()->length()/60); - text +=":"+QString("%1").arg(f.audioProperties()->length()%60,2,10,QChar('0')); + QString text = QString("%1").arg(m_file->audioProperties()->length()/60); + text +=":"+QString("%1").arg(m_file->audioProperties()->length()%60,2,10,QChar('0')); ap.insert(tr("Length"), text); - ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(f.audioProperties()->sampleRate())); - ap.insert(tr("Channels"), QString("%1").arg(f.audioProperties()->channels())); - ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(f.audioProperties()->bitrate())); - ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(f.length()/1024)); + ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(m_file->audioProperties()->sampleRate())); + ap.insert(tr("Channels"), QString("%1").arg(m_file->audioProperties()->channels())); + ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(m_file->audioProperties()->bitrate())); + ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(m_file->length()/1024)); } return ap; } @@ -64,8 +73,10 @@ QPixmap OpusMetaDataModel::cover() { - TagLib::Ogg::Opus::File file(m_path.toLocal8Bit().constData()); - TagLib::Ogg::XiphComment *tag = file.tag(); + if(!m_file || !m_file->isValid()) + return QPixmap(); + + TagLib::Ogg::XiphComment *tag = m_file->tag(); if(!tag) return QPixmap(); TagLib::StringList list = tag->fieldListMap()["METADATA_BLOCK_PICTURE"]; @@ -74,7 +85,7 @@ for(uint i = 0; i < list.size(); ++i) { TagLib::String value = list[i]; - QByteArray block = QByteArray::fromBase64(TStringToQString_qt4(value).toLatin1()); + QByteArray block = QByteArray::fromBase64(TStringToQString(value).toLatin1()); if(block.size() < 32) continue; qint64 pos = 0; @@ -109,16 +120,14 @@ } -VorbisCommentModel::VorbisCommentModel(const QString &path) : TagModel(TagModel::Save) +VorbisCommentModel::VorbisCommentModel(TagLib::Ogg::Opus::File *file) : TagModel(TagModel::Save) { - m_file = new TagLib::Ogg::Opus::File (path.toLocal8Bit().constData()); - m_tag = m_file->tag(); + m_file = file; + m_tag = file->tag(); } VorbisCommentModel::~VorbisCommentModel() -{ - delete m_file; -} +{} const QString VorbisCommentModel::name() { @@ -132,25 +141,25 @@ switch((int) key) { case Qmmp::TITLE: - return TStringToQString_qt4(m_tag->title()); + return TStringToQString(m_tag->title()); case Qmmp::ARTIST: - return TStringToQString_qt4(m_tag->artist()); - case Qmmp::ALBUM: - return TStringToQString_qt4(m_tag->album()); + return TStringToQString(m_tag->artist()); case Qmmp::ALBUMARTIST: if(m_tag->fieldListMap()["ALBUMARTIST"].isEmpty()) return QString(); else - return TStringToQString_qt4(m_tag->fieldListMap()["ALBUMARTIST"].front()); + return TStringToQString(m_tag->fieldListMap()["ALBUMARTIST"].front()); + case Qmmp::ALBUM: + return TStringToQString(m_tag->album()); case Qmmp::COMMENT: - return TStringToQString_qt4(m_tag->comment()); + return TStringToQString(m_tag->comment()); case Qmmp::GENRE: - return TStringToQString_qt4(m_tag->genre()); + return TStringToQString(m_tag->genre()); case Qmmp::COMPOSER: if(m_tag->fieldListMap()["COMPOSER"].isEmpty()) return QString(); else - return TStringToQString_qt4(m_tag->fieldListMap()["COMPOSER"].front()); + return TStringToQString(m_tag->fieldListMap()["COMPOSER"].front()); case Qmmp::YEAR: return QString::number(m_tag->year()); case Qmmp::TRACK: @@ -159,7 +168,7 @@ if(m_tag->fieldListMap()["DISCNUMBER"].isEmpty()) return QString(); else - return TStringToQString_qt4(m_tag->fieldListMap()["DISCNUMBER"].front()); + return TStringToQString(m_tag->fieldListMap()["DISCNUMBER"].front()); } return QString(); } @@ -169,7 +178,7 @@ if(!m_tag) return; - TagLib::String str = QStringToTString_qt4(value); + TagLib::String str = QStringToTString(value); switch((int) key) { @@ -179,12 +188,12 @@ case Qmmp::ARTIST: m_tag->setArtist(str); return; - case Qmmp::ALBUM: - m_tag->setAlbum(str); - return; case Qmmp::ALBUMARTIST: m_tag->addField("ALBUMARTIST", str, true); return; + case Qmmp::ALBUM: + m_tag->setAlbum(str); + return; case Qmmp::COMMENT: m_tag->setComment(str); return; @@ -209,11 +218,6 @@ void VorbisCommentModel::save() { - if(m_tag) + if(m_file) m_file->save(); - //taglib bug workarround - QString path = QString::fromLocal8Bit(m_file->name()); - delete m_file; - m_file = new TagLib::Ogg::Opus::File(path.toLocal8Bit().constData()); - m_tag = m_file->tag(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/opus/opusmetadatamodel.h new/qmmp-1.0.9/src/plugins/Input/opus/opusmetadatamodel.h --- old/qmmp-1.0.7/src/plugins/Input/opus/opusmetadatamodel.h 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/opus/opusmetadatamodel.h 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2013-2015 by Ilya Kotov * + * Copyright (C) 2013-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -38,13 +38,14 @@ private: QString m_path; QList<TagModel* > m_tags; + TagLib::Ogg::Opus::File *m_file; ulong readPictureBlockField(QByteArray data, int offset); }; class VorbisCommentModel : public TagModel { public: - VorbisCommentModel(const QString &path); + VorbisCommentModel(TagLib::Ogg::Opus::File *file); ~VorbisCommentModel(); const QString name(); const QString value(Qmmp::MetaData key); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/opus/replaygainreader.cpp new/qmmp-1.0.9/src/plugins/Input/opus/replaygainreader.cpp --- old/qmmp-1.0.7/src/plugins/Input/opus/replaygainreader.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/opus/replaygainreader.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2013-2015 by Ilya Kotov * + * Copyright (C) 2013-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -22,11 +22,13 @@ #include <taglib/tag.h> #include <taglib/fileref.h> #include <taglib/opusfile.h> +#include <taglib/tfilestream.h> #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { - TagLib::Ogg::Opus::File fileRef(path.toLocal8Bit ().constData()); + TagLib::FileStream stream(QStringToFileName(path), true); + TagLib::Ogg::Opus::File fileRef(&stream); if(fileRef.tag()) readVorbisComment(fileRef.tag()); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/vorbis/decodervorbisfactory.cpp new/qmmp-1.0.9/src/plugins/Input/vorbis/decodervorbisfactory.cpp --- old/qmmp-1.0.7/src/plugins/Input/vorbis/decodervorbisfactory.cpp 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/vorbis/decodervorbisfactory.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2008-2015 by Ilya Kotov * + * Copyright (C) 2008-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -23,15 +23,12 @@ #include <taglib/tag.h> #include <taglib/fileref.h> #include <taglib/vorbisfile.h> -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) #include <taglib/tfilestream.h> -#endif #include "replaygainreader.h" #include "decoder_vorbis.h" #include "vorbismetadatamodel.h" #include "decodervorbisfactory.h" - // DecoderOggFactory bool DecoderVorbisFactory::supports(const QString &source) const @@ -83,12 +80,8 @@ { FileInfo *info = new FileInfo(fileName); -#if (TAGLIB_MAJOR_VERSION > 1) || ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION >= 8)) - TagLib::FileStream stream(fileName.toLocal8Bit().constData(), true); + TagLib::FileStream stream(QStringToFileName(fileName), true); TagLib::Ogg::Vorbis::File fileRef(&stream); -#else - TagLib::Ogg::Vorbis::File fileRef(fileName.toLocal8Bit().constData()); -#endif TagLib::Ogg::XiphComment *tag = useMetaData ? fileRef.tag() : 0; if (tag && !tag->isEmpty()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/vorbis/replaygainreader.cpp new/qmmp-1.0.9/src/plugins/Input/vorbis/replaygainreader.cpp --- old/qmmp-1.0.7/src/plugins/Input/vorbis/replaygainreader.cpp 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/vorbis/replaygainreader.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -22,11 +22,15 @@ #include <taglib/tag.h> #include <taglib/fileref.h> #include <taglib/vorbisfile.h> +#include <taglib/tfilestream.h> +#include <taglib/id3v2framefactory.h> #include "replaygainreader.h" ReplayGainReader::ReplayGainReader(const QString &path) { - TagLib::Ogg::Vorbis::File fileRef(path.toLocal8Bit ().constData()); + TagLib::FileStream stream(QStringToFileName(path), true); + TagLib::Ogg::Vorbis::File fileRef(&stream); + if(fileRef.tag()) readVorbisComment(fileRef.tag()); } @@ -39,7 +43,7 @@ void ReplayGainReader::readVorbisComment(TagLib::Ogg::XiphComment *comment) { TagLib::Ogg::FieldListMap items = comment->fieldListMap(); - if (items.contains("REPLAYGAIN_TRACK_GAIN")) + if (items.contains("REPLAYGAIN_TRACK_GAIN")) setValue(Qmmp::REPLAYGAIN_TRACK_GAIN,TStringToQString(items["REPLAYGAIN_TRACK_GAIN"].front())); if (items.contains("REPLAYGAIN_TRACK_PEAK")) setValue(Qmmp::REPLAYGAIN_TRACK_PEAK,TStringToQString(items["REPLAYGAIN_TRACK_PEAK"].front())); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/vorbis/vorbismetadatamodel.cpp new/qmmp-1.0.9/src/plugins/Input/vorbis/vorbismetadatamodel.cpp --- old/qmmp-1.0.7/src/plugins/Input/vorbis/vorbismetadatamodel.cpp 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/vorbis/vorbismetadatamodel.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2015 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -18,6 +18,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ +#include <QtGlobal> #include <taglib/tag.h> #include <taglib/fileref.h> #include <taglib/vorbisfile.h> @@ -25,34 +26,43 @@ #include <taglib/tmap.h> #include "vorbismetadatamodel.h" -#define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) -#define TStringToQString_qt4(s) QString::fromUtf8(s.toCString(true)).trimmed() +#if ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION <= 9)) +#undef QStringToTString +#define QStringToTString(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8) +#endif VorbisMetaDataModel::VorbisMetaDataModel(const QString &path, QObject *parent) : MetaDataModel(parent) { m_path = path; - m_tags << new VorbisCommentModel(path); + m_file = new TagLib::Ogg::Vorbis::File(QStringToFileName(path)); + m_tag = m_file->tag(); + m_tags << new VorbisCommentModel(this); } VorbisMetaDataModel::~VorbisMetaDataModel() { while(!m_tags.isEmpty()) delete m_tags.takeFirst(); + + if(m_file) + { + delete m_file; + m_file = 0; + } } QHash<QString, QString> VorbisMetaDataModel::audioProperties() { QHash<QString, QString> ap; - TagLib::Ogg::Vorbis::File f (m_path.toLocal8Bit().constData()); - if(f.audioProperties()) + if(m_file->audioProperties()) { - QString text = QString("%1").arg(f.audioProperties()->length()/60); - text +=":"+QString("%1").arg(f.audioProperties()->length()%60,2,10,QChar('0')); + QString text = QString("%1").arg(m_file->audioProperties()->length()/60); + text +=":"+QString("%1").arg(m_file->audioProperties()->length()%60,2,10,QChar('0')); ap.insert(tr("Length"), text); - ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(f.audioProperties()->sampleRate())); - ap.insert(tr("Channels"), QString("%1").arg(f.audioProperties()->channels())); - ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(f.audioProperties()->bitrate())); - ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(f.length()/1024)); + ap.insert(tr("Sample rate"), QString("%1 " + tr("Hz")).arg(m_file->audioProperties()->sampleRate())); + ap.insert(tr("Channels"), QString("%1").arg(m_file->audioProperties()->channels())); + ap.insert(tr("Bitrate"), QString("%1 " + tr("kbps")).arg(m_file->audioProperties()->bitrate())); + ap.insert(tr("File size"), QString("%1 "+tr("KB")).arg(m_file->length()/1024)); } return ap; } @@ -64,17 +74,15 @@ QPixmap VorbisMetaDataModel::cover() { - TagLib::Ogg::Vorbis::File file(m_path.toLocal8Bit().constData()); - TagLib::Ogg::XiphComment *tag = file.tag(); - if(!tag) + if(!m_tag || m_tag->isEmpty()) return QPixmap(); - TagLib::StringList list = tag->fieldListMap()["METADATA_BLOCK_PICTURE"]; + TagLib::StringList list = m_tag->fieldListMap()["METADATA_BLOCK_PICTURE"]; if(list.isEmpty()) return QPixmap(); for(uint i = 0; i < list.size(); ++i) { TagLib::String value = list[i]; - QByteArray block = QByteArray::fromBase64(TStringToQString_qt4(value).toLatin1()); + QByteArray block = QByteArray::fromBase64(TStringToQString(value).toLatin1()); if(block.size() < 32) continue; qint64 pos = 0; @@ -109,16 +117,13 @@ } -VorbisCommentModel::VorbisCommentModel(const QString &path) : TagModel(TagModel::Save) +VorbisCommentModel::VorbisCommentModel(VorbisMetaDataModel *model) : TagModel(TagModel::Save) { - m_file = new TagLib::Ogg::Vorbis::File (path.toLocal8Bit().constData()); - m_tag = m_file->tag(); + m_model = model; } VorbisCommentModel::~VorbisCommentModel() -{ - delete m_file; -} +{} const QString VorbisCommentModel::name() { @@ -127,93 +132,99 @@ const QString VorbisCommentModel::value(Qmmp::MetaData key) { - if(!m_tag) + if(!m_model->m_tag || m_model->m_tag->isEmpty()) return QString(); + + TagLib::Ogg::XiphComment *tag = m_model->m_tag; switch((int) key) { case Qmmp::TITLE: - return TStringToQString_qt4(m_tag->title()); + return TStringToQString(tag->title()); case Qmmp::ARTIST: - return TStringToQString_qt4(m_tag->artist()); + return TStringToQString(tag->artist()); case Qmmp::ALBUMARTIST: - if(m_tag->fieldListMap()["ALBUMARTIST"].isEmpty()) + if(tag->fieldListMap()["ALBUMARTIST"].isEmpty()) return QString(); else - return TStringToQString_qt4(m_tag->fieldListMap()["ALBUMARTIST"].front()); + return TStringToQString(tag->fieldListMap()["ALBUMARTIST"].front()); case Qmmp::ALBUM: - return TStringToQString_qt4(m_tag->album()); + return TStringToQString(tag->album()); case Qmmp::COMMENT: - return TStringToQString_qt4(m_tag->comment()); + return TStringToQString(tag->comment()); case Qmmp::GENRE: - return TStringToQString_qt4(m_tag->genre()); + return TStringToQString(tag->genre()); case Qmmp::COMPOSER: - if(m_tag->fieldListMap()["COMPOSER"].isEmpty()) + if(tag->fieldListMap()["COMPOSER"].isEmpty()) return QString(); else - return TStringToQString_qt4(m_tag->fieldListMap()["COMPOSER"].front()); + return TStringToQString(tag->fieldListMap()["COMPOSER"].front()); case Qmmp::YEAR: - return QString::number(m_tag->year()); + return QString::number(tag->year()); case Qmmp::TRACK: - return QString::number(m_tag->track()); + return QString::number(tag->track()); case Qmmp::DISCNUMBER: - if(m_tag->fieldListMap()["DISCNUMBER"].isEmpty()) + if(tag->fieldListMap()["DISCNUMBER"].isEmpty()) return QString(); else - return TStringToQString_qt4(m_tag->fieldListMap()["DISCNUMBER"].front()); + return TStringToQString(tag->fieldListMap()["DISCNUMBER"].front()); } return QString(); } void VorbisCommentModel::setValue(Qmmp::MetaData key, const QString &value) { - if(!m_tag) + if(!m_model->m_tag || m_model->m_tag->isEmpty()) return; - TagLib::String str = QStringToTString_qt4(value); + TagLib::Ogg::XiphComment *tag = m_model->m_tag; + + TagLib::String str = QStringToTString(value); switch((int) key) { case Qmmp::TITLE: - m_tag->setTitle(str); + tag->setTitle(str); return; case Qmmp::ARTIST: - m_tag->setArtist(str); + tag->setArtist(str); return; case Qmmp::ALBUM: - m_tag->setAlbum(str); + tag->setAlbum(str); return; case Qmmp::ALBUMARTIST: - m_tag->addField("ALBUMARTIST", str, true); + tag->addField("ALBUMARTIST", str, true); return; case Qmmp::COMMENT: - m_tag->setComment(str); + tag->setComment(str); return; case Qmmp::GENRE: - m_tag->setGenre(str); + tag->setGenre(str); return; case Qmmp::COMPOSER: - m_tag->addField("COMPOSER", str, true); + tag->addField("COMPOSER", str, true); return; case Qmmp::TRACK: - m_tag->setTrack(value.toInt()); + tag->setTrack(value.toInt()); return; case Qmmp::YEAR: - m_tag->setYear(value.toInt()); + tag->setYear(value.toInt()); return; case Qmmp::DISCNUMBER: value == "0" ? - m_tag->removeField("DISCNUMBER"): - m_tag->addField("DISCNUMBER", str, true); + tag->removeField("DISCNUMBER"): + tag->addField("DISCNUMBER", str, true); } } void VorbisCommentModel::save() { - if(m_tag) - m_file->save(); + if(m_model->m_tag) + m_model->m_file->save(); + +#if ((TAGLIB_MAJOR_VERSION == 1) && (TAGLIB_MINOR_VERSION <= 10)) //taglib bug workarround - QString path = QString::fromLocal8Bit(m_file->name()); - delete m_file; - m_file = new TagLib::Ogg::Vorbis::File(path.toLocal8Bit().constData()); - m_tag = m_file->tag(); + delete m_model->m_file; + m_model->m_file = new TagLib::Ogg::Vorbis::File(QStringToFileName(m_model->m_path)); + m_model->m_tag = m_model->m_file->tag(); +#endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Input/vorbis/vorbismetadatamodel.h new/qmmp-1.0.9/src/plugins/Input/vorbis/vorbismetadatamodel.h --- old/qmmp-1.0.7/src/plugins/Input/vorbis/vorbismetadatamodel.h 2016-04-03 14:15:53.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Input/vorbis/vorbismetadatamodel.h 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2012 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -21,9 +21,11 @@ #ifndef VORBISMETADATAMODEL_H #define VORBISMETADATAMODEL_H +#include <qmmp/metadatamodel.h> #include <taglib/vorbisfile.h> #include <taglib/xiphcomment.h> -#include <qmmp/metadatamodel.h> + +class VorbisCommentModel; class VorbisMetaDataModel : public MetaDataModel { @@ -31,12 +33,16 @@ public: VorbisMetaDataModel(const QString &path, QObject *parent); ~VorbisMetaDataModel(); + friend class VorbisCommentModel; + QHash<QString, QString> audioProperties(); QList<TagModel* > tags(); QPixmap cover(); private: QString m_path; + TagLib::Ogg::Vorbis::File *m_file; + TagLib::Ogg::XiphComment *m_tag; QList<TagModel* > m_tags; ulong readPictureBlockField(QByteArray data, int offset); }; @@ -44,7 +50,7 @@ class VorbisCommentModel : public TagModel { public: - VorbisCommentModel(const QString &path); + VorbisCommentModel(VorbisMetaDataModel *model); ~VorbisCommentModel(); const QString name(); const QString value(Qmmp::MetaData key); @@ -52,8 +58,7 @@ void save(); private: - TagLib::Ogg::Vorbis::File *m_file; - TagLib::Ogg::XiphComment *m_tag; + VorbisMetaDataModel *m_model; }; #endif // VORBISMETADATAMODEL_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/plugins/Ui/qsui/mainwindow.cpp new/qmmp-1.0.9/src/plugins/Ui/qsui/mainwindow.cpp --- old/qmmp-1.0.7/src/plugins/Ui/qsui/mainwindow.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/plugins/Ui/qsui/mainwindow.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -130,6 +130,7 @@ m_statusLabel = new QLabel(this); m_ui.statusbar->addPermanentWidget(m_statusLabel, 0); m_ui.statusbar->addPermanentWidget(m_timeLabel, 1); + m_ui.statusbar->setStyleSheet("QStatusBar::item { border: 0px solid black };"); //volume m_ui.progressToolBar->addSeparator(); m_volumeSlider = new QSlider(Qt::Horizontal, this); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/qmmp/metadatamanager.cpp new/qmmp-1.0.9/src/qmmp/metadatamanager.cpp --- old/qmmp-1.0.7/src/qmmp/metadatamanager.cpp 2016-04-03 14:15:52.000000000 +0200 +++ new/qmmp-1.0.9/src/qmmp/metadatamanager.cpp 2016-05-02 14:23:19.000000000 +0200 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2009-2015 by Ilya Kotov * + * Copyright (C) 2009-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -183,7 +183,7 @@ if(model) { QPixmap pix = model->cover(); - model->deleteLater(); + delete model; if(!pix.isNull()) return pix; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qmmp-1.0.7/src/qmmp/qmmp.h new/qmmp-1.0.9/src/qmmp/qmmp.h --- old/qmmp-1.0.7/src/qmmp/qmmp.h 2016-04-03 14:15:59.000000000 +0200 +++ new/qmmp-1.0.9/src/qmmp/qmmp.h 2016-05-02 14:23:19.000000000 +0200 @@ -24,11 +24,20 @@ #define QMMP_VERSION_MAJOR 1 #define QMMP_VERSION_MINOR 0 -#define QMMP_VERSION_PATCH 7 +#define QMMP_VERSION_PATCH 9 #define QMMP_VERSION_STABLE 1 #define QMMP_VERSION_INT (QMMP_VERSION_MAJOR<<16 | QMMP_VERSION_MINOR<<8 | QMMP_VERSION_PATCH) +/*! + * Converts a \b QString to a \b TagLib::FileName + */ +#ifdef Q_OS_WIN +#define QStringToFileName(s) TagLib::FileName(reinterpret_cast<const wchar_t *>(s.utf16())) +#else +#define QStringToFileName(s) s.toLocal8Bit().constData() +#endif + /*! @brief The Qmmp class stores global settings and enums. * @author Ilya Kotov <forkotov02@hotmail.ru>
participants (1)
-
root@hilbert.suse.de