forked from vranki/ExtPlane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xplaneplugin.h
44 lines (40 loc) · 1.31 KB
/
xplaneplugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef XPLANEPLUGIN_H
#define XPLANEPLUGIN_H
#include <QObject>
#include <QDebug>
#include <QStringList>
#include <QtCore/QCoreApplication>
#include "XPLMDataAccess.h"
#include "XPLMUtilities.h"
#include "tcpserver.h"
#include "datarefprovider.h"
class DataRef;
/**
* The main plugin class
*/
class XPlanePlugin : public QObject, public DataRefProvider {
Q_OBJECT
public:
explicit XPlanePlugin(QObject *parent = 0);
~XPlanePlugin();
float flightLoop(float inElapsedSinceLastCall, float inElapsedTimeSinceLastFlightLoop, int inCounter, void *inRefcon);
int pluginStart(char * outName, char * outSig, char *outDesc);
void pluginStop();
void receiveMessage(XPLMPluginID inFromWho, long inMessage, void * inParam);
public: // DataRefProvider
virtual DataRef *subscribeRef(QString name);
virtual void unsubscribeRef(DataRef *ref);
virtual void keyStroke(int keyid);
virtual void buttonPress(int buttonid);
virtual void buttonRelease(int buttonid);
public slots:
void setFlightLoopInterval(float newInterval);
private:
QList<DataRef*> refs;
int argc; // Fake argc and argv for QCoreApplication
char *argv;
QCoreApplication *app; // For Qt main loop
TcpServer *server;
float flightLoopInterval; // Delay between loop calls (in seconds)
};
#endif // XPLANEPLUGIN_H