Some updates

Hello everybody!

It’s been a while since my last post, and it’s about time i tell you some of the progress on the kmix2 project. At last, kmix has now multimedia players support. For now, all major mpris-enabled audio players are ready and stable. Supported players for now are: Amarok, VLC and Clementine! I’ve having some thoughts about the libraries needed to support them. First thought was to create a generic mpris library and call every player using its respected dbus path. That seemed a little inconvenient, as long as differnt players support different/or unique features that other players don’t. That said, at some point we would need a different class for amarok, an other class for vlc etc supporting those features. The best idea (so far) was to create a different class for every player, in which I code its mpris implementations plus all the other features via dbus. All these classes are exposed to a central class by the name «Players», so everybody who wants multimedia players support can just create a Players class instance in his/her code and voila! Beautifull tab-widget with multimedia players on the fly! I’m posting a screenshot too of the code in action!


There are 10 Comments to "Some updates"

  • Ο/Η gsedej λέει:

    Hi! I am new to KDE. Would it be possible just to list all pulseaudio apps, like in gnome audio control. It shows all apps (like firefox, VLC, skype) in single tab and you can control volume for each app. There is also app «pavucontrol», but its too complicated for simple user.

  • Ο/Η Anand λέει:

    I think Veromix widget has this feature but crashes / hogs CPU. :-(

  • Ο/Η Eike Hein λέει:

    The basic idea of MPRIS2 is to have a generic, standardized interface and gaining the ability to enumerate arbitrary, unknown players. That’s why we e.g. switched Konversation’s media player integration from having player-specific implementations to supporting MPRIS2 exclusively. I’d try hard to stick to that path and avoid writing any player-specific code, if I were you. If you get tempted to write player-specific code, try to fix the players or the MPRIS2 spec instead (while implementing MPRIS2 support in Konversation and Dragon I found a bug in the spec and had no trouble getting it fixed; with Alex Merry we have one of the spec’s authors and maintainers in our community).

    • Ο/Η admin λέει:

      Thank you for your comment! It’s really nice to get comments from kde developers! :) Now, back to our topic. My mentor told me the same thing about the MPRIS protocol, but as I’m not that good with Qt, I couldn’t find any other way more elegant and feasible for me to create player-specific graphic content with a generic class. In my mind, in order to do it i should include a bunch of «if-then-else» to specify each player everytime. Another question I have (and have to ask my mentor about it) is how to query a player. For example, amarok is in org.kde.amarok, on the other hand, vlc is on org.mpris.(Player).vlc (if I remember correctly). That’s something I have to figure out!

      • Ο/Η Eike Hein λέει:

        The MPRIS2 specification actually requires players to register under org.mpris.MediaPlayer2.NAME – see the «Bus Name Policy» section in the spec document. That allows you to list all running players by listing everything on the bus that begins with «org.mpris.MediaPlayer2.».

        As for player-specific graphical presentations, again the specification has a few things that help you here. For example, the basic interface has a «DesktopEntry» property. From that property you can get the .desktop file for the player, and then you can use KDE APIs to retrieve things like the application name (for this you can also use the «Identity» property, of course) and application icon from the values given in the .desktop file.

        If you need to do anything more player-specific, the correct way to go about it is to first implement a generic, fallback version that is used for unknown players (but works with all of them, since it would implement the lowest common denominator of functionality) and load something player-specific when you recognize a player by its specific bus name.

        Always keep in mind: It should work with all players, even players you have never heard about, even players that haven’t even been written yet, so long as they implement the MPRIS2 standard correctly. You can do some extra tricks for individual players you recognize perhaps if they offer additional features, but if these are generally useful features, they should actually be added to the spec instead to encourage other players to provide them as well.

  • Ο/Η nece228 λέει:

    what is this whitespace doing below the players tabs? other than that looks really nice! :)
    btw cradle of filth…yuck…emo

    • Ο/Η admin λέει:

      That space is intended for some tests i do. Other than that, I think the tab player will fill all the space.

      P.S. That song was a quick example, I prefer Nightwish/Within Temptation/Kamelot! :D

      Thank you for your comment :)

Write a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>