mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-19 05:15:46 -04:00
CommonHostInterface: Make RunLater()/ApplySettings() virtual
This commit is contained in:
@ -306,6 +306,11 @@ void QtHostInterface::applySettings(bool display_osd_messages /* = false */)
|
||||
return;
|
||||
}
|
||||
|
||||
ApplySettings(display_osd_messages);
|
||||
}
|
||||
|
||||
void QtHostInterface::ApplySettings(bool display_osd_messages)
|
||||
{
|
||||
Settings old_settings(std::move(g_settings));
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> guard(m_settings_mutex);
|
||||
@ -1168,7 +1173,7 @@ void QtHostInterface::executeOnEmulationThread(std::function<void()> callback, b
|
||||
}
|
||||
|
||||
QMetaObject::invokeMethod(this, "executeOnEmulationThread", Qt::QueuedConnection,
|
||||
Q_ARG(std::function<void()>, callback), Q_ARG(bool, wait));
|
||||
Q_ARG(std::function<void()>, std::move(callback)), Q_ARG(bool, wait));
|
||||
if (wait)
|
||||
{
|
||||
// don't deadlock
|
||||
@ -1178,6 +1183,12 @@ void QtHostInterface::executeOnEmulationThread(std::function<void()> callback, b
|
||||
}
|
||||
}
|
||||
|
||||
void QtHostInterface::RunLater(std::function<void()> func)
|
||||
{
|
||||
QMetaObject::invokeMethod(this, "executeOnEmulationThread", Qt::QueuedConnection,
|
||||
Q_ARG(std::function<void()>, std::move(func)), Q_ARG(bool, false));
|
||||
}
|
||||
|
||||
void QtHostInterface::loadState(const QString& filename)
|
||||
{
|
||||
if (!isOnWorkerThread())
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "common/event.h"
|
||||
#include "core/host_interface.h"
|
||||
#include "core/system.h"
|
||||
#include "qtutils.h"
|
||||
#include "frontend-common/common_host_interface.h"
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QObject>
|
||||
@ -205,10 +206,12 @@ protected:
|
||||
void OnSystemStateSaved(bool global, s32 slot) override;
|
||||
|
||||
void LoadSettings() override;
|
||||
void ApplySettings(bool display_osd_messages) override;
|
||||
void SetDefaultSettings(SettingsInterface& si) override;
|
||||
void UpdateInputMap() override;
|
||||
|
||||
void SetMouseMode(bool relative, bool hide_cursor) override;
|
||||
void RunLater(std::function<void()> func) override;
|
||||
|
||||
private:
|
||||
enum : u32
|
||||
|
Reference in New Issue
Block a user