#ifndef CHANNEL_H #define CHANNEL_H #include "concurrentmap.h" #include "lazyloadedimage.h" #include #include #include #include #include class Message; class Channel { // static public: static Channel whispers; static Channel mentions; static Channel *addChannel(const QString &channel); static Channel *getChannel(const QString &channel); static void removeChannel(const QString &channel); private: static QMap channels; // members public: // properties const ConcurrentMap & bttvChannelEmotes() const { return m_bttvChannelEmotes; } const ConcurrentMap & ffzChannelEmotes() const { return m_ffzChannelEmotes; } const QMutex & messageMutex() const { return m_messageMutex; } const QString & name() const { return m_name; } int roomID() const { return m_roomID; } const QString & subLink() const { return m_subLink; } const QString & channelLink() const { return m_channelLink; } const QString & popoutPlayerLink() const { return m_popoutPlayerLink; } bool isLive() const { return m_isLive; } int streamViewerCount() const { return m_streamViewerCount; } const QString & streamStatus() const { return m_streamStatus; } const QString & streamGame() const { return m_streamGame; } // methods void addMessage(std::shared_ptr message); QVector> getMessagesClone(); private: Channel(QString channel); int m_referenceCount = 0; QVector> m_messages; QString m_name; int m_roomID; ConcurrentMap m_bttvChannelEmotes; ConcurrentMap m_ffzChannelEmotes; QMutex m_messageMutex; QString m_subLink; QString m_channelLink; QString m_popoutPlayerLink; bool m_isLive; int m_streamViewerCount; QString m_streamStatus; QString m_streamGame; }; #endif // CHANNEL_H