Simple GTKDialog Music Player

Audio editors, music players, video players, burning software, etc.
Post Reply
Message
Author
svanya
Posts: 15
Joined: Mon 29 Sep 2014, 04:57

Simple GTKDialog Music Player

#1 Post by svanya »

Hi, All.

For me the best part of puppy is the speed at which apps open, aka. no frills approach.

With that in mind I wrote the following.

Copy it to a shell script,
set permissions to runable,
open it,
select a directory,
click the OK button on the GTKDialog window
and
it will open a terminal with mplayer loaded with all of the mp3, wav, and wma files (recursively loaded) in that directory as a looped/shuffled playlist.

To close the app, close the mplayer window then click CANCEL on the GTKDialog window.

Note: if unhappy with a certain song, just select the mplayer/terminal window and push ENTER and it will go to the next song;
if unhappy with the entire folder close the mplayer/term window and select a different directory.

I run 7 desktops so am leaving this as an item on the desktop and then use if it from there.

-peace

Code: Select all

#! /bin/bash

export MAIN_DIALOG='
 <vbox>
  <frame Player>
  <text>
		<label>Choose a Directory</label>
  </text>
	   <hbox>
      <entry accept="directory">
        <label>Select a Directory</label>
        <variable>FILE_DIRECTORY</variable>
      </entry>
      <button>
        <input file stock="gtk-open"></input>
        <variable>FILE_BROWSE_DIRECTORY</variable>
        <action type="fileselect">FILE_DIRECTORY</action>
      </button>
    </hbox>
  </frame>
  <hbox>
		<button use-stock="true" label="gtk-ok">
			<variable>OKBUTTON</variable>
	<action>rxvt -hold -e find "$FILE_DIRECTORY" -regextype posix-awk -regex "(.*.mp3|.*.wav|.*.wma)" -exec mplayer -shuffle -loop 0 {} +</action>
		</button>
		<button cancel></button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG
PS. I understand this is extensible via various filetype filters, taking out the shuffle and loop, etc. But for me, this is enough for now.

Ciao!/Chow! :D And have fun.

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#2 Post by trapster »

Awesome!!
Very simple.
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#3 Post by starhawk »

I'd love to see a screenshot of this in operation...

;)

svanya
Posts: 15
Joined: Mon 29 Sep 2014, 04:57

Screenshot(s)

#4 Post by svanya »

Here are attached, pix (in order) of the windows that open, sorry folks this is in reverse order, i.e. the topmost is what it looks like once you select a directory, the second on is the windows manager once you click the folder icon, and the last one is the app itself.

Hope this helps.

Chow!
Attachments
Gtkmusicplayer3.png
Mplayer once it opens...
(23.75 KiB) Downloaded 504 times
Gtkmusicplayer2.png
Once you click the folder icon, your windows manager opens, in my case ROX
(82.59 KiB) Downloaded 496 times
Gtkmusicplayer.jpg
The Initial App Window
(23.09 KiB) Downloaded 508 times

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#5 Post by starhawk »

OK, so it's basically a console player.

Sorry, I'm out... can't stand that stuff for some reason.

sfs
Posts: 49
Joined: Sat 02 Nov 2013, 04:49
Location: Russia
Contact:

#6 Post by sfs »

mplayer -> madplay (150k) ?
gtkdialog -> yad --notification ?
post 23
[url=https://sourceforge.net/projects/puppyrusa/]PuppyRus-Arch[/url]

Post Reply