OSDN Git Service

Updated Monkey's Audio binaries to v10.36 (2023-12-17), compiled with ICL 2024.0...
[lamexp/LameXP.git] / src / Model_AudioFile.cpp
index df7b8cb..5e9d853 100644 (file)
@@ -1,12 +1,12 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2014 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2023 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
+// it under the terms of the GNU GENERAL PUBLIC LICENSE as published by
 // the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version, but always including the *additional*
-// restrictions defined in the "License.txt" file.
+// (at your option) any later version; always including the non-optional
+// LAMEXP GNU GENERAL PUBLIC LICENSE ADDENDUM. See "License.txt" file!
 //
 // This program is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 #include "Model_AudioFile.h"
 
+//Internal
 #include "Global.h"
 
+//MUtils
+#include <MUtils/Global.h>
+
+//Qt
 #include <QTime>
 #include <QObject>
 #include <QMutexLocker>
 #include <QFile>
 
+//CRT
 #include <limits.h>
 
 const unsigned int AudioFileModel::BITDEPTH_IEEE_FLOAT32 = UINT_MAX-1;
 
 #define PRINT_S(VAR) do \
 { \
-       if((VAR).isEmpty()) qDebug(#VAR " = N/A"); else qDebug(#VAR " = \"%s\"", QUTF8((VAR))); \
+       if((VAR).isEmpty()) qDebug(#VAR " = N/A"); else qDebug(#VAR " = \"%s\"", MUTILS_UTF8((VAR))); \
 } \
 while(0)
 
@@ -149,6 +155,29 @@ void AudioFileModel_MetaInfo::print(void) const
        PRINT_U(m_position);
 }
 
+bool  AudioFileModel_MetaInfo::empty(const bool &ignoreArtwork) const
+{
+       bool isEmpty = true;
+
+       if(!m_titel.isEmpty())   isEmpty = false;
+       if(!m_artist.isEmpty())  isEmpty = false;
+       if(!m_album.isEmpty())   isEmpty = false;
+       if(!m_genre.isEmpty())   isEmpty = false;
+       if(!m_comment.isEmpty()) isEmpty = false;
+       if(m_year)               isEmpty = false;
+       if(m_position)           isEmpty = false;
+
+       if(!ignoreArtwork)
+       {
+               if(!m_cover.isEmpty())
+               {
+                       isEmpty = false;
+               }
+       }
+
+       return isEmpty;
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 // Audio File - Technical Info
 ///////////////////////////////////////////////////////////////////////////////
@@ -346,7 +375,7 @@ const QString AudioFileModel::audioCompressInfo(void) const
                                info.append(QString(", %1: %2 kbps (%3)").arg(tr("Bitrate"), QString::number(m_techInfo.audioBitrate()), tr("Constant")));
                                break;
                        case BitrateModeVariable:
-                               info.append(WCHAR2QSTR(L", %1: \u2248%2 kbps (%3)").arg(tr("Bitrate"), QString::number(m_techInfo.audioBitrate()), tr("Variable")));
+                               info.append(MUTILS_QSTR(L", %1: \u2248%2 kbps (%3)").arg(tr("Bitrate"), QString::number(m_techInfo.audioBitrate()), tr("Variable")));
                                break;
                        default:
                                info.append(QString(", %1: %2 kbps").arg(tr("Bitrate"), QString::number(m_techInfo.audioBitrate())));