}
}
} else {
- mPlayer->setPos(pos);
- const std::vector<LOTNode *> &renderList = mPlayer->renderList();
+ const std::vector<LOTNode *> &renderList = mPlayer->renderList(pos);
update(renderList);
}
}
}
mBuffer.buffer = nullptr;
} else {
- mPlayer->setPos(mPendingPos);
- const std::vector<LOTNode *> &renderList = mPlayer->renderList();
+ const std::vector<LOTNode *> &renderList = mPlayer->renderList(mPendingPos);
update(renderList);
}
}
float playTime() const;
- void setPos(float pos);
float pos();
- const std::vector<LOTNode *> &renderList() const;
+ const std::vector<LOTNode *> &renderList(float pos) const;
// TODO: Consider correct position...
void setSize(int width, int height);
#include <fstream>
class LOTPlayerPrivate {
+
+private:
+ bool setPos(float pos);
+
public:
LOTPlayerPrivate();
bool setFilePath(std::string path);
void setSize(const VSize &sz);
VSize size() const;
float playTime() const;
- bool setPos(float pos);
float pos();
- const std::vector<LOTNode *> &renderList() const;
+ const std::vector<LOTNode *> &renderList(float pos);
bool render(float pos, const LOTBuffer &buffer);
public:
}
}
-const std::vector<LOTNode *> &LOTPlayerPrivate::renderList() const
+const std::vector<LOTNode *> &LOTPlayerPrivate::renderList(float pos)
{
if (!mCompItem) {
static std::vector<LOTNode *> empty;
return empty;
}
-
+ this->setPos(pos);
return mCompItem->renderList();
}
bool LOTPlayerPrivate::setPos(float pos)
{
- if (!mModel || !mCompItem) return false;
+ if (!mModel || !mCompItem) {
+ vWarning << "Invalid data, mModel(?), mCompItem(?)";
+ return false;
+ }
if (pos > 1.0) pos = 1.0;
if (pos < 0) pos = 0;
return d->playTime();
}
-void LOTPlayer::setPos(float pos)
-{
- d->setPos(pos);
-}
-
float LOTPlayer::pos()
{
return d->pos();
}
-const std::vector<LOTNode *> &LOTPlayer::renderList() const
+const std::vector<LOTNode *> &LOTPlayer::renderList(float pos) const
{
- return d->renderList();
+ return d->renderList(pos);
}
std::future<bool> LOTPlayer::render(float pos, LOTBuffer buffer)