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/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 ++++++++++++++++ 24 files changed, 398 insertions(+), 632 deletions(-) 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 (limited to 'src/qmmpui') 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 -- cgit v1.2.3-13-gbd6f