mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
db5aec019c
Fallback Region A user-selected fallback to use instead of the default PAL This is used for unknown region or region free titles to give them the ability to force region to use. This replaces the current fallback region of PAL. This can be useful if a user is trying to play a region free tilte that is originally NTSC and expects to be run at NTSC speeds. This may be done when a user attempts to dump a WAD of their own without understanding the settings they have chosen, or could be an intentional decision by a developer of a ROM hack that can be injected into a Virtual Console WAD. Remove using System Menu region being checked in GetFallbackRegion Use DiscIO::Region instead of std::String for fallback Add explanation text for Fallback Region
200 lines
5.5 KiB
C++
200 lines
5.5 KiB
C++
// 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 "DiscIO/Enums.h"
|
|
|
|
namespace Core
|
|
{
|
|
enum class State;
|
|
}
|
|
|
|
namespace DiscIO
|
|
{
|
|
enum class Language;
|
|
}
|
|
|
|
namespace NetPlay
|
|
{
|
|
class NetPlayClient;
|
|
class NetPlayServer;
|
|
} // namespace NetPlay
|
|
|
|
class InputConfig;
|
|
|
|
// 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;
|
|
|
|
~Settings();
|
|
|
|
static Settings& Instance();
|
|
static QSettings& GetQSettings();
|
|
|
|
// UI
|
|
void SetThemeName(const QString& theme_name);
|
|
void SetCurrentUserStyle(const QString& stylesheet_name);
|
|
QString GetCurrentUserStyle() const;
|
|
|
|
void SetUserStylesEnabled(bool enabled);
|
|
bool AreUserStylesEnabled() const;
|
|
|
|
bool IsLogVisible() const;
|
|
void SetLogVisible(bool visible);
|
|
bool IsLogConfigVisible() const;
|
|
void SetLogConfigVisible(bool visible);
|
|
void SetToolBarVisible(bool visible);
|
|
bool IsToolBarVisible() const;
|
|
void SetWidgetsLocked(bool visible);
|
|
bool AreWidgetsLocked() const;
|
|
|
|
void RefreshWidgetVisibility();
|
|
|
|
// 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 RefreshGameList();
|
|
void NotifyRefreshGameListStarted();
|
|
void NotifyRefreshGameListComplete();
|
|
void RefreshMetadata();
|
|
void NotifyMetadataRefreshComplete();
|
|
void ReloadTitleDB();
|
|
bool IsAutoRefreshEnabled() const;
|
|
void SetAutoRefreshEnabled(bool enabled);
|
|
|
|
// Emulation
|
|
int GetStateSlot() const;
|
|
void SetStateSlot(int);
|
|
bool IsBatchModeEnabled() const;
|
|
void SetBatchModeEnabled(bool batch);
|
|
|
|
bool IsSDCardInserted() const;
|
|
void SetSDCardInserted(bool inserted);
|
|
bool IsUSBKeyboardConnected() const;
|
|
void SetUSBKeyboardConnected(bool connected);
|
|
|
|
// Graphics
|
|
void SetHideCursor(bool hide_cursor);
|
|
bool GetHideCursor() const;
|
|
void SetKeepWindowOnTop(bool top);
|
|
bool IsKeepWindowOnTopEnabled() const;
|
|
|
|
// Audio
|
|
int GetVolume() const;
|
|
void SetVolume(int volume);
|
|
void IncreaseVolume(int volume);
|
|
void DecreaseVolume(int volume);
|
|
|
|
// NetPlay
|
|
std::shared_ptr<NetPlay::NetPlayClient> GetNetPlayClient();
|
|
void ResetNetPlayClient(NetPlay::NetPlayClient* client = nullptr);
|
|
std::shared_ptr<NetPlay::NetPlayServer> GetNetPlayServer();
|
|
void ResetNetPlayServer(NetPlay::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 SetThreadsVisible(bool enabled);
|
|
bool IsThreadsVisible() 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;
|
|
void SetNetworkVisible(bool enabled);
|
|
bool IsNetworkVisible() const;
|
|
void SetJITVisible(bool enabled);
|
|
bool IsJITVisible() const;
|
|
QFont GetDebugFont() const;
|
|
void SetDebugFont(QFont font);
|
|
|
|
// Auto-Update
|
|
QString GetAutoUpdateTrack() const;
|
|
void SetAutoUpdateTrack(const QString& mode);
|
|
|
|
// Fallback Region
|
|
DiscIO::Region GetFallbackRegion() const;
|
|
void SetFallbackRegion(const DiscIO::Region& region);
|
|
|
|
// Analytics
|
|
bool IsAnalyticsEnabled() const;
|
|
void SetAnalyticsEnabled(bool enabled);
|
|
|
|
signals:
|
|
void ConfigChanged();
|
|
void EmulationStateChanged(Core::State new_state);
|
|
void ThemeChanged();
|
|
void PathAdded(const QString&);
|
|
void PathRemoved(const QString&);
|
|
void DefaultGameChanged(const QString&);
|
|
void GameListRefreshRequested();
|
|
void GameListRefreshStarted();
|
|
void GameListRefreshCompleted();
|
|
void TitleDBReloadRequested();
|
|
void MetadataRefreshRequested();
|
|
void MetadataRefreshCompleted();
|
|
void AutoRefreshToggled(bool enabled);
|
|
void HideCursorChanged();
|
|
void KeepWindowOnTopChanged(bool top);
|
|
void VolumeChanged(int volume);
|
|
void NANDRefresh();
|
|
void RegistersVisibilityChanged(bool visible);
|
|
void ThreadsVisibilityChanged(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 NetworkVisibilityChanged(bool visible);
|
|
void JITVisibilityChanged(bool visible);
|
|
void DebugModeToggled(bool enabled);
|
|
void DebugFontChanged(QFont font);
|
|
void AutoUpdateTrackChanged(const QString& mode);
|
|
void FallbackRegionChanged(const DiscIO::Region& region);
|
|
void AnalyticsToggled(bool enabled);
|
|
void DevicesChanged();
|
|
void SDCardInsertionChanged(bool inserted);
|
|
void USBKeyboardConnectionChanged(bool connected);
|
|
|
|
private:
|
|
bool m_batch = false;
|
|
std::shared_ptr<NetPlay::NetPlayClient> m_client;
|
|
std::shared_ptr<NetPlay::NetPlayServer> m_server;
|
|
Settings();
|
|
};
|
|
|
|
Q_DECLARE_METATYPE(Core::State);
|