Qmmp
/usr/src/RPM/BUILD/qmmp-0.8-svn/src/qmmpui/qmmpuisettings.h
00001 /***************************************************************************
00002  *   Copyright (C) 2012 by Ilya Kotov                                      *
00003  *   forkotov02@hotmail.ru                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
00019  ***************************************************************************/
00020 
00021 #ifndef QMMPUISETTINGS_H
00022 #define QMMPUISETTINGS_H
00023 
00024 #include <QObject>
00025 #include <QStringList>
00026 
00027 class QTimer;
00028 
00032 class QmmpUiSettings : public QObject
00033 {
00034     Q_OBJECT
00035 public:
00041     explicit QmmpUiSettings(QObject *parent = 0);
00045     virtual ~QmmpUiSettings();
00049     bool convertUnderscore() const;
00053     bool convertTwenty() const;
00057     bool useMetadata() const;
00061     const QString titleFormat() const;
00065     const QString groupFormat() const;
00069     bool isRepeatableList() const;
00073     bool isShuffle() const;
00077     bool isGroupsEnabled() const;
00081     bool isRepeatableTrack() const;
00085     bool isNoPlayListAdvance() const;
00090     void setConvertUnderscore(bool enabled);
00095     void setConvertTwenty(bool enabled);
00100     void setTitleFormat(const QString &titleFormat);
00105     void setGroupFormat(const QString &groupFormat);
00110     void setUseMetadata(bool enabled);
00114     bool resumeOnStartup() const;
00119     void setResumeOnStartup(bool enabled);
00124     void setUseClipboard(bool enabled);
00128     bool useClipboard() const;
00132     QStringList restrictFilters() const;
00136     void setRestrictFilters(const QString &filters);
00140     QStringList excludeFilters() const;
00145     void setExcludeFilters(const QString &filters);
00150     bool useDefaultPlayList() const;
00154     QString defaultPlayListName() const;
00160     void setDefaultPlayList(const QString &name, bool enabled = true);
00165     void setAutoSavePlayList(bool enabled);
00171     bool autoSavePlayList() const;
00175     static QmmpUiSettings* instance();
00176 
00177 signals:
00182     void repeatableListChanged(bool state);
00187     void shuffleChanged(bool state);
00192     void groupsChanged(bool state);
00197     void repeatableTrackChanged(bool enabled);
00203     void noPlayListAdvanceChanged(bool enabled);
00204 
00205 public slots:
00210     void setRepeatableList(bool r);
00215     void setShuffle(bool s);
00220     void setGroupsEnabled(bool enabled);
00225     void setRepeatableTrack(bool enabled);
00231     void setNoPlayListAdvance(bool enabled);
00232 
00233 private slots:
00237     void sync();
00238 
00239 
00240 private:
00241     static QmmpUiSettings* m_instance;
00242     //playlist
00243     QString m_title_format;
00244     QString m_group_format;
00245     bool m_convertUnderscore, m_convertTwenty;
00246     bool m_useMetadata;
00247     bool m_autosave_playlist;
00248     bool m_repeate_list;
00249     bool m_shuffle;
00250     bool m_groups_enabled;
00251     bool m_repeat_track;
00252     bool m_no_pl_advance;
00253     //general
00254     bool m_resume_on_startup;
00255     QStringList m_exclude_filters, m_restrict_filters;
00256     //default playlist
00257     bool m_use_default_pl;
00258     QString m_default_pl_name;
00259     //url dialog
00260     bool m_use_clipboard;
00261     //timer
00262     QTimer *m_timer;
00263 };
00264 
00265 #endif // QMMPUISETTINGS_H
 All Classes Functions Variables Enumerations Enumerator