Qmmp
qmmpuisettings.h
1 /***************************************************************************
2  * Copyright (C) 2012-2015 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef QMMPUISETTINGS_H
22 #define QMMPUISETTINGS_H
23 
24 #include <QObject>
25 #include <QStringList>
26 #include "playlistheadermodel.h"
27 #include "metadataformatter.h"
28 
29 class QTimer;
30 class MetaDataHelper;
31 
35 class QmmpUiSettings : public QObject
36 {
37  Q_OBJECT
38 public:
44  explicit QmmpUiSettings(QObject *parent = 0);
48  virtual ~QmmpUiSettings();
52  bool convertUnderscore() const;
56  bool convertTwenty() const;
60  bool useMetadata() const;
64  const QString groupFormat() const;
68  bool isRepeatableList() const;
72  bool isShuffle() const;
76  bool isGroupsEnabled() const;
80  bool isRepeatableTrack() const;
84  bool isNoPlayListAdvance() const;
89  void setConvertUnderscore(bool enabled);
94  void setConvertTwenty(bool enabled);
99  void setGroupFormat(const QString &groupFormat);
104  void setUseMetadata(bool enabled);
108  bool resumeOnStartup() const;
113  void setResumeOnStartup(bool enabled);
118  void setUseClipboard(bool enabled);
122  bool useClipboard() const;
126  QStringList restrictFilters() const;
130  void setRestrictFilters(const QString &filters);
134  QStringList excludeFilters() const;
139  void setExcludeFilters(const QString &filters);
144  bool useDefaultPlayList() const;
148  QString defaultPlayListName() const;
154  void setDefaultPlayList(const QString &name, bool enabled = true);
159  void setAutoSavePlayList(bool enabled);
165  bool autoSavePlayList() const;
170  void setClearPreviousPlayList(bool enabled);
176  bool clearPreviousPlayList() const;
180  static QmmpUiSettings* instance();
181 
182 signals:
187  void repeatableListChanged(bool state);
192  void shuffleChanged(bool state);
197  void groupsChanged(bool state);
202  void repeatableTrackChanged(bool enabled);
208  void noPlayListAdvanceChanged(bool enabled);
209 
210 public slots:
215  void setRepeatableList(bool r);
220  void setShuffle(bool s);
225  void setGroupsEnabled(bool enabled);
230  void setRepeatableTrack(bool enabled);
236  void setNoPlayListAdvance(bool enabled);
237 
238 private slots:
242  void sync();
243 
244 
245 private:
246  static QmmpUiSettings* m_instance;
247  //playlist
248  QString m_group_format;
249  bool m_convertUnderscore, m_convertTwenty;
250  bool m_useMetadata;
251  bool m_autosave_playlist;
252  bool m_repeate_list;
253  bool m_shuffle;
254  bool m_groups_enabled;
255  bool m_repeat_track;
256  bool m_no_pl_advance;
257  bool m_clear_prev_playlist;
258  //general
259  bool m_resume_on_startup;
260  QStringList m_exclude_filters, m_restrict_filters;
261  //default playlist
262  bool m_use_default_pl;
263  QString m_default_pl_name;
264  //url dialog
265  bool m_use_clipboard;
266  //timer
267  QTimer *m_timer;
268  //formatters
269  MetaDataHelper *m_helper;
270 };
271 
272 #endif // QMMPUISETTINGS_H
bool clearPreviousPlayList() const
const QString groupFormat() const
bool isRepeatableList() const
void setUseClipboard(bool enabled)
bool isRepeatableTrack() const
void setShuffle(bool s)
void groupsChanged(bool state)
void setClearPreviousPlayList(bool enabled)
virtual ~QmmpUiSettings()
void setNoPlayListAdvance(bool enabled)
bool convertUnderscore() const
void noPlayListAdvanceChanged(bool enabled)
bool isGroupsEnabled() const
void setExcludeFilters(const QString &filters)
bool resumeOnStartup() const
void setConvertUnderscore(bool enabled)
bool useMetadata() const
void setRepeatableList(bool r)
void shuffleChanged(bool state)
QStringList restrictFilters() const
QmmpUiSettings(QObject *parent=0)
QString defaultPlayListName() const
QStringList excludeFilters() const
void setRepeatableTrack(bool enabled)
void repeatableListChanged(bool state)
bool isShuffle() const
bool convertTwenty() const
void setAutoSavePlayList(bool enabled)
bool autoSavePlayList() const
bool isNoPlayListAdvance() const
void setGroupFormat(const QString &groupFormat)
void setRestrictFilters(const QString &filters)
void setUseMetadata(bool enabled)
The QmmpUiSettings class provides access to global libqmmpui library settings.
Definition: qmmpuisettings.h:35
void setDefaultPlayList(const QString &name, bool enabled=true)
bool useClipboard() const
bool useDefaultPlayList() const
void setConvertTwenty(bool enabled)
static QmmpUiSettings * instance()
void setGroupsEnabled(bool enabled)
void repeatableTrackChanged(bool enabled)
void setResumeOnStartup(bool enabled)