Qmmp
Loading...
Searching...
No Matches
qmmpuisettings.h
1/***************************************************************************
2 * Copyright (C) 2012-2025 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
30class MetaDataHelper;
31
35class QMMPUI_EXPORT QmmpUiSettings : public QObject
36{
37 Q_OBJECT
38public:
44 explicit QmmpUiSettings(QObject *parent = nullptr);
48 virtual ~QmmpUiSettings();
52 bool convertUnderscore() const;
56 bool convertTwenty() const;
60 bool useMetaData() const;
64 QString groupFormat() const;
68 QString groupExtraRowFormat() const;
72 int linesPerGroup() const;
80 bool groupCoverVisible() const;
88 bool isRepeatableList() const;
92 bool isShuffle() const;
96 bool isGroupsEnabled() const;
100 bool isRepeatableTrack() const;
113 void setConvertUnderscore(bool enabled);
118 void setConvertTwenty(bool enabled);
123 void setGroupFormat(const QString &groupFormat);
128 void setGroupExtraRowFormat(const QString &extraRowFormat);
133 void setLinesPerGroup(int lines);
138 void setGroupExtraRowVisible(bool enabled);
143 void setGroupCoverVisible(bool enabled);
148 void setGroupDividingLineVisible(bool enabled);
153 void setUseMetaData(bool enabled);
157 bool resumeOnStartup() const;
162 void setResumeOnStartup(bool enabled);
167 void setUseClipboard(bool enabled);
171 bool useClipboard() const;
175 const QStringList &restrictFilters() const;
179 void setRestrictFilters(const QString &filters);
183 const QStringList &excludeFilters() const;
188 void setExcludeFilters(const QString &filters);
193 bool useDefaultPlayList() const;
197 const QString &defaultPlayListName() const;
203 void setDefaultPlayList(const QString &name, bool enabled = true);
208 void setAutoSavePlayList(bool enabled);
214 bool autoSavePlayList() const;
219 void setClearPreviousPlayList(bool enabled);
230 void setSkipExistingTracks(bool enabled);
237 bool skipExistingTracks() const;
257 void setReadMetaDataForPlayLists(bool enabled);
262
263signals:
268 void repeatableListChanged(bool state);
273 void shuffleChanged(bool state);
278 void groupsChanged(bool state);
283 void repeatableTrackChanged(bool enabled);
289 void noPlayListAdvanceChanged(bool enabled);
294 void playListTransitionChanged(bool enabled);
295
296public slots:
301 void setRepeatableList(bool r);
306 void setShuffle(bool s);
311 void setGroupsEnabled(bool enabled);
316 void setRepeatableTrack(bool enabled);
322 void setNoPlayListAdvance(bool enabled);
328
329private slots:
333 void sync();
334
335private:
336 void saveSettings(bool rebuildGroups = false);
337
338 static QmmpUiSettings* m_instance;
339 //playlist
340 QString m_group_format;
341 QString m_group_extra_row_format;
342 int m_lines_per_group;
343 bool m_group_extra_row_visible;
344 bool m_group_cover_visible;
345 bool m_group_dividing_line_visible;
346 bool m_convert_underscore, m_convert_twenty;
347 bool m_use_metadata;
348 bool m_autosave_playlist;
349 bool m_repeate_list;
350 bool m_shuffle;
351 bool m_groups_enabled;
352 bool m_repeat_track;
353 bool m_no_pl_advance;
354 bool m_clear_prev_playlist;
355 bool m_read_metadata_for_playlist;
356 bool m_transit_between_playlists;
357 bool m_skip_existing_tracks;
358 bool m_stop_after_removing_of_current;
359 //general
360 bool m_resume_on_startup;
361 QStringList m_exclude_filters, m_restrict_filters;
362 //default playlist
363 bool m_use_default_pl;
364 QString m_default_pl_name;
365 //url dialog
366 bool m_use_clipboard;
367 //formatters
368 MetaDataHelper *m_helper;
369 //protect from multiple calls
370 bool m_saveSettings = false;
371 bool m_rebuildGroups = false;
372};
373
374#endif // QMMPUISETTINGS_H
bool isRepeatableList() const
void setResumeOnStartup(bool enabled)
void setRepeatableTrack(bool enabled)
void noPlayListAdvanceChanged(bool enabled)
void setGroupExtraRowFormat(const QString &extraRowFormat)
void setShuffle(bool s)
void setGroupCoverVisible(bool enabled)
void repeatableTrackChanged(bool enabled)
void setConvertTwenty(bool enabled)
QmmpUiSettings(QObject *parent=nullptr)
bool isRepeatableTrack() const
void setUseClipboard(bool enabled)
void setLinesPerGroup(int lines)
void setDefaultPlayList(const QString &name, bool enabled=true)
bool isShuffle() const
bool isGroupsEnabled() const
bool groupCoverVisible() const
void setAutoSavePlayList(bool enabled)
const QStringList & excludeFilters() const
void setClearPreviousPlayList(bool enabled)
bool autoSavePlayList() const
void setGroupDividingLineVisible(bool enabled)
void setGroupExtraRowVisible(bool enabled)
bool convertUnderscore() const
void repeatableListChanged(bool state)
bool clearPreviousPlayList() const
void groupsChanged(bool state)
const QStringList & restrictFilters() const
static QmmpUiSettings * instance()
bool useMetaData() const
bool resumeOnStartup() const
void setGroupsEnabled(bool enabled)
void playListTransitionChanged(bool enabled)
void shuffleChanged(bool state)
void setSkipExistingTracks(bool enabled)
void setStopAfterRemovingOfCurrentTrack(bool enabled)
void setConvertUnderscore(bool enabled)
bool useClipboard() const
bool groupExtraRowVisible() const
bool stopAfterRemovingOfCurrentTrack() const
void setExcludeFilters(const QString &filters)
bool groupDividingLineVisible() const
int linesPerGroup() const
void setGroupFormat(const QString &groupFormat)
void setRestrictFilters(const QString &filters)
bool isNoPlayListAdvance() const
bool isPlayListTransitionEnabled() const
bool useDefaultPlayList() const
bool readMetaDataForPlayLists() const
void setUseMetaData(bool enabled)
void setRepeatableList(bool r)
bool skipExistingTracks() const
QString groupFormat() const
virtual ~QmmpUiSettings()
void setNoPlayListAdvance(bool enabled)
void setReadMetaDataForPlayLists(bool enabled)
void setPlayListTransitionEnabled(bool enabled)
bool convertTwenty() const
QString groupExtraRowFormat() const
const QString & defaultPlayListName() const