F.E.I.S/NotificationsQueue.h
Stepland 8d44098063 - Tab selection in linear view
- Cut/Copy/Paste selected notes
- LN displayed correctly in the Linear View
- bunch of other small stuff
2019-03-27 20:37:30 +01:00

33 lines
714 B
C++

//
// Created by Syméon on 02/03/2019.
//
#ifndef FEIS_NOTIFICATIONSQUEUE_H
#define FEIS_NOTIFICATIONSQUEUE_H
#include <deque>
#include <SFML/System.hpp>
#include "Notification.h"
/*
* Responsible for displaying the notifications with a fadeout effect
*/
class NotificationsQueue {
public:
explicit NotificationsQueue(int max_size = 10): max_size(max_size) {};
void push(const std::shared_ptr<Notification> &notification);
void display();
private:
void update();
float time_to_alpha(float seconds) {return std::max(0.0f,2.0f*(0.5f-seconds));}
sf::Clock last_push;
const int max_size;
std::deque<std::shared_ptr<Notification>> queue;
};
#endif //FEIS_NOTIFICATIONSQUEUE_H