Page 9 of 11

Posted: Thu 17 Dec 2009, 07:53
by esmourguit
Bonjour à tous,
@Zigbert,
Thank you very much, it works in french now.
Cordialement ;)

pcd - CD-audio player

Posted: Wed 30 Jun 2010, 14:51
by BobSongs
I'm using Puppy Linux 4.x on a RAM drive. I am using pcd (simple, sweet, effective) to listen to an audio CD. It pulled in the track names and all. Very nice!

This PC has two optical drives. pcd has no option to switch from one to the next. Is this feature added for puppy 5.x?

Thanks

Posted: Thu 01 Jul 2010, 04:35
by zigbert
BobSongs
Pcd always read the default CD-device (/dev/cdrom). You can change this by redefining your preferred device in the CD/DVD-wizard. See setup-menu.


Sigmund

Posted: Fri 20 Aug 2010, 20:45
by zigbert
Version 1.2
See main post

Changelog
- Progress bar
- 'Copy CD' goes directly to burn-options dialog in Pburn
- improved language detection (thanks to wow)
- Bugfix: Check internet connection when not using LANG=en_US (thanks to wow)
- Bugfix: 'Stop', 'next' and 'previous' button froze playing-song-info.
- Bugfix: Clear info when eject.

Important
Pmusic 1.3 includes playback (and simple ripping) of audio-CD. Pmusic will also show a complete progressbar, and give the possibility to jump forward/back in playback time. Pcd has a sweet and simple ui, but Pmusic will simulate pCD by using the -c switch. - 'pmusic -c' will read cd and start playing the first song. So why bother continue the development of pCD. The answer is simply system-usage. While pCD pipes the rip directly into the player (cdda2wav | aplay), pmusic first rip, then starts the universal converter that pipes the result into the player (cdda2wav; ffmpeg | aplay). This gives more use of both cpu and temporary storage / memory. The reason why doing it so complex in Pmusic is to achieve more flexibility of the output stream.


Sigmund

Posted: Tue 28 Sep 2010, 14:25
by Karl Godt
Hi zigbert !

like pfind I like pCD very much !

but I'd like to have pCD starting from menu without autoprobing for CD drives and contents.
so I made a little pCDmenustart.sh :
usr-local-bin

#!/bin/bash
## this is a shellscript to not search automatically for CD drives running pCD from the menu

export MENUSTART=1
exec pcd
exit

and added this to
usr-local-pcd-pcd

line 27+

if [ $MENUSTART = 1 ]; then
. $APPDIR/func -stop
else
. $APPDIR/func -probe
fi

but most annoying is the "Hickup" after finishing the last song.
so I added this to
usr-local-pcd-func
-play) line 125 +
lines 140+

Code: Select all

   TTR=`cat $WORKDIR/pcd-cddb | grep "total tracks:" | cut -f 5 -d " " | tr "," ":" | cut -f 2 -d ":" | tr -d ":"` #; echo $TTR
	WASPLAYING=`cat $WORKDIR/pcd-nr`
	if [ $TTR -gt $WASPLAYING ]; then  
	$APPDIR/func -next
	else
	$APPDIR/func -stop
	fi
	;;
I modified pCD Version=1.2 running Quirky 1.3 and posting from it now

Thank you again very much for your work!

Posted: Tue 28 Sep 2010, 16:02
by zigbert
Karl Godt
Great stuff!
I will look at it when I am back home from holiday


Sigmund

Posted: Thu 04 Nov 2010, 21:07
by Karl Godt
I should change the code to something like

echo forHELLved... > /tmp/pcd.menustart

instead of using export : I had to realize that export just works inside its shell and not even at a later opened terminal.

and accordingly

if test -f /tmp/pcd.menustart; then
. $APPDIR/func -stop
else
. $APPDIR/func -probe
fi

Posted: Sat 06 Nov 2010, 08:34
by zigbert
Version 1.3
See main post

changelog
- Set pCD to defaultcdplayer (thanks to BarryK)
- parameter -x skips disc to spin at startup. (thanks to Karl Godt)
- Bugfix: pCD tries to read next song after played the last song. (thanks to Karl Godt)

Posted: Sat 06 Nov 2010, 08:38
by zigbert
Karl Godt
I added your hickup fix, but used an alternative solution for the anti-spinup. Using parameters makes life easier if we later want more options.....


Thank you, and sorry for taking so long
Sigmund

Posted: Sat 06 Nov 2010, 10:44
by Karl Godt
NEXT : pcd-1.3 :

is working well on dpup-008
(I also kicked out confusing or buggy gnome-mplayer and replaced it with gxine from dpup-005 )

unfortunately 2 things to report :
/usr/share/applications/pcd.desktop
Exec=pcd
should be
Exec=pcd -x

/root/Downloads/pcd-1.3/pinstall.sh
the syntax seems to be confusing

Code: Select all

#!/bin/sh
#post-install script.
if [ "`pwd`" != "/" ];then
  echo '#!/bin/sh' > ./usr/local/bin/defaultcdplayer
  echo 'exec pcd' >> ./usr/local/bin/defaultcdplayer
  chmod 755 ./usr/local/bin/defaultcdplayer
fi
1.: if [ "`pwd`" != "/" ];then
can it be omitted ?

2.: ./usr/local/bin/defaultcdplayer
shouldn't it be just
/usr/local/bin/defaultcdplayer
without the dot ?

I would prefer
a whole
/pcd-1.3/usr/local/bin/defaultcdplayer
#!/bin/sh
exec pcd "$@"
inside the directory before doing dir2pet.

I am learning to create pets also and can only say that tgz2pet didn't worked properly for me
but dir2pet did.
To create pre- or post-install scripts that create a backup of the old defaultmediaplayer script I have just a misty imagination of
something like that :
if test -f /FILE; then
cp /FILE /FILE.PET.bak

pCD is the best CD player I know because gxine is very noisy on using the cd/dvd drive.

Posted: Sat 06 Nov 2010, 20:04
by zigbert
Karl Godt
I would like /usr/share/applications/pcd.desktop to execute pCD the normal way (with spin-up) by default. I think that this is the best solution for most users. You can manually edit the .desktop file, or make a symlink on your desktop to include the -x switch.

The pinstall script is not my code. Barry asked me to include it, and I don't mess with that guy, else I got very good reasons :D


Sigmund

Posted: Sat 06 Nov 2010, 23:14
by BarryK
Karl Godt wrote:/root/Downloads/pcd-1.3/pinstall.sh
the syntax seems to be confusing

Code: Select all

#!/bin/sh
#post-install script.
if [ "`pwd`" != "/" ];then
  echo '#!/bin/sh' > ./usr/local/bin/defaultcdplayer
  echo 'exec pcd' >> ./usr/local/bin/defaultcdplayer
  chmod 755 ./usr/local/bin/defaultcdplayer
fi
1.: if [ "`pwd`" != "/" ];then
can it be omitted ?
It is that way for very good reason. If a PET is to be installed when building a Puppy in Woof, the current-directory when 'pinstall.sh' is run is not '/', hence the '.' in front is essential (or just usr/localbin/defaultcdplayer).

The 'if' test is testing if installing in Woof. It depends what you want. If you only want to change the default CD player when installing in Woof, then need that test.

SED and DOUBLE QUOTES

Posted: Sun 07 Nov 2010, 10:42
by Karl Godt
Thanks for the clarification !

It seems that

Code: Select all

#!/bin/bash
# post-install script.
# if [ "`pwd`" != "/" ];then
if test -f /etc/xdg/templates/_root_.jwmrc ; then
cp /etc/xdg/templates/_root_.jwmrc /etc/xdg/templates/_root_.jwmrc.acpitool.bak
cp /etc/xdg/templates/_root_.jwmrc /tmp

S1=`cat -n /tmp/_root_.jwmrc | grep -n '<\!-- <Exit confirm="false" label="Exit to prompt" icon="prompt16.xpm" /> -->'`
S1LN=`echo $S1 | cut -f 1 -d ":"`
S9=`cat -n /tmp/_root_.jwmrc | grep -n '</JWM>'`
S9LLN=`echo $S9 | cut -f 1 -d ":"`
TP=`expr $S9LLN - $S1LN`
TAIL=`tail -n $TP /tmp/_root_.jwmrc`
HEAD=`head -n $S1LN /tmp/_root_.jwmrc`

NEWMENUP='  <Program label=\"Suspend to RAM -- light sleep\" icon=\"zz.png\">rxvt -e acpitool -s</Program>'

SEDINSL=`expr $S1LN + 1`

# sed '45i\newline' file | sed '45inewline' file 
# use -i to edit in place redirect using '> outfile' to copy it to another file.
# Also the backslash isn't necessary, I just put it there for clarity. 

sed -i "$SEDINSL i\ $NEWMENUP" /etc/xdg/templates/_root_.jwmrc 
# ' prevents sed from using Variables

fixmenus
`jwm -restart`
fi
exit
is working well for me !

It is a pet that contains 2 icons and the simple debian-squeeze acpitool binary.

It took me perhaps 24 hours to find out about the sed syntax to write a line somewhere into a file.
head and tail had been the first attempt of mine but echo $TAIL or $HEAD > FILE converted it to one string.

awk I was trying also , perhaps it also needed Double Quotes to use $VARIABLES.

Posted: Sun 07 Nov 2010, 15:24
by abushcrafter
In the pinstall.sh in the current package for pcd 1.3. You forgot to add ""$@"". So you should have this: "/usr/local/bin/defaultcdplayer":

Code: Select all

#!/bin/sh
exec pcd "$@"

tracks don't show in window

Posted: Sat 27 Nov 2010, 21:24
by don570
I'm not sure which version of pcd

Tested versions in wary 098 and luci 239

I launched pcd with no CD in tray
and got the message in window 'No disc inserted'

When I inserted Audio CD, then clicked 'Read CD'
then clicked play icon , the window still showed
'No disc inserted'. The entire CD did play to the end.

Note : I don't have internet access so it can't search
for names of tracks on the internet.

Posted: Wed 01 Dec 2010, 08:01
by zigbert
Version 1.4
See main post

Changelog
- Bugfix: New disc-scan after 'No disc insterted' message (thanks to don570)

no change noticed in pcd 1.4

Posted: Mon 06 Dec 2010, 20:38
by don570
I didn't notice any change in the new version pcd 1.4
I still get the 'no disc inserted' message in the window
if I launch pcd and then insert the Audio CD.
Tested on luci 241 . I have no internet access.

________________________________________

Posted: Wed 08 Dec 2010, 18:00
by zigbert
don570
So there is more....... :)

I have added a 1 sec sleep in line 20 (/usr/local/pcd/func), to wait for the disc to spin up. Does it help you? Please try pCD-1.4-1 in the main post.


Sigmund

Take your time

Posted: Wed 08 Dec 2010, 22:05
by Karl Godt
Spider mode enabled. Check if remote file exists.
--2010-12-08 19:43:18-- http://puppylinux.com/
Resolving puppylinux.com... failed: Connection timed out.
wget: unable to resolve host address `puppylinux.com'

AND ANOTHER TRY 'Read CD' >
# LANG=C wget -S --spider -T 1 puppylinux.com
Spider mode enabled. Check if remote file exists.
--2010-12-08 19:28:50-- http://puppylinux.com/
Resolving puppylinux.com... 74.53.27.162
Connecting to puppylinux.com|74.53.27.162|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Wed, 08 Dec 2010 18:26:55 GMT
Server: Apache mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Last-Modified: Fri, 26 Nov 2010 12:45:35 GMT
ETag: "5bb4003-15b4-495f4193f99c0"
Accept-Ranges: bytes
Content-Length: 5556
Content-Type: text/html
Connection: keep-alive
Length: 5556 (5.4K) [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

It seems that the disk drive icon has to appear on the desktop before clicking 'Read CD' which can take sometimes several seconds. Clicking 'Read CD' immediately after inserting the CD `pcd` showed no disk inserted, Clicking 'Read CD' another time before the drive icon appeared also no disk inserted, Clicking 'Read CD' immediately after the drive icon appeared just unknown artist and track #Nrs. The FOURTH Clicking 'Read CD' then showed the retrieved Data.

I also looked into the code and gtkdialog is poorly documented ... google for gtkdialog3 and you'll find zigbert and murga linux 8)

Code: Select all

<button>
     <label>$LOC204</label>
     <action>$APPDIR/func -stop</action>
     <action>eject</action>
     <action>for i in \`ls /root/.pcd/tmp\` ; do echo > /root/.pcd/tmp/\"\$i\" ; done</action>
     <action>sleep 1.4</action>
     <action type=\"clear\">ENTRY_ARTIST</action>
     <action>refresh:ENTRY_ARTIST</action>
     <action type=\"clear\">ENTRY_ALBUM</action>
     <action>Refresh:ENTRY_ALBUM</action>
     <action type=\"clear\">CDDA</action>
     <action>Refresh:CDDA</action>
     <action type=\"clear\">PB</action>
     <action>Refresh:PB</action>
    </button>
is working on dpup-005 but with warnings ( of which I get a lot from seamonkey, abiword and other apps here )
** (gtkdialog3:4382): WARNING **: gtkdialog: Warning: Clear not implemented for this widget..

no disc inserted

Posted: Sat 11 Dec 2010, 18:46
by don570
I tried pcd 1.4.1 and I'm still getting 'no disc inserted'
messages if I launch pcd first.

I tried terminating my DVD burner differently to see
if that would change anything, but no difference.

I wait to see desktop drive icon before clicking 'Read CD'
Am I the only one with this problem?
I have an IBM M41 desktop machine.

_________________________________________________