mpris.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:cozy 作者: geigi 项目源码 文件源码
def Get(self, interface, property_name):
        if property_name in ["CanQuit", "CanRaise", "CanSeek",
                             "CanControl", "HasRatingsExtension"]:
            return GLib.Variant("b", True)
        elif property_name == "HasTrackList":
            return GLib.Variant("b", False)
        elif property_name == "Identity":
            return GLib.Variant("s", "Cozy")
        elif property_name == "DesktopEntry":
            return GLib.Variant("s", "com.github.geigi.cozy")
        elif property_name == "SupportedUriSchemes":
            return GLib.Variant("as", ["file"])
        elif property_name == "SupportedMimeTypes":
            return GLib.Variant("as", ["application/ogg",
                                       "audio/x-vorbis+ogg",
                                       "audio/x-flac",
                                       "audio/mpeg"])
        elif property_name == "PlaybackStatus":
            return GLib.Variant("s", self.__get_status())
        elif property_name == "Metadata":
            return GLib.Variant("a{sv}", self.__metadata)
        elif property_name == "Position":
            return GLib.Variant(
                "x",
                get_current_duration())
        elif property_name in ["CanGoNext", "CanGoPrevious",
                               "CanPlay", "CanPause"]:
            return GLib.Variant("b", get_current_track() is not None)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号