From 94d94e53ee022fa98bc6fcafa3b645e29916c6b4 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Sun, 27 Dec 2015 15:05:38 +0000 Subject: added AudioConverter to public api git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5912 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmp/CMakeLists.txt | 3 ++- src/qmmp/audioconverter.cpp | 2 +- src/qmmp/audioconverter.h | 46 ++++++++++++++++++++++++++++++++++++++++++++ src/qmmp/audioconverter_p.h | 46 -------------------------------------------- src/qmmp/outputwriter.cpp | 2 +- src/qmmp/qmmp.pro | 5 +++-- src/qmmp/qmmpaudioengine.cpp | 2 +- 7 files changed, 54 insertions(+), 52 deletions(-) create mode 100644 src/qmmp/audioconverter.h delete mode 100644 src/qmmp/audioconverter_p.h (limited to 'src') diff --git a/src/qmmp/CMakeLists.txt b/src/qmmp/CMakeLists.txt index 3cc2a0e9b..9b45af1c8 100644 --- a/src/qmmp/CMakeLists.txt +++ b/src/qmmp/CMakeLists.txt @@ -78,7 +78,7 @@ SET(libqmmp_HDRS qmmp.h replaygain_p.h fileinfo.h - audioconverter_p.h + audioconverter.h qmmpplugincache_p.h eqsettings.h decoder.h @@ -94,6 +94,7 @@ SET(libqmmp_HDRS SET(libqmmp_DEVEL_HDRS abstractengine.h + audioconverter.h audioparameters.h buffer.h decoderfactory.h diff --git a/src/qmmp/audioconverter.cpp b/src/qmmp/audioconverter.cpp index fd5f8ad3c..cda48905b 100644 --- a/src/qmmp/audioconverter.cpp +++ b/src/qmmp/audioconverter.cpp @@ -21,7 +21,7 @@ #include #include #include -#include "audioconverter_p.h" +#include "audioconverter.h" #define INT_TO_FLOAT(TYPE,in,out,samples,offset,max) \ { \ diff --git a/src/qmmp/audioconverter.h b/src/qmmp/audioconverter.h new file mode 100644 index 000000000..02ad08297 --- /dev/null +++ b/src/qmmp/audioconverter.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2010-2015 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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef AUDIOCONVERTER_H +#define AUDIOCONVERTER_H + +#include +#include "qmmp.h" + +/*! + * @author Ilya Kotov + */ +class AudioConverter +{ +public: + AudioConverter(); + + void configure(Qmmp::AudioFormat f); + void toFloat(const unsigned char *in, float *out, size_t samples); + void fromFloat(const float *in, const unsigned char *out, size_t samples); + + +private: + Qmmp::AudioFormat m_format; + bool m_swap; + +}; + +#endif // AUDIOCONVERTER_H diff --git a/src/qmmp/audioconverter_p.h b/src/qmmp/audioconverter_p.h deleted file mode 100644 index 2cb017355..000000000 --- a/src/qmmp/audioconverter_p.h +++ /dev/null @@ -1,46 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010-2015 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., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef AUDIOCONVERTER_P_H -#define AUDIOCONVERTER_P_H - -#include -#include "qmmp.h" - -/*! @internal - * @author Ilya Kotov - */ -class AudioConverter -{ -public: - AudioConverter(); - - void configure(Qmmp::AudioFormat f); - void toFloat(const unsigned char *in, float *out, size_t samples); - void fromFloat(const float *in, const unsigned char *out, size_t samples); - - -private: - Qmmp::AudioFormat m_format; - bool m_swap; - -}; - -#endif // AUDIOCONVERTER_P_H diff --git a/src/qmmp/outputwriter.cpp b/src/qmmp/outputwriter.cpp index ae64779d7..8e78bb6c3 100644 --- a/src/qmmp/outputwriter.cpp +++ b/src/qmmp/outputwriter.cpp @@ -22,7 +22,7 @@ #include "statehandler.h" #include "visual.h" #include "output.h" -#include "audioconverter_p.h" +#include "audioconverter.h" #include "channelconverter_p.h" #include "volumecontrol_p.h" #include "outputwriter_p.h" diff --git a/src/qmmp/qmmp.pro b/src/qmmp/qmmp.pro index a9421c547..34b1fbbff 100644 --- a/src/qmmp/qmmp.pro +++ b/src/qmmp/qmmp.pro @@ -29,7 +29,6 @@ HEADERS += \ enginefactory.h \ metadatamanager.h \ replaygain_p.h \ - audioconverter_p.h \ qmmpsettings.h \ eqsettings.h \ qmmpevents_p.h \ @@ -39,7 +38,8 @@ HEADERS += \ recycler_p.h \ qmmpplugincache_p.h \ channelmap.h \ - channelconverter_p.h + channelconverter_p.h \ + audioconverter.h SOURCES += recycler.cpp \ decoder.cpp \ output.cpp \ @@ -107,6 +107,7 @@ unix { target.path = $$LIB_DIR devel.files += \ abstractengine.h \ + audioconverter.h audioparameters.h \ buffer.h \ decoderfactory.h \ diff --git a/src/qmmp/qmmpaudioengine.cpp b/src/qmmp/qmmpaudioengine.cpp index d55372266..505d148e9 100644 --- a/src/qmmp/qmmpaudioengine.cpp +++ b/src/qmmp/qmmpaudioengine.cpp @@ -30,7 +30,7 @@ #include "effectfactory.h" #include "inputsource.h" #include "statehandler.h" -#include "audioconverter_p.h" +#include "audioconverter.h" #include "qmmpaudioengine_p.h" #include "channelconverter_p.h" #include "metadatamanager.h" -- cgit v1.2.3-13-gbd6f