Linux CD player

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Linux CD player

Post by pjot »

Hi,

In the world of Linux, CD-players are almost always bound to a windowmanager. KDE ships one, GNOME also. There is an alternative by using XMMS, but this program renders the audio over PCM, which causes some CPU load. Finally there is a commandline tool called "DCD" but it is... well, console-based, so no GUI.

As I am using XFCE it was kind of annoying not to be able to play audio CD's. Therefore I programmed a genuine CD-player with newLisp, which plays the audio over the CD audio channel.

Image

Code here:

http://www.turtle.dds.nl/newlisp/cdplayer.lsp

It will lookup the track titles with CDDA2WAV, and add them to the drop-down list below, which can be used to select some other track.

Especially for this tool I adapted the GTK-server in a way that it is able to handle async events while waiting for events from the user. This 2.0.11 release will become available at the end of this week.

Regards
Peter

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

Nice.
Btw, (just in case if you wrote xml code by hands) you may use something like:

Code: Select all

(context 'GTK)
(define (property pname pvalue)
  (string "<property name=\"" pname "\">" pvalue "</property>\n"))

(define (child )
  (string "<child>\n" (join (args)) "</child>\n"))

(define (widget wclass wid)
  (string "<widget Class=\"" wclass "\" id=\"" wid "\">\n"
           (join (args))
           "</widget>\n"))

> (println (widget "wcl" "wn1"
>                  (property "p1" "v1")
>                  (property "p2" "v2")
>                  (child
>                    (widget "wcl2" "wn2"
>                            (property "p3" "p4")
>                            (property "p5" "p6")))))
<widget Class="wcl" id="wn1">
<property name="p1">v1</property>
<property name="p2">v2</property>
<child>
<widget Class="wcl2" id="wn2">
<property name="p3">p4</property>
<property name="p5">p6</property>
</widget>
</child>
</widget>
WBR, Dmi

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

Thanks DMI.

The XML code was generated automagically by Glade. I did not perform any further modifications there. :-)

Peter

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

With a little delay GTK-server 2.0.11 was released today. Now everybody can enjoy this wonderful CD player! Unless there is no audio cable between your CD drive and soundcard... :-)

Peter

Locked