syndilights/frameserver/Server.h

78 lines
1.1 KiB
C
Raw Normal View History

#ifndef __SERVER_H_
#define __SERVER_H_
#include <iostream>
#include <string>
#include <vector>
2010-11-12 21:37:12 +01:00
#include <list>
#include <glibmm/timeval.h>
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <ncurses.h>
#include "Buffers.h"
#include "Buffer.h"
#include "defines.h"
2010-11-17 15:38:40 +01:00
enum modes
{
FRAME,
FRAME_VALUES,
CLIENTS
};
using boost::asio::ip::udp;
using namespace std;
class Server : public sigc::trackable
{
public:
2010-11-12 21:37:12 +01:00
Server(int _port);
~Server();
void launch_threads();
private:
2010-11-17 15:38:40 +01:00
Glib::Mutex mutex_;
void console();
void input();
void test();
char brtoc(unsigned char);
int brtoi(unsigned char);
void console_printframe(frame_t _frame);
void console_printframe_values(frame_t _frame);
void console_printstats();
2010-11-17 15:38:40 +01:00
void console_printclients();
void listen();
void mix();
2010-11-17 15:38:40 +01:00
void output(frame_t);
int get_size();
void expire();
bool consoleinit;
int console_input;
long displaycounter, packetcounter;
2010-11-12 21:37:12 +01:00
vector<Glib::Thread*> threads;
vector<Buffer*> buffers;
2010-11-12 21:37:12 +01:00
vector<udp::endpoint> endpoints;
vector<time_t> times;
2010-11-12 21:37:12 +01:00
time_t currenttime;
frame_t frame;
int port;
char mode;
};
#endif