├── .gitignore ├── CHANGELOG.md ├── CMakeLists.txt ├── LICENSE ├── README.md ├── logo.png ├── mkzip ├── plasmoid ├── Messages.sh ├── contents │ ├── config │ │ ├── config.qml │ │ └── main.xml │ ├── screenshot.png │ └── ui │ │ ├── AlbumArt.qml │ │ ├── CompactRepresentation.qml │ │ ├── ExpandedRepresentation.qml │ │ ├── PlayerControls.qml │ │ ├── TrackInfo.qml │ │ ├── configCompactView.qml │ │ └── main.qml └── metadata.desktop ├── screenshot.png └── vertical_panel_layout.png /.gitignore: -------------------------------------------------------------------------------- 1 | CMakeFiles 2 | CMakeCache.txt 3 | cmake_install.cmake 4 | Makefile 5 | prefix.sh 6 | regenerateindex.sh 7 | .directory 8 | org.kde.mediacontroller_plus.appdata.xml 9 | org.kde.mediacontroller_plus-plasmoids-metadata.json 10 | *.plasmoid 11 | build/ 12 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | 4 | **v0.3.1** 5 | - Fix source removal (cherry-picked from upstream) 6 | - Adapt the layout for vertical panels 7 | 8 | **v0.3.0** 9 | - Options to show album, track or controls individually 10 | 11 | **v0.2.8** 12 | - Fix label color on light themes 13 | - Simplify second line logic 14 | - Fix media source icons and add fallback 15 | 16 | **v0.2.7** 17 | - Improve visuals for thinner panels 18 | 19 | **v0.2.6** 20 | - Workaround to retrieve Spotify album art 21 | 22 | **v0.2.5** 23 | - Improve Selector TabBar 24 | - Show progress even on minimal view 25 | - Show artist on secondary label 26 | - Hide secondary label on one-line mode 27 | 28 | **v0.2.4** 29 | - Small fixes in compact view 30 | 31 | **v0.2.3** 32 | - For minimal height show track info in one line 33 | 34 | **v0.2.2** 35 | - Hability to show/hide background (works from Plasma 5.18) 36 | 37 | **v0.2.1** 38 | - Open files and URLs on drag&drop even when no player selected 39 | 40 | **v0.2.0** 41 | 42 | - Add configuration options to the panel view: 43 | * Minimum/maximum width 44 | * Show progress bar 45 | * Hide disabled controls 46 | 47 | **v0.1.1** 48 | 49 | - Fix sources tabbar continuous update 50 | 51 | **v0.1.0** 52 | 53 | - Modified version with tabbar and compact view for panels 54 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Set minimum CMake version (required for CMake 3.0 or later) 2 | cmake_minimum_required(VERSION 2.8.12) 3 | 4 | # Use Extra CMake Modules (ECM) for common functionality. 5 | # See http://api.kde.org/ecm/manual/ecm.7.html 6 | # and http://api.kde.org/ecm/manual/ecm-kde-modules.7.html 7 | find_package(ECM REQUIRED NO_MODULE) 8 | # Needed by find_package(KF5Plasma) below. 9 | set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_MODULE_PATH}) 10 | 11 | # Locate plasma_install_package macro. 12 | find_package(KF5Plasma REQUIRED) 13 | 14 | # Add installatation target ("make install"). 15 | plasma_install_package(plasmoid org.kde.mediacontroller_plus) 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mediacontroller+ 2 | This is a modified version of mediacontroller plasma5 widget. 3 | 4 | It provides the same functionality as the traditional mediacontroller widget, giving you control over every media player in your system (through the MPRIS2 protocol), but it adapts to more factor forms and sizes, allowing you to have a nice media control even on the panel. 5 | 6 | You can download it on the [KDE Store](https://store.kde.org/p/1317639/), or use the built-in 'Get New Addons' directly in your plasma desktop. 7 | 8 | ![mediacontroller+ gallery](screenshot.png) 9 | 10 | * Full Representation (_desktop_, _pop-up_): 11 | - Vertical View (same as in classic mediacontroller) 12 | - Horizontal View: when the widget gets wider, the album art goes to the left 13 | - Icon tab bar to select the player in a nicer and quicker way 14 | 15 | * Compact Representation (_panel_, _systray_): 16 | - Different Views: 17 | - Compact View for panels. It keeps most of the functionallity in a smaller size: icon/album art, track/artist, player controls and progress bar which uses the same style as the taskbar progress jobs. 18 | - Minimal View for thinner panels, hiding the album art and progress bar 19 | - Icon View for smaller sizes (same as in classic mediacontroller) 20 | - Minimum (preferred) / Maximum widths configurable 21 | - Display options to show/hide progressbar 22 | 23 | - Drag and drop any media file or URL to open it 24 | - on the selected player (the player has to support this option) 25 | - on default application if no player selected 26 | 27 | As a disclaimer, it is one of my first tries on qml and plasmoids, and I just wanted to have a nicer media player applet for my panel, while keeping the most of the classic widget untouched. Of course, my main wish would be for this changes to be integrated in the official mediacontroller applet, which I find kind of visually simple in its current state. 28 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ismailof/mediacontroller_plus/8c8c8fb400c940df4e85c517aa709622addfe958/logo.png -------------------------------------------------------------------------------- /mkzip: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | METADATA="plasmoid/metadata.desktop" 4 | VERSION=$(grep "X-KDE-PluginInfo-Version" $METADATA | sed 's/.*=//') 5 | 6 | cd plasmoid 7 | zip -r ../MediaController+_${VERSION}.plasmoid * 8 | cd .. 9 | -------------------------------------------------------------------------------- /plasmoid/Messages.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | $EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp 3 | $XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.mediacontroller.pot 4 | rm -f rc.cpp 5 | -------------------------------------------------------------------------------- /plasmoid/contents/config/config.qml: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2016 Bill Binder 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, see . 16 | */ 17 | 18 | import QtQuick 2.4 19 | 20 | import org.kde.plasma.configuration 2.0 21 | 22 | ConfigModel { 23 | ConfigCategory { 24 | name: i18n("Panel View") 25 | icon: "preferences-desktop-user" 26 | source: "configCompactView.qml" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /plasmoid/contents/config/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 18 11 | 12 | 13 | 0 14 | 15 | 16 | true 17 | 18 | 19 | true 20 | 21 | 22 | true 23 | 24 | 25 | true 26 | 27 | 28 | 1 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /plasmoid/contents/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ismailof/mediacontroller_plus/8c8c8fb400c940df4e85c517aa709622addfe958/plasmoid/contents/screenshot.png -------------------------------------------------------------------------------- /plasmoid/contents/ui/AlbumArt.qml: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2013 Sebastian Kügler * 3 | * Copyright 2014, 2016 Kai Uwe Broulik * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU Library General Public License as * 7 | * published by the Free Software Foundation; either version 2 of the * 8 | * License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU Library General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU Library General Public * 16 | * License along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 19 | ***************************************************************************/ 20 | 21 | import QtQuick 2.4 22 | import org.kde.plasma.core 2.0 as PlasmaCore 23 | 24 | 25 | Item { 26 | 27 | readonly property real aspectRatio: albumArt.visible ? (albumArt.paintedWidth / albumArt.paintedHeight) : 1.0 28 | 29 | PlasmaCore.IconItem { 30 | anchors { 31 | horizontalCenter: parent.horizontalCenter 32 | verticalCenter: parent.verticalCenter 33 | } 34 | 35 | height: Math.min(parent.height, Math.max(PlasmaCore.Units.iconSizes.large, Math.round(parent.height / 2))) 36 | width: height 37 | 38 | source: mpris2Source.currentData["Desktop Icon Name"] 39 | visible: !albumArt.visible 40 | 41 | usesPlasmaTheme: false 42 | } 43 | 44 | Image { 45 | id: albumArt 46 | anchors { 47 | fill: parent 48 | } 49 | 50 | source: processArtUrl(root.albumArt) 51 | asynchronous: true 52 | fillMode: Image.PreserveAspectFit 53 | sourceSize: Qt.size(512, 512) 54 | visible: !!root.track && status === Image.Ready 55 | } 56 | 57 | // HACK: Spotify has changed the base URL of their album art images 58 | // but hasn't updated the URL reported by the MPRIS service 59 | // https://community.spotify.com/t5/Desktop-Linux/MPRIS-cover-art-url-file-not-found/td-p/4920104 60 | function processArtUrl(url) { 61 | let SPOTIFY_OLD_URL = "https://open.spotify.com" 62 | let SPOTIFY_NEW_URL = "https://i.scdn.co" 63 | 64 | if (url.startsWith(SPOTIFY_OLD_URL)) { 65 | return url.replace(SPOTIFY_OLD_URL, SPOTIFY_NEW_URL) 66 | } 67 | return url 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /plasmoid/contents/ui/CompactRepresentation.qml: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2020 Ismael Asensio * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU Library General Public License as * 6 | * published by the Free Software Foundation; either version 2 of the * 7 | * License, or (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU Library General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU Library General Public * 15 | * License along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | ***************************************************************************/ 19 | 20 | import QtQml 2.2 21 | import QtQuick 2.4 22 | import QtQuick.Layouts 1.1 23 | import org.kde.plasma.core 2.0 as PlasmaCore 24 | 25 | Item { 26 | id: compactRoot 27 | 28 | readonly property bool isOnVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical 29 | 30 | readonly property bool iconView: (width < PlasmaCore.Units.gridUnit * 2) 31 | || (!plasmoid.configuration.showAlbumArt 32 | && !plasmoid.configuration.showTrackInfo 33 | && !plasmoid.configuration.showPlaybackControls) 34 | 35 | Layout.fillWidth: isOnVertical || plasmoid.configuration.showTrackInfo 36 | Layout.fillHeight: !isOnVertical 37 | 38 | Layout.minimumWidth: isOnVertical ? plasmoid.width : (iconView ? 1 : 5) * PlasmaCore.Units.gridUnit 39 | Layout.preferredWidth: plasmoid.configuration.showTrackInfo ? (plasmoid.configuration.minimumWidthUnits || 18) * PlasmaCore.Units.gridUnit 40 | : mainRow.implicitWidth 41 | Layout.maximumWidth: isOnVertical ? plasmoid.width : plasmoid.configuration.maximumWidthUnits * PlasmaCore.Units.gridUnit 42 | 43 | Layout.preferredHeight: isOnVertical ? mainRow.implicitHeight : plasmoid.height 44 | 45 | // HACK: To get the panel backgroud margins 46 | PlasmaCore.Svg { 47 | id: marginsHelper 48 | imagePath: "widgets/panel-background" 49 | 50 | readonly property int topMargin: { 51 | if (hasElement("hint-top-margin")) { 52 | print(elementSize("hint-top-margin").height) 53 | return elementSize("hint-top-margin").height 54 | } 55 | return PlasmaCore.Units.smallSpacing 56 | } 57 | } 58 | 59 | Item { 60 | id: miniProgressBar 61 | z: 0 62 | visible: plasmoid.configuration.showProgressBar && !iconView 63 | 64 | anchors.fill: parent 65 | // Negative margins to fill the panel. It seems simpler than 66 | // Plasmoid.constraintHints: PlasmaCore.Types.CanFillArea 67 | // and the hack to get the margins is required anyway 68 | anchors.margins: -marginsHelper.topMargin 69 | 70 | Item { 71 | id: progress 72 | anchors { 73 | top: parent.top 74 | left: parent.left 75 | bottom: parent.bottom 76 | } 77 | 78 | width: parent.width * root.position / root.length 79 | clip: true 80 | 81 | PlasmaCore.FrameSvgItem { 82 | width: miniProgressBar.width 83 | height: miniProgressBar.height 84 | 85 | imagePath: "widgets/tasks" 86 | prefix: ["progress", "hover"] 87 | } 88 | } 89 | } 90 | 91 | // HACK: To allow two lines on small panels (~ 32px to 36px) 92 | Item { 93 | id: verticalCenterHelper 94 | anchors { 95 | left: compactRoot.left 96 | right: compactRoot.right 97 | verticalCenter: compactRoot.verticalCenter 98 | margins: 0 99 | } 100 | height: mainRow.implicitHeight 101 | } 102 | 103 | GridLayout { 104 | id: mainRow 105 | z: 100 106 | visible: !iconView 107 | 108 | columns: isOnVertical ? 1 : undefined 109 | rows: isOnVertical ? undefined : 1 110 | 111 | readonly property bool heightOverflow: trackInfo.implicitHeight > compactRoot.height 112 | 113 | rowSpacing: PlasmaCore.Units.smallSpacing 114 | columnSpacing: rowSpacing 115 | 116 | anchors { 117 | fill: (isOnVertical || !heightOverflow) ? parent : verticalCenterHelper 118 | margins: 0 119 | } 120 | 121 | AlbumArt { 122 | id: albumArt 123 | visible: plasmoid.configuration.showAlbumArt 124 | Layout.fillWidth: true 125 | Layout.fillHeight: true 126 | Layout.alignment: Qt.AlignVCenter 127 | Layout.margins: 2 // To mimick the breeze icons internal margins and better adjust height 128 | Layout.minimumWidth: isOnVertical ? 0 : height 129 | Layout.preferredWidth: isOnVertical ? width : height * aspectRatio 130 | Layout.minimumHeight: isOnVertical ? width : 0 131 | Layout.preferredHeight: isOnVertical ? width / aspectRatio : height 132 | } 133 | 134 | TrackInfo { 135 | id: trackInfo 136 | visible: plasmoid.configuration.showTrackInfo 137 | Layout.fillWidth: true 138 | Layout.fillHeight: true 139 | Layout.alignment: Qt.AlignVCenter 140 | textAlignment: isOnVertical ? Text.AlignHCenter : Text.AlignLeft 141 | lineLimit: { 142 | if (isOnVertical) return 3; 143 | if (compactRoot.height > PlasmaCore.Units.gridUnit * 3) return 3; 144 | if (compactRoot.height > PlasmaCore.Units.gridUnit * 1.5) return 2; 145 | return 1; 146 | } 147 | spacing: 0 148 | } 149 | 150 | PlayerControls { 151 | id: playerControls 152 | visible: plasmoid.configuration.showPlaybackControls 153 | Layout.fillWidth: isOnVertical || !trackInfo.visible 154 | Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter 155 | compactView: true 156 | canFitPrevNext: !isOnVertical || compactRoot.width > PlasmaCore.Units.iconSizes.smallMedium * 3 157 | controlSize: Math.max(PlasmaCore.Units.iconSizes.small, 158 | isOnVertical ? Math.min(compactRoot.width / controlsCount, PlasmaCore.Units.iconSizes.large) : 159 | trackInfo.visible ? Math.min(parent.height, PlasmaCore.Units.iconSizes.large) 160 | : parent.height) 161 | } 162 | } 163 | 164 | PlasmaCore.IconItem { 165 | id: playerStatusIcon 166 | 167 | source: root.state === "playing" ? "media-playback-playing" : 168 | root.state === "paused" ? "media-playback-paused" : 169 | "media-playback-stopped" 170 | active: compactMouse.containsMouse 171 | visible: iconView 172 | 173 | anchors.fill: parent 174 | } 175 | 176 | MouseArea { 177 | id: compactMouse 178 | 179 | anchors.fill: parent 180 | z: -1 181 | 182 | hoverEnabled: true 183 | acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.BackButton | Qt.ForwardButton 184 | 185 | onWheel: { 186 | var service = mpris2Source.serviceForSource(mpris2Source.current) 187 | var operation = service.operationDescription("ChangeVolume") 188 | operation.delta = (wheel.angleDelta.y / 120) * 0.03 189 | operation.showOSD = true 190 | service.startOperationCall(operation) 191 | } 192 | 193 | onClicked: { 194 | switch (mouse.button) { 195 | case Qt.MiddleButton: 196 | root.togglePlaying() 197 | break 198 | case Qt.BackButton: 199 | root.action_previous() 200 | breakPlasmaCore.Units.smallSpacing 201 | case Qt.ForwardButton: 202 | root.action_next() 203 | break 204 | default: 205 | plasmoid.expanded = !plasmoid.expanded 206 | /* if (!iconView && mpris2Source.currentData.CanRaise) { 207 | root.action_open() 208 | } else { 209 | plasmoid.expanded = !plasmoid.expanded 210 | } 211 | */ 212 | } 213 | } 214 | } 215 | 216 | DropArea { 217 | z: -10 218 | anchors.fill: parent 219 | keys: ["text/uri-list", "audio/*", "video/*"] 220 | 221 | onDropped: { 222 | console.log("***\n" + drop.text 223 | + " - " + drop.keys 224 | + "\n***") 225 | 226 | drop.accept() 227 | 228 | if (root.noPlayer) { 229 | // No player selected. Open uri with default desktop application 230 | Qt.openUrlExternally(drop.text) 231 | } else { 232 | //Open URI using mpris method 233 | var service = mpris2Source.serviceForSource(mpris2Source.current); 234 | var operation = service.operationDescription("OpenUri"); 235 | operation.uri = drop.text 236 | 237 | service.startOperationCall(operation) 238 | } 239 | } 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /plasmoid/contents/ui/ExpandedRepresentation.qml: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2013 Sebastian Kügler * 3 | * Copyright 2014, 2016 Kai Uwe Broulik * 4 | * Copyright 2020 Ismael Asensio * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Library General Public License as * 8 | * published by the Free Software Foundation; either version 2 of the * 9 | * License, or (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU Library General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU Library General Public * 17 | * License along with this program; if not, write to the * 18 | * Free Software Foundation, Inc., * 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 20 | ***************************************************************************/ 21 | 22 | import QtQuick 2.5 23 | import QtQuick.Layouts 1.3 24 | import org.kde.plasma.core 2.0 as PlasmaCore 25 | import org.kde.plasma.components 3.0 as PlasmaComponents3 26 | import org.kde.kcoreaddons 1.0 as KCoreAddons 27 | 28 | 29 | Item { 30 | id: expandedRepresentation 31 | 32 | Layout.minimumWidth: Layout.minimumHeight * 1.5 33 | Layout.minimumHeight: PlasmaCore.Units.gridUnit * 7 34 | Layout.preferredWidth: Layout.preferredHeight * 1.5 35 | Layout.preferredHeight: PlasmaCore.Units.gridUnit * 22 36 | 37 | readonly property bool verticalView: width / height < 1.8 38 | 39 | // only show hours (the default for KFormat) when track is actually longer than an hour 40 | readonly property int durationFormattingOptions: root.length >= 60*60*1000*1000 ? 0 : KCoreAddons.FormatTypes.FoldHours 41 | 42 | property bool disablePositionUpdate: false 43 | property bool keyPressed: false 44 | 45 | Connections { 46 | target: plasmoid 47 | onExpandedChanged: { 48 | if (plasmoid.expanded) { 49 | root.retrievePosition(); 50 | } 51 | } 52 | } 53 | 54 | Keys.onPressed: keyPressed = true 55 | 56 | Keys.onReleased: { 57 | keyPressed = false 58 | 59 | if (!event.modifiers) { 60 | event.accepted = true 61 | 62 | if (event.key === Qt.Key_Space || event.key === Qt.Key_K) { 63 | // K is YouTube's key for "play/pause" :) 64 | root.togglePlaying() 65 | } else if (event.key === Qt.Key_P) { 66 | root.action_previous() 67 | } else if (event.key === Qt.Key_N) { 68 | root.action_next() 69 | } else if (event.key === Qt.Key_S) { 70 | root.action_stop() 71 | } else if (event.key === Qt.Key_Left || event.key === Qt.Key_J) { // TODO ltr languages 72 | // seek back 5s 73 | seekSlider.value = Math.max(0, seekSlider.value - 5000000) // microseconds 74 | seekSlider.moved(); 75 | } else if (event.key === Qt.Key_Right || event.key === Qt.Key_L) { 76 | // seek forward 5s 77 | seekSlider.value = Math.min(seekSlider.to, seekSlider.value + 5000000) 78 | seekSlider.moved(); 79 | } else if (event.key === Qt.Key_Home) { 80 | seekSlider.value = 0 81 | seekSlider.moved(); 82 | } else if (event.key === Qt.Key_End) { 83 | seekSlider.value = seekSlider.to 84 | seekSlider.moved(); 85 | } else if (event.key >= Qt.Key_0 && event.key <= Qt.Key_9) { 86 | // jump to percentage, ie. 0 = beginnign, 1 = 10% of total length etc 87 | seekSlider.value = seekSlider.to * (event.key - Qt.Key_0) / 10 88 | seekSlider.moved(); 89 | } else { 90 | event.accepted = false 91 | } 92 | } 93 | } 94 | 95 | PlasmaComponents3.TabBar { 96 | id: playerSelector 97 | width: parent.width 98 | height: visible ? PlasmaCore.Units.gridUnit * 2 : 0 99 | 100 | anchors { 101 | top: parent.top 102 | topMargin: 0 103 | horizontalCenter: parent.horizontalCenter 104 | } 105 | visible: tabButtonInstantiator.model.length > 2 // more than one player, @multiplex is always there 106 | 107 | Repeater { 108 | id: tabButtonInstantiator 109 | model: { root.mprisSourcesModel } 110 | 111 | delegate: PlasmaComponents3.TabButton { 112 | parent: playerSelector 113 | checked: modelData["source"] == model.current 114 | text: "" // modelData["text"] 115 | icon.name: modelData["icon"] 116 | PlasmaComponents3.ToolTip.text: modelData["text"] 117 | PlasmaComponents3.ToolTip.visible: hovered 118 | onClicked: { 119 | disablePositionUpdate = true 120 | mpris2Source.current = modelData["source"]; 121 | disablePositionUpdate = false 122 | } 123 | } 124 | 125 | onModelChanged: { 126 | //if model changes, we try to find the current player again 127 | for (var i = 0, length = model.length; i < length; i++) { 128 | if (model[i].source === mpris2Source.current) { 129 | playerSelector.currentIndex = i 130 | break 131 | } 132 | } 133 | } 134 | } 135 | } 136 | 137 | 138 | AlbumArt { 139 | id: albumArt 140 | 141 | anchors { 142 | left: parent.left 143 | top: playerSelector.bottom 144 | right: verticalView? parent.right : controlCol.left 145 | bottom: verticalView? controlCol.top: parent.bottom 146 | margins: PlasmaCore.Units.smallSpacing 147 | } 148 | } 149 | 150 | ColumnLayout { 151 | id: controlCol 152 | width: verticalView? parent.width: parent.width - albumArt.height 153 | anchors.right: parent.right 154 | anchors.bottom: parent.bottom 155 | 156 | spacing: PlasmaCore.Units.smallSpacing 157 | 158 | RowLayout { 159 | id: progress 160 | 161 | spacing: PlasmaCore.Units.smallSpacing 162 | 163 | // if there's no "mpris:length" in the metadata, we cannot seek, so hide it in that case 164 | enabled: !root.noPlayer && root.track && root.length > 0 ? true : false 165 | opacity: enabled ? 1 : 0 166 | Behavior on opacity { 167 | NumberAnimation { duration: PlasmaCore.Units.longDuration } 168 | } 169 | 170 | // ensure the layout doesn't shift as the numbers change and measure roughly the longest text that could occur with the current song 171 | TextMetrics { 172 | id: timeMetrics 173 | text: i18nc("Remaining time for song e.g -5:42", "-%1", 174 | KCoreAddons.Format.formatDuration(seekSlider.to / 1000, expandedRepresentation.durationFormattingOptions)) 175 | font: PlasmaCore.Theme.smallestFont 176 | } 177 | 178 | PlasmaComponents3.Label { 179 | Layout.preferredWidth: timeMetrics.width 180 | verticalAlignment: Text.AlignVCenter 181 | horizontalAlignment: Text.AlignRight 182 | text: KCoreAddons.Format.formatDuration(seekSlider.value / 1000, expandedRepresentation.durationFormattingOptions) 183 | opacity: 0.9 184 | font: PlasmaCore.Theme.smallestFont 185 | } 186 | 187 | PlasmaComponents3.Slider { 188 | id: seekSlider 189 | Layout.fillWidth: true 190 | z: 999 191 | value: 0 192 | visible: root.canSeek 193 | 194 | onMoved: { 195 | if (!disablePositionUpdate) { 196 | // delay setting the position to avoid race conditions 197 | queuedPositionUpdate.restart() 198 | } 199 | } 200 | } 201 | 202 | PlasmaComponents3.ProgressBar { 203 | id: progressBar 204 | Layout.fillWidth: true 205 | value: root.position 206 | from: 0 207 | to: root.length 208 | visible: !root.canSeek 209 | 210 | onValueChanged: { 211 | // we don't want to interrupt the user dragging the slider 212 | if (!seekSlider.pressed && !keyPressed) { 213 | // we also don't want passive position updates 214 | disablePositionUpdate = true 215 | seekSlider.value = value 216 | disablePositionUpdate = false 217 | } 218 | } 219 | 220 | onToChanged: { 221 | disablePositionUpdate = true 222 | // When reducing maximumValue, value is clamped to it, however 223 | // when increasing it again it gets its old value back. 224 | // To keep us from seeking to the end of the track when moving 225 | // to a new track, we'll reset the value to zero and ask for the position again 226 | seekSlider.value = 0 227 | seekSlider.to = to 228 | root.retrievePosition() 229 | disablePositionUpdate = false 230 | } 231 | } 232 | 233 | PlasmaComponents3.Label { 234 | Layout.preferredWidth: timeMetrics.width 235 | verticalAlignment: Text.AlignVCenter 236 | horizontalAlignment: Text.AlignLeft 237 | text: i18nc("Remaining time for song e.g -5:42", "-%1", 238 | KCoreAddons.Format.formatDuration((seekSlider.to - seekSlider.value) / 1000, expandedRepresentation.durationFormattingOptions)) 239 | opacity: 0.9 240 | font: PlasmaCore.Theme.smallestFont 241 | } 242 | } 243 | 244 | TrackInfo { 245 | id: trackInfo 246 | Layout.fillWidth: true 247 | textAlignment: Text.AlignHCenter 248 | } 249 | 250 | Item { 251 | width: parent.width 252 | height: playerControls.height 253 | Layout.fillWidth: true 254 | 255 | PlayerControls { 256 | id: playerControls 257 | anchors.horizontalCenter: parent.horizontalCenter 258 | compactView: false 259 | } 260 | } 261 | } 262 | 263 | Timer { 264 | id: queuedPositionUpdate 265 | interval: 100 266 | onTriggered: { 267 | if (root.position == seekSlider.value) { 268 | return; 269 | } 270 | var service = mpris2Source.serviceForSource(mpris2Source.current) 271 | var operation = service.operationDescription("SetPosition") 272 | operation.microseconds = seekSlider.value 273 | service.startOperationCall(operation) 274 | } 275 | } 276 | } 277 | -------------------------------------------------------------------------------- /plasmoid/contents/ui/PlayerControls.qml: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2013 Sebastian Kügler * 3 | * Copyright 2014, 2016 Kai Uwe Broulik * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU Library General Public License as * 7 | * published by the Free Software Foundation; either version 2 of the * 8 | * License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU Library General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU Library General Public * 16 | * License along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 19 | ***************************************************************************/ 20 | 21 | import QtQuick 2.4 22 | import QtQuick.Layouts 1.3 23 | import org.kde.plasma.core 2.0 as PlasmaCore 24 | import org.kde.plasma.components 3.0 as PlasmaComponents3 25 | 26 | 27 | RowLayout { 28 | id: playerControls 29 | 30 | property bool enabled: root.canControl 31 | property bool compactView: false 32 | property bool canFitPrevNext: true 33 | 34 | property int controlSize: PlasmaCore.Units.iconSizes.huge 35 | readonly property int controlSmallerSize: Math.min(controlSize, 36 | Math.max(Math.round(controlSize / 1.25), PlasmaCore.Units.iconSizes.medium)) 37 | readonly property int controlsCount : 1 + (prevButton.visible ? 1 : 0) + (nextButton.visible ? 1 : 0) 38 | 39 | spacing: compactView ? 0 : PlasmaCore.Units.largeSpacing 40 | 41 | PlasmaComponents3.ToolButton { 42 | id: prevButton 43 | Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft 44 | implicitWidth: controlSmallerSize 45 | implicitHeight: implicitWidth 46 | enabled: playerControls.enabled && root.canGoPrevious 47 | visible: canFitPrevNext && (!compactView 48 | || plasmoid.configuration.showPrevNextControls === Qt.Checked 49 | || (plasmoid.configuration.showPrevNextControls === Qt.PartiallyChecked && enabled)) 50 | 51 | icon.name: LayoutMirroring.enabled ? "media-skip-forward" : "media-skip-backward" 52 | onClicked: { 53 | //root.position = 0 // Let the media start from beginning. Bug 362473 54 | root.action_previous() 55 | } 56 | } 57 | 58 | PlasmaComponents3.ToolButton { 59 | Layout.alignment: Qt.AlignCenter 60 | implicitWidth: controlSize 61 | implicitHeight: implicitWidth 62 | enabled: root.state == "playing" ? root.canPause : root.canPlay 63 | icon.name: root.state == "playing" ? "media-playback-pause" : "media-playback-start" 64 | onClicked: root.togglePlaying() 65 | } 66 | 67 | PlasmaComponents3.ToolButton { 68 | id: nextButton 69 | Layout.alignment: Qt.AlignVCenter | Qt.AlignRight 70 | implicitWidth: controlSmallerSize 71 | implicitHeight: implicitWidth 72 | enabled: playerControls.enabled && root.canGoNext 73 | visible: canFitPrevNext && (!compactView 74 | || plasmoid.configuration.showPrevNextControls === Qt.Checked 75 | || (plasmoid.configuration.showPrevNextControls === Qt.PartiallyChecked && enabled)) 76 | 77 | icon.name: LayoutMirroring.enabled ? "media-skip-backward" : "media-skip-forward" 78 | onClicked: { 79 | //root.position = 0 // Let the media start from beginning. Bug 362473 80 | root.action_next() 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /plasmoid/contents/ui/TrackInfo.qml: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2013 Sebastian Kügler * 3 | * Copyright 2014, 2016 Kai Uwe Broulik * 4 | * Copyright 2020 Ismael Asensio * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU Library General Public License as * 8 | * published by the Free Software Foundation; either version 2 of the * 9 | * License, or (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU Library General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU Library General Public * 17 | * License along with this program; if not, write to the * 18 | * Free Software Foundation, Inc., * 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 20 | ***************************************************************************/ 21 | 22 | import QtQuick 2.4 23 | import QtQuick.Layouts 1.2 24 | import org.kde.plasma.core 2.0 as PlasmaCore 25 | import org.kde.plasma.components 3.0 as PlasmaComponents3 26 | 27 | 28 | ColumnLayout { 29 | id: trackInfo 30 | 31 | property alias textAlignment: mainLabel.horizontalAlignment 32 | property int lineLimit: 2 33 | 34 | readonly property int implicitWidht: Math.max(mainLabel.implicitWidht, 35 | lineLimit > 1 ? secondLabel.implicitWidht : 0, 36 | lineLimit > 2 ? thirdLabel.implicitWidht : 0) 37 | 38 | readonly property string album: { 39 | var metadata = root.currentMetadata 40 | 41 | if (!metadata) { 42 | return "" 43 | } 44 | var xesamAlbum = metadata["xesam:album"] 45 | if (xesamAlbum) { 46 | return xesamAlbum 47 | } 48 | 49 | // if we play a local file without title and artist, show its containing folder instead 50 | if (metadata["xesam:title"] || root.artist) { 51 | return "" 52 | } 53 | 54 | var xesamUrl = (metadata["xesam:url"] || "").toString() 55 | if (xesamUrl.indexOf("file:///") !== 0) { // "!startsWith()" 56 | return "" 57 | } 58 | 59 | var urlParts = xesamUrl.split("/") 60 | if (urlParts.length < 3) { 61 | return "" 62 | } 63 | 64 | var lastFolderPath = urlParts[urlParts.length - 2] // last would be filename 65 | if (lastFolderPath) { 66 | return lastFolderPath 67 | } 68 | 69 | return "" 70 | } 71 | 72 | PlasmaComponents3.Label { 73 | id: mainLabel 74 | Layout.fillWidth: true 75 | horizontalAlignment: Text.AlignHCenter 76 | 77 | maximumLineCount: 1 78 | elide: Text.ElideRight 79 | text: { 80 | if (!root.track) { 81 | return i18n("No media playing") 82 | } 83 | if (lineLimit == 1 && root.artist) { 84 | return i18nc("artist – track", "%1 – %2", root.artist, root.track) 85 | } 86 | return root.track 87 | } 88 | textFormat: Text.PlainText 89 | } 90 | 91 | PlasmaComponents3.Label { 92 | id: secondLabel 93 | Layout.fillWidth: true 94 | 95 | opacity: 0.6 96 | horizontalAlignment: textAlignment 97 | wrapMode: Text.NoWrap 98 | elide: Text.ElideRight 99 | visible: lineLimit > 1 && text.length > 0 100 | text: { 101 | if (lineLimit == 3 || !album) { return root.artist } 102 | if (!root.artist) { return album } 103 | return i18nc("artist / album", "%1 / %2", root.artist, album) 104 | } 105 | textFormat: Text.PlainText 106 | } 107 | 108 | PlasmaComponents3.Label { 109 | id: thirdLabel 110 | Layout.fillWidth: true 111 | 112 | opacity: 0.6 113 | horizontalAlignment: textAlignment 114 | wrapMode: Text.NoWrap 115 | elide: Text.ElideRight 116 | visible: lineLimit > 2 && text.length > 0 117 | text: album 118 | textFormat: Text.PlainText 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /plasmoid/contents/ui/configCompactView.qml: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2016 Bill Binder 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, see . 16 | */ 17 | 18 | import QtQuick 2.5 19 | import QtQuick.Layouts 1.2 20 | import QtQuick.Controls 2.5 as QQC2 21 | import org.kde.plasma.core 2.0 as PlasmaCore 22 | 23 | import org.kde.kirigami 2.14 as Kirigami 24 | 25 | 26 | Item { 27 | id: compactViewConfig 28 | 29 | property alias cfg_minimumWidthUnits: widthSlider.proxyFirstValue 30 | property alias cfg_maximumWidthUnits: widthSlider.proxySecondValue 31 | property alias cfg_showProgressBar: showProgressBar.checked 32 | property alias cfg_showAlbumArt: showAlbumArt.checked 33 | property alias cfg_showTrackInfo: showTrackInfo.checked 34 | property alias cfg_showPlaybackControls: showPlaybackControls.checked 35 | property int cfg_showPrevNextControls 36 | 37 | Kirigami.FormLayout { 38 | 39 | QQC2.CheckBox { 40 | id: showAlbumArt 41 | Kirigami.FormData.label: i18n("Show in panel view:") 42 | text: i18n("Album art") 43 | } 44 | 45 | QQC2.CheckBox { 46 | id: showTrackInfo 47 | text: i18n("Track information") 48 | } 49 | 50 | QQC2.CheckBox { 51 | id: showPlaybackControls 52 | text: i18n("Playback controls") 53 | } 54 | 55 | QQC2.CheckBox { 56 | id: showProgressBar 57 | enabled: showAlbumArt.checked || showTrackInfo.checked || showPlaybackControls.checked 58 | text: i18n("Progress bar") 59 | } 60 | 61 | Kirigami.Separator { 62 | Kirigami.FormData.isSection: true 63 | } 64 | 65 | RowLayout { 66 | Kirigami.FormData.label: i18n("Width Range:") 67 | 68 | enabled: cfg_showTrackInfo && plasmoid.formFactor === PlasmaCore.Types.Horizontal 69 | spacing: PlasmaCore.Units.smallSpacing 70 | 71 | Layout.fillWidth: true 72 | Layout.alignment: Qt.AlignTop 73 | Layout.bottomMargin: PlasmaCore.Units.largeSpacing 74 | 75 | QQC2.Label { 76 | id: lbl_minWidth 77 | text: Math.round(widthSlider.proxyFirstValue * PlasmaCore.Units.gridUnit) + "px" 78 | Layout.preferredWidth: 50 79 | horizontalAlignment: Text.AlignRight 80 | } 81 | 82 | QQC2.RangeSlider { 83 | id: widthSlider 84 | Layout.fillWidth: true 85 | from: 1 86 | to: 101 87 | stepSize: 1 88 | snapMode: QQC2.RangeSlider.SnapAlways 89 | first.value: 18 90 | second.value: to 91 | 92 | //On QT 2.5 `RangeSlider` values are not allowed as an alias 93 | property int proxySecondValue: 0 94 | property int proxyFirstValue: 1 95 | 96 | first.onValueChanged: proxyFirstValue = first.value 97 | second.onValueChanged: proxySecondValue = (second.position == 1.0) ? 0 : second.value 98 | onProxyFirstValueChanged: first.value = proxyFirstValue 99 | onProxySecondValueChanged: second.value = proxySecondValue ? proxySecondValue : to 100 | } 101 | 102 | QQC2.Label { 103 | id: lbl_maximumWidth 104 | text: (widthSlider.second.position == 1.0) ? i18n("No limit") 105 | : Math.round(widthSlider.proxySecondValue * PlasmaCore.Units.gridUnit) + "px" 106 | Layout.preferredWidth: 50 107 | horizontalAlignment: Text.AlignLeft 108 | } 109 | } 110 | 111 | Kirigami.Separator {} 112 | 113 | QQC2.RadioButton { 114 | id: showPrevNextAlways 115 | Kirigami.FormData.label: i18n("Show Previous/Next controls:") 116 | text: i18n("Always") 117 | enabled: cfg_showPlaybackControls 118 | checked: cfg_showPrevNextControls === Qt.Checked 119 | } 120 | QQC2.RadioButton { 121 | id: showPrevNextNever 122 | text: i18n("Never") 123 | enabled: cfg_showPlaybackControls 124 | checked: cfg_showPrevNextControls === Qt.Unchecked 125 | } 126 | QQC2.RadioButton { 127 | id: showPrevNextWhenEnabled 128 | text: i18n("Only when useful") 129 | enabled: cfg_showPlaybackControls 130 | checked: cfg_showPrevNextControls === Qt.PartiallyChecked 131 | } 132 | } 133 | 134 | QQC2.ButtonGroup { 135 | id: showPrevNextGroup 136 | buttons: [showPrevNextAlways, showPrevNextNever, showPrevNextWhenEnabled] 137 | 138 | readonly property int value: { 139 | switch (checkedButton) { 140 | case showPrevNextAlways: return Qt.Checked; 141 | case showPrevNextNever: return Qt.Unchecked; 142 | case showPrevNextWhenEnabled: return Qt.PartiallyChecked; 143 | } 144 | } 145 | 146 | onClicked: { cfg_showPrevNextControls = value } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /plasmoid/contents/ui/main.qml: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2013 Sebastian Kügler * 3 | * Copyright 2014 Kai Uwe Broulik * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU Library General Public License as * 7 | * published by the Free Software Foundation; either version 2 of the * 8 | * License, or (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU Library General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU Library General Public * 16 | * License along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 19 | ***************************************************************************/ 20 | 21 | import QtQuick 2.0 22 | import QtQuick.Layouts 1.1 23 | import org.kde.plasma.plasmoid 2.0 24 | import org.kde.plasma.core 2.0 as PlasmaCore 25 | 26 | 27 | Item { 28 | id: root 29 | 30 | property var currentMetadata: mpris2Source.currentData ? mpris2Source.currentData.Metadata : undefined 31 | property string track: { 32 | if (!currentMetadata) { 33 | return "" 34 | } 35 | var xesamTitle = currentMetadata["xesam:title"] 36 | if (xesamTitle) { 37 | return xesamTitle 38 | } 39 | // if no track title is given, print out the file name 40 | var xesamUrl = currentMetadata["xesam:url"] ? currentMetadata["xesam:url"].toString() : "" 41 | if (!xesamUrl) { 42 | return "" 43 | } 44 | var lastSlashPos = xesamUrl.lastIndexOf('/') 45 | if (lastSlashPos < 0) { 46 | return "" 47 | } 48 | var lastUrlPart = xesamUrl.substring(lastSlashPos + 1) 49 | return decodeURIComponent(lastUrlPart) 50 | } 51 | property string artist: { 52 | if (!currentMetadata) { 53 | return "" 54 | } 55 | var xesamArtist = currentMetadata["xesam:artist"] 56 | if (!xesamArtist) { 57 | return ""; 58 | } 59 | if (typeof xesamArtist == "string") { 60 | return xesamArtist 61 | } else { 62 | return xesamArtist.join(", ") 63 | } 64 | } 65 | property string albumArt: currentMetadata ? currentMetadata["mpris:artUrl"] || "" : "" 66 | 67 | readonly property string identity: !root.noPlayer ? mpris2Source.currentData.Identity || mpris2Source.current : "" 68 | 69 | property bool noPlayer: mpris2Source.sources.length <= 1 70 | 71 | property var mprisSourcesModel: [] 72 | 73 | readonly property bool canControl: (!root.noPlayer && mpris2Source.currentData.CanControl) || false 74 | readonly property bool canGoPrevious: (canControl && mpris2Source.currentData.CanGoPrevious) || false 75 | readonly property bool canGoNext: (canControl && mpris2Source.currentData.CanGoNext) || false 76 | readonly property bool canPlay: (canControl && mpris2Source.currentData.CanPlay) || false 77 | readonly property bool canPause: (canControl && mpris2Source.currentData.CanPause) || false 78 | readonly property bool canSeek: mpris2Source.currentData.CanSeek || false 79 | 80 | readonly property double mprisPosition: mpris2Source.currentData.Position || 0 81 | readonly property real rate: mpris2Source.currentData.Rate || 1 82 | readonly property double length: currentMetadata ? currentMetadata["mpris:length"] || 0 : 0 83 | 84 | property double position : mprisPosition 85 | 86 | 87 | Plasmoid.switchWidth: PlasmaCore.Units.gridUnit * 10 88 | Plasmoid.switchHeight: PlasmaCore.Units.gridUnit * 8 89 | Plasmoid.icon: albumArt ? albumArt : "media-playback-playing" 90 | Plasmoid.toolTipMainText: i18n("No media playing") 91 | Plasmoid.toolTipSubText: identity 92 | Plasmoid.toolTipTextFormat: Text.PlainText 93 | Plasmoid.status: PlasmaCore.Types.PassiveStatus 94 | 95 | Plasmoid.backgroundHints: PlasmaCore.Types.StandardBackground | PlasmaCore.Types.ConfigurableBackground 96 | 97 | Plasmoid.onContextualActionsAboutToShow: { 98 | plasmoid.clearActions() 99 | 100 | if (root.noPlayer) { 101 | return 102 | } 103 | 104 | plasmoid.setActionSeparator("playerList") 105 | 106 | if (mpris2Source.currentData.CanRaise) { 107 | var icon = mpris2Source.currentData["Desktop Icon Name"] || "" 108 | plasmoid.setAction("open", i18nc("Open player window or bring it to the front if already open", "Open"), icon) 109 | } 110 | 111 | if (canControl) { 112 | plasmoid.setAction("previous", i18nc("Play previous track", "Previous Track"), 113 | Qt.application.layoutDirection === Qt.RightToLeft ? "media-skip-forward" : "media-skip-backward"); 114 | plasmoid.action("previous").enabled = Qt.binding(function() { 115 | return root.canGoPrevious 116 | }) 117 | 118 | // if CanPause, toggle the menu entry between Play & Pause, otherwise always use Play 119 | if (root.state == "playing" && root.canPause) { 120 | plasmoid.setAction("pause", i18nc("Pause playback", "Pause"), "media-playback-pause") 121 | plasmoid.action("pause").enabled = Qt.binding(function() { 122 | return root.state === "playing" && root.canPause; 123 | }); 124 | } else { 125 | plasmoid.setAction("play", i18nc("Start playback", "Play"), "media-playback-start") 126 | plasmoid.action("play").enabled = Qt.binding(function() { 127 | return root.state !== "playing" && root.canPlay; 128 | }); 129 | } 130 | 131 | plasmoid.setAction("next", i18nc("Play next track", "Next Track"), 132 | Qt.application.layoutDirection === Qt.RightToLeft ? "media-skip-backward" : "media-skip-forward") 133 | plasmoid.action("next").enabled = Qt.binding(function() { 134 | return root.canGoNext 135 | }) 136 | 137 | plasmoid.setAction("stop", i18nc("Stop playback", "Stop"), "media-playback-stop") 138 | plasmoid.action("stop").enabled = Qt.binding(function() { 139 | return root.state === "playing" || root.state === "paused"; 140 | }) 141 | } 142 | 143 | if (mpris2Source.currentData.CanQuit) { 144 | plasmoid.setActionSeparator("quitseparator"); 145 | plasmoid.setAction("quit", i18nc("Quit player", "Quit"), "application-exit") 146 | } 147 | 148 | plasmoid.setActionSeparator("playerActionsSeparator") 149 | } 150 | 151 | onMprisPositionChanged: { 152 | position = mprisPosition 153 | } 154 | 155 | // Reset position on track changes and retrieve again 156 | // Best option for players not retrieving the current position (Spotify) 157 | onTrackChanged: { 158 | position = 0 159 | retrievePosition() 160 | } 161 | 162 | 163 | // HACK Some players like Amarok take quite a while to load the next track 164 | // this avoids having the plasmoid jump between popup and panel 165 | onStateChanged: { 166 | if (state != "") { 167 | plasmoid.status = PlasmaCore.Types.ActiveStatus 168 | } else { 169 | updatePlasmoidStatusTimer.restart() 170 | } 171 | } 172 | 173 | Timer { 174 | id: updatePlasmoidStatusTimer 175 | interval: 3000 176 | onTriggered: { 177 | if (state != "") { 178 | plasmoid.status = PlasmaCore.Types.ActiveStatus 179 | } else { 180 | plasmoid.status = PlasmaCore.Types.PassiveStatus 181 | } 182 | } 183 | } 184 | 185 | Timer { 186 | id: updateProgressTimer 187 | 188 | interval: 1000 / rate 189 | repeat: true 190 | running: root.state === "playing" 191 | 192 | onTriggered: { 193 | // some players don't continuously update the seek slider position via mpris 194 | // add one second; value in microseconds 195 | position += 1000000 196 | root.retrievePosition() 197 | } 198 | } 199 | 200 | 201 | Plasmoid.fullRepresentation: ExpandedRepresentation {} 202 | 203 | Plasmoid.compactRepresentation: CompactRepresentation {} 204 | 205 | PlasmaCore.DataSource { 206 | id: mpris2Source 207 | 208 | readonly property string multiplexSource: "@multiplex" 209 | property string current: multiplexSource 210 | 211 | readonly property var currentData: data[current] 212 | 213 | engine: "mpris2" 214 | connectedSources: sources 215 | 216 | onSourceAdded: { 217 | updateMprisSourcesModel() 218 | } 219 | 220 | onSourceRemoved: { 221 | // if player is closed, reset to multiplex source 222 | if (source === current) { 223 | current = multiplexSource 224 | } 225 | updateMprisSourcesModel() 226 | } 227 | } 228 | 229 | Component.onCompleted: { 230 | mpris2Source.serviceForSource("@multiplex").enableGlobalShortcuts(); 231 | updateMprisSourcesModel() 232 | } 233 | 234 | function togglePlaying() { 235 | if (root.state === "playing") { 236 | if (root.canPause) { 237 | root.action_pause(); 238 | } 239 | } else { 240 | if (root.canPlay) { 241 | root.action_play(); 242 | } 243 | } 244 | } 245 | 246 | function action_open() { 247 | serviceOp(mpris2Source.current, "Raise"); 248 | } 249 | function action_quit() { 250 | serviceOp(mpris2Source.current, "Quit"); 251 | } 252 | 253 | function action_play() { 254 | serviceOp(mpris2Source.current, "Play"); 255 | } 256 | 257 | function action_pause() { 258 | serviceOp(mpris2Source.current, "Pause"); 259 | } 260 | 261 | function action_playPause() { 262 | serviceOp(mpris2Source.current, "PlayPause"); 263 | } 264 | 265 | function action_previous() { 266 | serviceOp(mpris2Source.current, "Previous"); 267 | } 268 | 269 | function action_next() { 270 | serviceOp(mpris2Source.current, "Next"); 271 | } 272 | 273 | function action_stop() { 274 | serviceOp(mpris2Source.current, "Stop"); 275 | } 276 | 277 | function retrievePosition() { 278 | serviceOp(mpris2Source.current, "GetPostion"); 279 | } 280 | 281 | function serviceOp(src, op) { 282 | var service = mpris2Source.serviceForSource(src); 283 | var operation = service.operationDescription(op); 284 | return service.startOperationCall(operation); 285 | } 286 | 287 | function updateMprisSourcesModel () { 288 | 289 | var model = [{ 290 | 'text': i18n("Choose player automatically"), 291 | 'icon': 'emblem-favorite', 292 | 'source': mpris2Source.multiplexSource 293 | }] 294 | 295 | var sources = mpris2Source.sources 296 | for (var i = 0, length = sources.length; i < length; ++i) { 297 | var source = sources[i] 298 | if (source === mpris2Source.multiplexSource) { 299 | continue 300 | } 301 | 302 | const playerData = mpris2Source.data[source]; 303 | // source data is removed before its name is removed from the list 304 | if (!playerData) { 305 | continue; 306 | } 307 | 308 | model.push({ 309 | 'text': playerData["Identity"], 310 | 'icon': playerData["Desktop Icon Name"] || playerData["DesktopEntry"] || "emblem-music-symbolic", 311 | 'source': source 312 | }); 313 | } 314 | 315 | root.mprisSourcesModel = model; 316 | } 317 | 318 | 319 | /* Menu { 320 | id: mprisSourcesMenu 321 | 322 | Instantiator { 323 | model: mprisSourcesModel 324 | onObjectAdded: mprisSourcesMenu.insertItem( index, object ) 325 | onObjectRemoved: mprisSourcesMenu.removeItem( object ) 326 | delegate: MenuItem { 327 | text: text 328 | icon: icon 329 | onTriggered: { 330 | mpris2Source.current = source; 331 | } 332 | } 333 | } 334 | } 335 | */ 336 | 337 | states: [ 338 | State { 339 | name: "playing" 340 | when: !root.noPlayer && mpris2Source.currentData.PlaybackStatus === "Playing" 341 | 342 | PropertyChanges { 343 | target: plasmoid 344 | icon: albumArt ? albumArt : "media-playback-playing" 345 | toolTipMainText: track 346 | toolTipSubText: artist ? i18nc("by Artist (player name)", "by %1 (%2)", artist, identity) : identity 347 | } 348 | }, 349 | State { 350 | name: "paused" 351 | when: !root.noPlayer && mpris2Source.currentData.PlaybackStatus === "Paused" 352 | 353 | PropertyChanges { 354 | target: plasmoid 355 | icon: albumArt ? albumArt : "media-playback-paused" 356 | toolTipMainText: track 357 | toolTipSubText: artist ? i18nc("by Artist (paused, player name)", "by %1 (paused, %2)", artist, identity) : i18nc("Paused (player name)", "Paused (%1)", identity) 358 | } 359 | } 360 | ] 361 | } 362 | -------------------------------------------------------------------------------- /plasmoid/metadata.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Media Player + 3 | Name[ar]=مشغّل وسائط 4 | Name[bs]=Izvođač medija 5 | Name[ca]=Reproductor multimèdia 6 | Name[ca@valencia]=Reproductor multimèdia 7 | Name[cs]=Přehrávač médií 8 | Name[da]=Medieafspiller 9 | Name[de]=Medienwiedergabe 10 | Name[el]=Αναπαραγωγέας πολυμέσων 11 | Name[en_GB]=Media Player 12 | Name[es]=Reproductor multimedia 13 | Name[et]=Meediamängija 14 | Name[eu]=Multimedia-jotzailea 15 | Name[fi]=Mediasoitin 16 | Name[fr]=Lecteur multimédia 17 | Name[gl]=Reprodutor multimedia 18 | Name[he]=נגן מדיה 19 | Name[hu]=Médialejátszó 20 | Name[ia]=Media Player (Reproductor de Media) 21 | Name[is]=Margmiðlunarspilari 22 | Name[it]=Lettore multimediale 23 | Name[ja]=メディアプレーヤー 24 | Name[ko]=미디어 재생기 25 | Name[lt]=Kūrinių leistuvė 26 | Name[nb]=Mediespiller 27 | Name[nds]=Medienafspeler 28 | Name[nl]=Mediaspeler 29 | Name[nn]=Mediespelar 30 | Name[pa]=ਮੀਡਿਆ ਪਲੇਅਰ 31 | Name[pl]=Odtwarzacz multimedialny 32 | Name[pt]=Reprodutor Multimédia 33 | Name[pt_BR]=Reprodutor de mídia 34 | Name[ru]=Проигрыватель 35 | Name[sk]=Prehrávač médií 36 | Name[sl]=Predstavnostni predvajalnik 37 | Name[sr]=медија плејер 38 | Name[sr@ijekavian]=медија плејер 39 | Name[sr@ijekavianlatin]=medija plejer 40 | Name[sr@latin]=medija plejer 41 | Name[sv]=Mediaspelare 42 | Name[tr]=Ortam Yürütücüsü 43 | Name[uk]=Програвач 44 | Name[x-test]=xxMedia Playerxx 45 | Name[zh_CN]=媒体播放器 46 | Name[zh_TW]=媒體播放器 47 | Comment=Media Player Controls 48 | Comment[ar]=تحكّمات مشغّل الوسائط 49 | Comment[bs]=Kontrole izvođača medija 50 | Comment[ca]=Controls del reproductor multimèdia 51 | Comment[ca@valencia]=Controls del reproductor multimèdia 52 | Comment[cs]=Ovládání přehrávače médií 53 | Comment[da]=Kontroller til medieafspiller 54 | Comment[de]=Steuerung der Medienwiedergabe 55 | Comment[el]=Χειριστήρια αναπαραγωγέα πολυμέσων 56 | Comment[en_GB]=Media Player Controls 57 | Comment[es]=Controles del reproductor multimedia 58 | Comment[et]=Meediamängija juhtelemendid 59 | Comment[eu]=Multimedia-jotzailearen kontrolak 60 | Comment[fi]=Mediasoittimen säätimet 61 | Comment[fr]=Contrôles du lecteur multimédia 62 | Comment[gl]=Controis do reprodutor multimedia 63 | Comment[he]=פקדי ניגון מדיה 64 | Comment[hu]=Médialejátszó vezérlők 65 | Comment[ia]=Controlos de Reproductor de Multimedia 66 | Comment[id]=Kendali Player Media 67 | Comment[is]=Stjórntæki margmiðlunarspilara 68 | Comment[it]=Controlli del lettore multimediale 69 | Comment[ja]=メディアプレーヤーコントロール 70 | Comment[ko]=미디어 재생기 제어 71 | Comment[lt]=Kūrinių leistuvės valdikliai 72 | Comment[nb]=Styring for mediespiller 73 | Comment[nds]=Medienafspeler stüern 74 | Comment[nl]=Besturing van mediaspeler 75 | Comment[nn]=Mediespelarkontrollar 76 | Comment[pa]=ਮੀਡਿਆ ਪਲੇਅਰ ਕੰਟਰੋਲ 77 | Comment[pl]=Obsługa odtwarzacza multimedialnego 78 | Comment[pt]=Controlos do Leitor Multimédia 79 | Comment[pt_BR]=Controles do reprodutor de mídia 80 | Comment[ru]=Управление мультимедийным проигрывателем 81 | Comment[sk]=Ovládanie prehrávača médií 82 | Comment[sl]=Nadzorne tipke predstavnostnega predvajalnika 83 | Comment[sr]=Управљање медија плејером 84 | Comment[sr@ijekavian]=Управљање медија плејером 85 | Comment[sr@ijekavianlatin]=Upravljanje medija plejerom 86 | Comment[sr@latin]=Upravljanje medija plejerom 87 | Comment[sv]=Kontroller för mediaspelare 88 | Comment[tr]=Ortam Yürütücüsü Denetimleri 89 | Comment[uk]=Керування мультимедійним програвачем 90 | Comment[x-test]=xxMedia Player Controlsxx 91 | Comment[zh_CN]=媒体播放器控件 92 | Comment[zh_TW]=媒體播放器控制 93 | Icon=applications-multimedia 94 | 95 | Type=Service 96 | X-KDE-ServiceTypes=Plasma/Applet 97 | X-KDE-PluginInfo-Author=Sebastian Kügler 98 | X-KDE-PluginInfo-Category=Multimedia 99 | X-KDE-PluginInfo-Depends= 100 | X-KDE-PluginInfo-Email=sebas@kde.org 101 | X-KDE-PluginInfo-EnabledByDefault=true 102 | X-KDE-PluginInfo-License=GPL-2.0+ 103 | X-KDE-PluginInfo-Name=org.kde.plasma.mediacontroller_plus 104 | X-KDE-PluginInfo-Version=0.3.2 105 | X-KDE-PluginInfo-Website=https://www.kde.org/plasma-desktop 106 | X-Plasma-StandAloneApp=true 107 | X-Plasma-API=declarativeappletscript 108 | X-Plasma-MainScript=ui/main.qml 109 | X-Plasma-NotificationArea=true 110 | X-Plasma-NotificationAreaCategory=ApplicationStatus 111 | X-Plasma-Provides=org.kde.plasma.multimediacontrols 112 | X-Plasma-DBusActivationService=org.mpris.MediaPlayer2.* 113 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ismailof/mediacontroller_plus/8c8c8fb400c940df4e85c517aa709622addfe958/screenshot.png -------------------------------------------------------------------------------- /vertical_panel_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ismailof/mediacontroller_plus/8c8c8fb400c940df4e85c517aa709622addfe958/vertical_panel_layout.png --------------------------------------------------------------------------------