Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report current track via MPRIS DBus interface #7493

Open
mixxxbot opened this issue Aug 22, 2022 · 32 comments
Open

Report current track via MPRIS DBus interface #7493

mixxxbot opened this issue Aug 22, 2022 · 32 comments
Labels

Comments

@mixxxbot
Copy link
Collaborator

Reported by: daschuer
Date: 2014-06-05T06:07:25Z
Status: In Progress
Importance: Wishlist
Launchpad Issue: lp1326653


This is a follow up from this bug: Bug #⁠1326596

It would be nice if we report the current track via MPRIS DBus interface.

See:
Qt's QDBus* classes http://qt-project.org/doc/qt-4.8/qtdbus.html
https://code.google.com/p/qmmp/source/browse/branches/qmmp-0.5/src/plugins/General/mpris/mpris.cpp?r=2132

Related: Bug #⁠918199

@mixxxbot
Copy link
Collaborator Author

Commented by: shwan-ciyako
Date: 2015-01-26T13:50:38Z


Hi Daniel
I am very interested in solving this situation, have a friend that might be able to help me out in putting together some code, but if I am going to try doing it by myself, as I am a hardware engineer, this will take me time without help.
My current idea was to add that in the autodj part of the code. you said that QT has support for it. is there any file in the source of Mixxx that handles the data I want to get that you can pint me to?
giving a guide/idea about where in the source and what to edit and kind of suggestion about the implementation will probably help me out a lot on the way.

We would like to knoe at least the comming 10 songs, or minimal the playing and next deck, using 4 decks also is an option .

@mixxxbot
Copy link
Collaborator Author

Commented by: mikael-holber
Date: 2015-01-26T14:08:14Z


The list of information we request (also applies to COM-server and applescript/scriptbridge) are:

Artist
AlbumArtist
Album
Title
Genre
Year
Performer
Comment
Composer
fileURL

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-01-26T14:44:07Z


Hi Shwan,

cool!

First you should make sure you environment is prepared. Are you able to build the latest master and are you able to single step though the code?
This link may help getting you up http://www.mixxx.org/wiki/doku.php/bugfix_workflow otherwise just ask.

I think the MPRIS clients expect a single player like all other media players. For your requirements it seams to be the best to let the clients believe that Mixxx is such a player.
We can only predict the next track reliable when Auto DJ is enabled. In this state, the next tracks is loaded to a deck but still on top of the Auto DJ play list. So there is no need to deal with four decks.

The current playing deck, you will get from the PlayerInfo::getCurrentPlayingTrack a singelton class in src/playerinfo.cpp
To implement only this seams to be a reasonable fist step.

For the following tracks you may interface somehow with the AutoDJ src/library/autodj/autodjprocessor.cpp
the tracks are located in m_pAutoDJTableModel

I have not much experience with DBus, but this seams to be a good tutorial:
https://techbase.kde.org/Development/Tutorials#D-Bus

Hope that helps.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-01-26T14:50:34Z


This may help as well:

TrackPointer pTrack = PlayerInfo::instance().getCurrentPlayingTrack();

The list of information we request ...

Yes, no problem. You can query all that by pTrack->getXXX() functions.

@mixxxbot
Copy link
Collaborator Author

Commented by: mikael-holber
Date: 2015-01-26T14:57:46Z


Great! I will get both Shwan and Horia working on this ;)

On Mon, Jan 26, 2015 at 3:50 PM, Daniel Schürmann <
<email address hidden>> wrote:

This may help as well:

TrackPointer pTrack = PlayerInfo::instance().getCurrentPlayingTrack();

The list of information we request ...

Yes, no problem. You can query all that by pTrack->getXXX() functions.

--
You received this bug notification because you are subscribed to a
duplicate bug report (1414572).
https://bugs.launchpad.net/bugs/1326653

Title:
Report current track via MPRIS DBus interface

To manage notifications about this bug go to:
https://bugs.launchpad.net/mixxx/+bug/1326653/+subscriptions

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-04-07T09:17:41Z


Hi holber,

I have got recently a request to interface Mixxx with a beamer.
How is the status of this project? Do you need help?
Thank you for the updates.

Kind regards,

Daniel

@mixxxbot
Copy link
Collaborator Author

Commented by: mikael-holber
Date: 2015-04-07T10:23:18Z


Hi Daniel,

I tried to mobilize some resources here but with little luck. I do not have
any experience with QT so I would need a lot of help. If you could help me
it would be great! The project is available at http://www.beam-project.com

We are currently in the process of moving the repository from google-code
as they are closing down, so use the binary releases if you want to try it
out.

The obvious information we would need is "Current song" which is playing to
the public (not headphones). If there is any intuitive way of predicting
the next track that will be played (or if it is used in playlist-mode) this
would be very useful as well. This is of course complementary information
that requires the user to use Mixxx in a specific, predefined way.

The information that our application will access is the following from each
song:

Artist
AlbumArtist
Album
Title
Genre
Year
Performer
Comment
Composer
fileURL

We then structure the information as following:
CURRENTSONG PREVIOUSSONG NEXTSONG NEXTTANDA%Artist %PreviousArtist
%NextArtist %NextTandaArtist%AlbumArtist %PreviousAlbumArtist
%NextAlbumArtist %NextTandaAlbumArtist%Album %PreviousAlbum %NextAlbum
%NextTandaAlbum%Title %PreviousTitle %NextTitle %NextTandaTitle%Genre
%PreviousGenre %NextGenre %NextTandaGenre%Comment %PreviousComment
%NextComment %NextTandaComment%Composer %PreviousComposer %NextComposer
%NextTandaComposer%Performer %PreviousPerformer %NextPerformer
%NextTandaPerformer%Year %PreviousYear %NextYear %NextTandaYear%Singer
%PreviousSinger %NextSinger %NextTandaSinger%IsCortina %PreviousIsCortina
%NextIsCortina

Previous song is saved in the application, This is not live-information.
Current song is obviously current. Next song is read from the playlist.
Next tanda is a "tango specific" expression where we locate the next
"section" of songs based on some rules.

Hope this helps you understand our intention. We are absolutely willing to
adopt Beam to be more general, for this we would need some use-cases.

Best Regards
Mikael

On Tue, Apr 7, 2015 at 11:17 AM, Daniel Schürmann <
<email address hidden>> wrote:

Hi holber,

I have got recently a request to interface Mixxx with a beamer.
How is the status of this project? Do you need help?
Thank you for the updates.

Kind regards,

Daniel

--
You received this bug notification because you are subscribed to a
duplicate bug report (1414572).
https://bugs.launchpad.net/bugs/1326653

Title:
Report current track via MPRIS DBus interface

To manage notifications about this bug go to:
https://bugs.launchpad.net/mixxx/+bug/1326653/+subscriptions

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-04-07T10:50:43Z


Thank you for your fast responds.

I will try to give you all the support I can.

What could be the mode in which we can work together?
When do you will have time to spend on this?
Do you have already a Mixxx building environment? Do you need help to set one up?

@mixxxbot
Copy link
Collaborator Author

Commented by: mikael-holber
Date: 2015-04-07T13:41:15Z


My partner Horia will assist you.

Kind regards
Mikael

On Tue, Apr 7, 2015 at 12:50 PM, Daniel Schürmann <
<email address hidden>> wrote:

Thank you for your fast responds.

I will try to give you all the support I can.

What could be the mode in which we can work together?
When do you will have time to spend on this?
Do you have already a Mixxx building environment? Do you need help to set
one up?

--
You received this bug notification because you are subscribed to a
duplicate bug report (1414572).
https://bugs.launchpad.net/bugs/1326653

Title:
Report current track via MPRIS DBus interface

To manage notifications about this bug go to:
https://bugs.launchpad.net/mixxx/+bug/1326653/+subscriptions

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-04-10T08:45:31Z


@horia: Thank you for your help. Pleas contact me to discuss how an when we can start with this.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-04-18T20:58:15Z


The MPRIS 2.2 stubs are prepared:
https://github.com/daschuer/mixxx/tree/mpris/src/mpris

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-04-19T11:04:10Z


Status update:
The MPRIS 2.2 interface is installed.
The root MediaPlayer2 interface is working.
So you can Raise() and Fullscreen() Mixxx remotely
The MediaPlayer2.Player interface is working in some places. It is a bit hard to map this interface to the "current" deck, but it should be possible with some effort.
I am only not sure if it worth the work, because we have no use case for this. So it is probably a good idea to remain in this state until we have one.

The real valid use case that makes me doing this work is the interface to the beam-project.
I have not implemented the meta data interface yet because MPRIS is somehow open how to do it.

@horia: It is pretty easy to do it on top of my branch.
Here you find how to access the track info object: https://github.com/daschuer/mixxx/blob/mpris/src/mpris/mediaplayer2player.cpp#L30
It should contain all metadata required to display the current track.
If you need additional help, just ask.

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-08T20:25:26Z


Hi guys,

I have some time these days and I would be happy to start working on Mixxx's DBus interface.

Daniel could you give me some directions to setup my devenv?!

Horia.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-06-08T21:08:31Z


Hi Horia,

Great :-D

A good start to read is here:
http://www.mixxx.org/wiki/doku.php/bugfix_workflow

Where is the point you need help?
Are you familiar with git?
Are you able to build Mixxx from the command line?
What is your favorite IDE?

Daniel

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-10T21:21:52Z


Hi,

My first question was aiming at this: http://www.mixxx.org/wiki/doku.php/compiling_on_linux . So it is clear now.

Yes, I am familiar with git, with DBus and with Qt as well.
I have just read about Bazaar and perform the necessary setup.

IDE: I like to use Qt Creator even for non-Qt projects

No, I did not managed to build Mixxx from the command line. I got this error:
"horia@horia-ThinkPad-X301:~$ sudo apt-get build-dep mixxx
[sudo] password for horia: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libexpat1-dev' instead of 'libexpat-dev'
Note, selecting 'libshout3-dev' instead of 'libshout-dev'
The following packages have unmet dependencies:
 libjack-dev : Depends: libjack0 (= 1:0.121.3+20120418git75e3e20b-2.1ubuntu1) but it is not going to be installed
E: Build-dependencies for mixxx could not be satisfied.
horia@horia-ThinkPad-X301:~$ 
"
Horia

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-06-11T06:42:50Z


I have just read about Bazaar

There is no need to, because we have moved the source entirely to GitHub.

The following packages have unmet dependencies:
libjack-dev : Depends: libjack0 (= 1:0.121.3+20120418git75e3e20b-2.1ubuntu1) but it is not going to be installed

Strange, I assume you are on Ubuntu Trusty, like me
libjack0 1:0.121.3+20120418git75e3e20b-2.1ubuntu1 is installed.

I can reproduce the issue by installing libjack0

This solves the issue on my system
sudo apt-get install libjack-dev libjack0 portaudio19-dev

It looks like there is a kind of package dead lock with jack 1 and 2
I will file a Bug.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-06-11T06:51:48Z


Bug #⁠1464120

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-11T14:54:06Z


Hi Daniel,

I managed to build Mixxx on my machine.
Now, I want to setup my QtCreator as specified here: http://www.mixxx.org/wiki/doku.php/qtcreator

At a certain point it says:" right click on the top-level directory and select “Add existing files”, and then select SConstruct from the list. Do the same for theSConscripts."

It is my first time wotking with SCons, I found the SConstruct file but did not found SConscripts.

Horia.

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-11T14:53:12Z


Hi Daniel,

I managed to build Mixxx on my machine.
Now, I want to setup my QtCreator as specified here:
http://www.mixxx.org/wiki/doku.php/qtcreator

At a certain point it says:" right click on the top-level directory and
select “Add existing files”, and then select SConstruct from the list. Do
the same for theSConscripts."

It is my first time wotking with SCons, I found the SConstruct file but did
not found SConscripts.

Horia.

On Thu, Jun 11, 2015 at 9:51 AM, Daniel Schürmann <
<email address hidden>> wrote:

Bug #⁠1464120

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1326653

Title:
Report current track via MPRIS DBus interface

Status in Mixxx:
In Progress

Bug description:
This is a follow up from this bug: Bug #⁠1326596

It would be nice if we report the current track via MPRIS DBus
interface.

See:
Qt's QDBus* classes http://qt-project.org/doc/qt-4.8/qtdbus.html

https://code.google.com/p/qmmp/source/browse/branches/qmmp-0.5/src/plugins/General/mpris/mpris.cpp?r=2132

Related: Bug #⁠918199

To manage notifications about this bug go to:
https://bugs.launchpad.net/mixxx/+bug/1326653/+subscriptions

-- 
Horia Uifaleanu
email: <email address hidden>

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-06-11T22:12:17Z


Sorry, I can't help a lot with Qt Creator.
Can one else jump in?

IMHO you do not need to deal with SConstruct and SConscripts.
Just replacing "make" with "scons" should work.
So you may try to continue with
"Adding a build and a clean target"

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-11T22:14:16Z


Hi Daniel,

One further question: where is the mpris branch you were reffering upper here in the comments?

I can't find it on th eremote repository:

horia@horia-ThinkPad-X301:~/mixxx$ git branch -r
  origin/1.10
  origin/1.11
  origin/1.12
  origin/1.8
  origin/1.9
  origin/HEAD -> origin/master
  origin/master
  origin/memory-leak
  origin/release-1.11.x-translations
  origin/translator-comments
  origin/trunk_translations
horia@horia-ThinkPad-X301:~/mixxx$

Horia.

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-11T22:24:02Z


Tests:

Are they any tests written or do you have something in mind for the current MPRIS 2.2 stubs you indicated?
https://github.com/daschuer/mixxx/tree/mpris/src/mpris

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-06-11T22:26:22Z


You can pull it into your repro like that

git checkout -b mpris master
git pull https://github.com/daschuer/mixxx.git mpris

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-06-11T22:34:20Z


Tests:

I have used D-Feet, to check and invoke the DBus functions.
I think the reference client is Beamer for now :-)

Maybe we can finally invoke d-Bus command line calls from a
Google Test to build unit tests.
All other unit tests are located in the src/test

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-11T22:54:47Z


I will use D-feet for the quick checks.

Google Test:
In what regards the other tests, a simple scenario testing would be to create a new DBus session to retrieve the info via the DBus interface and compare the results with the values from the singleton PlayerInfo::getCurrentPlayingTrack.
This approach might be suitable for unit tests as well.

MPRIS 2.2 standard:
I will start with the entries for the current playing track but basically, on long term, I would like to go on with all the items specified by MPRIS 2.2

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-06-12T06:21:50Z


I will start with the entries for the current playing track but basically, on long term, I would like to go on with all the items specified by MPRIS 2.2

That sounds reasonable. Just make beamer work! ;-) Thank you. 

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-12T12:43:08Z


Ok! Got it working!

https://drive.google.com/file/d/0B3hQF_jNtG39dldmU3R0Wnl4VGc/view?usp=sharing

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-14T16:04:48Z


Hi Daniel,

I already have something to commit and for the moment my github username ( horiator ) might not have access yet to https://github.com/daschuer/mixxx.git mpris

Horia.

@mixxxbot
Copy link
Collaborator Author

Commented by: horia-uifaleanu
Date: 2015-06-14T16:54:38Z


Ok. You can ignore my last comment!

I have created a fork and I will issue a pull request.

Horia.

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2018-09-20T17:38:38Z


Due to lack of progress, marking Triaged and clearing assignee. Feel free to revert if it is in fact still in progress :).

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2018-09-20T20:00:03Z


#1675

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@acolombier
Copy link
Member

Fixed by #3483

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants