2017-01-01 13:07:36 +01:00
|
|
|
#ifndef CHANNEL_H
|
|
|
|
#define CHANNEL_H
|
|
|
|
|
|
|
|
#include "QString"
|
2017-01-03 21:19:33 +01:00
|
|
|
#include "QMap"
|
2017-01-05 16:07:20 +01:00
|
|
|
#include "QMutex"
|
|
|
|
#include "QVector"
|
|
|
|
|
|
|
|
class Message;
|
2017-01-01 13:07:36 +01:00
|
|
|
|
|
|
|
class Channel
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static const Channel whispers;
|
|
|
|
static const Channel mentions;
|
|
|
|
|
2017-01-03 21:19:33 +01:00
|
|
|
static Channel* addChannel(const QString &channel);
|
|
|
|
static Channel* getChannel(const QString &channel);
|
|
|
|
static void removeChannel(const QString &channel);
|
2017-01-01 18:43:52 +01:00
|
|
|
|
2017-01-01 13:07:36 +01:00
|
|
|
public:
|
|
|
|
QString getSubLink();
|
|
|
|
QString getChannelLink();
|
|
|
|
QString getPopoutPlayerLink();
|
|
|
|
|
|
|
|
bool getIsLive();
|
|
|
|
int getStreamViewerCount();
|
|
|
|
QString getStreamStatus();
|
|
|
|
QString getStreamGame();
|
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
void addMessage(Message* message);
|
|
|
|
// ~Channel();
|
|
|
|
|
|
|
|
QVector<Message*>* getMessagesClone();
|
|
|
|
|
2017-01-01 13:07:36 +01:00
|
|
|
private:
|
|
|
|
Channel(QString channel);
|
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
QMutex* messageMutex;
|
|
|
|
|
2017-01-03 21:19:33 +01:00
|
|
|
static QMap<QString, Channel*> channels;
|
|
|
|
|
|
|
|
int referenceCount = 1;
|
2017-01-01 13:07:36 +01:00
|
|
|
|
|
|
|
QString name;
|
|
|
|
|
|
|
|
int roomID;
|
|
|
|
|
2017-01-05 16:07:20 +01:00
|
|
|
QVector<Message*>* messages = new QVector<Message*>();
|
|
|
|
|
2017-01-01 13:07:36 +01:00
|
|
|
QString subLink = "";
|
|
|
|
QString channelLink = "";
|
|
|
|
QString popoutPlayerLink = "";
|
|
|
|
|
|
|
|
bool isLive = false;
|
|
|
|
int streamViewerCount = 0;
|
|
|
|
QString streamStatus = "";
|
|
|
|
QString streamGame = "";
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CHANNEL_H
|