Add set property function for doubles

This commit is contained in:
Ylva Selling
2023-02-28 10:05:52 -05:00
parent cc4e92e7fb
commit 4a617aa9eb
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -105,6 +105,7 @@ private:
void setPropertyStringMpv(const char* name, const char* value);
void setPropertyAsyncMpv(int value, MpvKey key);
void setPropertyAsyncMpv(const char* value, MpvKey key);
void setPropertyAsyncMpv(double value, MpvKey key);
void getPropertyAsyncMpv(MpvKey key);
// Map to simulation time functions
+16
View File
@@ -192,6 +192,22 @@ void VideoPlayer::setPropertyAsyncMpv(const char* value, MpvKey key) {
}
}
void VideoPlayer::setPropertyAsyncMpv(double value, MpvKey key) {
if (!_isInitialized) {
return;
}
int result = mpv_set_property_async(
_mpvHandle,
static_cast<uint64_t>(key),
keys[key],
formats[key],
&value
);
if (!checkMpvError(result)) {
LWARNING("Error when playing video");
}
}
void VideoPlayer::getPropertyAsyncMpv(MpvKey key) {
int result = mpv_get_property_async(
_mpvHandle,