]> git.vomp.tv Git - vompclient.git/blob - vconnect.h
Event class to std::string
[vompclient.git] / vconnect.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
18 */
19
20 #ifndef VCONNECT_H
21 #define VCONNECT_H
22
23 #include <vector>
24 #include <mutex>
25 #include <thread>
26 #include <condition_variable>
27
28 #include "vinfo.h"
29 #include "vdr.h"
30
31 class Log;
32 class BoxStack;
33 class Message;
34
35 class VConnect : public VInfo
36 {
37   public:
38     VConnect();
39     ~VConnect();
40
41     int handleCommand(int command);
42     void processMessage(Message* m);
43     void draw();
44
45     void run();
46
47   private:
48
49     void clearServerIPs();
50
51     BoxStack* boxstack;
52     VDR* vdr;
53     Log* logger;
54     std::vector<VDRServer> servers;
55     int selectedServer;
56
57     std::thread connectThread;
58     std::mutex threadMutex;
59     std::condition_variable threadCond;
60     bool threadReqQuit;
61     void threadMethod();
62     void stop();
63 };
64
65 #endif