PeasyMP3 - a Minimal Media Player

Audio editors, music players, video players, burning software, etc.
Message
Author
PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#31 Post by PaulR »

A tip for novices like me:

You can save a step if you play directories via the 'open with' route. Customise the Rox menu to 'Play with peasymp3' when you right-click any folder. Brilliant!

Paul

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#32 Post by rcrsn51 »

Thanks for that tip.

I have posted a new version on Page 1 that has improved support for Internet radio streams.

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#33 Post by PaulR »

Another thought occurred to me - would it be possible to detect when the program was fed a directory from a customised Rox context menu and if so automatically start playing? I can thing of no logical reason not to do this from the users perspective!

Cheers

Paul

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#34 Post by rcrsn51 »

PaulR wrote:Another thought occurred to me - would it be possible to detect when the program was fed a directory from a customised Rox context menu and if so automatically start playing?
I looked at this idea once and decided against it.

For example, my default .peasymp3 folder has a bunch of Internet radio stations. I rarely want to auto-play the first alphabetical entry in the playlist.

It's only one more mouse click to start playback.

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#35 Post by PaulR »

Maybe if the first file in the directory is an mp3 etc rather than a link? Or perhaps a command line switch?? Just thoughts...

Paul

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#36 Post by rcrsn51 »

PeasyMP3 v3.5 now plays MIDI files through Timidity. Here are the instructions for installing Timidity.

1. Install the timidity_wary53-2.13.1.pet. Click the small green DOWNLOAD box.

2. Using one of your MIDI files, test Timidity from the command line: timidity xxx.mid

3. Make PeasyMP3 the default player for MIDI files.
a. Right-click on a MIDI file
b. Select: Set Run Action
c. Enter the command: peasymp3 "$@"

--------------------------
Last edited by rcrsn51 on Thu 16 Feb 2017, 23:11, edited 5 times in total.

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#37 Post by PaulR »

Would it make sense to have a 'stop' button?

With streamed media this would allow one to temporarily suspend the stream instead of having to quit the program or fiddle with a volume control. Pressing 'start' afterwards would reconnect the stream (or restart an mp3).

Paul

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#38 Post by rcrsn51 »

PaulR wrote:With streamed media this would allow one to temporarily suspend the stream instead of having to quit the program or fiddle with a volume control.
The Pause/Resume buttons do this for me. Do they not work with your streams?

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#39 Post by PaulR »

rcrsn51 wrote:The Pause/Resume buttons do this for me. Do they not work with your streams?
No, I get a constantly repeating sound if I pause a stream; the only way to silence it is to exit the program. I suppose it's related to the eeepc hardware.

Paul

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#40 Post by rcrsn51 »

Can you give me a link to one of these streams? Do you get the same thing with mp3s?

[Edit] I tested this with an Acer netbook and Pause/Resume worked OK. However, here is a work-around for your eeepc.

1. Go to /usr/sbin and open peasymp3 in a text editor.

2. In geany, turn on line numbering with View > Editor > Show Line Numbers

3. Go to line 152. Change the word PAUSE to STOP

4. Go to line 156. Change RESUME to CONTROL 0

5. Save and exit.

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#41 Post by PaulR »

Pausing/resuming an mp3 works flawlessly every time, whereas pausing a stream causes the same problem every time - the last fraction of a second of whatever sound was broadcast is repeated ad infinitum.

Here's one stream I've tried:
http://www.bbc.co.uk/radio/listen/live/r4_aaclca.pls

I obtained the link from the online database linked to from the PupRadio/PupTelly program - I haven't looked for an alternative link for the same station as yet.

Paul

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#42 Post by rcrsn51 »

That stream pauses/resumes OK for me.

Try my suggestion above. However, it will affect pause/resume of other media types too.

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#43 Post by PaulR »

Right, thanks - I'll decide which is most likely to require a pause and edit the script accordingly if necessary. Thanks again for the help.

Paul

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#44 Post by npierce »

After years of using sound cards which had built-in synthesisers, I currently have one with none, so searched the Additional Software forum for Timidity. Happily I found your above post, with links for Timidity and the sound font, as the first hit.

And, of course, while here I tried out the new version of PeasyMP3 with support for Timidity.

I can report that all works well on Racy 5.2.2 (although I did a bit of head-scratching before I noticed that the first .mid file that I tried was actually a .MID file).


(By the way, I can report that the PaulR's BBC link works fine for me. Pause brings silence, and Resume picks up cleanly from where it left off. I do remember years ago occasionally running into the same symptom that he is experiencing, but I had different hardware then. If I remember correctly, it was inconsistent, and often happened after listening for a long time. I had no trouble with PeasyMP3 even after listening for about an hour.)

Thanks for PeasyMP3.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#45 Post by rcrsn51 »

Thanks for testing
(although I did a bit of head-scratching before I noticed that the first .mid file that I tried was actually a .MID file).
I never got around to dealing with this - maybe it's time to do so.
Pause brings silence, and Resume picks up cleanly from where it left off.
I may have a solution to Paul's problem and am waiting for him to test it.

PaulR
Posts: 249
Joined: Wed 04 May 2005, 18:45
Location: UK

#46 Post by PaulR »

Right, I've just checked the eepc again with the latest (public) version of PeasyMP3 and it's now working perfectly!

I inadvertently rebooted the machine earlier, the first reboot for several days and this seems to have cured the problem. I've tried switching between streams and between streamed media and mp3's and everything is fine.

I have access to one other machine here (a T42 Thinkpad) but haven't tried it on that yet. I'll see what happens over the weekend with the eeepc - if the problem recurs I'll edit the script and/or try the patched version and report back.

Paul

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#47 Post by RSH »

Hi.

This is the PEasy-Multimedia-Suite created from rcrsn51's different "Peasy"-Apps.

I did not change anything on the scripts.

Just packaged it, created Icons for the Applications and edited the .desktop files, to have a DE Menu Entry and the nice new Icons.

RSH
Attachments
PEasyMM-Suite.pet
(46.91 KiB) Downloaded 556 times
image-2.jpg
(16.41 KiB) Downloaded 706 times
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#48 Post by rcrsn51 »

Very nice! Thank you.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#49 Post by greengeek »

RSH wrote:This is the PEasy-Multimedia-Suite created from rcrsn51's different "Peasy"-Apps.
Is there a way to add Carousel to the right-click menu so that I can simply rightclick my "Music" folder and have Carousel play all of the contents in random order?

EDIT : ok - let me clarify that request... I can use the rightclick menu, then select "open with" and find carousel in the list - but in Pemasu's Upup 3.9.9.2 there is quite a lot listed in the "open with" menu so I have to scroll a lot. What I meant was - is it easy to add "Play in Carousel" to the right click menu without going the extra step into "open with"?? (hoping this description is a bit more clear...)

EDIT2 :I have previously worked out how to modify carousel so that it has the random flag "preset" (and also fewer selection windows) but just don't know how to get this modified script to "grab" the music directory that I right-click on.

The pic shows how I have modified the Carousel window, and the modified code is as follows:

EDIT: dont copy this code - it has a bug

Code: Select all

#!/bin/sh
# rcrsn51 2013-06-15
# greengeek 2013-06-22 
# - commented out RAND test. Attempt to force random mode always.
# - removed "random" checkbox
# - changed title bar to "Peasy Carousel Media Randomiser"
# - removed 5 of the original 6 "file entry" fields

export TEXTDOMAIN=peasymp3
export OUTPUT_CHARSET=UTF-8

export PIDFILE="/tmp/carousel.pid"  	#for Stop
export PIDFILE2="/tmp/carousel.pid2"	#for Pause
export TMPFOLDER="/tmp/carouseltmp"	#for Random

DOPLAY () {

#if [ $RAND = "false" ]; then
#  while [ 1 ]; do 
#    for DISC in "$A" "$B" "$C" "$D" "$E" "$F"; do
#      [ -z "$DISC" ] && continue
#      peasymp3 "$DISC" -b
#    done
#  done
#
#else
# 
  while [ 1 ]; do 
    rm -rf $TMPFOLDER
    mkdir $TMPFOLDER
    for DISC in "$A" "$B" "$C" "$D" "$E" "$F"; do
      [ -z "$DISC" ] && continue
      if [ -f "$DISC" ]; then
        ln -s "$DISC" $TMPFOLDER/$RANDOM"-""$(basename "$DISC")"
      else
        find -L "$DISC" -not -type d | while read TRACK; do
          ln -s "$TRACK" $TMPFOLDER/$RANDOM"-""$(basename "$TRACK")"
        done
      fi
    done
    peasymp3 $TMPFOLDER -b
  done
 
#fi

}
export -f DOPLAY

PLAY () {
  [ -f $PIDFILE ] && exit
  DOPLAY &
  echo $! > $PIDFILE
}
export -f PLAY

PAUSE () {
  PID=$(pidof aplay)
  [ -z "$PID" ] && PID=$(pidof mplayer| awk '{print $NF}')
  if [ -n "$PID" ]; then
    kill -STOP $PID
    echo $PID > $PIDFILE2
  fi
}
export -f PAUSE

RESUME () {
  if [ -f $PIDFILE2 ]; then
    kill -CONT $(cat $PIDFILE2) 2>/dev/null
    rm $PIDFILE2
  fi
}
export -f RESUME

NEXTTRACK () {		#skip a track
  RESUME
  killall lame aplay mplayer
}
export -f NEXTTRACK

NEXTDISC () {		#skip a disc
  RESUME
  killall peasymp3 lame aplay mplayer
}
export -f NEXTDISC

export PROG1="
<window title="Peasy Carousel Media Randomiser v0.0">
<vbox>
  <frame $(gettext 'Drag your Music folder here, or browse to it...        ')>
    <hbox>
      <entry accept="directory">
         <variable>A</variable>
       </entry>
      <button>
        <input file stock="gtk-open"></input>
        <action type="fileselect">A</action>
      </button>
    </hbox>
  </frame>
  <hbox>
    <button>
      <label>$(gettext 'Play')</label>
    </button>
    <button>
      <label>$(gettext 'Cancel')</label>
    </button>
  </hbox>
 </vbox>
</window>
"

export PROG2="
<window title="PeasyMP3 Carousel">
<vbox>
  <hbox>
    <button>
      <label>$(gettext 'Pause')</label>
      <action>PAUSE</action>
    </button>
    <button>
      <label>$(gettext 'Resume')</label>
      <action>RESUME</action>
    </button>
    <button>
      <label>$(gettext 'Next Track')</label>
      <action>NEXTTRACK</action>
    </button>
    <button>
      <label>$(gettext 'Next Disc')</label>
      <action>NEXTDISC</action>
    </button>
    <button>
      <label>$(gettext 'Volume')</label>
      <action>rxvt -e alsamixer &</action>
    </button>
    <button>
      <label>$(gettext 'Quit')</label>
    </button>
  </hbox>
 </vbox>
</window>
"

[ "$(ps --no-heading -C peasymp3carousel | wc -l)" -gt 2 ] && exit
rm $PIDFILE

I=$IFS; IFS=""
for STATEMENTS in  $(gtkdialog3 --program PROG1); do
  eval $STATEMENTS
done
IFS=$I

[ "$EXIT" = "$(gettext 'Cancel')" -o "$EXIT" = "abort" ] && exit

export A B C D E F RAND
PLAY
gtkdialog3 --program PROG2

RESUME
kill $(cat $PIDFILE)
rm $PIDFILE
killall peasymp3 lame aplay mplayer
rm -rf $TMPFOLDER 
Attachments
Carousel_mod.jpg
(67.87 KiB) Downloaded 624 times
Last edited by greengeek on Sat 05 Oct 2013, 19:39, edited 2 times in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#50 Post by rcrsn51 »

Try this:

1. Right-click on a music folder.

2. Select Customize Menu.

3. You will see a window that probably contains Search with Pfind.

4. Drag the file /usr/sbin/peasymp3carousel into this window as a Link.

5. Rename the link Play in Carousel.

Now when you right-click on a music folder, this Play option will appear at the top of the list.

Post Reply