mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-25 13:38:35 -05:00
Add set property function for doubles
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user