Qmmp
/usr/src/RPM/BUILD/qmmp-1.1.7/src/qmmpui/qmmpuisettings.h
00001 /***************************************************************************
00002  *   Copyright (C) 2012-2015 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 #include "playlistheadermodel.h"
00027 #include "metadataformatter.h"
00028 
00029 class QTimer;
00030 class MetaDataHelper;
00031 
00035 class QmmpUiSettings : public QObject
00036 {
00037     Q_OBJECT
00038 public:
00044     explicit QmmpUiSettings(QObject *parent = 0);
00048     virtual ~QmmpUiSettings();
00052     bool convertUnderscore() const;
00056     bool convertTwenty() const;
00060     bool useMetadata() const;
00064     const QString groupFormat() const;
00068     bool isRepeatableList() const;
00072     bool isShuffle() const;
00076     bool isGroupsEnabled() const;
00080     bool isRepeatableTrack() const;
00084     bool isNoPlayListAdvance() const;
00089     void setConvertUnderscore(bool enabled);
00094     void setConvertTwenty(bool enabled);
00099     void setGroupFormat(const QString &groupFormat);
00104     void setUseMetadata(bool enabled);
00108     bool resumeOnStartup() const;
00113     void setResumeOnStartup(bool enabled);
00118     void setUseClipboard(bool enabled);
00122     bool useClipboard() const;
00126     QStringList restrictFilters() const;
00130     void setRestrictFilters(const QString &filters);
00134     QStringList excludeFilters() const;
00139     void setExcludeFilters(const QString &filters);
00144     bool useDefaultPlayList() const;
00148     QString defaultPlayListName() const;
00154     void setDefaultPlayList(const QString &name, bool enabled = true);
00159     void setAutoSavePlayList(bool enabled);
00165     bool autoSavePlayList() const;
00170     void setClearPreviousPlayList(bool enabled);
00176     bool clearPreviousPlayList() const;
00180     static QmmpUiSettings* instance();
00181 
00182 signals:
00187     void repeatableListChanged(bool state);
00192     void shuffleChanged(bool state);
00197     void groupsChanged(bool state);
00202     void repeatableTrackChanged(bool enabled);
00208     void noPlayListAdvanceChanged(bool enabled);
00209 
00210 public slots:
00215     void setRepeatableList(bool r);
00220     void setShuffle(bool s);
00225     void setGroupsEnabled(bool enabled);
00230     void setRepeatableTrack(bool enabled);
00236     void setNoPlayListAdvance(bool enabled);
00237 
00238 private slots:
00242     void sync();
00243 
00244 
00245 private:
00246     static QmmpUiSettings* m_instance;
00247     //playlist
00248     QString m_group_format;
00249     bool m_convertUnderscore, m_convertTwenty;
00250     bool m_useMetadata;
00251     bool m_autosave_playlist;
00252     bool m_repeate_list;
00253     bool m_shuffle;
00254     bool m_groups_enabled;
00255     bool m_repeat_track;
00256     bool m_no_pl_advance;
00257     bool m_clear_prev_playlist;
00258     //general
00259     bool m_resume_on_startup;
00260     QStringList m_exclude_filters, m_restrict_filters;
00261     //default playlist
00262     bool m_use_default_pl;
00263     QString m_default_pl_name;
00264     //url dialog
00265     bool m_use_clipboard;
00266     //timer
00267     QTimer *m_timer;
00268     //formatters
00269     MetaDataHelper *m_helper;
00270 };
00271 
00272 #endif // QMMPUISETTINGS_H
 All Classes Functions Variables Enumerations Enumerator