Fixed initialization of source and of SessionSource; sources are ready

after full initialization and in standly. A new button allows playing
the source (media or session) in the new source pannel.
This commit is contained in:
brunoherbelin
2020-07-19 19:03:49 +02:00
parent 71a3de644d
commit d916bb5706
11 changed files with 108 additions and 59 deletions

View File

@@ -43,6 +43,7 @@ public:
// cloning mechanism
virtual CloneSource *clone ();
inline size_t numClones() const { return clones_.size(); }
// Display mode
typedef enum {
@@ -54,7 +55,6 @@ public:
Mode mode () const;
void setMode (Mode m);
// get handle on the nodes used to manipulate the source in a view
inline Group *group (View::Mode m) const { return groups_.at(m); }
inline Node *groupNode (View::Mode m) const { return static_cast<Node*>(groups_.at(m)); }
@@ -74,6 +74,9 @@ public:
// touch to request update
inline void touch () { need_update_ = true; }
// informs if its ready (i.e. initialized)
inline bool ready() const { return initialized_; }
// a Source shall be updated before displayed (Mixing, Geometry and Layer)
virtual void update (float dt);
@@ -81,9 +84,6 @@ public:
virtual void setActive (bool on);
inline bool active () { return active_; }
// accept all kind of visitors
virtual void accept (Visitor& v);
// a Source shall informs if the source failed (i.e. shall be deleted)
virtual bool failed() const = 0;
@@ -93,6 +93,8 @@ public:
// a Source shall define how to render into the frame buffer
virtual void render() = 0;
// accept all kind of visitors
virtual void accept (Visitor& v);
struct hasNode: public std::unary_function<Source*, bool>
{
@@ -170,7 +172,7 @@ public:
// implementation of source API
void setActive (bool on) override;
void render() override;
uint texture() const override { return origin_->texture(); }
uint texture() const override;
bool failed() const override { return origin_ == nullptr; }
void accept (Visitor& v) override;