-
Notifications
You must be signed in to change notification settings - Fork 13
/
m1.h
88 lines (71 loc) · 1.71 KB
/
m1.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef _M1_H_
#define _M1_H_
#include <QtGui>
#include "ui_m1.h"
class M1UI: public QDockWidget, public Ui::M1UI
{
Q_OBJECT
public:
M1UI(QWidget *parent = 0);
void init();
};
class M1Thread : public QThread
{
Q_OBJECT
public:
M1Thread(QObject *parent = 0);
~M1Thread();
public slots:
void stop();
void play(QTreeWidgetItem* = NULL, int = 0);
void pause();
void prev();
void next();
void record();
protected:
void run();
private:
int gameNum;
int cmdNum;
bool done;
bool cancel;
QMutex mutex;
};
class M1Core : public QObject
{
Q_OBJECT
private:
QString m1_dir;
QFutureWatcher<void> m1Watcher;
public:
M1Core(QObject *parent = 0);
~M1Core();
int max_games;
bool isHex;
M1Thread m1Thread;
bool available;
QString version;
void init();
void loadLib();
static int m1ui_message(void *, int, char *, int);
typedef void (*fp_m1snd_init)(void *, int (*m1ui_message)(void *,int, char *, int));
fp_m1snd_init m1snd_init;
typedef int (*fp_m1snd_run)(int, int);
fp_m1snd_run m1snd_run;
typedef void (*fp_m1snd_shutdown)();
fp_m1snd_shutdown m1snd_shutdown;
typedef void (*fp_m1snd_setoption)(int, int);
fp_m1snd_setoption m1snd_setoption;
typedef int (*fp_m1snd_get_info_int)(int, int);
fp_m1snd_get_info_int m1snd_get_info_int;
typedef char* (*fp_m1snd_get_info_str)(int, int);
fp_m1snd_get_info_str m1snd_get_info_str;
typedef void (*fp_m1snd_set_info_int)(int, int, int, int);
fp_m1snd_set_info_int m1snd_set_info_int;
typedef void (*fp_m1snd_set_info_str)(int, char*, int, int, int);
fp_m1snd_set_info_str m1snd_set_info_str;
public slots:
void postInit();
void updateList(const QString & = "");
};
#endif