aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-12-12 10:36:27 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-12-12 10:36:27 +0000
commit8ce673a6d805a3b0c290b7c6587ff2180a8b3bc5 (patch)
tree30b7296c0f115a757c68cc20e33cc2e00fccd282
parent9447729e6a99b0e7532670c4f76b8151eefe47aa (diff)
downloadqmmp-8ce673a6d805a3b0c290b7c6587ff2180a8b3bc5.tar.gz
qmmp-8ce673a6d805a3b0c290b7c6587ff2180a8b3bc5.tar.bz2
qmmp-8ce673a6d805a3b0c290b7c6587ff2180a8b3bc5.zip
added ReplayGainInfo class
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1438 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/qmmp/qmmp.pro6
-rw-r--r--src/qmmp/replaygaininfo.cpp99
-rw-r--r--src/qmmp/replaygaininfo.h51
3 files changed, 154 insertions, 2 deletions
diff --git a/src/qmmp/qmmp.pro b/src/qmmp/qmmp.pro
index a88480b85..638fe71ac 100644
--- a/src/qmmp/qmmp.pro
+++ b/src/qmmp/qmmp.pro
@@ -28,7 +28,8 @@ HEADERS += recycler.h \
emptyinputsource.h \
inputsourcefactory.h \
enginefactory.h \
- metadatamanager.h
+ metadatamanager.h \
+ replaygaininfo.h
SOURCES += recycler.cpp \
decoder.cpp \
output.cpp \
@@ -50,7 +51,8 @@ SOURCES += recycler.cpp \
inputsource.cpp \
fileinputsource.cpp \
emptyinputsource.cpp \
- metadatamanager.cpp
+ metadatamanager.cpp \
+ replaygaininfo.cpp
FORMS +=
unix:TARGET = ../../lib/qmmp
win32:TARGET = ../../../bin/qmmp
diff --git a/src/qmmp/replaygaininfo.cpp b/src/qmmp/replaygaininfo.cpp
new file mode 100644
index 000000000..90033d827
--- /dev/null
+++ b/src/qmmp/replaygaininfo.cpp
@@ -0,0 +1,99 @@
+/***************************************************************************
+ * Copyright (C) 2009 by Ilya Kotov *
+ * forkotov02@hotmail.ru *
+ * *
+ * 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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "replaygaininfo.h"
+
+ReplayGainInfo::ReplayGainInfo()
+{
+ m_trackGain = 0;
+ m_trackPeak = 0;
+ m_albumGain = 0;
+ m_albumPeak = 0;
+}
+
+ReplayGainInfo::ReplayGainInfo(const ReplayGainInfo &other)
+{
+ m_trackGain = other.trackGain();
+ m_trackPeak = other.trackPeak();
+ m_albumGain = other.albumGain();
+ m_albumPeak = other.albumPeak();
+}
+
+void ReplayGainInfo::operator=(const ReplayGainInfo &ri)
+{
+ m_trackGain = ri.trackGain();
+ m_trackPeak = ri.trackPeak();
+ m_albumGain = ri.albumGain();
+ m_albumPeak = ri.albumPeak();
+}
+
+bool ReplayGainInfo::operator==(const ReplayGainInfo &ri) const
+{
+ return m_trackGain == ri.trackGain() &&
+ m_trackPeak == ri.trackPeak() &&
+ m_albumGain == ri.albumGain() &&
+ m_albumPeak == ri.albumPeak();
+
+}
+
+bool ReplayGainInfo::operator!=(const ReplayGainInfo &ri) const
+{
+ return !operator==(ri);
+}
+
+double ReplayGainInfo::trackGain() const
+{
+ return m_trackGain;
+}
+
+double ReplayGainInfo::trackPeak() const
+{
+ return m_trackPeak;
+}
+
+double ReplayGainInfo::albumGain() const
+{
+ return m_albumGain;
+}
+
+double ReplayGainInfo::albumPeak() const
+{
+ return m_albumPeak;
+}
+
+void ReplayGainInfo::setTrackGain(double r)
+{
+ m_trackGain = r;
+}
+
+void ReplayGainInfo::setTrackPeak(double r)
+{
+ m_trackPeak = r;
+}
+
+void ReplayGainInfo::setAlbumGain(double r)
+{
+ m_albumGain = r;
+}
+
+void ReplayGainInfo::setAlbumPeak(double r)
+{
+ m_albumPeak = r;
+}
diff --git a/src/qmmp/replaygaininfo.h b/src/qmmp/replaygaininfo.h
new file mode 100644
index 000000000..2109dccd8
--- /dev/null
+++ b/src/qmmp/replaygaininfo.h
@@ -0,0 +1,51 @@
+/***************************************************************************
+ * Copyright (C) 2009 by Ilya Kotov *
+ * forkotov02@hotmail.ru *
+ * *
+ * 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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef REPLAYGAININFO_H
+#define REPLAYGAININFO_H
+
+/**
+ @author Ilya Kotov <forkotov02@hotmail.ru>
+*/
+class ReplayGainInfo
+{
+public:
+ ReplayGainInfo();
+ ReplayGainInfo(const ReplayGainInfo &other);
+ void operator=(const ReplayGainInfo &ri);
+ bool operator==(const ReplayGainInfo &ri) const;
+ bool operator!=(const ReplayGainInfo &ri) const;
+ double trackGain() const;
+ double trackPeak() const;
+ double albumGain() const;
+ double albumPeak() const;
+ void setTrackGain(double r);
+ void setTrackPeak(double r);
+ void setAlbumGain(double r);
+ void setAlbumPeak(double r);
+
+private:
+ double m_trackGain;
+ double m_trackPeak;
+ double m_albumGain;
+ double m_albumPeak;
+};
+
+#endif // REPLAYGAININFO_H