diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmmp/qmmp.pro | 6 | ||||
| -rw-r--r-- | src/qmmp/replaygaininfo.cpp | 99 | ||||
| -rw-r--r-- | src/qmmp/replaygaininfo.h | 51 |
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 |
