Add Host/HostSettings
This commit is contained in:
29
src/core/host.h
Normal file
29
src/core/host.h
Normal file
@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace Host {
|
||||
/// Reads a file from the resources directory of the application.
|
||||
/// This may be outside of the "normal" filesystem on platforms such as Mac.
|
||||
std::optional<std::vector<u8>> ReadResourceFile(const char* filename);
|
||||
|
||||
/// Reads a resource file file from the resources directory as a string.
|
||||
std::optional<std::string> ReadResourceFileToString(const char* filename);
|
||||
|
||||
/// Adds OSD messages, duration is in seconds.
|
||||
void AddOSDMessage(std::string message, float duration = 2.0f);
|
||||
void AddKeyedOSDMessage(std::string key, std::string message, float duration = 2.0f);
|
||||
void AddFormattedOSDMessage(float duration, const char* format, ...);
|
||||
void AddKeyedFormattedOSDMessage(std::string key, float duration, const char* format, ...);
|
||||
void RemoveKeyedOSDMessage(std::string key);
|
||||
void ClearOSDMessages();
|
||||
|
||||
/// Displays an asynchronous error on the UI thread, i.e. doesn't block the caller.
|
||||
void ReportErrorAsync(const std::string_view& title, const std::string_view& message);
|
||||
void ReportFormattedErrorAsync(const std::string_view& title, const char* format, ...);
|
||||
} // namespace Host
|
||||
Reference in New Issue
Block a user