From 6ba4fc48fd35f5c0ea53739cce79fae84014aeeb Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 27 Jun 2011 17:32:13 +0000 Subject: renamed private headers git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2240 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmp/abstractengine.cpp | 2 +- src/qmmp/audioconverter.cpp | 2 +- src/qmmp/audioconverter.h | 41 ------------- src/qmmp/audioconverter_p.h | 41 +++++++++++++ src/qmmp/effect.cpp | 2 +- src/qmmp/emptyinputsource.cpp | 2 +- src/qmmp/emptyinputsource.h | 43 ------------- src/qmmp/emptyinputsource_p.h | 43 +++++++++++++ src/qmmp/fileinputsource.cpp | 2 +- src/qmmp/fileinputsource.h | 45 -------------- src/qmmp/fileinputsource_p.h | 45 ++++++++++++++ src/qmmp/inputsource.cpp | 4 +- src/qmmp/metadatachangedevent.cpp | 2 +- src/qmmp/metadatachangedevent.h | 50 --------------- src/qmmp/metadatachangedevent_p.h | 50 +++++++++++++++ src/qmmp/qmmp.pro | 14 ++--- src/qmmp/qmmpaudioengine.cpp | 6 +- src/qmmp/qmmpaudioengine.h | 96 ----------------------------- src/qmmp/qmmpaudioengine_p.h | 96 +++++++++++++++++++++++++++++ src/qmmp/replaygain.cpp | 2 +- src/qmmp/replaygain.h | 54 ----------------- src/qmmp/replaygain_p.h | 54 +++++++++++++++++ src/qmmp/soundcore.cpp | 6 +- src/qmmp/statechangedevent.cpp | 2 +- src/qmmp/statechangedevent.h | 45 -------------- src/qmmp/statechangedevent_p.h | 45 ++++++++++++++ src/qmmp/statehandler.cpp | 4 +- src/qmmpui/abstractplaylistitem.cpp | 116 ----------------------------------- src/qmmpui/abstractplaylistitem.h | 118 ------------------------------------ src/qmmpui/detailsdialog.cpp | 2 +- src/qmmpui/filedialog.cpp | 2 +- src/qmmpui/fileloader.cpp | 4 +- src/qmmpui/fileloader.h | 88 --------------------------- src/qmmpui/fileloader_p.h | 88 +++++++++++++++++++++++++++ src/qmmpui/mediaplayer.cpp | 4 +- src/qmmpui/playlistitem.cpp | 2 +- src/qmmpui/playlistmanager.cpp | 2 +- src/qmmpui/playlistmodel.cpp | 6 +- src/qmmpui/playlistsettings.cpp | 2 +- src/qmmpui/playlistsettings.h | 53 ---------------- src/qmmpui/playlistsettings_p.h | 53 ++++++++++++++++ src/qmmpui/playstate.cpp | 2 +- src/qmmpui/playstate.h | 110 --------------------------------- src/qmmpui/playstate_p.h | 110 +++++++++++++++++++++++++++++++++ src/qmmpui/qmmpui.pro | 12 ++-- src/qmmpui/qtfiledialog.cpp | 2 +- src/qmmpui/qtfiledialog.h | 75 ----------------------- src/qmmpui/qtfiledialog_p.h | 75 +++++++++++++++++++++++ src/qmmpui/tageditor.cpp | 2 +- src/qmmpui/tageditor.h | 51 ---------------- src/qmmpui/tageditor_p.h | 51 ++++++++++++++++ src/ui/playlist.cpp | 1 - 52 files changed, 797 insertions(+), 1032 deletions(-) delete mode 100644 src/qmmp/audioconverter.h create mode 100644 src/qmmp/audioconverter_p.h delete mode 100644 src/qmmp/emptyinputsource.h create mode 100644 src/qmmp/emptyinputsource_p.h delete mode 100644 src/qmmp/fileinputsource.h create mode 100644 src/qmmp/fileinputsource_p.h delete mode 100644 src/qmmp/metadatachangedevent.h create mode 100644 src/qmmp/metadatachangedevent_p.h delete mode 100644 src/qmmp/qmmpaudioengine.h create mode 100644 src/qmmp/qmmpaudioengine_p.h delete mode 100644 src/qmmp/replaygain.h create mode 100644 src/qmmp/replaygain_p.h delete mode 100644 src/qmmp/statechangedevent.h create mode 100644 src/qmmp/statechangedevent_p.h delete mode 100644 src/qmmpui/abstractplaylistitem.cpp delete mode 100644 src/qmmpui/abstractplaylistitem.h delete mode 100644 src/qmmpui/fileloader.h create mode 100644 src/qmmpui/fileloader_p.h delete mode 100644 src/qmmpui/playlistsettings.h create mode 100644 src/qmmpui/playlistsettings_p.h delete mode 100644 src/qmmpui/playstate.h create mode 100644 src/qmmpui/playstate_p.h delete mode 100644 src/qmmpui/qtfiledialog.h create mode 100644 src/qmmpui/qtfiledialog_p.h delete mode 100644 src/qmmpui/tageditor.h create mode 100644 src/qmmpui/tageditor_p.h diff --git a/src/qmmp/abstractengine.cpp b/src/qmmp/abstractengine.cpp index 702bf66aa..bf452756e 100644 --- a/src/qmmp/abstractengine.cpp +++ b/src/qmmp/abstractengine.cpp @@ -23,7 +23,7 @@ #include #include #include "enginefactory.h" -#include "qmmpaudioengine.h" +#include "qmmpaudioengine_p.h" #include "qmmp.h" #include "abstractengine.h" diff --git a/src/qmmp/audioconverter.cpp b/src/qmmp/audioconverter.cpp index dbe9706e7..e6718d47e 100644 --- a/src/qmmp/audioconverter.cpp +++ b/src/qmmp/audioconverter.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "audioconverter.h" +#include "audioconverter_p.h" //static functions static inline void s8_to_s16(qint8 *in, qint16 *out, qint64 samples) diff --git a/src/qmmp/audioconverter.h b/src/qmmp/audioconverter.h deleted file mode 100644 index 5fdaa1caa..000000000 --- a/src/qmmp/audioconverter.h +++ /dev/null @@ -1,41 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2010 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 AUDIOCONVERTER_H -#define AUDIOCONVERTER_H - -#include "effect.h" - -/*! @internal - * @author Ilya Kotov - */ -class AudioConverter : public Effect -{ -public: - AudioConverter(); - void configure(quint32 srate = 44100, int chan = 2, Qmmp::AudioFormat f = Qmmp::PCM_S16LE); - void applyEffect(Buffer *b); - -private: - Qmmp::AudioFormat m_format; - -}; - -#endif // AUDIOCONVERTER_H diff --git a/src/qmmp/audioconverter_p.h b/src/qmmp/audioconverter_p.h new file mode 100644 index 000000000..5fdaa1caa --- /dev/null +++ b/src/qmmp/audioconverter_p.h @@ -0,0 +1,41 @@ +/*************************************************************************** + * Copyright (C) 2010 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 AUDIOCONVERTER_H +#define AUDIOCONVERTER_H + +#include "effect.h" + +/*! @internal + * @author Ilya Kotov + */ +class AudioConverter : public Effect +{ +public: + AudioConverter(); + void configure(quint32 srate = 44100, int chan = 2, Qmmp::AudioFormat f = Qmmp::PCM_S16LE); + void applyEffect(Buffer *b); + +private: + Qmmp::AudioFormat m_format; + +}; + +#endif // AUDIOCONVERTER_H diff --git a/src/qmmp/effect.cpp b/src/qmmp/effect.cpp index 51490f098..a172cd97b 100644 --- a/src/qmmp/effect.cpp +++ b/src/qmmp/effect.cpp @@ -22,7 +22,7 @@ #include #include #include -#include "qmmpaudioengine.h" +#include "qmmpaudioengine_p.h" #include "qmmp.h" #include "effectfactory.h" #include "effect.h" diff --git a/src/qmmp/emptyinputsource.cpp b/src/qmmp/emptyinputsource.cpp index 1b1c13748..d841e3d3c 100644 --- a/src/qmmp/emptyinputsource.cpp +++ b/src/qmmp/emptyinputsource.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "emptyinputsource.h" +#include "emptyinputsource_p.h" EmptyInputSource::EmptyInputSource(const QString &url, QObject *parent) : InputSource(url,parent) { diff --git a/src/qmmp/emptyinputsource.h b/src/qmmp/emptyinputsource.h deleted file mode 100644 index 09798791b..000000000 --- a/src/qmmp/emptyinputsource.h +++ /dev/null @@ -1,43 +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 EMPTYINPUTSOURCE_H -#define EMPTYINPUTSOURCE_H - -#include "inputsource.h" - -/*! @internal - @author Ilya Kotov -*/ -class EmptyInputSource : public InputSource -{ -Q_OBJECT -public: - EmptyInputSource(const QString &url, QObject *parent = 0); - - QIODevice *ioDevice(); - bool initialize(); - bool isReady(); - -private: - bool m_ok; -}; - -#endif // EMPTYINPUTSOURCE_H diff --git a/src/qmmp/emptyinputsource_p.h b/src/qmmp/emptyinputsource_p.h new file mode 100644 index 000000000..09798791b --- /dev/null +++ b/src/qmmp/emptyinputsource_p.h @@ -0,0 +1,43 @@ +/*************************************************************************** + * 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 EMPTYINPUTSOURCE_H +#define EMPTYINPUTSOURCE_H + +#include "inputsource.h" + +/*! @internal + @author Ilya Kotov +*/ +class EmptyInputSource : public InputSource +{ +Q_OBJECT +public: + EmptyInputSource(const QString &url, QObject *parent = 0); + + QIODevice *ioDevice(); + bool initialize(); + bool isReady(); + +private: + bool m_ok; +}; + +#endif // EMPTYINPUTSOURCE_H diff --git a/src/qmmp/fileinputsource.cpp b/src/qmmp/fileinputsource.cpp index 60e91f450..99d4453e8 100644 --- a/src/qmmp/fileinputsource.cpp +++ b/src/qmmp/fileinputsource.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include -#include "fileinputsource.h" +#include "fileinputsource_p.h" FileInputSource::FileInputSource(const QString &url, QObject *parent) : InputSource(url,parent) { diff --git a/src/qmmp/fileinputsource.h b/src/qmmp/fileinputsource.h deleted file mode 100644 index 084a412ab..000000000 --- a/src/qmmp/fileinputsource.h +++ /dev/null @@ -1,45 +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 FILEINPUTSOURCE_H -#define FILEINPUTSOURCE_H - -#include "inputsource.h" - -class QFile; - -/** @internal - @author Ilya Kotov -*/ -class FileInputSource : public InputSource -{ -Q_OBJECT -public: - FileInputSource(const QString &url, QObject *parent = 0); - - QIODevice *ioDevice(); - bool initialize(); - bool isReady(); - -private: - QFile *m_file; -}; - -#endif // FILEINPUTSOURCE_H diff --git a/src/qmmp/fileinputsource_p.h b/src/qmmp/fileinputsource_p.h new file mode 100644 index 000000000..084a412ab --- /dev/null +++ b/src/qmmp/fileinputsource_p.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * 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 FILEINPUTSOURCE_H +#define FILEINPUTSOURCE_H + +#include "inputsource.h" + +class QFile; + +/** @internal + @author Ilya Kotov +*/ +class FileInputSource : public InputSource +{ +Q_OBJECT +public: + FileInputSource(const QString &url, QObject *parent = 0); + + QIODevice *ioDevice(); + bool initialize(); + bool isReady(); + +private: + QFile *m_file; +}; + +#endif // FILEINPUTSOURCE_H diff --git a/src/qmmp/inputsource.cpp b/src/qmmp/inputsource.cpp index 43451f356..8d1a93a08 100644 --- a/src/qmmp/inputsource.cpp +++ b/src/qmmp/inputsource.cpp @@ -23,8 +23,8 @@ #include #include #include "qmmp.h" -#include "fileinputsource.h" -#include "emptyinputsource.h" +#include "fileinputsource_p.h" +#include "emptyinputsource_p.h" #include "inputsource.h" InputSource::InputSource(const QString &source, QObject *parent) : QObject(parent) diff --git a/src/qmmp/metadatachangedevent.cpp b/src/qmmp/metadatachangedevent.cpp index 210f03f50..891666349 100644 --- a/src/qmmp/metadatachangedevent.cpp +++ b/src/qmmp/metadatachangedevent.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "metadatachangedevent.h" +#include "metadatachangedevent_p.h" MetaDataChangedEvent::MetaDataChangedEvent(const QMap &metaData) : QEvent (QEvent::Type(Qmmp::MetaDataChanged)) diff --git a/src/qmmp/metadatachangedevent.h b/src/qmmp/metadatachangedevent.h deleted file mode 100644 index f49c87f33..000000000 --- a/src/qmmp/metadatachangedevent.h +++ /dev/null @@ -1,50 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2011 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 METADATACHANGEDEVENT_H -#define METADATACHANGEDEVENT_H - -#include -#include -#include -#include "qmmp.h" - -/*! @internal - * @author Ilya Kotov - */ -class MetaDataChangedEvent : public QEvent -{ -public: - MetaDataChangedEvent(const QMap &metaData); - virtual ~MetaDataChangedEvent(); - /*! - * Returns all meta data in map. - */ - QMap metaData(); - /*! - * Returns the metdata string associated with the given \b key. - */ - QString metaData(Qmmp::MetaData key); - -private: - QMap m_metaData; -}; - -#endif // METADATACHANGEDEVENT_H diff --git a/src/qmmp/metadatachangedevent_p.h b/src/qmmp/metadatachangedevent_p.h new file mode 100644 index 000000000..f49c87f33 --- /dev/null +++ b/src/qmmp/metadatachangedevent_p.h @@ -0,0 +1,50 @@ +/*************************************************************************** + * Copyright (C) 2011 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 METADATACHANGEDEVENT_H +#define METADATACHANGEDEVENT_H + +#include +#include +#include +#include "qmmp.h" + +/*! @internal + * @author Ilya Kotov + */ +class MetaDataChangedEvent : public QEvent +{ +public: + MetaDataChangedEvent(const QMap &metaData); + virtual ~MetaDataChangedEvent(); + /*! + * Returns all meta data in map. + */ + QMap metaData(); + /*! + * Returns the metdata string associated with the given \b key. + */ + QString metaData(Qmmp::MetaData key); + +private: + QMap m_metaData; +}; + +#endif // METADATACHANGEDEVENT_H diff --git a/src/qmmp/qmmp.pro b/src/qmmp/qmmp.pro index 2160de85e..cece5d73d 100644 --- a/src/qmmp/qmmp.pro +++ b/src/qmmp/qmmp.pro @@ -21,16 +21,16 @@ HEADERS += recycler.h \ metadatamodel.h \ tagmodel.h \ abstractengine.h \ - qmmpaudioengine.h \ + qmmpaudioengine_p.h \ audioparameters.h \ inputsource.h \ - fileinputsource.h \ - emptyinputsource.h \ + fileinputsource_p.h \ + emptyinputsource_p.h \ inputsourcefactory.h \ enginefactory.h \ metadatamanager.h \ replaygain.h \ - audioconverter.h \ + audioconverter_p.h \ qmmpsettings.h \ eqsettings.h \ statechangedevent.h \ @@ -63,7 +63,7 @@ SOURCES += recycler.cpp \ eqsettings.cpp \ statechangedevent.cpp \ metadatachangedevent.cpp -FORMS += +FORMS += unix:TARGET = ../../lib/qmmp win32:TARGET = ../../../bin/qmmp CONFIG += release \ @@ -77,11 +77,11 @@ unix:isEmpty(LIB_DIR):LIB_DIR = /lib unix:DEFINES += LIB_DIR=\\\"$$LIB_DIR\\\" DEFINES += QMMP_VERSION=$$QMMP_VERSION DEFINES += QMMP_STR_VERSION=\\\"$$QMMP_VERSION\\\" -contains(CONFIG, SVN_VERSION) { +contains(CONFIG, SVN_VERSION) { unix:DEFINES += SVN_REVISION=\\\"$$system(./svn_revision.sh)\\\" win32:DEFINES += SVN_REVISION=\\\"svn\\\" } -unix { +unix { target.path = $$LIB_DIR devel.files += recycler.h \ buffer.h \ diff --git a/src/qmmp/qmmpaudioengine.cpp b/src/qmmp/qmmpaudioengine.cpp index 0ba012e9c..275663637 100644 --- a/src/qmmp/qmmpaudioengine.cpp +++ b/src/qmmp/qmmpaudioengine.cpp @@ -21,7 +21,7 @@ #include #include #include -#include "replaygain.h" +#include "replaygain_p.h" #include "effect.h" #include "buffer.h" #include "decoder.h" @@ -29,8 +29,8 @@ #include "decoderfactory.h" #include "effectfactory.h" #include "inputsource.h" -#include "audioconverter.h" -#include "qmmpaudioengine.h" +#include "audioconverter_p.h" +#include "qmmpaudioengine_p.h" #include "metadatamanager.h" diff --git a/src/qmmp/qmmpaudioengine.h b/src/qmmp/qmmpaudioengine.h deleted file mode 100644 index aaef326da..000000000 --- a/src/qmmp/qmmpaudioengine.h +++ /dev/null @@ -1,96 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009-2010 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 QMMPAUDIOENGINE_H -#define QMMPAUDIOENGINE_H - -#include -#include -#include "abstractengine.h" -#include "audioparameters.h" - -class QIODevice; -class Output; -class Effect; -class DecoderFactory; -class StateHandler; -class Decoder; -class InputSource; -class EffectFactory; -class ReplayGain; -class QmmpSettings; - -/*! @internal - * @author Ilya Kotov - */ -class QmmpAudioEngine : public AbstractEngine -{ -Q_OBJECT -public: - QmmpAudioEngine(QObject *parent); - ~QmmpAudioEngine(); - - bool play(); - bool enqueue(InputSource *source); - qint64 totalTime(); - void seek(qint64 time); - void stop(); - void pause(); - void addEffect(EffectFactory *factory); - void removeEffect(EffectFactory *factory); - - static QmmpAudioEngine *instance(); - -private slots: - void finish(); - void updateReplayGainSettings(); - -private: - void run(); - void reset(); - void flush(bool = false); - void addOffset(); - qint64 produceSound(char *data, qint64 size, quint32 brate); - void sendMetaData(); - Output *createOutput(); - void prepareEffects(Decoder *d); - - DecoderFactory *m_factory; - QList m_effects; - QList m_blockedEffects; - Output *m_output; - - bool m_done, m_finish, m_user_stop; - uint m_bks; - qint64 m_totalTime, m_seekTime; - qint64 m_output_at, m_output_size; - int m_bitrate, m_chan, m_bps; - unsigned char *m_output_buf; - Decoder *m_decoder; - QQueue m_decoders; - QHash m_inputs; - AudioParameters m_ap; - bool m_next; - static QmmpAudioEngine *m_instance; - ReplayGain *m_replayGain; - QmmpSettings *m_settings; -}; - -#endif // QMMPAUDIOENGINE_H diff --git a/src/qmmp/qmmpaudioengine_p.h b/src/qmmp/qmmpaudioengine_p.h new file mode 100644 index 000000000..aaef326da --- /dev/null +++ b/src/qmmp/qmmpaudioengine_p.h @@ -0,0 +1,96 @@ +/*************************************************************************** + * Copyright (C) 2009-2010 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 QMMPAUDIOENGINE_H +#define QMMPAUDIOENGINE_H + +#include +#include +#include "abstractengine.h" +#include "audioparameters.h" + +class QIODevice; +class Output; +class Effect; +class DecoderFactory; +class StateHandler; +class Decoder; +class InputSource; +class EffectFactory; +class ReplayGain; +class QmmpSettings; + +/*! @internal + * @author Ilya Kotov + */ +class QmmpAudioEngine : public AbstractEngine +{ +Q_OBJECT +public: + QmmpAudioEngine(QObject *parent); + ~QmmpAudioEngine(); + + bool play(); + bool enqueue(InputSource *source); + qint64 totalTime(); + void seek(qint64 time); + void stop(); + void pause(); + void addEffect(EffectFactory *factory); + void removeEffect(EffectFactory *factory); + + static QmmpAudioEngine *instance(); + +private slots: + void finish(); + void updateReplayGainSettings(); + +private: + void run(); + void reset(); + void flush(bool = false); + void addOffset(); + qint64 produceSound(char *data, qint64 size, quint32 brate); + void sendMetaData(); + Output *createOutput(); + void prepareEffects(Decoder *d); + + DecoderFactory *m_factory; + QList m_effects; + QList m_blockedEffects; + Output *m_output; + + bool m_done, m_finish, m_user_stop; + uint m_bks; + qint64 m_totalTime, m_seekTime; + qint64 m_output_at, m_output_size; + int m_bitrate, m_chan, m_bps; + unsigned char *m_output_buf; + Decoder *m_decoder; + QQueue m_decoders; + QHash m_inputs; + AudioParameters m_ap; + bool m_next; + static QmmpAudioEngine *m_instance; + ReplayGain *m_replayGain; + QmmpSettings *m_settings; +}; + +#endif // QMMPAUDIOENGINE_H diff --git a/src/qmmp/replaygain.cpp b/src/qmmp/replaygain.cpp index ccd3bf28e..b9e143ad6 100644 --- a/src/qmmp/replaygain.cpp +++ b/src/qmmp/replaygain.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include -#include "replaygain.h" +#include "replaygain_p.h" ReplayGain::ReplayGain() { diff --git a/src/qmmp/replaygain.h b/src/qmmp/replaygain.h deleted file mode 100644 index 50b3a373a..000000000 --- a/src/qmmp/replaygain.h +++ /dev/null @@ -1,54 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2009-2010 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 REPLAYGAIN_H -#define REPLAYGAIN_H - -#include -#include -#include "qmmpsettings.h" -#include "qmmp.h" - -/*! @internal - * @author Ilya Kotov - */ -class ReplayGain -{ -public: - ReplayGain(); - - void setSampleSize(int size); - void updateSettings(QmmpSettings::ReplayGainMode mode, double preamp, - double default_gain, bool clip); - void setReplayGainInfo(const QMap &info); - void applyReplayGain(char *data, qint64 size); - -private: - void updateScale(); - int m_sampleSize; - QMap m_info; - double m_scale; - QmmpSettings::ReplayGainMode m_mode; - double m_preamp; - double m_default_gain; - bool m_prevent_clipping; -}; - -#endif // REPLAYGAIN_H diff --git a/src/qmmp/replaygain_p.h b/src/qmmp/replaygain_p.h new file mode 100644 index 000000000..50b3a373a --- /dev/null +++ b/src/qmmp/replaygain_p.h @@ -0,0 +1,54 @@ +/*************************************************************************** + * Copyright (C) 2009-2010 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 REPLAYGAIN_H +#define REPLAYGAIN_H + +#include +#include +#include "qmmpsettings.h" +#include "qmmp.h" + +/*! @internal + * @author Ilya Kotov + */ +class ReplayGain +{ +public: + ReplayGain(); + + void setSampleSize(int size); + void updateSettings(QmmpSettings::ReplayGainMode mode, double preamp, + double default_gain, bool clip); + void setReplayGainInfo(const QMap &info); + void applyReplayGain(char *data, qint64 size); + +private: + void updateScale(); + int m_sampleSize; + QMap m_info; + double m_scale; + QmmpSettings::ReplayGainMode m_mode; + double m_preamp; + double m_default_gain; + bool m_prevent_clipping; +}; + +#endif // REPLAYGAIN_H diff --git a/src/qmmp/soundcore.cpp b/src/qmmp/soundcore.cpp index b81508b42..505829a12 100644 --- a/src/qmmp/soundcore.cpp +++ b/src/qmmp/soundcore.cpp @@ -23,9 +23,9 @@ #include #include #include -#include "statechangedevent.h" -#include "metadatachangedevent.h" -#include "qmmpaudioengine.h" +#include "statechangedevent_p.h" +#include "metadatachangedevent_p.h" +#include "qmmpaudioengine_p.h" #include "decoderfactory.h" #include "effect.h" #include "statehandler.h" diff --git a/src/qmmp/statechangedevent.cpp b/src/qmmp/statechangedevent.cpp index 24483ce61..3dc53dfd5 100644 --- a/src/qmmp/statechangedevent.cpp +++ b/src/qmmp/statechangedevent.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "statechangedevent.h" +#include "statechangedevent_p.h" StateChangedEvent::StateChangedEvent(Qmmp::State currentState, Qmmp::State previousState) : QEvent((QEvent::Type)Qmmp::StateChanged) diff --git a/src/qmmp/statechangedevent.h b/src/qmmp/statechangedevent.h deleted file mode 100644 index 96841e6a7..000000000 --- a/src/qmmp/statechangedevent.h +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2011 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 STATECHANGEDEVENT_H -#define STATECHANGEDEVENT_H - -#include -#include "qmmp.h" - -/*! @internal - * @author Ilya Kotov - */ -class StateChangedEvent : public QEvent -{ -public: - StateChangedEvent(Qmmp::State currentState, Qmmp::State previousState); - virtual ~StateChangedEvent(); - - Qmmp::State currentState() const; - Qmmp::State previousState() const; - -private: - Qmmp::State m_state; - Qmmp::State m_prevState; - -}; - -#endif // STATECHANGEDEVENT_H diff --git a/src/qmmp/statechangedevent_p.h b/src/qmmp/statechangedevent_p.h new file mode 100644 index 000000000..96841e6a7 --- /dev/null +++ b/src/qmmp/statechangedevent_p.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2011 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 STATECHANGEDEVENT_H +#define STATECHANGEDEVENT_H + +#include +#include "qmmp.h" + +/*! @internal + * @author Ilya Kotov + */ +class StateChangedEvent : public QEvent +{ +public: + StateChangedEvent(Qmmp::State currentState, Qmmp::State previousState); + virtual ~StateChangedEvent(); + + Qmmp::State currentState() const; + Qmmp::State previousState() const; + +private: + Qmmp::State m_state; + Qmmp::State m_prevState; + +}; + +#endif // STATECHANGEDEVENT_H diff --git a/src/qmmp/statehandler.cpp b/src/qmmp/statehandler.cpp index b8625aae5..7f6a9c7ca 100644 --- a/src/qmmp/statehandler.cpp +++ b/src/qmmp/statehandler.cpp @@ -21,8 +21,8 @@ #include #include #include "soundcore.h" -#include "statechangedevent.h" -#include "metadatachangedevent.h" +#include "statechangedevent_p.h" +#include "metadatachangedevent_p.h" #include "statehandler.h" #define TICK_INTERVAL 250 diff --git a/src/qmmpui/abstractplaylistitem.cpp b/src/qmmpui/abstractplaylistitem.cpp deleted file mode 100644 index bbae56bd3..000000000 --- a/src/qmmpui/abstractplaylistitem.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 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 "abstractplaylistitem.h" - -AbstractPlaylistItem::AbstractPlaylistItem() -{ - m_length = 0; -} - - -AbstractPlaylistItem::~AbstractPlaylistItem() -{ -} - -const QString AbstractPlaylistItem::title () const -{ - return m_metaData.value(Qmmp::TITLE); -} - -const QString AbstractPlaylistItem::artist () const -{ - return m_metaData.value(Qmmp::ARTIST); -} - -const QString AbstractPlaylistItem::album () const -{ - return m_metaData.value(Qmmp::ALBUM); -} - -const QString AbstractPlaylistItem::comment () const -{ - return m_metaData.value(Qmmp::COMMENT); -} - -const QString AbstractPlaylistItem::genre () const -{ - return m_metaData.value(Qmmp::GENRE); -} - -const QString AbstractPlaylistItem::composer() const -{ - return m_metaData.value(Qmmp::COMPOSER); -} - -const QString AbstractPlaylistItem::track () const -{ - return m_metaData.value(Qmmp::TRACK); -} - -const QString AbstractPlaylistItem::year () const -{ - return m_metaData.value(Qmmp::YEAR); -} - -const QString AbstractPlaylistItem::discNumber () const -{ - return m_metaData.value(Qmmp::DISCNUMBER); -} - -const QString AbstractPlaylistItem::url () const -{ - return m_metaData.value(Qmmp::URL); -} - -qint64 AbstractPlaylistItem::length () -{ - return m_length; -} - -bool AbstractPlaylistItem::isEmpty() -{ - return m_metaData.isEmpty(); -} - -void AbstractPlaylistItem::clear() -{ - m_metaData.clear(); - m_length = 0; -} - -void AbstractPlaylistItem::setMetaData(const QMap &metaData) -{ - m_metaData = metaData; -} - -void AbstractPlaylistItem::setMetaData(Qmmp::MetaData key, const QString &value) -{ - m_metaData.insert(key, value); -} - -void AbstractPlaylistItem::setLength(qint64 length) -{ - m_length = length; -} - -const QMap AbstractPlaylistItem::metaData() -{ - return m_metaData; -} diff --git a/src/qmmpui/abstractplaylistitem.h b/src/qmmpui/abstractplaylistitem.h deleted file mode 100644 index c3f962a42..000000000 --- a/src/qmmpui/abstractplaylistitem.h +++ /dev/null @@ -1,118 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008-2010 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 ABSTRACTPLAYLISTITEM_H -#define ABSTRACTPLAYLISTITEM_H - -#include -#include -#include - -/** @brief The AbstractPlaylistItem class provides the basic functionality for the playlist items. - * @author Ilya Kotov - */ -class AbstractPlaylistItem -{ -public: - /*! - * Constructs empty AbstractPlaylistItem object. - */ - AbstractPlaylistItem(); - /*! - * Object destructor - */ - ~AbstractPlaylistItem(); - /*! - * Returns song title. - */ - const QString title () const; - /*! - * Returns song artist. - */ - const QString artist () const; - /*! - * Returns song album. - */ - const QString album () const; - /*! - * Returns comment. - */ - const QString comment () const; - /*! - * Returns genre. - */ - const QString genre () const; - /*! - * Returns composer. - */ - const QString composer() const; - /*! - * Returns track number. - */ - const QString track () const; - /*! - * Returns year. - */ - const QString year () const; - /*! - * Returns disc number. - */ - const QString discNumber () const; - /*! - * Returns stream url or local file path. - */ - const QString url () const; - /*! - * Returns song length in seconds. - */ - qint64 length (); - /*! - * Returns \b true if item has no metadata. - */ - bool isEmpty(); - /*! - * Removes all metadata from item. - */ - void clear(); - /*! - * Loads metadata. - * @param metaData A map with metadata. - */ - virtual void setMetaData(const QMap &metaData); - /*! - * Loads one metadata value. - * @param key Metadata key. - * @param value Metadata value. - */ - virtual void setMetaData(Qmmp::MetaData key, const QString &value); - /*! - * Sets length in seconds. - */ - virtual void setLength(qint64 length); - /*! - * Returns all meta data in map. - */ - const QMap metaData(); - -private: - QMap m_metaData; - qint64 m_length; -}; - -#endif diff --git a/src/qmmpui/detailsdialog.cpp b/src/qmmpui/detailsdialog.cpp index 10cba244b..d072f51ea 100644 --- a/src/qmmpui/detailsdialog.cpp +++ b/src/qmmpui/detailsdialog.cpp @@ -29,7 +29,7 @@ #include #include "ui_detailsdialog.h" #include "playlistitem.h" -#include "tageditor.h" +#include "tageditor_p.h" #include "detailsdialog.h" DetailsDialog::DetailsDialog(PlayListItem *item, QWidget *parent) diff --git a/src/qmmpui/filedialog.cpp b/src/qmmpui/filedialog.cpp index 55e297dcb..cd1b1e713 100644 --- a/src/qmmpui/filedialog.cpp +++ b/src/qmmpui/filedialog.cpp @@ -27,7 +27,7 @@ #include #include #include "filedialog.h" -#include "qtfiledialog.h" +#include "qtfiledialog_p.h" FileDialog* FileDialog::_instance = 0; diff --git a/src/qmmpui/fileloader.cpp b/src/qmmpui/fileloader.cpp index 203d147fe..b37a795e3 100644 --- a/src/qmmpui/fileloader.cpp +++ b/src/qmmpui/fileloader.cpp @@ -19,8 +19,8 @@ ***************************************************************************/ #include -#include "fileloader.h" -#include "playlistsettings.h" +#include "fileloader_p.h" +#include "playlistsettings_p.h" #include "playlistitem.h" FileLoader::FileLoader(QObject *parent) : QThread(parent) diff --git a/src/qmmpui/fileloader.h b/src/qmmpui/fileloader.h deleted file mode 100644 index f3c89b490..000000000 --- a/src/qmmpui/fileloader.h +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2011 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 FILELOADER_H -#define FILELOADER_H - -#include -#include -#include -#include - -class PlayListItem; - -/*! @internal - * @brief File loader class. - * - * This class represents fileloader object that - * processes file list in separate thread and emits - * \b newPlayListItem(PlayListItem*) signal for every newly - * created media file. - * @author Ilya Kotov - */ -class FileLoader : public QThread -{ - Q_OBJECT -public: - /*! - * Constructs FileLoader object. - * @param parent QObject parent - */ - FileLoader(QObject *parent = 0); - /*! - * Object destructor. - */ - ~FileLoader(); - /*! - * Sets files to load - */ - void finish(); - /*! - * Sets file to load - */ - void loadFile(const QString &path); - /*! - * Sets files to load - */ - void loadFiles(const QStringList &paths); - /*! - * Sets directory to load - */ - void loadDirectory(const QString &path); - -signals: - /*! - * Emitted when new playlist item is available. - * @param item Pointer of the new PlayListItem object. - */ - void newPlayListItem(PlayListItem *item); - -protected: - virtual void run(); - void addFile(const QString &path); - void addDirectory(const QString &s); - -private: - QQueue m_files; - QQueue m_directories; - QStringList m_filters; - bool m_finished; -}; - -#endif diff --git a/src/qmmpui/fileloader_p.h b/src/qmmpui/fileloader_p.h new file mode 100644 index 000000000..f3c89b490 --- /dev/null +++ b/src/qmmpui/fileloader_p.h @@ -0,0 +1,88 @@ +/*************************************************************************** + * Copyright (C) 2006-2011 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 FILELOADER_H +#define FILELOADER_H + +#include +#include +#include +#include + +class PlayListItem; + +/*! @internal + * @brief File loader class. + * + * This class represents fileloader object that + * processes file list in separate thread and emits + * \b newPlayListItem(PlayListItem*) signal for every newly + * created media file. + * @author Ilya Kotov + */ +class FileLoader : public QThread +{ + Q_OBJECT +public: + /*! + * Constructs FileLoader object. + * @param parent QObject parent + */ + FileLoader(QObject *parent = 0); + /*! + * Object destructor. + */ + ~FileLoader(); + /*! + * Sets files to load + */ + void finish(); + /*! + * Sets file to load + */ + void loadFile(const QString &path); + /*! + * Sets files to load + */ + void loadFiles(const QStringList &paths); + /*! + * Sets directory to load + */ + void loadDirectory(const QString &path); + +signals: + /*! + * Emitted when new playlist item is available. + * @param item Pointer of the new PlayListItem object. + */ + void newPlayListItem(PlayListItem *item); + +protected: + virtual void run(); + void addFile(const QString &path); + void addDirectory(const QString &s); + +private: + QQueue m_files; + QQueue m_directories; + QStringList m_filters; + bool m_finished; +}; + +#endif diff --git a/src/qmmpui/mediaplayer.cpp b/src/qmmpui/mediaplayer.cpp index c4dc178e0..ef70f5cdb 100644 --- a/src/qmmpui/mediaplayer.cpp +++ b/src/qmmpui/mediaplayer.cpp @@ -22,8 +22,8 @@ #include #include #include -#include -#include +#include +#include #include "playlistitem.h" #include "mediaplayer.h" diff --git a/src/qmmpui/playlistitem.cpp b/src/qmmpui/playlistitem.cpp index 49f3bcce8..084bb3ffa 100644 --- a/src/qmmpui/playlistitem.cpp +++ b/src/qmmpui/playlistitem.cpp @@ -21,7 +21,7 @@ #include #include #include "metadataformatter.h" -#include "playlistsettings.h" +#include "playlistsettings_p.h" #include "playlistitem.h" PlayListItem::PlayListItem() : QMap(), m_flag(FREE) diff --git a/src/qmmpui/playlistmanager.cpp b/src/qmmpui/playlistmanager.cpp index 6960b1068..85ec93855 100644 --- a/src/qmmpui/playlistmanager.cpp +++ b/src/qmmpui/playlistmanager.cpp @@ -24,7 +24,7 @@ #include #include #include -#include "playlistsettings.h" +#include "playlistsettings_p.h" #include "playlistmanager.h" PlayListManager::PlayListManager(QObject *parent) : QObject(parent) diff --git a/src/qmmpui/playlistmodel.cpp b/src/qmmpui/playlistmodel.cpp index b015e54bb..5c46694f9 100644 --- a/src/qmmpui/playlistmodel.cpp +++ b/src/qmmpui/playlistmodel.cpp @@ -33,11 +33,11 @@ #include #include "playlistparser.h" #include "playlistformat.h" -#include "fileloader.h" +#include "fileloader_p.h" #include "playlistitem.h" -#include "playstate.h" +#include "playstate_p.h" #include "detailsdialog.h" -#include "playlistsettings.h" +#include "playlistsettings_p.h" #include "playlistmodel.h" diff --git a/src/qmmpui/playlistsettings.cpp b/src/qmmpui/playlistsettings.cpp index 5fec65c19..c1fa58174 100644 --- a/src/qmmpui/playlistsettings.cpp +++ b/src/qmmpui/playlistsettings.cpp @@ -20,7 +20,7 @@ #include #include -#include "playlistsettings.h" +#include "playlistsettings_p.h" PlaylistSettings *PlaylistSettings::m_instance = 0; diff --git a/src/qmmpui/playlistsettings.h b/src/qmmpui/playlistsettings.h deleted file mode 100644 index cce4f35e1..000000000 --- a/src/qmmpui/playlistsettings.h +++ /dev/null @@ -1,53 +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 PLAYLISTSETTINGS_H -#define PLAYLISTSETTINGS_H - -#include - -/*! @internal - * @author Ilya Kotov - */ -class PlaylistSettings -{ -public: - PlaylistSettings(); - - ~PlaylistSettings(); - - static PlaylistSettings* instance(); - bool convertUnderscore(); - bool convertTwenty(); - bool useMetadata(); - const QString format() const; - void setConvertUnderscore(bool); - void setConvertTwenty(bool); - void setFormat(const QString &format); - void setUseMetadata(bool); - -private: - static PlaylistSettings* m_instance; - bool m_convertUnderscore, m_convertTwenty; - bool m_useMetadata; - QString m_format; - -}; - -#endif diff --git a/src/qmmpui/playlistsettings_p.h b/src/qmmpui/playlistsettings_p.h new file mode 100644 index 000000000..cce4f35e1 --- /dev/null +++ b/src/qmmpui/playlistsettings_p.h @@ -0,0 +1,53 @@ +/*************************************************************************** + * 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 PLAYLISTSETTINGS_H +#define PLAYLISTSETTINGS_H + +#include + +/*! @internal + * @author Ilya Kotov + */ +class PlaylistSettings +{ +public: + PlaylistSettings(); + + ~PlaylistSettings(); + + static PlaylistSettings* instance(); + bool convertUnderscore(); + bool convertTwenty(); + bool useMetadata(); + const QString format() const; + void setConvertUnderscore(bool); + void setConvertTwenty(bool); + void setFormat(const QString &format); + void setUseMetadata(bool); + +private: + static PlaylistSettings* m_instance; + bool m_convertUnderscore, m_convertTwenty; + bool m_useMetadata; + QString m_format; + +}; + +#endif diff --git a/src/qmmpui/playstate.cpp b/src/qmmpui/playstate.cpp index 50db86459..b615a0dfe 100644 --- a/src/qmmpui/playstate.cpp +++ b/src/qmmpui/playstate.cpp @@ -18,7 +18,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "playstate.h" +#include "playstate_p.h" ShufflePlayState::ShufflePlayState(PlayListModel * model) : PlayState(model) { diff --git a/src/qmmpui/playstate.h b/src/qmmpui/playstate.h deleted file mode 100644 index 011a02848..000000000 --- a/src/qmmpui/playstate.h +++ /dev/null @@ -1,110 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2007-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 _PLAYSTATE_H -#define _PLAYSTATE_H - -#include "playlistmodel.h" - -/*! @internal - * @brief Abstract class that represents data model playing states. - * @author Vladimir Kuznetsov - */ -class PlayState -{ -public: - /*! Makes single step forward through songs list. - * If the step has done returns \b true, otherwise returns \b false - */ - virtual bool next() = 0; - - /*! Makes single step back through songs list. - * If the step has done returns \b true, otherwise returns \b false - */ - virtual bool previous() = 0; - /*! - * Returns next item index. - */ - virtual int nextIndex() = 0; - /*! - * Service method, resets state to it's defaults. - */ - virtual void resetState() - { - ; - } - /*! - * Service method, can be used for state initializing. - */ - virtual void prepare() - { - ; - } - virtual ~PlayState() - { - ; - } - PlayState(PlayListModel* model) : m_model(model) - { - ; - } -protected: - - /// Data model - PlayListModel* m_model; -}; - -/*! @internal - * @brief Represents normal playing state. - * @author Vladimir Kuznetsov - */ -class NormalPlayState : public PlayState -{ -public: - virtual bool next(); - virtual bool previous(); - virtual int nextIndex(); - NormalPlayState(PlayListModel* model); -}; - -/*! @internal - * @brief Represents shuffle playing state. - * @author Vladimir Kuznetsov - */ -class ShufflePlayState : public PlayState -{ -public: - virtual bool next(); - virtual bool previous(); - virtual int nextIndex(); - virtual void prepare(); - ShufflePlayState(PlayListModel* model); - virtual void resetState(); -private: - - /// Current shuffled index. - int m_shuffled_current; - - /// List of indexes used for shuffled playing. - QList m_shuffled_indexes; -}; - - -#endif diff --git a/src/qmmpui/playstate_p.h b/src/qmmpui/playstate_p.h new file mode 100644 index 000000000..011a02848 --- /dev/null +++ b/src/qmmpui/playstate_p.h @@ -0,0 +1,110 @@ +/*************************************************************************** + * Copyright (C) 2007-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 _PLAYSTATE_H +#define _PLAYSTATE_H + +#include "playlistmodel.h" + +/*! @internal + * @brief Abstract class that represents data model playing states. + * @author Vladimir Kuznetsov + */ +class PlayState +{ +public: + /*! Makes single step forward through songs list. + * If the step has done returns \b true, otherwise returns \b false + */ + virtual bool next() = 0; + + /*! Makes single step back through songs list. + * If the step has done returns \b true, otherwise returns \b false + */ + virtual bool previous() = 0; + /*! + * Returns next item index. + */ + virtual int nextIndex() = 0; + /*! + * Service method, resets state to it's defaults. + */ + virtual void resetState() + { + ; + } + /*! + * Service method, can be used for state initializing. + */ + virtual void prepare() + { + ; + } + virtual ~PlayState() + { + ; + } + PlayState(PlayListModel* model) : m_model(model) + { + ; + } +protected: + + /// Data model + PlayListModel* m_model; +}; + +/*! @internal + * @brief Represents normal playing state. + * @author Vladimir Kuznetsov + */ +class NormalPlayState : public PlayState +{ +public: + virtual bool next(); + virtual bool previous(); + virtual int nextIndex(); + NormalPlayState(PlayListModel* model); +}; + +/*! @internal + * @brief Represents shuffle playing state. + * @author Vladimir Kuznetsov + */ +class ShufflePlayState : public PlayState +{ +public: + virtual bool next(); + virtual bool previous(); + virtual int nextIndex(); + virtual void prepare(); + ShufflePlayState(PlayListModel* model); + virtual void resetState(); +private: + + /// Current shuffled index. + int m_shuffled_current; + + /// List of indexes used for shuffled playing. + QList m_shuffled_indexes; +}; + + +#endif diff --git a/src/qmmpui/qmmpui.pro b/src/qmmpui/qmmpui.pro index c69af5341..1696ea003 100644 --- a/src/qmmpui/qmmpui.pro +++ b/src/qmmpui/qmmpui.pro @@ -27,15 +27,15 @@ HEADERS += general.h \ commandlineoption.h \ filedialog.h \ filedialogfactory.h \ - qtfiledialog.h \ + qtfiledialog_p.h \ playlistitem.h \ playlistmodel.h \ - playstate.h \ - fileloader.h \ + playstate_p.h \ + fileloader_p.h \ mediaplayer.h \ - playlistsettings.h \ + playlistsettings_p.h \ detailsdialog.h \ - tageditor.h \ + tageditor_p.h \ playlistmanager.h \ metadataformatter.h \ templateeditor.h @@ -75,7 +75,7 @@ TRANSLATIONS = translations/libqmmpui_ru.ts \ translations/libqmmpui_nl.ts \ translations/libqmmpui_ja.ts \ translations/libqmmpui_es.ts -unix { +unix { devel.files += general.h \ generalfactory.h \ generalhandler.h \ diff --git a/src/qmmpui/qtfiledialog.cpp b/src/qmmpui/qtfiledialog.cpp index 1b9d7bb05..7af812189 100644 --- a/src/qmmpui/qtfiledialog.cpp +++ b/src/qmmpui/qtfiledialog.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include -#include "qtfiledialog.h" +#include "qtfiledialog_p.h" FileDialog* QtFileDialogFactory::create() diff --git a/src/qmmpui/qtfiledialog.h b/src/qmmpui/qtfiledialog.h deleted file mode 100644 index 1cff174c9..000000000 --- a/src/qmmpui/qtfiledialog.h +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2008 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 QTFILEDIALOG_H -#define QTFILEDIALOG_H - -#include - -#include "filedialog.h" - -class QTranslator; - -/*! @internal - * @author Vladimir Kuznetsov - */ - -class QtFileDialogFactory : public QObject, public FileDialogFactory -{ - Q_OBJECT - Q_INTERFACES(FileDialogFactory); -public: - QtFileDialogFactory(){}; - FileDialog* create(); - const FileDialogProperties properties() const; - void showAbout(QWidget*); - QTranslator *createTranslator(QObject*); - virtual ~QtFileDialogFactory() - { - ; - } -}; - -class QtFileDialog : public FileDialog -{ -public: - virtual ~QtFileDialog(); - QString existingDirectory(QWidget *parent , - const QString & , - const QString &dir); - - QString openFileName(QWidget *parent, - const QString &caption, - const QString &dir, - const QString &filter, - QString *selectedFilter); - - QStringList openFileNames(QWidget *parent, - const QString &caption, - const QString &dir, - const QString &filter, QString *selectedFilter); - - QString saveFileName (QWidget *parent, - const QString &caption, - const QString & dir, - const QString &filter, - QString *selectedFilter); -}; - -#endif diff --git a/src/qmmpui/qtfiledialog_p.h b/src/qmmpui/qtfiledialog_p.h new file mode 100644 index 000000000..1cff174c9 --- /dev/null +++ b/src/qmmpui/qtfiledialog_p.h @@ -0,0 +1,75 @@ +/*************************************************************************** + * Copyright (C) 2008 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 QTFILEDIALOG_H +#define QTFILEDIALOG_H + +#include + +#include "filedialog.h" + +class QTranslator; + +/*! @internal + * @author Vladimir Kuznetsov + */ + +class QtFileDialogFactory : public QObject, public FileDialogFactory +{ + Q_OBJECT + Q_INTERFACES(FileDialogFactory); +public: + QtFileDialogFactory(){}; + FileDialog* create(); + const FileDialogProperties properties() const; + void showAbout(QWidget*); + QTranslator *createTranslator(QObject*); + virtual ~QtFileDialogFactory() + { + ; + } +}; + +class QtFileDialog : public FileDialog +{ +public: + virtual ~QtFileDialog(); + QString existingDirectory(QWidget *parent , + const QString & , + const QString &dir); + + QString openFileName(QWidget *parent, + const QString &caption, + const QString &dir, + const QString &filter, + QString *selectedFilter); + + QStringList openFileNames(QWidget *parent, + const QString &caption, + const QString &dir, + const QString &filter, QString *selectedFilter); + + QString saveFileName (QWidget *parent, + const QString &caption, + const QString & dir, + const QString &filter, + QString *selectedFilter); +}; + +#endif diff --git a/src/qmmpui/tageditor.cpp b/src/qmmpui/tageditor.cpp index 7e4927213..b94dcbb6d 100644 --- a/src/qmmpui/tageditor.cpp +++ b/src/qmmpui/tageditor.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include -#include "tageditor.h" +#include "tageditor_p.h" #include "ui_tageditor.h" TagEditor::TagEditor(TagModel *tagModel, QWidget *parent) : QWidget(parent), m_ui(new Ui::TagEditor) diff --git a/src/qmmpui/tageditor.h b/src/qmmpui/tageditor.h deleted file mode 100644 index 7ed6c9033..000000000 --- a/src/qmmpui/tageditor.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 TAGEDITOR_H -#define TAGEDITOR_H - -#include - -namespace Ui { - class TagEditor; -} - -class TagModel; - -/*! @internal - * @author Ilya Kotov - */ -class TagEditor : public QWidget -{ -Q_OBJECT -public: - TagEditor(TagModel *tagModel, QWidget *parent = 0); - ~TagEditor(); - - void save(); - -private: - void readTag(); - Ui::TagEditor *m_ui; - TagModel *m_tagModel; - -}; - -#endif // TAGEDITOR_H diff --git a/src/qmmpui/tageditor_p.h b/src/qmmpui/tageditor_p.h new file mode 100644 index 000000000..7ed6c9033 --- /dev/null +++ b/src/qmmpui/tageditor_p.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 TAGEDITOR_H +#define TAGEDITOR_H + +#include + +namespace Ui { + class TagEditor; +} + +class TagModel; + +/*! @internal + * @author Ilya Kotov + */ +class TagEditor : public QWidget +{ +Q_OBJECT +public: + TagEditor(TagModel *tagModel, QWidget *parent = 0); + ~TagEditor(); + + void save(); + +private: + void readTag(); + Ui::TagEditor *m_ui; + TagModel *m_tagModel; + +}; + +#endif // TAGEDITOR_H diff --git a/src/ui/playlist.cpp b/src/ui/playlist.cpp index 9ecec594c..75a6110ea 100644 --- a/src/ui/playlist.cpp +++ b/src/ui/playlist.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include "dock.h" -- cgit v1.2.3-13-gbd6f