You are not logged in.

lefty

Unregistered

1

Tuesday, August 17th 2004, 10:50pm

Query default mp3 player

Hi,
I am developing a non-KDE application, but I want it to work with the KDE desktop.
Is there a library function I can call to query the default application that handles mp3 files?
Thanks for any help you can give me,
Ed

2

Wednesday, August 18th 2004, 1:01am

RE: Query default mp3 player

These are stored in this folder on my pc (in the home folder of a user)

.kde3.2/share/config/

The file you're looking for is profilerc

And the default mp3 player can be found in the section (if there is one): [audio/x-mp3 - 1]


But I think that's not the best solution.
You should let the system your program runs on decide which program to open.
In other words, you just tell the system to play an mp3 file, and then, KDE, GNome or Windows for example, will load it's default player for mp3.

djanubis

Beginner

Posts: 29

Location: Moulins France

Occupation: Software ingeneering

  • Send private message

3

Wednesday, August 18th 2004, 7:35am

RE: Query default mp3 player

Well, KDE and Gnome usually have default players configured. Unfortunately, other desktops don't always. So, you should check if this is defined and work accordingly with. If not defined, you could use a dialog to ask user what is the player and store it in some QSettings.
Never patch not working code. Rewrite it !
Never patch badly designed classes. Recreate them cleanly.
(Excerpts from Computing Bible)

Home of the Lab project

Christian

Beginner

Posts: 26

Location: Karlsruhe, Germany

Occupation: in training

  • Send private message

4

Wednesday, August 18th 2004, 7:56am

And if you have started a KDE MP3 player like noatun you can use DCOP (http://wiki.qtforum.org/wakka.php?wakka=dcop&v=1cn5) to communicate with the mp3 player.
"You shouldn't learn Qt and be a logical thinking person, but learn Qt to become such" (decoding)
"A C++ compiler is not a baby rattle." (Kevin)

lefty

Unregistered

5

Wednesday, August 18th 2004, 9:38am

RE: Query default mp3 player

"You should let the system your program runs on decide which program to open.
In other words, you just tell the system to play an mp3 file, and then, KDE, GNome or Windows for example, will load it's default player for mp3."
Yes that's what I want to do, but which system API do I call to do it? (obviously Gnome and KDE will have different APIs)

djanubis

Beginner

Posts: 29

Location: Moulins France

Occupation: Software ingeneering

  • Send private message

6

Wednesday, August 18th 2004, 10:55am

RE: Query default mp3 player

There are some discussions on a common description for commonly used tools. I don't remember on wich mailing list this happens, but till it's there, there is no simple answer X(

KDE uses some DCOP while Gnome has various ways to communicate. XMMS has its own control API while mplayer has another and GStreamer a third one.
Sounds to me a common description and a common stub launcher would be great.
Never patch not working code. Rewrite it !
Never patch badly designed classes. Recreate them cleanly.
(Excerpts from Computing Bible)

Home of the Lab project

lefty

Unregistered

7

Wednesday, August 18th 2004, 12:56pm

RE: Query default mp3 player

I don't want to communicate with the mp3 player. I only want to query which app is the system default, (ie. the app that Konqueror launches automatically when you double click the file).
I'm begining to think it would be far easier to just allow the user to enter it as a setting.

[quote][i]
KDE uses some DCOP while Gnome has various ways to communicate. XMMS has its own control API while mplayer has another and GStreamer a third one.
Sounds to me a common description and a common stub launcher would be great.[/quote]

djanubis

Beginner

Posts: 29

Location: Moulins France

Occupation: Software ingeneering

  • Send private message

8

Wednesday, August 18th 2004, 12:59pm

RE: Query default mp3 player

Quoted

I'm begining to think it would be far easier to just allow the user to enter it as a setting.

Sure, till there's no common way to know what the user put as default in each and every desktop manager, this sounds the simplest way.
Never patch not working code. Rewrite it !
Never patch badly designed classes. Recreate them cleanly.
(Excerpts from Computing Bible)

Home of the Lab project

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

9

Wednesday, August 18th 2004, 11:09pm

You can use the Launcher facitlity of QDS (a lib I announced in general forum)

Until the developers on freedesktop.org agree on the launcher spec, your only alternative is to let the user specify the launcher

Cheers,
_
Qt/KDE Developer
Debian User

djanubis

Beginner

Posts: 29

Location: Moulins France

Occupation: Software ingeneering

  • Send private message

10

Thursday, August 19th 2004, 6:49am

The idea behind the scene in qds is very interesting. Will you make it a public project on freshmeat ? :P :P
Never patch not working code. Rewrite it !
Never patch badly designed classes. Recreate them cleanly.
(Excerpts from Computing Bible)

Home of the Lab project

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

11

Thursday, August 19th 2004, 5:05pm

Its currently to small to put it into a public CVS and it is not advanced enough to make it an announced release on freshmeat.

But all the sources are available, it is free software

Unfortunately I haven't got any feedback yet, so I guess nobody really needs any of its features, despite reoccuring questions about launching default viewers/players.

Oh well :rolleyes:

Cheers,
_
Qt/KDE Developer
Debian User

djanubis

Beginner

Posts: 29

Location: Moulins France

Occupation: Software ingeneering

  • Send private message

12

Thursday, August 19th 2004, 5:16pm

I gave it a try, seems very interesting, and complying more or less with Freedesktop.org discussions and proposals.
If you need help for features, ideas, would be great to have a common cross-platform Qt application stub model. And, when freedesktop standard will emerge, it could be easy to change some behaviour to be compliant withh it too.
Never patch not working code. Rewrite it !
Never patch badly designed classes. Recreate them cleanly.
(Excerpts from Computing Bible)

Home of the Lab project

lefty

Unregistered

13

Sunday, August 22nd 2004, 4:35pm

[quote][i]Originally posted by anda_skoa[/i]

Unfortunately I haven't got any feedback yet, so I guess nobody really needs any of its features, despite reoccuring questions about launching default viewers/players.
_[/quote]
I think you haven't got any feedback because no one can access the web page:
"Not Found The page you requested was not found on this server!"

I for one would be interested (especially if it can be used by a non-KDE application)!

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

14

Sunday, August 22nd 2004, 7:48pm

*Sigh*

Seems my university's webserver has problems mounting the Novell share which contains the student websites :(

I attached a snapshot of the QDS website to the QDS thread in the announcement forum.

If you want to run the test program from the target dir, you have to add install/lib to LD_LIBRARY_PATH so that the libs can be found by the Linux runtime loader
e.g

Source code

1
2
3
4
# qds> cd install
# install> export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
# install> cd bin
# bin>./qdstest


The Testwidget for the QNetwork service is not very good yet, but Launcher or QSound should be pretty easy to understand.

Quoted

I for one would be interested (especially if it can be used by a non-KDE application)!


That is the primary idea. It should be usable by pure Qt applications on allQt supported platforms.
The source archive contains a rudimentary Launcher implementation for Windows, a similar module for OS X would be easy as well (in fact I already have the necessary code snippet but no OSX machine to test on)

Cheers,
_
Qt/KDE Developer
Debian User

blu fire

Beginner

Posts: 20

Location: London

Occupation: Student

  • Send private message

15

Friday, August 27th 2004, 12:22pm

Can krun.h be used on Gnome if KDE is installed?

djanubis

Beginner

Posts: 29

Location: Moulins France

Occupation: Software ingeneering

  • Send private message

16

Friday, August 27th 2004, 1:50pm

Should run, but you create a strong dependancy on another dektop... wich is not very modular.
Never patch not working code. Rewrite it !
Never patch badly designed classes. Recreate them cleanly.
(Excerpts from Computing Bible)

Home of the Lab project

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

17

Sunday, August 29th 2004, 6:38am

Quoted

Originally posted by blu fire
Can krun.h be used on Gnome if KDE is installed?


Well, a KDE application is always a KDE application, no matter what DE it runs on.

Cheers,
_
Qt/KDE Developer
Debian User

blu fire

Beginner

Posts: 20

Location: London

Occupation: Student

  • Send private message

18

Monday, August 30th 2004, 11:44am

Will it query KDE's database of programs and their associates or Gnome's one if its run on Gnome?

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

19

Monday, August 30th 2004, 6:21pm

A KDE Applikation always uses the KDE file associations.

At least until the respective specification on freedesktop.org is finished and implemented, then the desktops will share it

Cheers,
_
Qt/KDE Developer
Debian User