summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_protocol_sc
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-19 13:39:50 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-10-19 13:39:50 +0200
commita8ffbb76f3e3bbca547fccf5135323e06cae9d2a (patch)
treecd77a5302cb4ead5995a2a86d5b5b6324ebf43ff /ftnoir_protocol_sc
parent0f0d663c6263a59e2cb14f555a00b39b19c134e7 (diff)
update modules to refactored API
Diffstat (limited to 'ftnoir_protocol_sc')
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc.cpp22
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc.h18
2 files changed, 19 insertions, 21 deletions
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
index 72b800d2..b56585df 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp
@@ -68,7 +68,7 @@ FTNoIR_Protocol::~FTNoIR_Protocol()
}
}
-void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) {
+void FTNoIR_Protocol::pose( const double *headpose ) {
virtSCRotX = -headpose[Pitch]; // degrees
virtSCRotY = -headpose[Yaw];
virtSCRotZ = headpose[Roll];
@@ -134,7 +134,7 @@ private:
HANDLE hactctx;
};
-bool FTNoIR_Protocol::checkServerInstallationOK()
+bool FTNoIR_Protocol::correct()
{
if (!SCClientLib.isLoaded())
{
@@ -152,17 +152,17 @@ bool FTNoIR_Protocol::checkServerInstallationOK()
//
simconnect_open = (importSimConnect_Open) SCClientLib.resolve("SimConnect_Open");
if (simconnect_open == NULL) {
- qDebug() << "FTNoIR_Protocol::checkServerInstallationOK() says: SimConnect_Open function not found in DLL!";
+ qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_Open function not found in DLL!";
return false;
}
simconnect_set6DOF = (importSimConnect_CameraSetRelative6DOF) SCClientLib.resolve("SimConnect_CameraSetRelative6DOF");
if (simconnect_set6DOF == NULL) {
- qDebug() << "FTNoIR_Protocol::checkServerInstallationOK() says: SimConnect_CameraSetRelative6DOF function not found in DLL!";
+ qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_CameraSetRelative6DOF function not found in DLL!";
return false;
}
simconnect_close = (importSimConnect_Close) SCClientLib.resolve("SimConnect_Close");
if (simconnect_close == NULL) {
- qDebug() << "FTNoIR_Protocol::checkServerInstallationOK() says: SimConnect_Close function not found in DLL!";
+ qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_Close function not found in DLL!";
return false;
}
@@ -170,35 +170,35 @@ bool FTNoIR_Protocol::checkServerInstallationOK()
simconnect_calldispatch = (importSimConnect_CallDispatch) SCClientLib.resolve("SimConnect_CallDispatch");
if (simconnect_calldispatch == NULL) {
- qDebug() << "FTNoIR_Protocol::checkServerInstallationOK() says: SimConnect_CallDispatch function not found in DLL!";
+ qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_CallDispatch function not found in DLL!";
return false;
}
simconnect_subscribetosystemevent = (importSimConnect_SubscribeToSystemEvent) SCClientLib.resolve("SimConnect_SubscribeToSystemEvent");
if (simconnect_subscribetosystemevent == NULL) {
- qDebug() << "FTNoIR_Protocol::checkServerInstallationOK() says: SimConnect_SubscribeToSystemEvent function not found in DLL!";
+ qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_SubscribeToSystemEvent function not found in DLL!";
return false;
}
simconnect_mapclienteventtosimevent = (importSimConnect_MapClientEventToSimEvent) SCClientLib.resolve("SimConnect_MapClientEventToSimEvent");
if (simconnect_subscribetosystemevent == NULL) {
- qDebug() << "FTNoIR_Protocol::checkServerInstallationOK() says: SimConnect_MapClientEventToSimEvent function not found in DLL!";
+ qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_MapClientEventToSimEvent function not found in DLL!";
return false;
}
simconnect_addclienteventtonotificationgroup = (importSimConnect_AddClientEventToNotificationGroup) SCClientLib.resolve("SimConnect_AddClientEventToNotificationGroup");
if (simconnect_subscribetosystemevent == NULL) {
- qDebug() << "FTNoIR_Protocol::checkServerInstallationOK() says: SimConnect_AddClientEventToNotificationGroup function not found in DLL!";
+ qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_AddClientEventToNotificationGroup function not found in DLL!";
return false;
}
simconnect_setnotificationgrouppriority = (importSimConnect_SetNotificationGroupPriority) SCClientLib.resolve("SimConnect_SetNotificationGroupPriority");
if (simconnect_subscribetosystemevent == NULL) {
- qDebug() << "FTNoIR_Protocol::checkServerInstallationOK() says: SimConnect_SetNotificationGroupPriority function not found in DLL!";
+ qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_SetNotificationGroupPriority function not found in DLL!";
return false;
}
- qDebug() << "FTNoIR_Protocol::checkServerInstallationOK() says: SimConnect functions resolved in DLL!";
+ qDebug() << "FTNoIR_Protocol::correct() says: SimConnect functions resolved in DLL!";
return true;
}
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h
index 02cb7b0e..784c915c 100644
--- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h
+++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h
@@ -89,9 +89,9 @@ class FTNoIR_Protocol : public IProtocol
public:
FTNoIR_Protocol();
~FTNoIR_Protocol() override;
- bool checkServerInstallationOK();
- void sendHeadposeToGame(const double* headpose);
- QString getGameName() {
+ bool correct();
+ void pose(const double* headpose);
+ QString game_name() {
return "FS2004/FSX";
}
private:
@@ -127,13 +127,13 @@ private:
settings s;
};
-class SCControls: public QWidget, public IProtocolDialog
+class SCControls: public IProtocolDialog
{
Q_OBJECT
public:
SCControls();
- void registerProtocol(IProtocol *) {}
- void unRegisterProtocol() {}
+ void register_protocol(IProtocol *) {}
+ void unregister_protocol() {}
private:
Ui::UICSCControls ui;
settings s;
@@ -145,8 +145,6 @@ private slots:
class FTNoIR_ProtocolDll : public Metadata
{
public:
- void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FSX SimConnect"); }
- void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("SimConnect"); }
- void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Microsoft SimConnect protocol"); }
- void getIcon(QIcon *icon) { *icon = QIcon(":/images/fsx.png"); }
+ QString name() { return QString("Microsoft FSX SimConnect"); }
+ QIcon icon() { return QIcon(":/images/fsx.png"); }
};