Duckstation/src/frontend-common/common_host.h

53 lines
1.6 KiB
C
Raw Normal View History

#pragma once
#include "core/system.h"
2022-07-27 14:42:41 +00:00
#include <memory>
#include <mutex>
2022-08-05 07:50:28 +00:00
#include <string>
#include <vector>
class SettingsInterface;
2022-07-27 14:42:41 +00:00
class AudioStream;
enum class AudioStretchMode : u8;
namespace CommonHost {
/// Initializes configuration.
void UpdateLogSettings();
void Initialize();
void Shutdown();
void SetDefaultSettings(SettingsInterface& si);
void SetDefaultControllerSettings(SettingsInterface& si);
void SetDefaultHotkeyBindings(SettingsInterface& si);
void LoadSettings(SettingsInterface& si, std::unique_lock<std::mutex>& lock);
void CheckForSettingsChanges(const Settings& old_settings);
void OnSystemStarting();
void OnSystemStarted();
void OnSystemDestroyed();
void OnSystemPaused();
void OnSystemResumed();
void OnGameChanged(const std::string& disc_path, const std::string& game_serial, const std::string& game_name);
void PumpMessagesOnCPUThread();
bool CreateHostDisplayResources();
void ReleaseHostDisplayResources();
2022-07-27 14:42:41 +00:00
2022-08-04 11:39:15 +00:00
#ifdef WITH_CUBEB
std::unique_ptr<AudioStream> CreateCubebAudioStream(u32 sample_rate, u32 channels, u32 buffer_ms, u32 latency_ms,
AudioStretchMode stretch);
2022-08-05 07:50:28 +00:00
std::vector<std::string> GetCubebDriverNames();
2022-08-04 11:39:15 +00:00
#endif
2022-07-27 14:42:41 +00:00
#ifdef _WIN32
std::unique_ptr<AudioStream> CreateXAudio2Stream(u32 sample_rate, u32 channels, u32 buffer_ms, u32 latency_ms,
AudioStretchMode stretch);
#endif
} // namespace CommonHost
namespace ImGuiManager {
void RenderDebugWindows();
}
namespace Host {
/// Return the current window handle. Needed for DInput.
void* GetTopLevelWindowHandle();
} // namespace Host