mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-13 03:09:57 +01:00
Show also non-playable sources to allow testing pre- post-display. Show post-processed image only if source made changes.
60 lines
1.3 KiB
C++
60 lines
1.3 KiB
C++
#ifndef CLONESOURCE_H
|
|
#define CLONESOURCE_H
|
|
|
|
#include <queue>
|
|
|
|
#include "Source.h"
|
|
#include "FrameBufferFilter.h"
|
|
|
|
class CloneSource : public Source
|
|
{
|
|
friend class Source;
|
|
|
|
public:
|
|
~CloneSource();
|
|
|
|
// implementation of source API
|
|
void update (float dt) override;
|
|
void setActive (bool on) override;
|
|
bool playing () const override { return !paused_; }
|
|
void play (bool on) override;
|
|
bool playable () const override;
|
|
void replay () override;
|
|
guint64 playtime () const override;
|
|
uint texture() const override;
|
|
bool failed() const override { return origin_ == nullptr; }
|
|
void accept (Visitor& v) override;
|
|
void render() override;
|
|
glm::ivec2 icon() const override;
|
|
std::string info() const override;
|
|
|
|
// implementation of cloning mechanism
|
|
inline void detach() { origin_ = nullptr; }
|
|
inline Source *origin() const { return origin_; }
|
|
|
|
// Filtering
|
|
void setFilter(FrameBufferFilter::Type T);
|
|
inline FrameBufferFilter *filter() { return filter_; }
|
|
|
|
|
|
protected:
|
|
// only Source class can create new CloneSource via clone();
|
|
CloneSource(Source *origin, uint64_t id = 0);
|
|
|
|
void init() override;
|
|
Source *origin_;
|
|
|
|
// control
|
|
bool paused_;
|
|
|
|
// connecting line
|
|
class DotLine *connection_;
|
|
|
|
// Filter
|
|
FrameBufferFilter *filter_;
|
|
|
|
};
|
|
|
|
|
|
#endif // CLONESOURCE_H
|