URL: http://paste.pocoo.org/show/PfIAE7hocDLjvfs0yEW6/
Changelog:
Many bugs fixed including old ones like the wrapper bug and resize bug
Search is now "AND"
Added two options to update the playlist.
URL: http://paste.pocoo.org/show/Dkm79P5BP8R6o9xqkzGF/
Changelog:
Browse mode ends after picking a song.
Using pads instead of windows eliminates the need for a strict addnstr which solves the unicode bug. (there is still one extra blank line at the right or else wide character will wrap)
Rebound play previous/next song, because arrow keys and such will do '['
URL: http://paste.pocoo.org/show/qG3FZOrDAQW19MgJ06yn/
Changelog:
Added remove function. It is integrated in search (and so also 'show playlist in left pane') and is a menu accessible with 'R'.
Added quick searching.
Added copy filename to X11 clipboard in advanced menu.
Changed all the configuration options names. This makes removing ~/.pyampc recommended (but not necessary) when you have used an older version.
URL: http://paste.pocoo.org/show/ryZbG9JqA9NXCmVDl5eu/
Changelog:
Nicer display of left pane search and of config
Storing search results (1-9) and it works across sessions (because it is stored in cfg file ~/.pyampc)
Across versions, config doesn't need to be deleted anymore (I had put it as a suggestion earlier)
When you start with an empty list, it will make a new list if you don't have any previous playlists.
Added basic player controls: seeking +/- 5s, next/previous song
I have started a new project, pyampc, which will be a persistent ncurses app in python using python-mpd (in [extra]).
It will use a two panel look, where the left panel can display various stuff and the right panel can browse around in an album list and track list.
I'll post a new update as soon as it can be used without having to customize.
]]>It's now dash compatible which shaves about 10 milliseconds off running time.
To revert to bash compatibility, append -e to the echo statements (that have escape codes (\n, \r))
Changed how things are displayed, so now you have to pick/configure a tier.
Different tiers have different variables available, because they can be quite costly to generate. Like this you can use time to compare tier 1 to 4 and see it's a lot faster.
And there are two alternatives per tier, usable like this: ampc -1 (regular tier 1) or ampc -4 -alt (alternative tier 4)
Without any arguments it won't display anything, but will make all the variables.
Internally I changed the mpd command processor to awk which is a lot more efficient. Except where it's just one bit of information you want though, that's faster manually.
Added -rest (restore). It will remove files from the playlist that you have removed before using -rm. Because -rm will generate a log in ~/.ampc_filterlog.
Added another character causing trouble in album names to escape.
Remaining bugs: a " in the filename will cause -rest to likely ignore that file. I don't think I've ever seen such a filename though, and it's not very likely that it will be -rm'ed as well.
Plans: Change all the variable names to make more sense.
Edit: and there is a small bug where write(stdout): Broken pipe is printed on stderr, but nothing seems to have gone wrong. It happens infrequently. Maybe it's because mpd is getting polled too often? I'm having trouble reproducing it though.
]]>http://paste.pocoo.org/show/LdjJpGryjuFIUxbCHoau/
New features:
-rep (toggle repeat current song mode)
-refr/-sort (for sorting other playlists, -refr will change the playlist file itself, -sort only gives filenames as output. I use this for my bookmarks playlist)
-proc (internal use, it will display mpd output nicely.)
Source code changed a lot, it should be a little bit faster now, because of less recursive calls. I also removed lots of useless comments.
It shouldn't be too hard now to switch from Album to Artist Album sorting.
Removed select menu. (I may axe dialog too)
-r (replay current song) removed
-f should work better now
-rm now incorporates -rmf. It also writes a log of files removed to ~/.ampc_filterlog
This should be useful when you make a new DB and want to remove them again.
I'll write an update that can map the files to IDs.
I found that the hanging bug was caused by some characters in the album name. I wonder if I got them all now.
Plans: change the output to different profiles, instead of countless switches. Because I really like how -1 works now (look at the source code in Configure).
Bugs: there is at least one missing file bug (for a bookmarks.m3u). I'll put some checks in place.
]]>I also replaced -q with -1 for 1 line. And it's easier to configure. I forgot to put in the comment there things you can put in it. Which is: $a_calb (current album), $a_csong (current song), $a_cperc (current percentage complete).
http://paste.pocoo.org/show/hETddbC89cylQF7Ffjsq/
Something else that is on my mind is unifying the frequently occurring sed command to extract info from an mpd playlist. I already combined -f and -rm, but I'll look into making the entire program nicer.
]]>It is split up in two programs.
The first is the playlist maker:
"ampc -db" makes a playlist sorted by Album / Disc / Track.
This should be useful for anyone who is annoyed by their client messing up their playlist with artist based sorting or directory based sorting. (Take "mpc -ls | mpc -add(?)" for example.) If your music directory is structured exactly for mpd, then this won't be very interesting. It's also not interesting if you like to make a very personalized playlist.
The rest of the program is really steering a running mpd.
By that I mean the program only changes the current song and exits.
So it's like mpc in that regard.
The UI should be interesting if you like to see what album comes next. And if you like to browse by album and pick the next song to play by album.
So it presumes an album based playlist, but it's not necessary (so you can use it with your own playlist without having used "ampc -db", but it may be unsorted)
Usage now comes down to:
"ampc -st" to store the album list in ~/.ampc
This is needed after the playlist changes (you can tell if you don't see albums)
To test it you can run "ampc" in a terminal and it will output an album list and a track list.
Comment this out though (the defaults are a bit personalized) firstline='echo "-----($(usefulinfo_oneline))"'
The UIs then are: select -s / dialog -dl / dmenu -d
Dialog and screen should work fine, dmenu needs some configuration because I use the vertical patch.
And configuration is also needed for the player controls because it's set for dmenu (you can tell by the -d switches instead of -dl)
And the player controls by default also do not have previous/next song/etc, because I have bound those to multimedia keys.
So:
a_dm='dmenu -i -l 24 -rs -ni -xs -p ampc'
Can be changed to a_dm='dmenu -i' to use the horizontal dmenu.
And you can change "a_player_controls" to something like this, for dialog usage:
a_player_controls='echo pause
echo next
echo exec ampc -dl -b
echo exec ampc -bms
echo exec ampc -dl -bml
echo dialog_find'
I think that is all that is needed.
]]>Added the filtering.
As it is the following happens after running "ampc -rm search term"
A file is made (/tmp/ampc_rmfile) which will have "(ID) file information" for everything that matched.
It will run an editor (leafpad) on it. You can delete lines you don't want to have filtered out of your playlist
It will remove these.
You can change this behavior in the script with
a_autoeditremovefile=true
a_autoeditor=leafpad
a_autoremoveafteredit=true
So a manual approach, after setting the two booleans to false:
ampc -rm search term
leafpad /tmp/ampc_rmfile
ampc -rmf
(The above commands are added in "Player controls" but commented)
Note that -rm and -f too do not use an AND search, so if the title is "foo bar instrumental" then "ampc -rm instrumental foo" will not match it. but e.g. "bar instrumental" will.
I may change this and update the post. (see edit below)
BTW concerning the dmenu hanging bug, I didn't find the trouble maker.
And the playlist IDs changing after restarting mpd will probably happen by using the filter.
Edit:
Adding "AND search" was easier than expected. I hope it works as expected though, I didn't test it thoroughly, but I think I got it
http://paste.pocoo.org/show/s8i8vt9yP8xtvZCJjy7t/
This applies to -f and -rm.
]]>http://paste.pocoo.org/show/RxhQRXwzN38mk5T3KpW3/
Other bugs I noticed: sometimes dmenu doesn't show up, blocks the keyboard and doesn't respond. CTRL+ALT+F1 and pkill dmenu (and/or ampc?) fixes it. It's only happened twice to me.
I think it has something to do with netcat not closing and dmenu waiting for input while still blocking the keyboard. There must be a case where 'close' isn't echo'ed.
And restarting mpd changes the playlist numbering. I don't really know how this works, I think it only happens if there are gaps in the numbering. If the album list doesn't display, run ./ampc -st again.
I'm still thinking about adding something to edit the playlist. Probably just an editable search that removes songs. (so you can get rid of 'instrumental/karaoke' songs e.g.)
]]>