#pragma once #define GIF_FRAME_LENGTH 33 #include "concurrentmap.hpp" #include "messages/lazyloadedimage.hpp" #include "twitch/emotevalue.hpp" #include #include #include #include namespace chatterino { class WindowManager; class Resources; class EmoteManager { public: using FFZEmoteMap = ConcurrentMap; using BTTVEmoteMap = ConcurrentMap; using ChatterinoEmoteMap = ConcurrentMap; EmoteManager(WindowManager &_windowManager, Resources &_resources); void loadGlobalEmotes(); void reloadBTTVChannelEmotes(const QString &channelName, BTTVEmoteMap &channelEmoteMap); void reloadFFZChannelEmotes(const QString &channelName, FFZEmoteMap &channelEmoteMap); ConcurrentMap &getTwitchEmotes(); ConcurrentMap &getBTTVEmotes(); ConcurrentMap &getFFZEmotes(); ConcurrentMap &getChatterinoEmotes(); ConcurrentMap &getBTTVChannelEmoteFromCaches(); ConcurrentMap &getFFZChannelEmoteFromCaches(); ConcurrentMap &getTwitchEmoteFromCache(); ConcurrentMap &getMiscImageFromCache(); messages::LazyLoadedImage *getCheerImage(long long int amount, bool animated); messages::LazyLoadedImage *getCheerBadge(long long int amount); messages::LazyLoadedImage *getTwitchEmoteById(const QString &name, long int id); int getGeneration() { return _generation; } void incGeneration() { _generation++; } boost::signals2::signal &getGifUpdateSignal(); private: WindowManager &windowManager; Resources &resources; ConcurrentMap bttvChannelEmotes; ConcurrentMap ffzChannelEmotes; ConcurrentMap _twitchEmotes; ConcurrentMap _bttvEmotes; ConcurrentMap _ffzEmotes; ConcurrentMap _chatterinoEmotes; ConcurrentMap _bttvChannelEmoteFromCaches; ConcurrentMap _ffzChannelEmoteFromCaches; ConcurrentMap _twitchEmoteFromCache; ConcurrentMap _miscImageFromCache; boost::signals2::signal _gifUpdateTimerSignal; QTimer _gifUpdateTimer; bool _gifUpdateTimerInitiated = false; int _generation = 0; // methods static QString getTwitchEmoteLink(long id, qreal &scale); void loadFFZEmotes(); void loadBTTVEmotes(); }; } // namespace chatterino