mirror-chatterino2/channel.h

113 lines
1.9 KiB
C
Raw Normal View History

#ifndef CHANNEL_H
#define CHANNEL_H
2017-01-07 20:43:55 +01:00
#include "concurrentmap.h"
#include "lazyloadedimage.h"
#include <QMap>
#include <QMutex>
2017-01-11 18:52:09 +01:00
#include <QString>
2017-01-07 20:43:55 +01:00
#include <QVector>
2017-01-11 01:08:20 +01:00
#include <memory>
2017-01-05 16:07:20 +01:00
class Message;
class Channel
{
public:
Channel(const QString &channel);
2017-01-07 20:43:55 +01:00
// properties
2017-01-11 18:52:09 +01:00
const ConcurrentMap<QString, LazyLoadedImage *> &
2017-01-18 04:33:30 +01:00
getBttvChannelEmotes() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return bttvChannelEmotes;
2017-01-11 18:52:09 +01:00
}
const ConcurrentMap<QString, LazyLoadedImage *> &
2017-01-18 04:33:30 +01:00
getFfzChannelEmotes() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return ffzChannelEmotes;
2017-01-11 18:52:09 +01:00
}
const QMutex &
2017-01-18 04:33:30 +01:00
getMessageMutex() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return messageMutex;
2017-01-11 18:52:09 +01:00
}
const QString &
2017-01-18 04:33:30 +01:00
getName() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return name;
2017-01-11 18:52:09 +01:00
}
2017-01-18 04:33:30 +01:00
2017-01-11 18:52:09 +01:00
int
2017-01-18 04:33:30 +01:00
getRoomID() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return roomID;
2017-01-11 18:52:09 +01:00
}
const QString &
2017-01-18 04:33:30 +01:00
getSubLink() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return subLink;
2017-01-11 18:52:09 +01:00
}
const QString &
2017-01-18 04:33:30 +01:00
getChannelLink() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return channelLink;
2017-01-11 18:52:09 +01:00
}
const QString &
2017-01-18 04:33:30 +01:00
getPopoutPlayerLink() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return popoutPlayerLink;
2017-01-11 18:52:09 +01:00
}
bool
2017-01-18 04:33:30 +01:00
getIsLive() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return isLive;
2017-01-11 18:52:09 +01:00
}
int
2017-01-18 04:33:30 +01:00
getStreamViewerCount() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return streamViewerCount;
2017-01-11 18:52:09 +01:00
}
const QString &
2017-01-18 04:33:30 +01:00
getStreamStatus() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return streamStatus;
2017-01-11 18:52:09 +01:00
}
const QString &
2017-01-18 04:33:30 +01:00
getStreamGame() const
2017-01-11 18:52:09 +01:00
{
2017-01-18 04:33:30 +01:00
return streamGame;
2017-01-11 18:52:09 +01:00
}
2017-01-05 20:49:33 +01:00
2017-01-07 20:43:55 +01:00
// methods
2017-01-11 01:08:20 +01:00
void addMessage(std::shared_ptr<Message> message);
2017-01-05 16:07:20 +01:00
2017-01-11 01:08:20 +01:00
QVector<std::shared_ptr<Message>> getMessagesClone();
2017-01-05 16:07:20 +01:00
private:
2017-01-18 04:33:30 +01:00
QVector<std::shared_ptr<Message>> messages;
2017-01-18 04:33:30 +01:00
QString name;
int roomID;
2017-01-18 04:33:30 +01:00
ConcurrentMap<QString, LazyLoadedImage *> bttvChannelEmotes;
ConcurrentMap<QString, LazyLoadedImage *> ffzChannelEmotes;
QMutex messageMutex;
2017-01-13 18:59:11 +01:00
2017-01-18 04:33:30 +01:00
QString subLink;
QString channelLink;
QString popoutPlayerLink;
2017-01-18 04:33:30 +01:00
bool isLive;
int streamViewerCount;
QString streamStatus;
QString streamGame;
};
2017-01-11 18:52:09 +01:00
#endif // CHANNEL_H