
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
AmarokMPC is an Amarok script for synchronising the localy played music with an instance of the Music Player Daemon (MPD, http://www.musicpd.org).
This task and usecase is somewhat limited:
If you have the same music on different computers (e.g. mounted with nfs) and want to play the same music on both computers at the same time, then this script might help you.
Amarok 2.0 will get a Ampache service which seems to do the same stuff. Currently no development will be done on my side, you are free to take over.
The current playlist is transfered from Amarok to mpd and synchronised including events like play, stop, skip, pause. Technically it works by translating the local paths to the remote equivalents to handle different mount points.
This script comes in handy when changing places while listening to music. You can now listen to your Amarok as long as a server with MPD and a same set of music is around.
Short Usage:
Set server address in configure dialogue first and wait for the "connected to ..." message. Then you can use the context menu from the Amarok playlist to start/stop MPD. See README for more information.
13 years ago
2007.01.14 (0.1):
initial release
2007.01.15 (0.11):
fix issue with remotely non available file
2007.01.30 (0.2):
* don't autoconnect on very first load, let user check settings first, new options for startup/shutdown
* check if tracks could be added to server, handle missing same as local tracks: skip locally
* menu for starting and stopping synchronisation, no need for starting/stopping skript for this
* menu for updating the mpd server
* interfere less with server, if we already stopped playing
13 years ago
2007.01.14 (0.1):
initial release
2007.01.15 (0.11):
fix issue with remotely non available file
2007.01.30 (0.2):
* don't autoconnect on very first load, let user check settings first, new options for startup/shutdown
* check if tracks could be added to server, handle missing same as local tracks: skip locally
* menu for starting and stopping synchronisation, no need for starting/stopping skript for this
* menu for updating the mpd server
* interfere less with server, if we already stopped playing
kleofas
10 years ago
Report
wodka
10 years ago
If not, how can i help?
Report
kleofas
10 years ago
Report
berot3
11 years ago
Report
actionshrimp
12 years ago
There's an easy enough fix though, you just reinstall the python-xml package, and they get put in something like /usr/lib/python2.5/site-packages/oldxml
Then edit amarokmpc.py and find line 41, which is
from xml.dom.ext.reader import Sax2
and add this as a new line just before that:
sys.path.append('/usr/lib/python%s/site-packages/oldxml' % sys.version[:3])
This lets the script know where to find the files. Hope this helps someone else!
Report
hacim
13 years ago
Report
chrisKA
13 years ago
Mail me if you have any questions. I'm not checking kde-apps regularly.
Report
rickcox
13 years ago
Quote:
def getCurrentPlaylist(playlistPath):
# create Reader object
reader = Sax2.Reader()
# parse the document
file = codecs.open(playlistPath, encoding='utf-8')
doc = reader.fromStream(playlistPath)
playlist = []
playlistElem = doc.getElementsByTagName('playlist')[0]
for itemElem in playlistElem.getElementsByTagName('item'):
filename = itemElem.getAttribute("url")
filename = filename.replace("file://", "").replace("file:", "")
filename = filename.replace("%20"," ").replace("%27","'").replace("%26","&").replace("%23","#").replace("%2B","+").replace("%3D","=").replace("%3F","?").replace("%5B","[").replace("%5D","]").replace("%25","%").replace("%3A",":")
playlist.append(filename)
return playlist
Report
rickcox
12 years ago
DISCLAIMER:
I haven't used this for a while and haven't tested it on any newer versions of Amarok. Let me know if it works for you.
Link:
http://www.filedropper.com/amarokmpc
Report
rickcox
12 years ago
http://www.kde-apps.org/content/show.php?content=78111
Report
chrisKA
13 years ago
Report
finferflu
13 years ago
Do you know what may be causing this?
Thank you
Report
triptol
13 years ago
So just turn down the volume in Amarok.
Report
ptifeth
13 years ago
Report
triptol
13 years ago
I now have my (very fat) Amarok Client to control MPD.
I use my Laptop without tone, as the most luxury remote control one could think of. I still have all the features I'm used to. Tried a couple of other MPD clients and although they all have nice features (gmpc and MPD WebAMP) none of them comes close to Amarok.
Thanks. Really enjoy this script.
Report
triptol
13 years ago
So both my client and server use the same mount point. I thought that is enough. It turns out to be that is not the case, since MPD has the path relative to the music root directory, whereas Amarok stores the whole path.
So if you're setup is like this:
NFS Mount point:
/mnt/music_server/music/[collection]
mpd.conf has:
music_directory=/mnt/music_server/music
This means that the MPD collection will start at the collection point, without a slash at the beginning!
Example:
/mnt/music_server/music/R/Radiohead/OK\ Computer/01\ -\ Airbag.flac
Amarok would use this path to refer to the file, whereas MPD would only use: R/Radiohead/OK\ Computer/01\ -\ Airbag.flac
Since the replace syntax was client:server, or replace_client_string:with_server_string it will look like this in this case:
/mnt/music_server/music/:
Nothing after the colon, trust me ;-)
Report
chrisKA
13 years ago
Report
finferflu
13 years ago
However whenever I try to run it, I get the following error message:
Traceback (most recent call last):
File "/home/user/.kde/share/apps/amarok/scripts/amarokmpc/amarokmpc.py", line 41, in ?
from xml.dom.ext.reader import Sax2
ImportError: No module named ext.reader
I guess I have to install something extra, but what?
Thank you!
Report
triptol
13 years ago
After that you will probably need to install py-libmpdclient (which can be found here: http://incise.org/index.cgi/py-libmpdclient2). On my system I needed the python-dev packages. Just unpack it, untar it and run
sudo python setup.py install
Don't forget to configure the script after you start it ;-)
Report