You are not logged in.

#26 2009-11-02 07:44:50

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: "Uzbl-like" music player out there?

And i can only repeat myself: mpd works fine with files outside of the library...
Put

bind_to_address         "/path/to/socket"

in your mpd.conf and any client connecting to that socket will be able to use files from anywhere on your HD.


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#27 2009-11-08 15:25:06

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: "Uzbl-like" music player out there?

Rasi wrote:

And i can only repeat myself: mpd works fine with files outside of the library...
Put

bind_to_address         "/path/to/socket"

in your mpd.conf and any client connecting to that socket will be able to use files from anywhere on your HD.

what do you mean "use files from anywhere on your hd"? because i just had a look at http://mpd.wikia.com/wiki/MusicPlayerDaemonCommands and it looks like in order to be able to play a file, it must be in the music database, which is kinda limiting. are you saying you can just play files and create playlists from files who are *not* in the music database?


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#28 2009-12-27 22:05:47

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: "Uzbl-like" music player out there?

Dieter@be wrote:
Rasi wrote:

And i can only repeat myself: mpd works fine with files outside of the library...
Put

bind_to_address         "/path/to/socket"

in your mpd.conf and any client connecting to that socket will be able to use files from anywhere on your HD.

what do you mean "use files from anywhere on your hd"? because i just had a look at http://mpd.wikia.com/wiki/MusicPlayerDaemonCommands and it looks like in order to be able to play a file, it must be in the music database, which is kinda limiting. are you saying you can just play files and create playlists from files who are *not* in the music database?

i still haven't found out a way to add random (outside of music database) files ...

btw I use the following config now:

music_directory                 "~/audio"
playlist_directory              "~/.local/share/mpd/playlists"
db_file                         "~/.local/share/mpd/mpd.db"
log_file                        "~/.local/share/mpd/mpd.log"
error_file                      "~/.local/share/mpd/mpd.error"
pid_file                        "~/.cache/mpd.pid"
state_file                      "~/.local/share/mpd/mpdstate"
bind_to_address                 "127.0.0.1"
#port                            "6600"
# "default", "secure", or "verbose".
#log_level                       "default"
#replaygain                      "album"
#replaygain_preamp               "0"
#volume_normalization            "no"

works quite nicely.  i just start mpd by doing `mpd .config/mpd/mpd.conf` and bam, it runs in userspace and adheres to the xdg spec smile


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#29 2009-12-28 01:27:45

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: "Uzbl-like" music player out there?

Dieter@be wrote:

i still haven't found out a way to add random (outside of music database) files ...

If you want to play a song outside your database, brisbin33 cooked up this little bash scheme:

#!/bin/sh
#
# creates a temp symlink to a file outside mpd DB
# adds it to the playlist and plays it
#
###

# usage: playnow [file]
[ $# -ne 1 ] && exit 1

# find our music directory
mdir="$(awk -F '"' '/^music_directory/ {print $2}' /etc/mpd.conf)"
mdir="${mdir/\~/$HOME}"
# no matter what we pass, or where we are, we get
# an absolute path to the file we want. nifty.
file="$(basename "$1")"
dir="$(dirname "$1")"
cd "${dir:-./}" && dir="$PWD" || exit 1

# clean the temp dir and make the new symlink
rm -rf "$mdir/temp"; mkdir "$mdir/temp"
ln -s "$dir/$file" "$mdir/temp/$file"

# update the db, add the new file, and play it
mpc --no-status update "temp/$file"
mpc --no-status add "temp/$file" &>/dev/null || exit 1
mpc play $(mpc playlist | wc -l)

exit $?

And for playing an m3u or pls playlist there are a couple of scripts in the hacks section of the mpd wiki.

Scott

Offline

#30 2009-12-28 03:54:05

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: "Uzbl-like" music player out there?

And perl:

#!/usr/bin/perl

# mpc-play
# version 0.2
# by Ilya "Voyager" Schurov (http://comm.noo.ru/iv-en/)

$MUSIC_PREFIX="/mnt/Music_1/";
$TEMP_DIR=".temp";
$SCRIPT_NAME="mpc-play";
# warning! all symlinks in $MUSIC_PREFIX/$TEMP_DIR will be lost on start!

$DEBUG=0;


$PWD=`pwd`;
chomp $PWD;

if(!@ARGV)
{
    print "Usage:\n$SCRIPT_NAME <files-to-play>\n";
}

say_and_do("mpc --no-status stop",$DEBUG);
say_and_do("mpc --no-status clear",$DEBUG);

# removing symlinks from $TEMP_DIR

while(<$MUSIC_PREFIX/$TEMP_DIR/*>)
{
        unlink if(-l);
}


foreach $file (@ARGV)
{
    $link=$file;
        
    # stripping slashes from arguments
    $link=~s/\//_/g;
    if($file!~/^\//)
    {
        $file="$PWD/$file";
    }
        
    symlink("$file","$MUSIC_PREFIX/$TEMP_DIR/$link") 
               || die("Can't create symlink from $file to $MUSIC_PREFIX/$TEMP_DIR/$link: $!");
    push @links, $link;
}
say_and_do("mpc update $TEMP_DIR",$DEBUG);

# now we need to wait while mpd updating DB
do
{
    $stat=`mpc`;
    sleep(0.1);
}while($stat=~/^Updating DB/m);

# generating playlist
foreach $link(@links)
{
    $link=~s/\`/\\\`/g;
    say_and_do("mpc --no-status add \"$TEMP_DIR/$link\"",$DEBUG);
}

#let's the music begins! :)
say_and_do("mpc play",$DEBUG);

sub say_and_do
{
    my $str=shift;
    my $debug=shift;
    print "$str\n" if($debug);
    system($str);
}

Offline

#31 2009-12-28 17:12:00

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: "Uzbl-like" music player out there?

hmm those are pretty ugly workarounds.  i've gone through their mantis, but nothing about this.


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#32 2010-12-18 18:44:51

AndreasBWagner
Member
From: Boston, MA, USA
Registered: 2010-03-05
Posts: 17
Website

Re: "Uzbl-like" music player out there?

I like the idea behind m9u which uses a filesystem interface and can easily be used with any decoder. It doesn't even need to be used with audio.

Offline

#33 2010-12-20 12:53:11

mentat
Member
From: France
Registered: 2009-01-13
Posts: 138
Website

Re: "Uzbl-like" music player out there?

Auto quote mode from an other post :

me wrote:

Please make a try of plait / plaiter player
For all cli lovers, it's a killer KISS app.

The way it's handle music is base on files and directories and text files.
No db no bloat. I never care again about how to tag compilation, multiple artists ...
Combination for mixing songs, construct dynamical lists is very impressive.

It's a pure way of life.

Please refer to:

http://plait.sourceforge.net/
https://aur.archlinux.org/packages.php?ID=35525

I've mention a bug here :
https://bbs.archlinux.org/viewtopic.php?id=108455

thx alterecco for the AUR package.

You have 2 bash scripts plaiter who pilot mpg123 via playlists and plait who manage index of your audio file in your filesystem.

mpg123 or mpg321 are most simpler players because mplayer, vlc ... are already heavy full features complex softwares for playing audio files.

Offline

Board footer

Powered by FluxBB