2015-04-22 19:33:53 +02:00
|
|
|
#ifndef SETTINGS_H
|
|
|
|
#define SETTINGS_H
|
|
|
|
|
2016-10-24 20:15:10 +02:00
|
|
|
#include "./targetlevelmodel.h"
|
|
|
|
#include "./knownfieldmodel.h"
|
|
|
|
|
2015-04-22 19:33:53 +02:00
|
|
|
#include <c++utilities/conversion/types.h>
|
|
|
|
|
|
|
|
#include <tagparser/tagvalue.h>
|
2016-10-24 20:15:10 +02:00
|
|
|
#include <tagparser/tag.h>
|
|
|
|
#include <tagparser/mediafileinfo.h>
|
2015-04-22 19:33:53 +02:00
|
|
|
|
2016-10-24 20:15:10 +02:00
|
|
|
#include <qtutilities/settingsdialog/qtsettings.h>
|
2015-04-22 19:33:53 +02:00
|
|
|
|
2016-10-24 20:15:10 +02:00
|
|
|
#include <QString>
|
|
|
|
#include <QByteArray>
|
2016-08-14 22:49:47 +02:00
|
|
|
|
2015-04-22 19:33:53 +02:00
|
|
|
namespace Settings {
|
|
|
|
|
|
|
|
enum class ActionEnabled
|
|
|
|
{
|
|
|
|
Ask,
|
|
|
|
Yes,
|
|
|
|
No
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class AdoptFields
|
|
|
|
{
|
|
|
|
Never,
|
|
|
|
WithinDirectory,
|
|
|
|
Always
|
|
|
|
};
|
2016-10-24 20:15:10 +02:00
|
|
|
|
2015-04-22 19:33:53 +02:00
|
|
|
enum class MultipleTagHandling
|
|
|
|
{
|
|
|
|
SingleEditorPerTarget,
|
|
|
|
SeparateEditors
|
|
|
|
};
|
2016-10-24 20:15:10 +02:00
|
|
|
|
|
|
|
struct AutoCompletition
|
|
|
|
{
|
|
|
|
AutoCompletition();
|
|
|
|
bool insertTitleFromFilename = false;
|
|
|
|
bool trimWhitespaces = true;
|
|
|
|
bool formatNames = false;
|
|
|
|
bool fixUmlauts = false;
|
|
|
|
KnownFieldModel fields;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Editor
|
|
|
|
{
|
|
|
|
Editor();
|
|
|
|
AdoptFields adoptFields = AdoptFields::Never;
|
|
|
|
bool saveAndShowNextOnEnter = false;
|
|
|
|
bool askBeforeDeleting = true;
|
|
|
|
MultipleTagHandling multipleTagHandling = MultipleTagHandling::SingleEditorPerTarget;
|
|
|
|
bool hideTagSelectionComboBox = false;
|
|
|
|
bool forceFullParse = false;
|
2016-04-21 23:55:22 +02:00
|
|
|
#ifndef TAGEDITOR_NO_WEBVIEW
|
2016-10-24 20:15:10 +02:00
|
|
|
bool noWebView = false;
|
2016-04-21 23:55:22 +02:00
|
|
|
#endif
|
2016-10-24 20:15:10 +02:00
|
|
|
bool hideCoverButtons = false;
|
|
|
|
AutoCompletition autoCompletition;
|
|
|
|
KnownFieldModel fields;
|
|
|
|
TargetLevelModel defaultTargets;
|
|
|
|
};
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
enum class UnsupportedFieldHandling
|
|
|
|
{
|
|
|
|
Ignore,
|
|
|
|
Discard
|
|
|
|
};
|
2016-08-14 22:49:47 +02:00
|
|
|
|
2016-10-24 20:15:10 +02:00
|
|
|
struct FileBrowser
|
|
|
|
{
|
|
|
|
bool hideBackupFiles = true;
|
|
|
|
bool readOnly = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Id3Processing
|
|
|
|
{
|
|
|
|
Media::TagUsage v1Usage = Media::TagUsage::Always;
|
|
|
|
Media::TagUsage v2Usage = Media::TagUsage::Always;
|
|
|
|
byte v2Version = 3;
|
|
|
|
bool keepVersionOfExistingId3v2Tag = true;
|
|
|
|
bool mergeMultipleSuccessiveId3v2Tags = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FileLayout
|
|
|
|
{
|
|
|
|
bool forceRewrite = true;
|
|
|
|
Media::ElementPosition preferredTagPosition = Media::ElementPosition::BeforeData;
|
|
|
|
bool forceTagPosition = true;
|
|
|
|
Media::ElementPosition preferredIndexPosition = Media::ElementPosition::BeforeData;
|
|
|
|
bool forceIndexPosition = true;
|
|
|
|
std::size_t minPadding = 0;
|
|
|
|
std::size_t maxPadding = 0;
|
|
|
|
std::size_t preferredPadding = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TagProcessing
|
|
|
|
{
|
|
|
|
Media::TagTextEncoding preferredEncoding = Media::TagTextEncoding::Utf8;
|
|
|
|
UnsupportedFieldHandling unsupportedFieldHandling = UnsupportedFieldHandling::Ignore;
|
|
|
|
bool autoTagManagement = true;
|
|
|
|
Id3Processing id3;
|
|
|
|
FileLayout fileLayout;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MainWindow
|
|
|
|
{
|
|
|
|
QByteArray geometry;
|
|
|
|
QByteArray state;
|
|
|
|
QString currentFileBrowserDirectory;
|
|
|
|
bool layoutLocked = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DbQuery
|
|
|
|
{
|
|
|
|
DbQuery();
|
|
|
|
bool widgetShown = false;
|
|
|
|
bool override = false;
|
|
|
|
KnownFieldModel fields;
|
|
|
|
QString musicBrainzUrl;
|
|
|
|
QString coverArtArchiveUrl;
|
|
|
|
QString lyricsWikiaUrl;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RenamingUtility
|
|
|
|
{
|
|
|
|
int scriptSource = 0;
|
|
|
|
QString externalScript;
|
|
|
|
QString editorScript;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Settings
|
|
|
|
{
|
|
|
|
Editor editor;
|
|
|
|
FileBrowser fileBrowser;
|
|
|
|
TagProcessing tagPocessing;
|
|
|
|
MainWindow mainWindow;
|
|
|
|
DbQuery dbQuery;
|
|
|
|
RenamingUtility renamingUtility;
|
|
|
|
Dialogs::QtSettings qt;
|
|
|
|
};
|
|
|
|
|
|
|
|
Settings &values();
|
2015-04-22 19:33:53 +02:00
|
|
|
void restore();
|
|
|
|
void save();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SETTINGS_H
|