{ "name": "MprisPlayer", "module": "Quickshell.Services.Mpris", "type": "class", "super": { "type": "qt", "module": "qml.QtQml", "name": "QtObject" }, "description": "A media player exposed over MPRIS.", "details": "A media player exposed over MPRIS.\n\n{{< callout type=\"warning\" >}}\n Support for various functionality and general compliance to\nthe MPRIS specification varies wildly by player.\nAlways check the associated `canXyz` and `xyzSupported` properties if available.\n{{< /callout >}}\n\n{{< callout type=\"info\" >}}\n The TrackList and Playlist interfaces were not implemented as we could not\nfind any media players using them to test against.\n\n{{< /callout >}}", "flags": [ "uncreatable" ], "properties": { "desktopEntry": { "type": { "type": "qt", "module": "qml", "name": "string" }, "details": "The name of the desktop entry for the media player, or an empty string if not provided.\n", "flags": [ "readonly" ] }, "maxRate": { "type": { "type": "qt", "module": "qml", "name": "real" }, "details": null, "flags": [ "readonly" ] }, "supportedUriSchemes": { "type": { "type": "qt", "module": "qml", "name": "list", "of": { "type": "qt", "module": "qml", "name": "string" } }, "details": "Uri schemes supported by {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"func\" mname=\"openUri\" >}}.\n", "flags": [ "readonly" ] }, "fullscreen": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": "If the player is currently shown in fullscreen.\n\nMay only be written to if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canSetFullscreen\" >}} is true.\n" }, "canGoNext": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "identity": { "type": { "type": "qt", "module": "qml", "name": "string" }, "details": "The human readable name of the media player.\n", "flags": [ "readonly" ] }, "loopState": { "type": { "type": "local", "module": "Quickshell.Services.Mpris", "name": "MprisLoopState" }, "details": "The loop state of the media player, or `None` if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"loopSupported\" >}} is false.\n\nMay only be written to if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canControl\" >}} and {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"loopSupported\" >}} are true.\n" }, "canSetFullscreen": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "canControl": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "positionSupported": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "trackArtists": { "type": { "type": "qt", "module": "qml", "name": "list", "of": { "type": "qt", "module": "qml", "name": "string" } }, "details": "The current track's artists, or an empty list if none were provided.\n", "flags": [ "readonly" ] }, "volumeSupported": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "canPause": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "metadata": { "type": { "type": "unknown", "module": "", "name": "" }, "details": "Metadata of the current track.\n\nA map of common properties is available [here](https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata).\nDo not count on any of them actually being present.\n\nNote that the {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"trackTitle\" >}}, {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"trackAlbum\" >}}, {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"trackAlbumArtist\" >}}, {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"trackArtists\" >}} and {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"trackArtUrl\" >}}\nproperties have extra logic to guard against bad players sending weird metadata, and should\nbe used over grabbing the properties directly from the metadata.\n", "flags": [ "readonly" ] }, "trackAlbum": { "type": { "type": "qt", "module": "qml", "name": "string" }, "details": "The current track's album, or \"Unknown Album\" if none was provided.\n", "flags": [ "readonly" ] }, "trackArtUrl": { "type": { "type": "qt", "module": "qml", "name": "string" }, "details": "The current track's art url, or `\"\"` if none was provided.\n", "flags": [ "readonly" ] }, "supportedMimeTypes": { "type": { "type": "qt", "module": "qml", "name": "list", "of": { "type": "qt", "module": "qml", "name": "string" } }, "details": "Mime types supported by {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"func\" mname=\"openUri\" >}}.\n", "flags": [ "readonly" ] }, "lengthSupported": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "position": { "type": { "type": "qt", "module": "qml", "name": "real" }, "details": "The current position in the playing track, as seconds, with millisecond precision,\nor `0` if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"positionSupported\" >}} is false.\n\nMay only be written to if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canSeek\" >}} and {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"positionSupported\" >}} are true.\n\n{{< callout type=\"warning\" >}}\n To avoid excessive property updates wasting CPU while `position` is not\nactively monitored, `position` usually will not update reactively, unless a nonlinear\nchange in position occurs, however reading it will always return the current position.\n\nIf you want to actively monitor the position, the simplest way it to emit the {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"signal\" mname=\"positionChanged\" >}}\nsignal manually for the duration you are monitoring it, Using a {{< qmltypelink type=\"qt\" module=\"qml.QtQuick\" name=\"FrameAnimation\" mtype=\"\" mname=\"\" >}} if you need\nthe value to update smoothly, such as on a slider, or a {{< qmltypelink type=\"qt\" module=\"qml.QtQuick\" name=\"Timer\" mtype=\"\" mname=\"\" >}} if not, as shown below.\n\n```qml {filename=\"Using a FrameAnimation\"}\nFrameAnimation {\n // only emit the signal when the position is actually changing.\n running: player.playbackState == MprisPlaybackState.Playing\n // emit the positionChanged signal every frame.\n onTriggered: player.positionChanged()\n}\n```\n\n```qml {filename=\"Using a Timer\"}\nTimer {\n // only emit the signal when the position is actually changing.\n running: player.playbackState == MprisPlaybackState.Playing\n // Make sure the position updates at least once per second.\n interval: 1000\n repeat: true\n // emit the positionChanged signal every second.\n onTriggered: player.positionChanged()\n}\n```\n\n{{< /callout >}}" }, "length": { "type": { "type": "qt", "module": "qml", "name": "real" }, "details": "The length of the playing track, as seconds, with millisecond precision,\nor the value of {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"position\" >}} if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"lengthSupported\" >}} is false.\n", "flags": [ "readonly" ] }, "playbackState": { "type": { "type": "local", "module": "Quickshell.Services.Mpris", "name": "MprisPlaybackState" }, "details": "The playback state of the media player.\n\n- If {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canPlay\" >}} is false, you cannot assign the `Playing` state.\n- If {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canPause\" >}} is false, you cannot assign the `Paused` state.\n- If {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canControl\" >}} is false, you cannot assign the `Stopped` state.\n(or any of the others, though their repsective properties will also be false)\n" }, "volume": { "type": { "type": "qt", "module": "qml", "name": "real" }, "details": "The volume of the playing track from 0.0 to 1.0, or 1.0 if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"volumeSupported\" >}} is false.\n\nMay only be written to if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canControl\" >}} and {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"volumeSupported\" >}} are true.\n" }, "trackTitle": { "type": { "type": "qt", "module": "qml", "name": "string" }, "details": "The title of the current track, or \"Unknown Track\" if none was provided.\n", "flags": [ "readonly" ] }, "canPlay": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "canRaise": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "canGoPrevious": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "canTogglePlaying": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "rate": { "type": { "type": "qt", "module": "qml", "name": "real" }, "details": "The speed the song is playing at, as a multiplier.\n\nOnly values between {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"minRate\" >}} and {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"maxRate\" >}} (inclusive) may be written to the property.\nAdditionally, It is recommended that you only write common values such as `0.25`, `0.5`, `1.0`, `2.0`\nto the property, as media players are free to ignore the value, and are more likely to\naccept common ones.\n" }, "shuffle": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": "If the play queue is currently being shuffled, or false if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"shuffleSupported\" >}} is false.\n\nMay only be written if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canControl\" >}} and {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"shuffleSupported\" >}} are true.\n" }, "loopSupported": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "shuffleSupported": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "trackAlbumArtist": { "type": { "type": "qt", "module": "qml", "name": "string" }, "details": "The current track's album artist, or \"Unknown Artist\" if none was provided.\n", "flags": [ "readonly" ] }, "canSeek": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "canQuit": { "type": { "type": "qt", "module": "qml", "name": "bool" }, "details": null, "flags": [ "readonly" ] }, "minRate": { "type": { "type": "qt", "module": "qml", "name": "real" }, "details": null, "flags": [ "readonly" ] } }, "functions": [ { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "next", "id": "next", "details": "Play the next song.\n\nMay only be called if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canGoNext\" >}} is true.\n", "params": [] }, { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "openUri", "id": "openUri", "details": "Open the given URI in the media player.\n\nMany players will silently ignore this, especially if the uri\ndoes not match {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"supportedUriSchemes\" >}} and {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"supportedMimeTypes\" >}}.\n", "params": [ { "name": "uri", "type": { "type": "qt", "module": "qml", "name": "string" } } ] }, { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "pause", "id": "pause", "details": "Equivalent to setting {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"playbackState\" >}} to `Paused`.\n", "params": [] }, { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "play", "id": "play", "details": "Equivalent to setting {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"playbackState\" >}} to `Playing`.\n", "params": [] }, { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "previous", "id": "previous", "details": "Play the previous song, or go back to the beginning of the current one.\n\nMay only be called if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canGoPrevious\" >}} is true.\n", "params": [] }, { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "quit", "id": "quit", "details": "Quit the media player.\n\nMay only be called if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canQuit\" >}} is true.\n", "params": [] }, { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "raise", "id": "raise", "details": "Bring the media player to the front of the window stack.\n\nMay only be called if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canRaise\" >}} is true.\n", "params": [] }, { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "seek", "id": "seek", "details": "Change `position` by an offset.\n\nEven if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"positionSupported\" >}} is false and you cannot set `position`,\nthis function may work.\n\nMay only be called if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canSeek\" >}} is true.\n", "params": [ { "name": "offset", "type": { "type": "qt", "module": "qml", "name": "real" } } ] }, { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "stop", "id": "stop", "details": "Equivalent to setting {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"playbackState\" >}} to `Stopped`.\n", "params": [] }, { "ret": { "type": "qt", "module": "qml", "name": "void" }, "name": "togglePlaying", "id": "togglePlaying", "details": "Equivalent to calling {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"func\" mname=\"play\" >}} if not playing or {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"func\" mname=\"pause\" >}} if playing.\n\nMay only be called if {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canTogglePlaying\" >}} is true, which is equivalent to\n{{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"prop\" mname=\"canPlay\" >}} or {{< qmltypelink type=\"\" module=\"\" name=\"\" mtype=\"func\" mname=\"canPause\" >}} depending on the current playback state.\n", "params": [] } ], "signals": { "trackChanged": { "name": "trackChanged", "details": null, "params": [] } }, "variants": {} }