quickshell-web/modules/Quickshell.Services.Mpris/MprisPlayer.json
2024-09-28 02:35:19 +03:00

539 lines
16 KiB
JSON

{
"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> [!WARNING] Support for various functionality and general compliance to\n> the MPRIS specification varies wildly by player.\n> Always check the associated `canXyz` and `xyzSupported` properties if available.\n\n> [!NOTE] The TrackList and Playlist interfaces were not implemented as we could not\n> find any media players using them to test against.\n",
"flags": [
"uncreatable"
],
"properties": {
"trackArtUrl": {
"type": {
"type": "qt",
"module": "qml",
"name": "string"
},
"details": "The current track's art url, or `\"\"` if none was provided.\n",
"flags": [
"readonly"
]
},
"playbackState": {
"type": {
"type": "local",
"module": "Quickshell.Services.Mpris",
"name": "MprisPlaybackState"
},
"details": "The playback state of the media player.\n\n- If TYPE99VcanPlay99Tprop99TYPE is false, you cannot assign the `Playing` state.\n- If TYPE99VcanPause99Tprop99TYPE is false, you cannot assign the `Paused` state.\n- If TYPE99VcanControl99Tprop99TYPE is false, you cannot assign the `Stopped` state.\n(or any of the others, though their repsective properties will also be false)\n"
},
"canSeek": {
"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"
]
},
"length": {
"type": {
"type": "qt",
"module": "qml",
"name": "real"
},
"details": "The length of the playing track, as seconds, with millisecond precision,\nor the value of TYPE99Vposition99Tprop99TYPE if TYPE99VlengthSupported99Tprop99TYPE is false.\n",
"flags": [
"readonly"
]
},
"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"
]
},
"identity": {
"type": {
"type": "qt",
"module": "qml",
"name": "string"
},
"details": "The human readable name of the media player.\n",
"flags": [
"readonly"
]
},
"canGoPrevious": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"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"
]
},
"maxRate": {
"type": {
"type": "qt",
"module": "qml",
"name": "real"
},
"details": null,
"flags": [
"readonly"
]
},
"canTogglePlaying": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"shuffleSupported": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"lengthSupported": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"canQuit": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"volumeSupported": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"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"
]
},
"fullscreen": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": "If the player is currently shown in fullscreen.\n\nMay only be written to if TYPE99VcanSetFullscreen99Tprop99TYPE is true.\n"
},
"shuffle": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": "If the play queue is currently being shuffled, or false if TYPE99VshuffleSupported99Tprop99TYPE is false.\n\nMay only be written if TYPE99VcanControl99Tprop99TYPE and TYPE99VshuffleSupported99Tprop99TYPE are true.\n"
},
"loopState": {
"type": {
"type": "local",
"module": "Quickshell.Services.Mpris",
"name": "MprisLoopState"
},
"details": "The loop state of the media player, or `None` if TYPE99VloopSupported99Tprop99TYPE is false.\n\nMay only be written to if TYPE99VcanControl99Tprop99TYPE and TYPE99VloopSupported99Tprop99TYPE are true.\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 TYPE99VvolumeSupported99Tprop99TYPE is false.\n\nMay only be written to if TYPE99VcanControl99Tprop99TYPE and TYPE99VvolumeSupported99Tprop99TYPE are true.\n"
},
"canGoNext": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"supportedMimeTypes": {
"type": {
"type": "qt",
"module": "qml",
"name": "list",
"of": {
"type": "qt",
"module": "qml",
"name": "string"
}
},
"details": "Mime types supported by TYPE99VopenUri99Tfunc99TYPE.\n",
"flags": [
"readonly"
]
},
"canPlay": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"canControl": {
"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 TYPE99VtrackTitle99Tprop99TYPE, TYPE99VtrackAlbum99Tprop99TYPE, TYPE99VtrackAlbumArtist99Tprop99TYPE, TYPE99VtrackArtists99Tprop99TYPE and TYPE99VtrackArtUrl99Tprop99TYPE\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"
]
},
"rate": {
"type": {
"type": "qt",
"module": "qml",
"name": "real"
},
"details": "The speed the song is playing at, as a multiplier.\n\nOnly values between TYPE99VminRate99Tprop99TYPE and TYPE99VmaxRate99Tprop99TYPE (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"
},
"supportedUriSchemes": {
"type": {
"type": "qt",
"module": "qml",
"name": "list",
"of": {
"type": "qt",
"module": "qml",
"name": "string"
}
},
"details": "Uri schemes supported by TYPE99VopenUri99Tfunc99TYPE.\n",
"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"
]
},
"uniqueId": {
"type": {
"type": "qt",
"module": "qml",
"name": "int"
},
"details": "An opaque identifier for the current track unique within the current player.\n\n> [!WARNING] This is NOT `mpris:trackid` as that is sometimes missing or nonunique\n> in some players.\n",
"flags": [
"readonly"
]
},
"loopSupported": {
"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 TYPE99VpositionSupported99Tprop99TYPE is false.\n\nMay only be written to if TYPE99VcanSeek99Tprop99TYPE and TYPE99VpositionSupported99Tprop99TYPE are true.\n\n> [!WARNING] To avoid excessive property updates wasting CPU while `position` is not\n> actively monitored, `position` usually will not update reactively, unless a nonlinear\n> change in position occurs, however reading it will always return the current position.\n>\n> If you want to actively monitor the position, the simplest way it to emit the TYPE99VpositionChanged99Tsignal99TYPE\n> signal manually for the duration you are monitoring it, Using a TYPE99MQT_qml_QtQuick99NFrameAnimation99TYPE if you need\n> the value to update smoothly, such as on a slider, or a TYPE99MQT_qml_QtQuick99NTimer99TYPE if not, as shown below.\n>\n> ```qml {filename=\"Using a FrameAnimation\"}\n> FrameAnimation {\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\"}\n> Timer {\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"
},
"canRaise": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"positionSupported": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"minRate": {
"type": {
"type": "qt",
"module": "qml",
"name": "real"
},
"details": null,
"flags": [
"readonly"
]
},
"canPause": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"details": null,
"flags": [
"readonly"
]
},
"canSetFullscreen": {
"type": {
"type": "qt",
"module": "qml",
"name": "bool"
},
"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 TYPE99VcanGoNext99Tprop99TYPE 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 TYPE99VsupportedUriSchemes99Tprop99TYPE and TYPE99VsupportedMimeTypes99Tprop99TYPE.\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 TYPE99VplaybackState99Tprop99TYPE to `Paused`.\n",
"params": []
},
{
"ret": {
"type": "qt",
"module": "qml",
"name": "void"
},
"name": "play",
"id": "play",
"details": "Equivalent to setting TYPE99VplaybackState99Tprop99TYPE 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 TYPE99VcanGoPrevious99Tprop99TYPE 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 TYPE99VcanQuit99Tprop99TYPE 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 TYPE99VcanRaise99Tprop99TYPE is true.\n",
"params": []
},
{
"ret": {
"type": "qt",
"module": "qml",
"name": "void"
},
"name": "seek",
"id": "seek",
"details": "Change `position` by an offset.\n\nEven if TYPE99VpositionSupported99Tprop99TYPE is false and you cannot set `position`,\nthis function may work.\n\nMay only be called if TYPE99VcanSeek99Tprop99TYPE 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 TYPE99VplaybackState99Tprop99TYPE to `Stopped`.\n",
"params": []
},
{
"ret": {
"type": "qt",
"module": "qml",
"name": "void"
},
"name": "togglePlaying",
"id": "togglePlaying",
"details": "Equivalent to calling TYPE99Vplay99Tfunc99TYPE if not playing or TYPE99Vpause99Tfunc99TYPE if playing.\n\nMay only be called if TYPE99VcanTogglePlaying99Tprop99TYPE is true, which is equivalent to\nTYPE99VcanPlay99Tprop99TYPE or TYPE99VcanPause99Tfunc99TYPE depending on the current playback state.\n",
"params": []
}
],
"signals": {},
"variants": {}
}