Qmmp
qmmpuisettings.h
1 /***************************************************************************
2  * Copyright (C) 2012-2018 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 #include "qmmpui_export.h"
29 
30 class QTimer;
31 class MetaDataHelper;
32 
36 class QMMPUI_EXPORT QmmpUiSettings : public QObject
37 {
38  Q_OBJECT
39 public:
45  explicit QmmpUiSettings(QObject *parent = 0);
49  virtual ~QmmpUiSettings();
53  bool convertUnderscore() const;
57  bool convertTwenty() const;
61  bool useMetadata() const;
65  const QString groupFormat() const;
69  bool isRepeatableList() const;
73  bool isShuffle() const;
77  bool isGroupsEnabled() const;
81  bool isRepeatableTrack() const;
85  bool isNoPlayListAdvance() const;
90  void setConvertUnderscore(bool enabled);
95  void setConvertTwenty(bool enabled);
100  void setGroupFormat(const QString &groupFormat);
105  void setUseMetadata(bool enabled);
109  bool resumeOnStartup() const;
114  void setResumeOnStartup(bool enabled);
119  void setUseClipboard(bool enabled);
123  bool useClipboard() const;
127  QStringList restrictFilters() const;
131  void setRestrictFilters(const QString &filters);
135  QStringList excludeFilters() const;
140  void setExcludeFilters(const QString &filters);
145  bool useDefaultPlayList() const;
149  QString defaultPlayListName() const;
155  void setDefaultPlayList(const QString &name, bool enabled = true);
160  void setAutoSavePlayList(bool enabled);
166  bool autoSavePlayList() const;
171  void setClearPreviousPlayList(bool enabled);
177  bool clearPreviousPlayList() const;
181  static QmmpUiSettings* instance();
182 
183 signals:
188  void repeatableListChanged(bool state);
193  void shuffleChanged(bool state);
198  void groupsChanged(bool state);
203  void repeatableTrackChanged(bool enabled);
209  void noPlayListAdvanceChanged(bool enabled);
210 
211 public slots:
216  void setRepeatableList(bool r);
221  void setShuffle(bool s);
226  void setGroupsEnabled(bool enabled);
231  void setRepeatableTrack(bool enabled);
237  void setNoPlayListAdvance(bool enabled);
238 
239 private slots:
243  void sync();
244 
245 
246 private:
247  static QmmpUiSettings* m_instance;
248  //playlist
249  QString m_group_format;
250  bool m_convertUnderscore, m_convertTwenty;
251  bool m_useMetadata;
252  bool m_autosave_playlist;
253  bool m_repeate_list;
254  bool m_shuffle;
255  bool m_groups_enabled;
256  bool m_repeat_track;
257  bool m_no_pl_advance;
258  bool m_clear_prev_playlist;
259  //general
260  bool m_resume_on_startup;
261  QStringList m_exclude_filters, m_restrict_filters;
262  //default playlist
263  bool m_use_default_pl;
264  QString m_default_pl_name;
265  //url dialog
266  bool m_use_clipboard;
267  //timer
268  QTimer *m_timer;
269  //formatters
270  MetaDataHelper *m_helper;
271 };
272 
273 #endif // QMMPUISETTINGS_H
The QmmpUiSettings class provides access to global libqmmpui library settings.
Definition: qmmpuisettings.h:36