From: APTX Date: Sat, 5 Mar 2022 00:34:19 +0000 (+0900) Subject: Remove old MpvProperty structs X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=61dbaf9753e96046d6727cb0c97e65aa257ab072;p=aniplayer.git Remove old MpvProperty structs --- diff --git a/backendplugins/backend_mpv/backendmpv.cpp b/backendplugins/backend_mpv/backendmpv.cpp index 55ef97b..8a24f2b 100644 --- a/backendplugins/backend_mpv/backendmpv.cpp +++ b/backendplugins/backend_mpv/backendmpv.cpp @@ -158,60 +158,6 @@ void MpvInstance::setCurrentSubtitleStream(TrackIndex track) { } } -template struct MpvProperty; - -template <> struct MpvProperty { - static void read(struct mpv_event_property *property) { - Q_ASSERT(property->format == MPV_FORMAT_NONE); - } -}; - -template <> struct MpvProperty { - static bool read(struct mpv_event_property *property) { - Q_ASSERT(property->format == MPV_FORMAT_FLAG); - Q_CHECK_PTR(property->data); - return *static_cast(property->data) ? true : false; - } -}; - -template <> struct MpvProperty { - static qint64 read(struct mpv_event_property *property) { - Q_ASSERT(property->format == MPV_FORMAT_INT64); - Q_CHECK_PTR(property->data); - return *static_cast(property->data); - } -}; - -template <> struct MpvProperty { - static double read(struct mpv_event_property *property) { - Q_ASSERT(property->format == MPV_FORMAT_DOUBLE); - Q_CHECK_PTR(property->data); - return *static_cast(property->data); - } -}; - -template <> struct MpvProperty { - static mpv_node *read(struct mpv_event_property *property) { - Q_ASSERT(property->format == MPV_FORMAT_NODE); - if (!property->data) - qWarning("Property data data is null"); - return static_cast(property->data); - } -}; - -template <> struct MpvProperty { - static char *read(struct mpv_event_property *property) { - Q_ASSERT(property->format == MPV_FORMAT_STRING); - Q_CHECK_PTR(property->data); - return *static_cast(property->data); - } -}; - -template -decltype(auto) readProperty(struct mpv_event_property *property) { - return MpvProperty::read(property); -} - int MpvInstance::readTrackIndex(const QString &qstr) { qCDebug(mpvBackend).nospace() << "Trying to read id from >" << qstr << "<";