-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Settings.h
153 lines (129 loc) · 3.97 KB
/
Settings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// Copyright 2015 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include <QFont>
#include <QObject>
#include <QSettings>
#include <QVector>
#include "Core/NetPlayClient.h"
#include "Core/NetPlayServer.h"
namespace Core
{
enum class State;
}
namespace DiscIO
{
enum class Language;
}
class GameListModel;
class InputConfig;
class QFont;
// UI settings to be stored in the config directory.
class Settings final : public QObject
{
Q_OBJECT
public:
Settings(const Settings&) = delete;
Settings& operator=(const Settings&) = delete;
Settings(Settings&&) = delete;
Settings& operator=(Settings&&) = delete;
static Settings& Instance();
static QSettings& GetQSettings();
// UI
void SetThemeName(const QString& theme_name);
bool IsInDevelopmentWarningEnabled() const;
bool IsLogVisible() const;
void SetLogVisible(bool visible);
bool IsLogConfigVisible() const;
void SetLogConfigVisible(bool visible);
bool IsControllerStateNeeded() const;
void SetControllerStateNeeded(bool needed);
void SetToolBarVisible(bool visible);
bool IsToolBarVisible() const;
void SetWidgetsLocked(bool visible);
bool AreWidgetsLocked() const;
// GameList
QStringList GetPaths() const;
void AddPath(const QString& path);
void RemovePath(const QString& path);
bool GetPreferredView() const;
void SetPreferredView(bool list);
QString GetDefaultGame() const;
void SetDefaultGame(QString path);
void ReloadPath(const QString& qpath);
// Emulation
int GetStateSlot() const;
void SetStateSlot(int);
// Graphics
void SetHideCursor(bool hide_cursor);
bool GetHideCursor() const;
// Audio
int GetVolume() const;
void SetVolume(int volume);
void IncreaseVolume(int volume);
void DecreaseVolume(int volume);
// NetPlay
NetPlayClient* GetNetPlayClient();
void ResetNetPlayClient(NetPlayClient* client = nullptr);
NetPlayServer* GetNetPlayServer();
void ResetNetPlayServer(NetPlayServer* server = nullptr);
// Cheats
bool GetCheatsEnabled() const;
void SetCheatsEnabled(bool enabled);
// Debug
void SetDebugModeEnabled(bool enabled);
bool IsDebugModeEnabled() const;
void SetRegistersVisible(bool enabled);
bool IsRegistersVisible() const;
void SetWatchVisible(bool enabled);
bool IsWatchVisible() const;
void SetBreakpointsVisible(bool enabled);
bool IsBreakpointsVisible() const;
void SetCodeVisible(bool enabled);
bool IsCodeVisible() const;
void SetMemoryVisible(bool enabled);
bool IsMemoryVisible() const;
QFont GetDebugFont() const;
void SetDebugFont(QFont font);
// Auto-Update
QString GetAutoUpdateTrack() const;
void SetAutoUpdateTrack(const QString& mode);
// Analytics
bool IsAnalyticsEnabled() const;
void SetAnalyticsEnabled(bool enabled);
// Other
GameListModel* GetGameListModel() const;
signals:
void ConfigChanged();
void EmulationStateChanged(Core::State new_state);
void ThemeChanged();
void PathAdded(const QString&);
void PathRemoved(const QString&);
void DefaultGameChanged(const QString&);
void PathReloadRequested(const QString&);
void HideCursorChanged();
void VolumeChanged(int volume);
void NANDRefresh();
void RegistersVisibilityChanged(bool visible);
void LogVisibilityChanged(bool visible);
void LogConfigVisibilityChanged(bool visible);
void ToolBarVisibilityChanged(bool visible);
void WidgetLockChanged(bool locked);
void EnableCheatsChanged(bool enabled);
void WatchVisibilityChanged(bool visible);
void BreakpointsVisibilityChanged(bool visible);
void CodeVisibilityChanged(bool visible);
void MemoryVisibilityChanged(bool visible);
void DebugModeToggled(bool enabled);
void DebugFontChanged(QFont font);
void AutoUpdateTrackChanged(const QString& mode);
void AnalyticsToggled(bool enabled);
private:
bool m_controller_state_needed = false;
std::unique_ptr<NetPlayClient> m_client;
std::unique_ptr<NetPlayServer> m_server;
Settings();
};
Q_DECLARE_METATYPE(Core::State);