From 8c3baffadbff167a75c34024374cd08dae4a9cdd Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 30 Oct 2014 11:26:31 +0100 Subject: client API: qthelper: add set_option_variant() --- libmpv/qthelper.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libmpv') diff --git a/libmpv/qthelper.hpp b/libmpv/qthelper.hpp index 2c3fe00596..1b0ff47a0b 100644 --- a/libmpv/qthelper.hpp +++ b/libmpv/qthelper.hpp @@ -216,6 +216,16 @@ static inline int set_property_variant(mpv_handle *ctx, const QString &name, return mpv_set_property(ctx, name.toUtf8().data(), MPV_FORMAT_NODE, node.node()); } +/** + * Set the given option as mpv_node converted from the QVariant argument. + */ +static inline int set_option_variant(mpv_handle *ctx, const QString &name, + const QVariant &v) +{ + node_builder node(v); + return mpv_set_option(ctx, name.toUtf8().data(), MPV_FORMAT_NODE, node.node()); +} + /** * mpv_command_node() equivalent. Returns QVariant() on error (and * unfortunately, the same on success). -- cgit v1.2.3