strawberry-audio-player-win.../src/settings/collectionsettingspage.h

91 lines
2.3 KiB
C
Raw Normal View History

2018-02-27 18:06:05 +01:00
/*
* Strawberry Music Player
* This file was part of Clementine.
* Copyright 2010, David Sansome <me@davidsansome.com>
2021-03-20 21:14:47 +01:00
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
2018-02-27 18:06:05 +01:00
*
* Strawberry is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Strawberry is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Strawberry. If not, see <http://www.gnu.org/licenses/>.
2018-08-09 18:39:44 +02:00
*
2018-02-27 18:06:05 +01:00
*/
#ifndef COLLECTIONSETTINGSPAGE_H
#define COLLECTIONSETTINGSPAGE_H
2018-02-27 18:06:05 +01:00
#include "config.h"
#include <QObject>
2020-02-09 02:29:35 +01:00
#include <QString>
#include <QStringList>
2018-02-27 18:06:05 +01:00
#include "settingspage.h"
2018-02-27 18:06:05 +01:00
2020-02-09 02:29:35 +01:00
class QModelIndex;
class SettingsDialog;
class Ui_CollectionSettingsPage;
2018-02-27 18:06:05 +01:00
class CollectionSettingsPage : public SettingsPage {
Q_OBJECT
2020-04-07 16:49:15 +02:00
public:
explicit CollectionSettingsPage(SettingsDialog *dialog);
2020-06-15 21:55:05 +02:00
~CollectionSettingsPage() override;
2018-02-27 18:06:05 +01:00
static const char *kSettingsGroup;
static const char *kSettingsCacheSize;
static const char *kSettingsCacheSizeUnit;
static const char *kSettingsDiskCacheEnable;
static const char *kSettingsDiskCacheSize;
static const char *kSettingsDiskCacheSizeUnit;
static const int kSettingsCacheSizeDefault;
static const int kSettingsDiskCacheSizeDefault;
enum SaveCoverType {
SaveCoverType_Cache = 1,
SaveCoverType_Album = 2,
SaveCoverType_Embedded = 3
};
enum SaveCoverFilename {
SaveCoverFilename_Hash = 1,
SaveCoverFilename_Pattern = 2
};
enum CacheSizeUnit {
CacheSizeUnit_KB,
CacheSizeUnit_MB,
CacheSizeUnit_GB,
CacheSizeUnit_TB,
};
2018-02-27 18:06:05 +01:00
2020-06-15 21:55:05 +02:00
void Load() override;
void Save() override;
2018-02-27 18:06:05 +01:00
2020-04-07 16:49:15 +02:00
private slots:
2018-02-27 18:06:05 +01:00
void Add();
void Remove();
2021-01-26 16:48:04 +01:00
void CurrentRowChanged(const QModelIndex &idx);
void DiskCacheEnable(const int state);
void CoverSaveInAlbumDirChanged();
void ClearPixmapDiskCache();
void CacheSizeUnitChanged(int index);
void DiskCacheSizeUnitChanged(int index);
2018-02-27 18:06:05 +01:00
2020-04-07 16:49:15 +02:00
private:
2018-02-27 18:06:05 +01:00
Ui_CollectionSettingsPage *ui_;
2020-10-17 17:29:09 +02:00
bool initialized_model_;
2018-02-27 18:06:05 +01:00
};
#endif // COLLECTIONSETTINGSPAGE_H