refs #248 added actual XBus::CService class which is registered with DBus and provides access to the sim data

This commit is contained in:
Mathew Sutcliffe
2014-06-14 20:48:57 +01:00
parent 2393674088
commit edec05e41a
5 changed files with 197 additions and 3 deletions

View File

@@ -7,6 +7,11 @@
#define _CRT_SECURE_NO_WARNINGS
#include "plugin.h"
#include "utils.h"
#include <XPLM/XPLMPlanes.h>
#if ! defined(XPLM210)
#define XPLM_MSG_LIVERY_LOADED 108
#endif
QSharedPointer<QApplication> g_qApp;
XBus::CPlugin *g_plugin;
@@ -40,7 +45,14 @@ PLUGIN_API void XPluginDisable()
PLUGIN_API void XPluginReceiveMessage(XPLMPluginID from, long msg, void *param)
{
Q_UNUSED(from);
Q_UNUSED(msg);
Q_UNUSED(param);
if (from == XPLM_PLUGIN_XPLANE)
{
if (msg == XPLM_MSG_PLANE_LOADED || msg == XPLM_MSG_LIVERY_LOADED)
{
if (reinterpret_cast<intptr_t>(param) == XPLM_USER_AIRCRAFT)
{
g_plugin->onAircraftModelChanged();
}
}
}
}