Rename the property in the video player to reload instead of reset, and add some more explanation

This commit is contained in:
Ylva Selling
2023-06-14 10:52:33 -04:00
parent 5d1882e398
commit 641c747f94
3 changed files with 13 additions and 12 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ public:
const std::unique_ptr<ghoul::opengl::Texture>& frameTexture() const;
bool isInitialized() const;
void reset();
void reload();
void destroy();
void update();
@@ -123,7 +123,7 @@ private:
properties::TriggerProperty _play;
properties::TriggerProperty _pause;
properties::TriggerProperty _goToStart;
properties::TriggerProperty _reset;
properties::TriggerProperty _reload;
properties::BoolProperty _playAudio;
properties::BoolProperty _loopVideo;
+10 -9
View File
@@ -60,13 +60,14 @@ namespace {
constexpr openspace::properties::Property::PropertyInfo GoToStartInfo = {
"GoToStart",
"Go To Start",
"Go to start in video"
"Sets the time to the beginning of the video and pauses it."
};
constexpr openspace::properties::Property::PropertyInfo ResetInfo = {
"Reset",
"Reset",
"Reset video"
constexpr openspace::properties::Property::PropertyInfo ReloadInfo = {
"Reload",
"Reload",
"Reloads the video and creates a new texture. This might be useful in case there "
"was an error loading the video."
};
constexpr openspace::properties::Property::PropertyInfo AudioInfo = {
@@ -249,7 +250,7 @@ VideoPlayer::VideoPlayer(const ghoul::Dictionary& dictionary)
, _play(PlayInfo)
, _pause(PauseInfo)
, _goToStart(GoToStartInfo)
, _reset(ResetInfo)
, _reload(ReloadInfo)
, _playAudio(AudioInfo, false)
, _loopVideo(LoopVideoInfo, true)
{
@@ -260,8 +261,8 @@ VideoPlayer::VideoPlayer(const ghoul::Dictionary& dictionary)
_videoFile = p.video;
_loopVideo = p.loopVideo.value_or(_loopVideo);
_reset.onChange([this]() { reset(); });
addProperty(_reset);
_reload.onChange([this]() { reload(); });
addProperty(_reload);
if (p.playbackMode.has_value()) {
switch (*p.playbackMode) {
@@ -781,7 +782,7 @@ const std::unique_ptr<ghoul::opengl::Texture>& VideoPlayer::frameTexture() const
return _frameTexture;
}
void VideoPlayer::reset() {
void VideoPlayer::reload() {
if (_videoFile.empty()) {
return;
}
+1 -1
View File
@@ -106,7 +106,7 @@ void VideoTileProvider::update() {
}
void VideoTileProvider::reset() {
_videoPlayer.reset();
_videoPlayer.reload();
}
ChunkTile VideoTileProvider::chunkTile(TileIndex tileIndex, int parents, int maxParents) {