aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-12-22 21:25:12 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-12-22 21:25:12 +0000
commit2d1d2a4a807fced7d2b5e56998da67149bc2010e (patch)
treec007eafec3f36f0278f18bcd4dd3eaa90dfc3769
parent093bd596d5fe84a450a5b4ee2717c0f291555d5c (diff)
downloadqmmp-2d1d2a4a807fced7d2b5e56998da67149bc2010e.tar.gz
qmmp-2d1d2a4a807fced7d2b5e56998da67149bc2010e.tar.bz2
qmmp-2d1d2a4a807fced7d2b5e56998da67149bc2010e.zip
removed unused code
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1452 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/qmmp/CMakeLists.txt2
-rw-r--r--src/qmmp/qmmp.h7
-rw-r--r--src/qmmp/qmmp.pro2
-rw-r--r--src/qmmp/replaygain.cpp10
-rw-r--r--src/qmmp/replaygain.h7
-rw-r--r--src/qmmp/replaygaininfo.cpp99
-rw-r--r--src/qmmp/replaygaininfo.h51
7 files changed, 16 insertions, 162 deletions
diff --git a/src/qmmp/CMakeLists.txt b/src/qmmp/CMakeLists.txt
index 8b38fa9c5..beddd73f5 100644
--- a/src/qmmp/CMakeLists.txt
+++ b/src/qmmp/CMakeLists.txt
@@ -54,7 +54,6 @@ SET(libqmmp_SRCS
emptyinputsource.cpp
metadatamanager.cpp
replaygain.cpp
- replaygaininfo.cpp
replaygainsettings.cpp
)
@@ -87,7 +86,6 @@ SET(libqmmp_MOC_HDRS
enginefactory.h
metadatamanager.h
replaygain.h
- replaygaininfo.h
replaygainsettings.h
)
diff --git a/src/qmmp/qmmp.h b/src/qmmp/qmmp.h
index 89f799a14..360dd81b1 100644
--- a/src/qmmp/qmmp.h
+++ b/src/qmmp/qmmp.h
@@ -56,6 +56,13 @@ public:
DISCNUMBER,/*!< Disc number */
URL /*!< Stream url or local file path */
};
+ enum ReplayGainKey
+ {
+ REPLAYGAIN_TRACK_GAIN = 0,
+ REPLAYGAIN_TRACK_PEAK,
+ REPLAYGAIN_ALBUM_GAIN,
+ REPLAYGAIN_ALBUM_PEAK
+ };
/*!
* Returns configuration file path.
*/
diff --git a/src/qmmp/qmmp.pro b/src/qmmp/qmmp.pro
index 6284861e7..b71928f08 100644
--- a/src/qmmp/qmmp.pro
+++ b/src/qmmp/qmmp.pro
@@ -29,7 +29,6 @@ HEADERS += recycler.h \
inputsourcefactory.h \
enginefactory.h \
metadatamanager.h \
- replaygaininfo.h \
replaygain.h \
replaygainsettings.h
SOURCES += recycler.cpp \
@@ -54,7 +53,6 @@ SOURCES += recycler.cpp \
fileinputsource.cpp \
emptyinputsource.cpp \
metadatamanager.cpp \
- replaygaininfo.cpp \
replaygain.cpp \
replaygainsettings.cpp
FORMS +=
diff --git a/src/qmmp/replaygain.cpp b/src/qmmp/replaygain.cpp
index 611fe3ef7..cdfb47e60 100644
--- a/src/qmmp/replaygain.cpp
+++ b/src/qmmp/replaygain.cpp
@@ -33,7 +33,7 @@ void ReplayGain::setSampleSize(int bits)
updateScale();
}
-void ReplayGain::setReplayGainInfo(const ReplayGainInfo &info)
+void ReplayGain::setReplayGainInfo(const QMap<Qmmp::ReplayGainKey, double> &info)
{
m_info = info;
updateScale();
@@ -75,12 +75,12 @@ void ReplayGain::updateScale()
switch((int) m_settings.mode())
{
case ReplayGainSettings::TRACK:
- m_scale = pow(10.0, m_info.trackGain()/20);
- peak = m_info.trackPeak();
+ m_scale = pow(10.0, m_info[Qmmp::REPLAYGAIN_TRACK_GAIN]/20);
+ peak = m_info[Qmmp::REPLAYGAIN_TRACK_PEAK];
break;
case ReplayGainSettings::ALBUM:
- m_scale = pow(10.0, m_info.albumGain()/20);
- peak = m_info.albumPeak();
+ m_scale = pow(10.0, m_info[Qmmp::REPLAYGAIN_ALBUM_GAIN]/20);
+ peak = m_info[Qmmp::REPLAYGAIN_ALBUM_PEAK];
break;
case ReplayGainSettings::DISABLED:
m_scale = 1.0;
diff --git a/src/qmmp/replaygain.h b/src/qmmp/replaygain.h
index 28ba68e4c..c11679243 100644
--- a/src/qmmp/replaygain.h
+++ b/src/qmmp/replaygain.h
@@ -22,7 +22,8 @@
#define REPLAYGAIN_H
#include <QtGlobal>
-#include "replaygaininfo.h"
+#include <QMap>
+#include "qmmp.h"
#include "replaygainsettings.h"
/*!
@@ -35,13 +36,13 @@ public:
void setSampleSize(int bits);
void setReplayGainSettings(const ReplayGainSettings &settings);
- void setReplayGainInfo(const ReplayGainInfo &info);
+ void setReplayGainInfo(const QMap<Qmmp::ReplayGainKey, double> &info);
void applyReplayGain(char *data, qint64 size);
private:
void updateScale();
int m_bits;
- ReplayGainInfo m_info;
+ QMap<Qmmp::ReplayGainKey, double> m_info;
ReplayGainSettings m_settings;
double m_scale;
};
diff --git a/src/qmmp/replaygaininfo.cpp b/src/qmmp/replaygaininfo.cpp
deleted file mode 100644
index 90033d827..000000000
--- a/src/qmmp/replaygaininfo.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/***************************************************************************
- * 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
deleted file mode 100644
index 2109dccd8..000000000
--- a/src/qmmp/replaygaininfo.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- * 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