mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Source creation by origin: File, software and hardware. Separate source
classes for Media and Session sources. Update of file dialog accordingly.
This commit is contained in:
35
Source.h
35
Source.h
@@ -14,6 +14,7 @@ class FrameBuffer;
|
||||
class FrameBufferSurface;
|
||||
class MediaPlayer;
|
||||
class Surface;
|
||||
class Session;
|
||||
class Frame;
|
||||
|
||||
class Source
|
||||
@@ -43,12 +44,12 @@ public:
|
||||
// a Source has a shader to control mixing effects
|
||||
inline ImageShader *blendingShader() const { return blendingshader_; }
|
||||
|
||||
// a Source shall be updated before displayed (Mixing, Geometry and Layer)
|
||||
void update (float dt);
|
||||
|
||||
// touch to request update
|
||||
inline void touch() { need_update_ = true; }
|
||||
|
||||
// a Source shall be updated before displayed (Mixing, Geometry and Layer)
|
||||
void update (float dt);
|
||||
|
||||
// accept all kind of visitors
|
||||
virtual void accept (Visitor& v);
|
||||
|
||||
@@ -95,6 +96,7 @@ protected:
|
||||
|
||||
// update need
|
||||
bool need_update_;
|
||||
float dt_;
|
||||
};
|
||||
|
||||
// TODO SourceSet sorted by shader
|
||||
@@ -122,32 +124,5 @@ private:
|
||||
Node *_n;
|
||||
};
|
||||
|
||||
class MediaSource : public Source
|
||||
{
|
||||
public:
|
||||
MediaSource();
|
||||
~MediaSource();
|
||||
|
||||
// implementation of source API
|
||||
FrameBuffer *frame() const override;
|
||||
void render() override;
|
||||
void accept (Visitor& v) override;
|
||||
bool failed() const override;
|
||||
|
||||
// Media specific interface
|
||||
void setPath(const std::string &p);
|
||||
std::string path() const;
|
||||
MediaPlayer *mediaplayer() const;
|
||||
|
||||
protected:
|
||||
|
||||
void init() override;
|
||||
|
||||
Surface *mediasurface_;
|
||||
std::string path_;
|
||||
MediaPlayer *mediaplayer_;
|
||||
};
|
||||
|
||||
// TODO dedicated source .cpp .h files for MediaSource
|
||||
|
||||
#endif // SOURCE_H
|
||||
|
||||
Reference in New Issue
Block a user